|
|
(self.webpackChunk=self.webpackChunk||[]).push([[3951,11305],{28563:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var i=t(5891),o=t(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"},a=t(22589),s=function(e,n){return o.createElement(a.Z,(0,i.Z)({},e,{ref:n,icon:r}))};var l=o.forwardRef(s)},88142:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var i=t(5891),o=t(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M632 698.3l141.9-112a8 8 0 000-12.6L632 461.7c-5.3-4.2-13-.4-13 6.3v76H295c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h324v76c0 6.7 7.8 10.4 13 6.3zm261.3-405L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v278c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V422c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-83.5c0-17-6.7-33.2-18.7-45.2zM640 288H384V184h256v104zm264 436h-56c-4.4 0-8 3.6-8 8v108H184V732c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v148c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V732c0-4.4-3.6-8-8-8z"}}]},name:"delivered-procedure",theme:"outlined"},a=t(22589),s=function(e,n){return o.createElement(a.Z,(0,i.Z)({},e,{ref:n,icon:r}))};var l=o.forwardRef(s)},29723: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={},n="5.0",t={},i=null,o=!1,r=!1,a=null,s=!1,l=null,c=null,u=0;u<arguments.length;u++){var d=arguments[u];if(null!==d)switch(_typeof(d)){case"number":n=d.toFixed(1);break;case"string":d.match(new RegExp("^[0-9]\\.[0-9]+$"))?n=d:a=d;break;case"object":void 0!==d.is3D?i=d:t=d;break;case"boolean":o=d,r=!0}}null===i&&(i={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},void 0===t.material_id||r||(o=!0)),null!==a&&void 0===t.id&&(t.id=a);var p="",f=!1,m=null,h=null,g=null,v=!1,x=null,w=null,_=null;void 0!==t.height&&(t.height=Math.round(t.height)),void 0!==t.width&&(t.width=Math.round(t.width));var y=function(e){return parseFloat(e)>4?parseFloat(e):5};function b(){try{return window.self!==window.top}catch(e){return!0}}function j(){return(!t.hasOwnProperty("screenshotGenerator")||!t.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,n){c=e,B(e,n)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,n){var t=parseFloat(e);NaN!==t&&t<5?console.log("The GeoGebra HTML5 codebase version "+t+" is deprecated. Using version latest instead."):(l=e,O(e,n))},e.getHTML5CodebaseVersion=function(){return h},e.getParameters=function(){return t},e.setFontsCSSURL=function(e){_=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function n(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,o="auto",r=t.id,a=!1,l=0;l<arguments.length;l++){var c=arguments[l];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?o=c:r=arguments[l]:"boolean"==typeof c?a=c:c instanceof HTMLElement&&(i=c)}function u(){if(s){o=I(o);var l=i||document.getElementById(r);if(l)if(e.removeExistingApplet(l,!1),void 0===t.width&&l.clientWidth&&(t.width=l.clientWidth),void 0===t.height&&l.clientHeight&&(t.height=l.clientHeight),t.width&&t.height||"html5"!==o||(delete t.width,delete t.height),m=o,"screenshot"===o)C(l,t);else{var c=!1;t.hasOwnProperty("playButton")&&t.playButton||t.hasOwnProperty("clickToLoad")&&t.clickToLoad?c=!0:t.hasOwnProperty("playButtonAutoDecide")&&t.playButtonAutoDecide&&(c=(!b()||n())&&j()),c?(m="screenshot",Z(l,t,a,o)):L(l,t,a)}else console.log("possibly bug on ajax loading? ")}else setTimeout(u,200)}u()},e.getViews=function(){return i},e.isJavaInstalled=function(){return!1};var k=function(n){var o=function(){t.onError&&t.onError(),D("Error: Fetching material (id "+t.material_id+") failed.",t)},r=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",a="/materials/"+t.material_id+"?scope=basic";N("https://"+r+"/api/proxy.php?path="+encodeURIComponent(a),(function(r){var a=JSON.parse(r),s=a.elements?a.elements.filter((function(e){return"G"==e.type||"E"==e.type}))[0]:a;if(s&&s.url){t.fileName=s.url,S(s.settings||{}),i.is3D=!0;var l="https://www.geogebra.org/images/";e.setPreviewImage(x||s.previewUrl,l+"GeoGebra_loading.png",l+"applet_play.png"),n()}else o()}),o)};function S(e){["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach((function(n){e[n]=!!e[n]})),["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"].forEach((function(n){void 0===t[n]&&void 0!==e[n]&&(t[n]=e[n])})),void 0===t.showToolBarHelp&&(t.showToolBarHelp=t.showToolBar)}function N(e,n,t){var i=new XMLHttpRequest;i.open("GET",e),i.onload=function(){n(i.responseText)},i.onerror=t,i.send()}e.isHTML5Installed=function(){return!0},e.getLoadedAppletType=function(){return m},e.setPreviewImage=function(e,n,t){x=e,w=n,t},e.removeExistingApplet=function(e,n){var i;"string"==typeof e&&(e=document.getElementById(e)),m=null;var o=null;for(i=0;i<e.childNodes.length;i++){var r=e.childNodes[i],a=r.className;"applet_screenshot"===a?n?(r.style.display="block",m="screenshot"):r.style.display="none":"applet_scaler prerender"!==a&&(e.removeChild(r),o=a&&-1!=a.indexOf("appletParameters")?r.id:null,i--)}var s=void 0!==t.id?t.id:o,l=window[s];l&&"function"==typeof l.getBase64&&(l.remove(),window[s]=null)},e.refreshHitPoints=function(){if(y(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var n=e.getAppletObject();return!(!n||"function"!=typeof n.recalculateEnvironments)&&(n.recalculateEnvironments(),!0)},e.startAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.startAnimation)&&(n.startAnimation(),!0)},e.stopAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.stopAnimation)&&(n.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==t.id?t.id:"ggbApplet";return window[e]},e.resize=function(){};var M=function(e){return e&&"false"!==e},L=function(n,t,i){y(h)<=4.2&&(i=!0);var o=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==h||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(o=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var r=document.createElement("div");r.classList.add("appletParameters","notranslate");var a=t.width,s=t.height;if(t.disableAutoScale=void 0===t.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():t.disableAutoScale,void 0!==t.width)if(y(h)<=4.4)M(t.showToolBar)&&(t.height-=7),M(t.showAlgebraInput)&&(t.height-=37),t.width<605&&M(t.showToolBar)&&(t.width=605,a=605);else{var u=100;(M(t.showToolBar)||M(t.showMenuBar))&&(t.hasOwnProperty("customToolBar")&&(t.customToolbar=t.customToolBar),u=M(t.showMenuBar)?245:155),a<u&&(t.width=u,a=u)}for(var d in r.style.border="none",r.style.display="inline-block",t)t.hasOwnProperty(d)&&"appletOnLoad"!==d&&r.setAttribute("data-param-"+d,t[d]);_&&r.setAttribute("data-param-fontscssurl",_),e.resize=function(){GGBAppletUtils.responsiveResize(n,t)},window.addEventListener("resize",(function(n){e.resize()}));var f="function"==typeof t.appletOnLoad?t.appletOnLoad:function(){};if(i||void 0===t.width){var m=document.createElement("div");m.className="applet_scaler",m.style.position="relative",m.style.display="block",m.appendChild(r),n.appendChild(m),t.appletOnLoad=function(n){e.resize(),f(n)}}else{t.hasOwnProperty("showSplash")||r.setAttribute("data-param-showSplash","false");var x=n.querySelector(".applet_scaler.prerender"),w=null!==x;if(w)b=x.querySelector(".ggb_preview");else{var b=P(a,s,t.borderColor,!1);(x=document.createElement("div")).className="applet_scaler",x.style.position="relative",x.style.display="block",x.style.width=a+"px",x.style.height=s+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(x,"66%"),y(h)>=5?(t.appletOnLoad=function(e){var t=n.querySelector(".ggb_preview");t&&t.parentNode.removeChild(t),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(x),window.GGBT_wsf_view&&$(window).trigger("resize"),f(e)},w||x.appendChild(b)):r.appendChild(b),x.appendChild(r),w||n.appendChild(x),setTimeout((function(){e.resize()}),1)}function j(e,n){n&&"function"==typeof n.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,n.appletOnLoad):renderGGBElement(e),D("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",n)}function k(e,n){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:n}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){j(e.article,e.params)})),html5AppletsToProcess=null)},y(h)<5&&(e.className+=" geogebraweb")):j(e,n)}if(o){scriptLoadStarted=!0;for(var S=0;S<r.childNodes.length;S++){"TABLE"===r.childNodes[S].tagName&&(r.removeChild(r.childNodes[S]),S--)}if(null!==ggbHTML5LoadedScript){var N=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=N&&N.parentNode.removeChild(N)}var L=document.createElement("script"),C=function(){k(r,t)};L.src=p+g,ggbHTML5LoadedCodebaseIsWebSimple=v,ggbHTML5LoadedCodebaseVersion=h,ggbHTML5LoadedScript=L.src,D("GeoGebra HTML5 codebase loaded: '"+p+"'.",t),c||l&&"5.0"!=l?p.requirejs?__webpack_require__.e(44796).then(function(){var e=[__webpack_require__(44796)];C.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(L.onload=C,n.appendChild(L)):(v?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),C())}else k(r,t);t.height=s,t.width=a},C=function(n,t,i){var o=P(t.width,t.height,t.borderColor,i),r=document.createElement("div");r.style.position="relative",r.style.display="block",r.style.width=t.width+"px",r.style.height=t.height+"px",r.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),r.appendChild(o);var a=GGBAppletUtils.getScale(t,n,i);i?(n.appendChild(A()),window.GGBT_wsf_view||(n.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(r,"66%"),n.appendChild(r),1===a||isNaN(a)||(GGBAppletUtils.scaleElement(r,a),r.style.width=t.width+"px",r.style.height=t.height+"px",r.parentNode.style.width=t.width*a+"px",r.parentNode.style.height=t.height*a+"px"),e.resize=function(){T(n,o,r,i)},window.addEventListener("resize",(function(n){e.resize()})),e.resize()};function T(e,n,i,o){if(e.contains(n)){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if("fullscreencontent"!==e.id)return;window.GGBT_wsf_view.setCloseBtnPosition(e)}var r=GGBAppletUtils.getScale(t,e,o);null!==i.parentNode&&(isNaN(r)||1===r?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=t.width+"px",i.parentNode.style.height=t.height+"px"):(GGBAppletUtils.scaleElement(i,r),i.parentNode.style.width=t.width*r+"px",i.parentNode.style.height=t.height*r+"px")),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(e),"object"===_typeof(window.GGBT_ws_header_footer)&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}e.onExitFullscreen=function(e,n){n.appendChild(e)};var Z=function(e,n,t,i){C(e,n,!0);for(var o=function(){var t=[];for(a=0;a<e.childNodes.length;a++)t.push(e.childNodes[a]);if(window.GGBT_wsf_view){var o=window.GGBT_wsf_view.renderFullScreen(e,n.id),r=document.getElementById("fullscreencontainer"),s=jQuery(e).find(".fullscreencontent");s.length>0?(o.remove(),s.attr("id","fullscreencontent").show(),jQuery(r).append(s),window.dispatchEvent(new Event("resize"))):L(o,n,!1),window.GGBT_wsf_view.launchFullScreen(r)}else m=i,L(e,n,!1);if(!window.GGBT_wsf_view)for(a=0;a<t.length;a++)e.removeChild(t[a])},r=e.getElementsByClassName("ggb_preview_play"),a=0;a<r.length;a++)r[a].addEventListener("click",o,!1),r[a].addEventListener("ontouchstart",o,!1);"function"==typeof window.ggbAppletPlayerOnload&&window.ggbAppletPlayerOnload(e),j()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},A=function(){var e=document.createElement("div");if(e.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var n='.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");}',t=document.createElement("style");t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n)),document.getElementsByTagName("head")[0].appendChild(t)}return e},P=function(e,n,t,i){var o=document.createElement("div");o.className="ggb_preview",o.style.position="absolute",o.style.zIndex="90",o.style.width=e-2+"px",o.style.height=n-2+"px",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.backgroundColor="white";var r="lightgrey";void 0!==t&&(r="none"===t?"transparent":t),o.style.border="1px solid "+r;var a,s,l,c=document.createElement("img");if((c.style.position="relative",c.style.zIndex="1000",c.style.top="-1px",c.style.left="-1px",null!==x&&c.setAttribute("src",x),c.style.opacity=.7,null!==w)&&!i){(a=document.createElement("img")).style.position="absolute",a.style.zIndex="1001",a.style.opacity=1,c.style.opacity=.3,(s=360)>e/4*3&&(s=e/4*3),l=s/5.8,a.setAttribute("src",w),a.setAttribute("width",s),a.setAttribute("height",l);var u=(e-s)/2,d=(n-l)/2;a.style.left=u+"px",a.style.top=d+"px",o.appendChild(a)}return o.appendChild(c),o},I=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},E=["web","webSimple","web3d","tablet","tablet3d","phone"],O=function(e,n){if(h=e,n)B(h,!0);else{var r,a,s=!o;if(s){var l=y(h);!isNaN(l)&&l<4.4&&(s=!1)}r="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=h.indexOf("//");for(var u in a=c>0?h:0===c?r+h:"https://www.geogebra.org/apps/5.2.814.0/",E)if(h.slice(-1*E[u].length)===E[u]||h.slice(-1*(E[u].length+1))===E[u]+"/")return void B(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||M(t.showToolBar)||M(t.showMenuBar)||M(t.showAlgebraInput)||M(t.enableRightClick)||t.appName&&"classic"!=t.appName?a+="web3d/":a+="webSimple/",B(a,!1)}},B=function(e,n){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===n&&(n=-1===e.indexOf("http")),f=n,g="web.nocache.js",v=!1;var t=p.split("/");t.length>1&&(n||"webSimple"!==t[t.length-2]?E.indexOf(t[t.length-2])>=0&&(g=t[t.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),t=e.split("/"),"test"===(h=t[t.length-3]).substr(0,4)?h=h.substr(4,1)+"."+h.substr(5,1):"war"!==h.substr(0,3)&&"beta"!==h.substr(0,4)||(h="5.0");var i=parseFloat(h);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),O("5.0",n))}},D=function(e,n){window.console&&window.console.log&&(!n||void 0===n.showLogging||n.showLogging&&"false"!==n.showLogging)&&console.log(e)};function z(){var e=n;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),O(e,!1),null!==c&&B(c,f),s=!0}return void 0!==t.material_id?k(z):z(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function n(e,n){1!=n?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+n+","+n+")",e.style.webkitTransform="scale("+n+","+n+")",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 t(e,n,t,i,o){if(e.isScreenshoGenerator)return 1;var r,a=void 0!==i&&i,s=null!=e.noScaleMargin&&e.noScaleMargin,l=(r=e.autoHeight)&&"false"!==r,c=function(e,n,t,i,o,r){var a=null;if(null!=r&&""!=r)for(var s=e.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+r+" ")>-1){a=s;break}s=s.parentNode}var l=0,c=0,u=0,d=0,p=0,f=0,m=0;if(a)l=a.offsetWidth,c=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=l):(l=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var h=e.getBoundingClientRect();h.left>0&&h.left<=l&&(void 0===o||!o)&&("rtl"===document.dir?(p=l-h.width-h.left,f=u<=480?10:30):(f=h.left,p=u<=480?10:30),d=f+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(d=40,m=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(d=0,m=40))}return e&&((void 0===t||!t)&&n>0&&n+d<l?l=n:l-=d,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==t&&t||(c-=m)),{width:l,height:c}}(n,e.width,t,l,a&&window.GGBT_wsf_view||s,o),u=parseInt(c.width),d=e.width,p=e.height;if(void 0===d){var f=n.querySelector(".appletParameters");f&&(d=f.offsetWidth,p=f.offsetHeight)}var m=u/d,h=a?1:c.height/p;return void 0===t||t||(m=Math.min(1,m),h=Math.min(1,h)),Math.min(m,h)}function i(e,n,i){var o,r=1,a=!1;return e.hasOwnProperty("allowUpscale")&&(a=e.allowUpscale),e.hasOwnProperty("scale")&&(r=parseFloat(e.scale),(isNaN(r)||null===r||0===r)&&(r=1),r>1&&(a=!0)),n&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?r:(o=t(e,n,a,i,e.scaleContainerClass),!a||e.hasOwnProperty("scale")&&1!==r?Math.min(r,o):o)}function o(e){var n=Math.min(window.innerWidth,document.documentElement.clientWidth),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),o=(n-i.width)/2,r=(t-i.height)/2;r<0&&(r=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=o<40?"40px":o+"px",e.style.top=r+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=r<40?"40px":r+"px",e.style.left=o+"px")}return{responsiveResize:function(t,r){var a=t.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(r.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(t)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var s=i(r,t);e()&&a.setAttribute("data-param-scale",s);for(var l=null,c=0;c<t.childNodes.length;c++)if(void 0!==t.childNodes[c].className&&t.childNodes[c].className.match(/^applet_scaler/)){l=t.childNodes[c];break}if(null!==l&&null!==l.querySelector(".noscale"))return;var u=void 0!==r.id?r.id:"ggbApplet",d=window[u];null!=d&&d.recalculateEnvironments||null===l||l.className.match(/fullscreen/)||(l.parentNode.style.transform="",isNaN(s)||1===s?(n(l,1),l.parentNode.style.width=r.width+"px",l.parentNode.style.height=r.height+"px"):(l.parentNode.style.width=r.width*s+"px",l.parentNode.style.height=r.height*s+"px",n(l,s))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&o(t),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(a).parents(".content-added-content"))}},isFlexibleWorksheetEditor:e,positionCenter:o,getScale:i,scaleElement:n}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var e=n.location.search;return-1!=e.indexOf(J)||-1!=e.indexOf(K)}function q(e,n){}q(H,I),webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{},t;function u(){return v(),t}function v(){if(!t){var e=o.createElement(Q);if(e.id=L,e.style.cssText=R+S,e.tabIndex=-1,o.body.appendChild(e),t=e.contentWindow.document,-1==navigator.userAgent.indexOf(T)){t.open();var n=document.compatMode==U?V:W;t.write(n+X),t.close()}}}function w(e){q(cb,eb),function(e){function n(){return _typeof(o.readyState)==Y?_typeof(o.body)!=Y&&null!=o.body:/loaded|complete/.test(o.readyState)}var t=n();if(t)e();else{o.addEventListener&&o.addEventListener(Z,r,!1);var i=setInterval((function(){r()}),$)}function r(){if(!t){if(!n())return;t=!0,e(),o.removeEventListener&&o.removeEventListener(Z,r,!1),i&&clearInterval(i)}}}((function(){var n,t,i,o;n=e,t=u(),i=t.body,(o=t.createElement(_)).language=ab,o.crossOrigin=W,o.src=n,webModule.__errFn&&(o.onerror=function(){webModule.__errFn(L,new Error(bb+n))}),i.appendChild(o),q(cb,db)}))}function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var n=c[e];return null==n?null:n},r=d,webModule.__errFn=e}function B(){function e(e){var n=e.lastIndexOf(rb);-1==n&&(n=e.length);var t=e.indexOf(sb);-1==t&&(t=e.length);var i=e.lastIndexOf(tb,Math.min(t,n));return i>=O?e.substring(O,i+P):W}var n,t=null!=(n=__gwt_getMetaProperty(wb))?n:W;return t==W&&(t=function(){for(var n=o.getElementsByTagName(_),t=O;t<n.length;++t)if(-1!=n[t].src.indexOf(xb))return e(n[t].src);return W}()),t==W&&(t=function(){var e=o.getElementsByTagName(yb);return e.length>O?e[e.length-P].href:W}()),t==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(t=e(o.location.href)),t=function(n){if(n.match(/^\w+:\/\//));else{var t=o.createElement(ub);t.src=n+vb,n=e(t.src)}return n}(t),t}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],o=[];function a(e){var n=o[e](),t=i[e];if(n in t)return n;var a=[];for(var s in t)a[t[s]]=s;throw r&&r(e,a,n),null}if(__gwt_isKnownPropertyValue=function(e,n){return n in i[e]},webModule.__getPropMap=function(){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[n]=a(n));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(e=Cb).indexOf(Db);-1!=s&&(t=parseInt(e.substring(s+P),$),e=e.substring(O,s))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var n=s[L].bindings;s[L].bindings=function(){for(var t=n?n():{},i=e[webModule.__softPermutationId],o=O;o<i.length;o++){var r=i[o];t[r[O]]=r[P]}return t}},webModule.__startLoadingFragment=function(e){return C(e)},webModule.__installRunAsyncCode=function(e){var n=u(),t=n.body,i=n.createElement(_);i.language=ab,i.text=e,t.appendChild(i),t.removeChild(i)},A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},"function"!=typeof window.web3d&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),"function"!=typeof window.webSimple&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet}else console.warn("deployggb.js was loaded twice")})()},47825:function(e,n,t){"use strict";function i(e){var n=!0;if(e.length>0){for(var t=0;t<e.length;t++)if(0==e[t].compile_success||!e[t].compile_success){n=!1;break}}else n=!1;return n}function o(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=[],i=0;i<e.length;i++){var o=e[i],r=n?"".concat(n,"/").concat(o.name):"".concat(o.name);t.push({title:o.name,type:o.type,isLeaf:"tree"!==o.type,key:r})}return t}function r(e,n,t){for(var i=0;i<e.length;i++){var o=e[i];if(o.key===n){o.children=t;break}o.children&&r(o.children,n,t)}return e}function a(e,n,t){var i;return function(){var o=this,r=arguments,a=function(){i=null,t||e.apply(o,r)},s=t&&!i;clearTimeout(i),i=setTimeout(a,n),s&&e.apply(o,r)}}t.d(n,{Ax:function(){return r},Ds:function(){return a},KI:function(){return s},SI:function(){return o},f1:function(){return i}});var s=t(19219).Z.API_SERVER},57837:function(e,n,t){"use strict";t.d(n,{Z:function(){return N}});var i=t(7557),o=t.n(i),r=t(41498),a=t.n(r),s=t(79800),l=t.n(s),c=t(59301),u=t(78241),d=t(8591),p=t(43418),f=t(57930),m=t(92832),h=t(61998),g=t(95237),v=t(43604),x=t(61186),w=t.n(x),_=t(65327),y=t(97682),b={tips:"tips___e8J4O",homeworkType:"homeworkType___ZjN2X",antdTable:"antdTable___amDdp",modalWrapper:"modalWrapper___XPojI"},j=t(69597),k=t(73244),S=t(37712),N=(0,y.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,classroomList:e.classroomList}}))((function(e){var n=e.dispatch,t=e.courseEndTime,i=(e.classroomList,e.successCallback),r=void 0===i?function(){}:i,s=e.visible,x=e.homeworkIds,y=e.courseId,N=e.isBatch,M=(e.shixunHomeworks,u.Z.useForm()),L=l()(M,1)[0],C=(0,c.useState)(!1),T=l()(C,2),Z=T[0],A=T[1],P=(0,c.useState)(!1),I=l()(P,2),E=I[0],O=I[1],B=(0,c.useState)(!1),D=l()(B,2),z=D[0],H=D[1],R=(0,c.useState)([]),G=l()(R,2),W=G[0],F=G[1],Y=(0,c.useState)([]),U=l()(Y,2),V=U[0],q=U[1],Q=(0,c.useState)([]),J=l()(Q,2),K=J[0],X=J[1],$=(0,c.useState)([]),ee=l()($,2),ne=ee[0],te=ee[1],ie=(0,c.useState)([]),oe=l()(ie,2),re=oe[0],ae=oe[1],se=(0,c.useState)([]),le=l()(se,2),ce=le[0],ue=le[1],de=(0,c.useState)([]),pe=l()(de,2),fe=pe[0],me=pe[1],he=(0,c.useState)([]),ge=l()(he,2),ve=ge[0],xe=ge[1],we=(0,c.useState)([]),_e=l()(we,2),ye=_e[0],be=_e[1];(0,c.useEffect)((function(){s?je():Se()}),[s]);var je=function(){var e=a()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),e.next=3,(0,j.oR)(x[0],{course_id:y});case 3:n=e.sent,H(n.no_group),N?(me(n.all_course_groups),xe(n.all_course_groups)):(te(n.late_course_groups),ae(n.late_course_groups),F(n.submit_course_groups),q(n.submit_course_groups)),A(!1),L.setFieldsValue({end_time:w()()});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=a()(o()().mark((function e(){var t,i,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=L.getFieldsValue(),i=w()(t.end_time).format("YYYY-MM-DD HH:mm"),!(N?0===ye.length:0===K.length&&0===ce.length)||z){e.next=6;break}return d.ZP.warning("请选择需要操作的班级"),e.abrupt("return");case 6:return O(!0),e.next=9,(0,j.Mc)(y,{no_group:z,homework_ids:x,group_ids:N?ye:K,end_time:i,late_group_ids:N?ye:ce});case 9:a=e.sent,O(!1),0===a.status&&(Se(),d.ZP.success("操作成功"),r(),n({type:"classroomList/setActionTabs",payload:{key:"清除选择数据"}}));case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){X([]),ue([]),q([]),ae([])};return(0,S.jsxs)(p.Z,{centered:!0,title:"立即截止",className:b.modalWrapper,width:N||z?520:760,open:s,confirmLoading:E,destroyOnClose:!0,okText:"截止",cancelText:"取消",onOk:function(){return ke()},onCancel:function(){Se(),n({type:"classroomList/setActionTabs",payload:{}})},children:[(0,S.jsxs)("div",{className:b.tips,children:[(0,S.jsx)("div",{children:"1、截止后学生不能再提交作业。"}),(0,S.jsx)("div",{children:"2、本操作只对“提交中”、“补交中”的作业有效。"})]}),(0,S.jsx)(u.Z,{form:L,layout:"vertical",children:(0,S.jsx)(u.Z.Item,{name:"end_time",label:"截止时间",children:(0,S.jsx)(f.default,{style:{width:"100%"},disabledDate:function(e){return(0,k.Q8)(e,t)},disabledTime:function(e){return(0,k.d0)(e)},placeholder:"请选择结束时间",showTime:{format:"HH:mm",defaultValue:w()((0,_.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1})})}),!z&&(0,S.jsx)(S.Fragment,{children:N?(0,S.jsxs)("div",{children:[(0,S.jsx)(m.Z,{placeholder:"搜索班级",onChange:function(e){xe(fe.filter((function(n){return n.name.indexOf(e.target.value)>-1})))}}),(0,S.jsx)(h.Z,{style:{marginTop:"10px",height:"300px",overflow:"auto"},className:b.antdTable,rowSelection:{type:"checkbox",onChange:function(e){be(e)}},rowKey:"id",pagination:!1,dataSource:ve,loading:Z,columns:[{title:"班级",dataIndex:"name"}]})]}):(0,S.jsxs)(g.Z,{gutter:24,children:[(0,S.jsxs)(v.Z,{span:14,children:[(0,S.jsx)("div",{className:b.homeworkType,children:"作业截止"}),(0,S.jsx)(m.Z,{placeholder:"搜索班级",onChange:function(e){q(W.filter((function(n){return n.name.indexOf(e.target.value)>-1})))}}),(0,S.jsx)("div",{className:b.tableWrapper,children:(0,S.jsx)(h.Z,{style:{marginTop:"10px",height:"260px",overflow:"auto"},className:b.antdTable,rowSelection:{type:"checkbox",onChange:function(e){X(e)}},rowKey:"id",pagination:!1,dataSource:V,loading:Z,columns:[{title:"班级",dataIndex:"name",ellipsis:!0},{title:"发布时间",dataIndex:"publish_time"},{title:"截止时间",dataIndex:"end_time"}]})})]}),(0,S.jsxs)(v.Z,{flex:10,style:{maxWidth:"280px"},children:[(0,S.jsx)("div",{className:b.homeworkType,children:"补交截止"}),(0,S.jsx)(m.Z,{placeholder:"搜索班级",onChange:function(e){ae(ne.filter((function(n){return n.name.indexOf(e.target.value)>-1})))}}),(0,S.jsx)("div",{className:b.tableWrapper,children:(0,S.jsx)(h.Z,{style:{marginTop:"10px",height:"260px",overflow:"auto",maxWidth:"280px"},className:b.antdTable,rowSelection:{type:"checkbox",onChange:function(e){ue(e)}},rowKey:"id",pagination:!1,loading:Z,dataSource:re,columns:[{title:"班级",dataIndex:"name",ellipsis:!0,width:120},{title:"截止时间",dataIndex:"late_time"}]})})]})]})})]})}))},48225:function(e,n,t){"use strict";t.d(n,{Z:function(){return _}});var i=t(7557),o=t.n(i),r=t(41498),a=t.n(r),s=t(79800),l=t.n(s),c=t(59301),u="imageDimensions___a7crR",d="img___Kroat",p="fullWidth___c492T",f=t(92310),m=t.n(f),h=t(71418),g=t(2859),v=t(52774),x=t(65327),w=t(37712),_=function(e){var n=e.data,t=e.className,i=e.fullWidth,r=e.style,s=void 0===r?{}:r,f=e.onClose,_=e.onOk,y=e.showFullTools,b=e.noAssociationId,j=(0,c.useRef)(null),k=(0,c.useRef)(null),S=(0,c.useRef)(null),N=(0,c.useRef)(null),M=(0,c.useState)(!1),L=l()(M,2),C=L[0],T=L[1],Z=(0,c.useState)("正在加载中"),A=l()(Z,2),P=A[0],I=A[1];(0,c.useEffect)((function(){S.current||(S.current=document.createElement("style"),document.head.appendChild(S.current)),null!=n&&n.visible?(document.body.setAttribute("data-custom","y-hidden"),S.current.innerHTML=" html { overflow-y: hidden; }",null!=n&&n.src&&E()):(document.body.removeAttribute("data-custom"),S.current&&(document.head.removeChild(S.current),S.current=null))}),[null==n?void 0:n.visible]);var E=function(){var e=a()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),I("正在加载中"),e.next=4,(0,x.ZJ)(null==n?void 0:n.src);case 4:t=e.sent,j.current.src="",j.current.src=t,j.current.onload=function(){B()},T(!1),I("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=a()(o()().mark((function e(t){var i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),I("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:n.title,file:t.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||b){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(n.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(t.state)}});case 8:0===e.sent.status&&_(),e.next=13;break;case 12:null!=i&&i.id&&_(i);case 13:T(!1),I("");case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),B=function(){k.current=new g.hP(j.current),k.current.targetRoot=N.current,k.current.addEventListener("render",O),k.current.addEventListener("beforeclose",f),y&&(k.current.availableMarkerTypes=k.current.ALL_MARKER_TYPES,k.current.uiStyleSettings.redoButtonVisible=!0,k.current.uiStyleSettings.notesButtonVisible=!0,k.current.uiStyleSettings.zoomButtonVisible=!0,k.current.uiStyleSettings.zoomOutButtonVisible=!0,k.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=k.current.uiStyleSettings,k.current.show(),null!=n&&n.snapshotData&&k.current.restoreState(n.snapshotData),setTimeout((function(){var e;window.scrollTo(0,0),(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var n=document.querySelector(e.name);n&&n.setAttribute("title",e.title)}))}),300)};return(0,w.jsx)(c.Fragment,{children:(null==n?void 0:n.visible)&&(0,w.jsx)(h.Z,{spinning:C,tip:P,style:{position:"absolute"},children:(0,w.jsx)("div",{ref:N,className:m()(u,t,i?p:""),style:s,children:(0,w.jsx)("img",{className:d,ref:j})})})})}},76810:function(e,n,t){"use strict";t.d(n,{h:function(){return v}});var i=t(82242),o=t.n(i),r=t(79800),a=t.n(r),s=t(59301),l=t(57809),c=t(78241),u=t(3113),d=t(89780),p=t.n(d),f=(t(82963),t(55286),t(37712)),m=l.default.Option,h={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 n=e.value,t=e.onChange,i=e.mode,r=e.options,l=void 0===r?{}:r,c=(0,s.useRef)(),u=(0,s.useState)(),d=a()(u,2),m=d[0],h=d[1];return(0,s.useEffect)((function(){if(m){var e=function(e){var n=e.getValue();t&&t(n)};return m.on("change",e),function(){m.off("change",e)}}}),[m,t]),(0,s.useEffect)((function(){m&&m.setOption("mode",i)}),[m,i]),(0,s.useEffect)((function(){m&&(n===m.getValue()&&""!==n||setTimeout((function(){m.setValue(n||"")}),300))}),[m,n]),(0,s.useEffect)((function(){if(c.current&&!m){var e=p().fromTextArea(c.current,o()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));h(e)}}),[c.current,m]),(0,f.jsx)("div",{className:"my-codemirror-container",children:(0,f.jsx)("textarea",{ref:c})})}n.Z=function(e){var n=e.callback,t=e.onCancel,i=(0,s.useState)("python"),r=a()(i,2),d=r[0],p=r[1];return(0,f.jsxs)(c.Z,o()(o()({},h),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},style:{width:500},children:[(0,f.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,f.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,f.jsx)(m,{value:e,children:g[e][0]},e)}))})}),(0,f.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,f.jsx)(v,{mode:d})}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(u.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},15754:function(e,n,t){"use strict";t.d(n,{Z:function(){return ye}});var i=t(91232),o=t.n(i),r=t(79800),a=t.n(r),s=t(85573),l=t.n(s),c=t(59301),u=t(89780),d=t.n(u),p=t(76374),f=(t(82963),t(6313),t(25717),t(99498),t(25419),t(67549),t(40848)),m=t(37712),h=function(e){var n=e.value,t=void 0===n?"":n,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[t]));return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=t(82242),v=t.n(g),x=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"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 w(e){var n=e.onActionCallback,t=e.title,i=e.icon,o=e.actionName,r=e.className,a=void 0===r?"":r,s=e.children;return(0,m.jsxs)("a",{title:t,className:a,onClick:function(){n(o)},children:[(0,m.jsx)("i",{className:"".concat(i)}),s]})}var _=function(e){var n=e.watch,t=e.showNullButton,i=e.showNullProgramButton,o=e.onActionCallback,r=e.fullScreen,a=e.insertTemp,s=e.hidetoolBar,l=e.extraUse,c=[].concat(x,[{title:"".concat(n?"关闭实时预览":"开启实时预览"),icon:"".concat(n?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,m.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(e,n){return(0,m.jsx)("li",{children:e.actionName?(0,m.jsx)(w,v()(v()({},e),{},{onActionCallback:o})):(0,m.jsx)("span",{className:"v-line"})},n)})),t?(0,m.jsx)("li",{children:(0,m.jsx)(w,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:o,children:(0,m.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("li",{children:(0,m.jsx)(w,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:o,children:(0,m.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,m.jsx)("li",{children:(0,m.jsx)(w,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:o,children:(0,m.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,a&&(0,m.jsx)("li",{children:(0,m.jsx)(w,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:o,children:(0,m.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,m.jsx)("li",{children:l}),(0,m.jsx)("li",{className:"btn-full-screen",children:(0,m.jsx)(w,{icon:"".concat(r?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:r?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:o})})]})},y=t(61832),b=t(78241),j=t(92832),k=t(3113),S={labelCol:{span:4},wrapperCol:{span:20}},N=function(e){var n=e.callback,t=e.onCancel;return(0,m.jsxs)(b.Z,v()(v()({},S),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){n(e)},style:{width:500},children:[(0,m.jsx)(b.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,m.jsx)(j.Z,{})}),(0,m.jsx)(b.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,m.jsx)(j.Z,{})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(k.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},M=t(76810),L=t(49368),C=t(95237),T=t(48225),Z=function(e){var n=e.callback,t=e.onCancel,i=document.createElement("canvas"),o=i.getContext("2d");i.width=1e3,i.height=800,o.fillStyle="#ffffff",o.fillRect(0,0,i.width,i.height);var r=i.toDataURL("image/png");return(0,m.jsx)(C.Z,{style:{height:"100vh"},children:(0,m.jsx)(T.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:r,visible:!0,title:String(Date.now())},onOk:function(e){n({src:e.url})},onClose:t})})},A=t(7557),P=t.n(A),I=t(41498),E=t.n(I),O=t(37205),B=t.n(O),D=t(12378);function z(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(z,go.CommandHandler),z.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},z.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.x,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n,e.position.y))})),e.commitTransaction("aligning left")},z.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.x+e.actualBounds.width;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},z.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.y,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,n))})),e.commitTransaction("alignTop")},z.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.y+e.actualBounds.height;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},z.prototype.alignCenterX=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center X");var t=n.actualBounds.x+n.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},z.prototype.alignCenterY=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center Y");var t=n.actualBounds.y+n.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},z.prototype.alignColumn=function(e){var n=this.diagram;n.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i<t.length-1;i++){var o=t[i],r=o.actualBounds.y+o.actualBounds.height+e;t[i+1].move(new go.Point(o.actualBounds.x,r))}n.commitTransaction("align Column")},z.prototype.alignRow=function(e){void 0===e&&(e=0),e=parseFloat(e);var n=this.diagram;n.startTransaction("align Row");var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i<t.length-1;i++){var o=t[i],r=o.actualBounds.x+o.actualBounds.width+e;t[i+1].move(new go.Point(r,o.actualBounds.y))}n.commitTransaction("align Row")},z.prototype.canRotate=function(e){var n=this.diagram;return null!==n&&!n.isReadOnly&&!n.isModelReadOnly&&!(n.selection.count<1)},z.prototype.rotate=function(e){var n;void 0===e&&(e=90),(n=this.diagram).startTransaction("rotate "+e.toString()),(n=this.diagram).selection.each((function(n){n instanceof go.Link||n instanceof go.Group||(n.angle+=e)})),n.commitTransaction("rotate "+e.toString())},z.prototype.pullToFront=function(){var e=this.diagram;e.startTransaction("pullToFront");var n=new go.Map;e.selection.each((function(e){n.set(e.layer,0)})),n.iteratorKeys.each((function(e){var t=0;e.parts.each((function(e){if(!e.isSelected){var n=e.zOrder;isNaN(n)?e.zOrder=0:t=Math.max(t,n)}})),n.set(e,t)})),e.selection.each((function(e){z._assignZOrder(e,n.get(e.layer)+1)})),e.commitTransaction("pullToFront")},z.prototype.pushToBack=function(){var e=this.diagram;e.startTransaction("pushToBack");var n=new go.Map;e.selection.each((function(e){n.set(e.layer,0)})),n.iteratorKeys.each((function(e){var t=0;e.parts.each((function(e){if(!e.isSelected){var n=e.zOrder;isNaN(n)?e.zOrder=0:t=Math.min(t,n)}})),n.set(e,t)})),e.selection.each((function(e){z._assignZOrder(e,n.get(e.layer)-1-z._findGroupDepth(e))})),e.commitTransaction("pushToBack")},z._assignZOrder=function(e,n,t){void 0===t&&(t=e),e.layer===t.layer&&(e.zOrder=n),e instanceof go.Group&&e.memberParts.each((function(e){z._assignZOrder(e,n+1,t)}))},z._findGroupDepth=function(e){if(e instanceof go.Group){var n=0;return e.memberParts.each((function(e){n=Math.max(n,z._findGroupDepth(e))})),n+1}return 0},z.prototype.doKeyDown=function(){var e=this.diagram;if(null!==e){var n=e.lastInput;if("Up"===n.key||"Down"===n.key||"Left"===n.key||"Right"===n.key){var t=this.arrowKeyBehavior;if("none"===t)return;if("select"===t)return void this._arrowKeySelect();if("move"===t)return void this._arrowKeyMove();if("tree"===t)return void this._arrowKeyTree()}go.CommandHandler.prototype.doKeyDown.call(this)}},z.prototype._getAllParts=function(){var e=new Array;return this.diagram.nodes.each((function(n){e.push(n)})),this.diagram.parts.each((function(n){e.push(n)})),e},z.prototype._arrowKeyMove=function(){var e=this.diagram,n=e.lastInput,t=0,i=0;if(n.control||n.meta)t=1,i=1;else if(null!==e.grid){var o=e.grid.gridCellSize;i=o.width,t=o.height}e.startTransaction("arrowKeyMove"),e.selection.each((function(e){"Up"===n.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y-t)):"Down"===n.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y+t)):"Left"===n.key?e.move(new go.Point(e.actualBounds.x-i,e.actualBounds.y)):"Right"===n.key&&e.move(new go.Point(e.actualBounds.x+i,e.actualBounds.y))})),e.commitTransaction("arrowKeyMove")},z.prototype._arrowKeySelect=function(){var e=this.diagram,n=e.lastInput,t=null;"Up"===n.key?t=this._findNearestPartTowards(270):"Down"===n.key?t=this._findNearestPartTowards(90):"Left"===n.key?t=this._findNearestPartTowards(180):"Right"===n.key&&(t=this._findNearestPartTowards(0)),null!==t&&(n.shift?t.isSelected=!0:n.control||n.meta?t.isSelected=!t.isSelected:e.select(t))},z.prototype._findNearestPartTowards=function(e){var n=this.diagram.selection.first();if(null===n)return null;for(var t=n.actualBounds.center,i=this._getAllParts(),o=1/0,r=n,a=0;a<i.length;a++){var s=i[a];if(s!==n&&s.canSelect()){var l=s.actualBounds.center,c=t.directionPoint(l),u=this._angleCloseness(c,e);if(u<=45){var d=t.distanceSquaredPoint(l);(d*=1+Math.sin(u*Math.PI/180))<o&&(o=d,r=s)}}}return r},z.prototype._angleCloseness=function(e,n){return Math.min(Math.abs(n-e),Math.min(Math.abs(n+360-e),Math.abs(n-360-e)))},z.prototype._arrowKeyTree=function(){var e=this.diagram,n=e.selection.first();if(n instanceof go.Node){var t=e.lastInput;if("Right"===t.key)if(n.isTreeLeaf);else if(n.isTreeExpanded){null!==(o=this._sortTreeChildrenByY(n).first())&&e.select(o)}else e.commandHandler.canExpandTree(n)&&e.commandHandler.expandTree(n);else if("Left"===t.key){if(!n.isTreeLeaf&&n.isTreeExpanded)e.commandHandler.canCollapseTree(n)&&e.commandHandler.collapseTree(n);else null!==(r=n.findTreeParentNode())&&e.select(r)}else if("Up"===t.key){if(null!==(r=n.findTreeParentNode()))if((s=(a=this._sortTreeChildrenByY(r)).indexOf(n))>0){for(var i=a.elt(s-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(r)}else if("Down"===t.key){var o;if(n.isTreeExpanded&&!n.isTreeLeaf)null!==(o=this._sortTreeChildrenByY(n).first())&&e.select(o);else for(;null!==n;){var r,a,s;if(null===(r=n.findTreeParentNode()))break;if((s=(a=this._sortTreeChildrenByY(r)).indexOf(n))<a.length-1){e.select(a.elt(s+1));break}n=r}}var l=e.selection.first();null!==l&&e.scrollToRect(l.actualBounds)}},z.prototype._sortTreeChildrenByY=function(e){var n=(new go.List).addAll(e.findTreeChildrenNodes());return n.sort((function(e,n){var t=e.location,i=n.location;return t.y<i.y?-1:t.y>i.y?1:t.x<i.x?-1:t.x>i.x?1:0})),n},z.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},z.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(z.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(z.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 H=z,R=(t(47313),t(85160)),G=t(43418),W=t(43604),F=t(52774),Y="myPaletteDiv___Xjz2I",U="maxH60___Pd4Re";window.go=D;var V=function(e){var n=e.onCancel,t=e.callback,i=(0,c.useRef)(),o=(0,c.useRef)(),r=(0,c.useRef)(),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1),u=(0,c.useState)(0),d=a()(u,2),p=d[0],f=d[1],h=function(){var e=E()(P()().mark((function e(){var n,o;return P()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.current.makeImage(),e.next=3,(0,F.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:n.src}});case 3:o=e.sent,t({src:o.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){f(p+1)}),[]),(0,m.jsx)("div",{ref:l,className:s.current?"".concat(U," body-overflow-initial"):"body-overflow-initial",children:(0,m.jsx)(G.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:l.current,rootClassName:"zIndex-9999",title:(0,m.jsxs)(C.Z,{children:[(0,m.jsx)(W.Z,{flex:1,children:"插入流程图"}),(0,m.jsx)(W.Z,{onClick:function(){s.current=!s.current,f(p+1)},children:(0,m.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:n,children:(0,m.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,m.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,m.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,m.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,m.jsx)("div",{style:{height:"calc(100% - 50px)"},className:Y,ref:r})]}),(0,m.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,m.jsx)(R.FI,{initDiagram:function(){var e=D.GraphObject.make,n="#ff3333",t="#3358ff",a="#25ad23",s="#d533ff",l="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",p="#fffcd5",f="#d5ebff",m="#f2dfe0",h="#a5d2fa",g="#cccccc",v="#b3e6b3",x="#fcbbbd";function w(n,t){var i=function(e,t){e.handled=!0,e.diagram.model.commit((function(i){var o=t.part.adornedPart,r=(new D.Point).setRectSpot(o.actualBounds,n);r.subtract(o.location),r.scale(2,2),r.x+=130*Math.sign(r.x),r.y+=130*Math.sign(r.y),r.add(o.location),r.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var a=i.copyNodeData(o.data);i.setGroupKeyForNodeData(a,i.getGroupKeyForNodeData(o.data)),i.addNodeData(a);var s={from:o.key,to:i.getKeyForNodeData(a)};i.addLinkData(s);var l=e.diagram.findNodeForData(a);l.location=r,e.diagram.select(l),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(D.Shape,{figure:t,alignment:n,alignmentFocus:n.opposite(),width:n.equals(D.Spot.Top)||n.equals(D.Spot.Bottom)?25:18,height:n.equals(D.Spot.Top)||n.equals(D.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},isActionable:!0,click:i,contextClick:i})}function _(n){return e(D.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,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},click:function(e,n){e.diagram.commandHandler.showContextMenu(n.part.adornedPart)}},n||{})}function y(e,n){return function(t,i){t.handled=!0,t.diagram.model.commit((function(t){t.set(i.part.adornedPart.data,e,n)}))}}function b(n,t){return t||(t="color"),e(D.Shape,{width:16,height:16,stroke:"lightgray",fill:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.stroke="dodgerblue"},mouseLeave:function(e,n){return n.stroke="lightgray"},click:y(t,n),contextClick:y(t,n)})}function j(){return[e("ContextMenuButton",e(D.Panel,"Horizontal",b(u,"fill"),b(p,"fill"),b(f,"fill"),b(m,"fill"))),e("ContextMenuButton",e(D.Panel,"Horizontal",b(g,"fill"),b(v,"fill"),b(h,"fill"),b(x,"fill")))]}function k(){return[e("ContextMenuButton",e(D.Panel,"Horizontal",b(d),b(a),b(t),b(n))),e("ContextMenuButton",e(D.Panel,"Horizontal",b(u),b(s),b(l),b(c)))]}function S(n,t){return t||(t="thickness"),e(D.Shape,"LineH",{width:16,height:16,strokeWidth:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y(t,n),contextClick:y(t,n)})}function N(n,t){return t||(t="dash"),e(D.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y(t,n),contextClick:y(t,n)})}function M(){return[e("ContextMenuButton",e(D.Panel,"Horizontal",S(1),S(2),S(3),S(4))),e("ContextMenuButton",e(D.Panel,"Horizontal",N(null),N([2,4]),N([4,4])))]}function L(n,t){return t||(t="figure"),e(D.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="lightgray"},click:y(t,n),contextClick:y(t,n)})}function C(n){return e(D.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(n+4).toString()+" H3"})}function T(n){var t="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===n?t="M0 0 M16 16 M0 8 L16 8":2===n&&(t="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(D.Shape,{geometryString:t,margin:2,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y("dir",n),contextClick:y("dir",n)})}function Z(n){var t=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",D.Spot.stringify(D.Spot.AllSides)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(D.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:t,contextClick:t})}function A(n,t){var i=0,o=D.Spot.RightSide;n.equals(D.Spot.Top)?(i=270,o=D.Spot.TopSide):n.equals(D.Spot.Left)?(i=180,o=D.Spot.LeftSide):n.equals(D.Spot.Bottom)&&(i=90,o=D.Spot.BottomSide),t||(i-=180);var r=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",D.Spot.stringify(o)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(D.Shape,{alignment:n,alignmentFocus:n.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:r,contextClick:r})}return i.current=new D.Diagram(o.current,{padding:20,grid:e(D.Panel,"Grid",e(D.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(D.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(H),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var n=e.subject;n.location=n.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 n=e.subject;e.diagram.toolManager.linkingTool.isForwards?n.toNode.invalidateConnectedLinks():n.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(D.Node,"Auto",{locationSpot:D.Spot.Center,locationObjectName:"SHAPE",desiredSize:new D.Size(120,60),minSize:new D.Size(40,40),resizable:!0,resizeCellSize:new D.Size(10,10),rotatable:!0},new D.Binding("location","loc",D.Point.parse).makeTwoWay(D.Point.stringify),new D.Binding("desiredSize","size",D.Size.parse).makeTwoWay(D.Size.stringify),e(D.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:D.Spot.AllSides,toSpot:D.Spot.AllSides},new D.Binding("figure"),new D.Binding("fill"),new D.Binding("stroke","borderColor"),new D.Binding("strokeWidth","thickness"),new D.Binding("strokeDashArray","dash")),e(D.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(D.TextBlock,{margin:1,textAlign:"center",overflow:D.TextBlock.OverflowEllipsis,editable:!0},new D.Binding("text").makeTwoWay(),new D.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(D.Panel,"Vertical",{maxSize:new D.Size(200,NaN)},e(D.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new D.Binding("text")),e(D.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new D.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(D.Adornment,"Spot",e(D.Placeholder,{padding:10}),w(D.Spot.Top,"TriangleUp"),w(D.Spot.Left,"TriangleLeft"),w(D.Spot.Right,"TriangleRight"),w(D.Spot.Bottom,"TriangleDown"),_({alignment:new D.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(D.Panel,"Horizontal",L("Rectangle"),L("RoundedRectangle"),L("Ellipse"),L("Diamond"))),e("ContextMenuButton",e(D.Panel,"Horizontal",L("Parallelogram2"),L("ManualOperation"),L("Procedure"),L("Cylinder1"))),e("ContextMenuButton",e(D.Panel,"Horizontal",L("Terminator"),L("CreateRequest"),L("Document"),L("TriangleDown"))),j(),k(),M()),i.current.groupTemplate=e(D.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:D.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,n){n.addMembers(n.diagram.selection,!0)||n.diagram.currentTool.doCancel()},avoidable:!1},new D.Binding("location","loc",D.Point.parse).makeTwoWay(D.Point.stringify),e(D.Panel,"Auto",{name:"BODY"},e(D.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:D.Spot.AllSides,toSpot:D.Spot.AllSides},new D.Binding("fill"),new D.Binding("stroke","color"),new D.Binding("strokeWidth","thickness"),new D.Binding("strokeDashArray","dash")),e(D.Placeholder,{background:"transparent",margin:20})),e(D.TextBlock,{alignment:D.Spot.Top,alignmentFocus:D.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new D.Binding("text"),new D.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(D.Adornment,"Spot",e(D.Panel,"Auto",e(D.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(D.Placeholder,{margin:1.5})),_({alignment:D.Spot.TopRight,alignmentFocus:D.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",j(),k(),M()),i.current.linkTemplate=e(D.Link,{layerName:"Foreground",routing:D.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new D.Binding("fromSpot","fromSpot",D.Spot.parse),new D.Binding("toSpot","toSpot",D.Spot.parse),new D.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new D.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new D.Binding("points").makeTwoWay(),e(D.Shape,{strokeWidth:2},new D.Binding("stroke","color"),new D.Binding("strokeWidth","thickness"),new D.Binding("strokeDashArray","dash")),e(D.Shape,{segmentIndex:0,segmentOffset:new D.Point(15,0),segmentOrientation:D.Link.OrientAlong,alignmentFocus:D.Spot.Right,figure:"circle",width:10,strokeWidth:0},new D.Binding("fill","color"),new D.Binding("visible","dir",(function(e){return 1===e}))),e(D.Shape,{segmentIndex:-1,segmentOffset:new D.Point(-10,6),segmentOrientation:D.Link.OrientPlus90,alignmentFocus:D.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new D.Binding("fill","color"),new D.Binding("visible","dir",(function(e){return e>=1})),new D.Binding("width","thickness",(function(e){return 7+3*e})),new D.Binding("height","thickness",(function(e){return 7+3*e})),new D.Binding("segmentOffset","thickness",(function(e){return new D.Point(-15,4+1.5*e)}))),e(D.Shape,{segmentIndex:0,segmentOffset:new D.Point(15,-6),segmentOrientation:D.Link.OrientMinus90,alignmentFocus:D.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new D.Binding("fill","color"),new D.Binding("visible","dir",(function(e){return 2===e})),new D.Binding("width","thickness",(function(e){return 7+3*e})),new D.Binding("height","thickness",(function(e){return 7+3*e})),new D.Binding("segmentOffset","thickness",(function(e){return new D.Point(-15,4+1.5*e)}))),e(D.TextBlock,{alignmentFocus:new D.Spot(0,1,-4,0),editable:!0},new D.Binding("text").makeTwoWay(),new D.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(D.Adornment,e(D.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:C(2)},new D.Binding("pathPattern","thickness",C)),_({alignmentFocus:new D.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",k(),M(),e("ContextMenuButton",e(D.Panel,"Horizontal",T(0),T(1),T(2))),e("ContextMenuButton",e(D.Panel,"Horizontal",e(D.Panel,"Spot",Z(!1),A(D.Spot.Top,!1),A(D.Spot.Left,!1),A(D.Spot.Right,!1),A(D.Spot.Bottom,!1)),e(D.Panel,"Spot",{margin:new D.Margin(0,0,0,2)},Z(!0),A(D.Spot.Top,!0),A(D.Spot.Left,!0),A(D.Spot.Right,!0),A(D.Spot.Bottom,!0))))),new D.Palette(r.current,{maxSelectionCount:1,linkTemplate:e(D.Link,{locationSpot:D.Spot.Center,selectionAdornmentTemplate:e(D.Adornment,"Link",{locationSpot:D.Spot.Center},e(D.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(D.Shape,{toArrow:"Standard",stroke:null}))},{routing:D.Link.AvoidsNodes,curve:D.Link.JumpOver,corner:5,toShortLength:4},new D.Binding("points"),e(D.Shape,{isPanelMain:!0,strokeWidth:2}),e(D.Shape,{toArrow:"Standard",stroke:null})),model:new D.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(B()(D.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(D.Node,"Auto",{locationSpot:D.Spot.Center},new D.Binding("location","location",D.Point.parse).makeTwoWay(D.Point.stringify),e(D.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 D.Binding("stroke").makeTwoWay(),new D.Binding("fill").makeTwoWay(),new D.Binding("figure")),e(D.TextBlock,{margin:new D.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new D.Size(16,16),maxSize:new D.Size(10,NaN),textAlign:"center",editable:!0},new D.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(D.Panel,"Grid",e(D.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(D.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,m.jsx)("div",{ref:o})]})]}),(0,m.jsx)("div",{className:"tr",children:(0,m.jsx)(k.ZP,{size:"large",onClick:h,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},q=t(5112),Q=t(94001),J=q.ZP.Group,K={margin:"0 8px"},X=function(e){var n=e.callback,t=e.onCancel;return(0,m.jsxs)(b.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){n(e)},children:[(0,m.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,m.jsx)("span",{style:K,children:"单元格数:"}),(0,m.jsx)("span",{style:K,children:"行数"}),(0,m.jsx)(b.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,m.jsx)(Q.Z,{})}),(0,m.jsx)("span",{style:K,children:"列数"}),(0,m.jsx)(b.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,m.jsx)(Q.Z,{})})]}),(0,m.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,m.jsx)("span",{style:K,children:"对齐方式:"}),(0,m.jsx)(b.Z.Item,{name:"align",children:(0,m.jsxs)(J,{children:[(0,m.jsx)(q.ZP,{value:"default",children:(0,m.jsx)("i",{className:"fa fa-align-justify"})}),(0,m.jsx)(q.ZP,{value:"left",children:(0,m.jsx)("i",{className:"fa fa-align-left"})}),(0,m.jsx)(q.ZP,{value:"center",children:(0,m.jsx)("i",{className:"fa fa-align-center"})}),(0,m.jsx)(q.ZP,{value:"right",children:(0,m.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(k.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},$=t(78673),ee=t(29723),ne=t.n(ee),te=(0,c.forwardRef)((function(e,n){var t=e.use3d,i=e.width,o=e.height,r=e.callback,s=(e.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),u=(0,c.useState)(!1),d=a()(u,2),p=d[0],f=d[1],h=(0,c.useRef)({id:s,appName:"graphing",width:i||1e3,height:o||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(ne())(h.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return r&&r(e),e};return(0,c.useEffect)((function(){h.current.appName=p?"3D":"graphing",l.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){f(t)}),[t]),(0,c.useImperativeHandle)(n,(function(){return{getImgData:g}})),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,m.jsxs)(C.Z,{align:"middle",children:[(0,m.jsx)(W.Z,{flex:1,children:(0,m.jsx)($.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return f(e)}})}),(0,m.jsx)(W.Z,{children:(0,m.jsx)(k.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ie=t(14337),oe=t(19219),re=t(8591),ae="link",se="upload-image",le="add-flowchart",ce="draw-image",ue="code-block",de="add-table",pe="------------",fe={default:pe,left:":".concat(pe),center:":".concat(pe,":"),right:"".concat(pe,":")},me=t(69924);var he="@▁▁@",ge=["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 ve(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var xe=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",we=l()(l()({},xe+"-B","bold"),xe+"-I","italic"),_e=l()(l()(l()(l()(l()(l()(l()(l()({},ae,"添加链接"),ue,"添加代码块"),se,"添加图片"),ce,"添加画图"),le,"插入流程图"),de,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),ye=function(e){var n=e.defaultValue,t=void 0===n?"":n,i=e.onChange,r=e.width,s=void 0===r?"100%":r,u=e.height,g=void 0===u?400:u,v=e.miniToolbar,x=void 0!==v&&v,w=e.isFocus,b=void 0!==w&&w,j=e.watch,k=e.insertTemp,S=e.mode,C=void 0===S?"markdown":S,T=e.id,A=void 0===T?"markdown-editor-id":T,P=e.showResizeBar,I=void 0!==P&&P,E=e.noStorage,O=void 0!==E&&E,B=e.showNullButton,D=void 0!==B&&B,z=e.showNullProgramButton,H=void 0!==z&&z,R=e.hidetoolBar,W=void 0!==R&&R,F=e.fullScreen,Y=void 0!==F&&F,U=e.onBlur,q=e.onCMBeforeChange,Q=e.onFullScreen,J=e.className,K=void 0===J?"":J,$=e.disablePaste,ee=void 0!==$&&$,ne=e.disabled,pe=void 0!==ne&&ne,xe=e.disabledFill,ye=void 0!==xe&&xe,be=e.placeholder,je=void 0===be?"":be,ke=e.values,Se=void 0===ke?"":ke,Ne=e.extraUse,Me=(0,c.useState)(null),Le=a()(Me,2),Ce=Le[0],Te=Le[1],Ze=(0,c.useState)(t),Ae=a()(Ze,2),Pe=Ae[0],Ie=Ae[1],Ee=(0,c.useState)(j),Oe=a()(Ee,2),Be=Oe[0],De=Oe[1],ze=(0,c.useState)(Y),He=a()(ze,2),Re=He[0],Ge=He[1],We=(0,c.useState)(""),Fe=a()(We,2),Ye=Fe[0],Ue=Fe[1],Ve=(0,c.useState)(0),qe=a()(Ve,2),Qe=qe[0],Je=qe[1],Ke=(0,c.useState)(g),Xe=a()(Ke,2),$e=Xe[0],en=Xe[1],nn=(0,c.useState)(!1),tn=a()(nn,2),on=(tn[0],tn[1]),rn=(0,c.useState)(0),an=a()(rn,2),sn=an[0],ln=an[1],cn=(0,c.useState)(0),un=a()(cn,2),dn=un[0],pn=un[1],fn=(0,c.useRef)(),mn=(0,c.useRef)(),hn=(0,c.useRef)(),gn=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Ie(Se),null==Ce||Ce.setValue(Se),window.scrollTo(0,e)}),[Se]),(0,c.useEffect)((function(){null==Q||Q(Re)}),[Re]),(0,c.useEffect)((function(){if(fn.current){var e=function(e,t){if(!ee){var i=t.clipboardData;if(i){var o=i.types.toString(),r=i.items;if("Files"===o||i.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==C)return;try{var a,s=r[1];"file"===(null===(a=r[0])||void 0===a?void 0:a.kind)&&(s=r[0]);var l=s.getAsFile(),c=l.name.split(".").pop();(0,L.I)(l,(function(e){var t,i,o;e.id?(null==l||null===(t=l.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection(".concat(e.content_type,")")):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('<video width="100%" controls src="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==l||null===(o=l.type)||void 0===o?void 0:o.indexOf("pdf"))>-1?n.replaceSelection('<a href="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(l.type,'&disposition=inline" target="_blank">').concat(l.name,"</a>")):ge.includes(c)?n.replaceSelection('<a href="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(l.name,"</a>")):n.replaceSelection("[".concat(l.name,"](").concat(oe.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(t){re.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=d().fromTextArea(fn.current,{mode:C,lineNumbers:!x,lineWrapping:!0,value:t,autoCloseTags:!0,autoCloseBrackets:!0});return n.on("keyup",(function(e,t){8===t.keyCode&&(""==e.getValue()?n.setOption("placeholder",je):n.setOption("placeholder",null))})),n.on("keydown",(function(e,n){if(8===n.keyCode){var t=function(e,n){var t=e.getDoc(),i=t.getCursor(),o=t.getLine(i.line),r=o.charAt(i.ch-1),a=o.lastIndexOf("@▁@",i.ch),s=o.lastIndexOf("@▁▁@",i.ch),l=a>s?a:s,c=a>s?3:4;if(-1===he.indexOf(r))return null;if(console.log("change1:",n,e,o,i,l,a,s,r),l>=0&&i.ch-l<5){var u=l+c;return t.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);t&&n.preventDefault()}})),b&&n.focus(),n.on("paste",e),pe&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Te(n),function(){n.off("paste",e)}}}),[]);var vn=(0,c.useCallback)((function(){mn.current}),[$e,mn,Re]);(0,c.useEffect)((function(){if(Ce){var e=function(){var e=new p.Z((function(e){var n,t=o()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(vn(),Ce.setSize("100%","100%"),Ce.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(fn.current.parentElement),e}();return function(){var n,t;null!==(n=fn.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=fn.current)||void 0===t?void 0:t.parentElement)}}}),[Ce,vn]),(0,c.useEffect)((function(){if(Ce){for(var e=[],n=function(){var n=a()(i[t],2),o=n[0],r=n[1],s=l()({},o,(function(){xn(r)}));e.push(s),Ce.addKeyMap(s)},t=0,i=Object.entries(we);t<i.length;t++)n();return function(){for(var n=0,t=e;n<t.length;n++){var i=t[n];Ce.removeKeyMap(i)}}}}),[Ce]),(0,c.useEffect)((function(){Y!==Re&&Ge(Y)}),[Y]),(0,me.Z)((function(){if(!O&&Qe>0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(A);e>=Qe+1e4&&(!n||n!==Pe)&&(window.sessionStorage.setItem(A,Pe),on(!0))}}),1e4),(0,c.useEffect)((function(){De(j)}),[Ce,j]),(0,c.useEffect)((function(){Ce&&b&&Ce.focus()}),[Ce,b]),(0,c.useEffect)((function(){if(Be&&Ce){var e=function(e){var n=e.target;if(gn.current){var t=n.scrollTop/n.scrollHeight;gn.current.scrollTop=gn.current.scrollHeight*t}},n=Ce.getScrollerElement();return n.addEventListener("scroll",e),function(){n.removeEventListener("scroll",e)}}}),[Ce,Be]),(0,c.useEffect)((function(){if(Ce&&q){var e=function(e,n){q(e,n)};return Ce.on("beforeChange",e),function(){Ce.off("beforeChange",e)}}}),[Ce,q]),(0,c.useEffect)((function(){if(Ce&&U){var e=function(){U(Ce.getValue())};return Ce.on("blur",e),function(){Ce.off("blur",e)}}}),[Ce,U]),(0,c.useEffect)((function(){if(Ce){var e=function(e,n){var t=e.getValue();Ie(t),Je((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(H?i(t,jn(t)):i(t))};return Ce.on("change",e),function(){Ce.off("change",e)}}}),[Ce,i]),(0,c.useEffect)((function(){if(Ce)if(null==t)Ce.setValue(""),Ie("");else{var e=window.scrollY||window.pageYOffset;t!==Ce.getValue()&&(Ce.setValue(t),Ie(t),Ce.setCursor(pe?1:Ce.lineCount(),0),window.scrollTo(0,e))}}),[Ce,t]);var xn=(0,c.useCallback)((function(e){var n=Ce.getCursor(),t=Ce.getSelection(),i=t.split("\n");switch(e){case"bold":return Ce.replaceSelection("**"+t+"**"),""===t&&Ce.setCursor(n.line,n.ch+2),Ce.focus();case"italic":return Ce.replaceSelection("*"+t+"*"),""===t&&Ce.setCursor(n.line,n.ch+1),Ce.focus();case"code":return Ce.replaceSelection("`"+t+"`"),""===t&&Ce.setCursor(n.line,n.ch+1),Ce.focus();case"inline-latex":return Ue("inline-latex"),Ce.focus();case"latex":return Ce.replaceSelection("```latex\n"+t+"\n```"),Ce.setCursor(n.line+1,t.length+1),Ce.focus();case"line-break":return Ce.replaceSelection("<br/>\n"),Ce.focus();case"list-ul":return""===t?Ce.replaceSelection("- "+t):Ce.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ce.focus();case"list-ol":return""===t?Ce.replaceSelection("1. "+t):Ce.replaceSelection(i.map((function(e,n){return""===e?"":"".concat(n+1,". ").concat(e)})).join("\n")),Ce.focus();case"add-null-ch":return""===t&&Ce.setCursor(n.line,n.ch),Ce.replaceSelection("▁"),Ce.focus();case"add-signal":return""===t&&Ce.setCursor(n.line,n.ch),Ce.replaceSelection("@▁@"),Ce.focus();case"add-multiple":return""===t&&Ce.setCursor(n.line,n.ch),Ce.replaceSelection(he),Ce.focus();case"inster-template-1":return""===t&&Ce.setCursor(n.line,n.ch),Ce.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ce.focus();case"eraser":return Ce.setValue(""),Ce.focus();case"trigger-watch":return De(!Be),Ce.focus();case"trigger-full-screen":return Ge(!Re),Ce.focus();case ae:return void Ue(ae);case ue:return void Ue(ue);case se:return void Ue(se);case ce:return void Ue(ce);case"maths-latex":return void Ue("maths-latex");case le:return void Ue(le);case de:return void Ue(de);default:throw new Error}}),[Ce,Be,Re]),wn=(0,c.useCallback)((function(e,n){var t,i,o,r,a;switch(Ue(""),Ye){case ae:var s=e.title,l=e.link;return Ce.replaceSelection("[".concat(s,"](").concat(l,")")),Ce.focus();case ue:var c=e.language,u=e.content;return Ce.replaceSelection(["```"+c,u,"```"].join("\n")),Ce.focus();case"maths-latex":for(var d=atob(e),p=new Uint8Array(d.length),f=0;f<d.length;f++)p[f]=d.charCodeAt(f);var m=new Blob([p],{type:"image/png"});(0,L.I)(m,(function(e){e.id?Ce.replaceSelection(".concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}));break;case"inline-latex":Ce.replaceSelection("`$$"+e+"$$`");break;case se:case ce:case"add-flowchart":var h=e.src,g=e.alt,v=n,x=null==v||null===(t=v.name)||void 0===t||null===(t=t.split("."))||void 0===t||null===(i=t.pop)||void 0===i?void 0:i.call(t);return(null==v||null===(o=v.type)||void 0===o?void 0:o.indexOf("image"))>-1||null==v||!v.type?g?Ce.replaceSelection(".concat(h,' "').concat(g,'" )')):Ce.replaceSelection("")):(null==v||null===(r=v.type)||void 0===r?void 0:r.indexOf("video"))>-1?Ce.replaceSelection('<video width="100%" controls src="'.concat(oe.Z.API_SERVER).concat(h,'"></video>')):(null==v||null===(a=v.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Ce.replaceSelection('<a href="'.concat(oe.Z.API_SERVER).concat(h,"?type=").concat(v.type,'&disposition=inline" target="_blank">').concat(v.name,"</a>")):ge.includes(x)?Ce.replaceSelection('<a href="'.concat(oe.Z.API_SERVER).concat(h,'?type=office&disposition=inline" target="_blank">').concat(v.name,"</a>")):Ce.replaceSelection("[".concat(v.name,"](").concat(oe.Z.API_SERVER).concat(h,")")),Ce.focus();case de:for(var w=e.row,_=e.col,y=e.align,b="\n",j=0;j<w;j++){for(var k=[],S=[],N=0;N<_;N++)1===j&&S.push(fe[y]),k.push(" ");1===j&&(b+="| ".concat(S.join(" | ")," |\n")),b+="| ".concat(k.join(1===_?"":" | ")," |\n")}return Ce.replaceSelection(b+"\n"),Ce.focus();default:throw new Error}}),[Ce,Ye]),_n=(0,c.useMemo)((function(){switch(Ye){case ae:return(0,m.jsx)(N,{callback:wn,onCancel:yn});case ue:return(0,m.jsx)(M.Z,{callback:wn,onCancel:yn});case se:return(0,m.jsx)(L.Z,{callback:wn,onCancel:yn});case le:return(0,m.jsx)(V,{callback:wn,onCancel:yn});case de:return(0,m.jsx)(X,{callback:wn,onCancel:yn});case"maths-latex":return(0,m.jsx)(te,{showSaveButton:!0,callback:wn});case"inline-latex":return(0,m.jsx)(ie.Z,{showSaveButton:!0,callback:wn});default:return null}}),[Ye]);function yn(){Ue("")}(0,c.useEffect)((function(){if(hn.current){var e=function(e){o=!0,r=e.pageY},n=function(){o=!1},t=function(e){if(o){var n=e.pageY-r;n<0&&(n=0),n>300&&(n=300),en(g+n+"px")}},i=hn.current,o=!1,r=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",t),document.addEventListener("mouseup",n),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)}}}),[Ce,hn]),(0,c.useEffect)((function(){en(g)}),[g]);var bn={width:ve(s),height:ve($e)},jn=((0,c.useMemo)((function(){if(Qe){var e=new Date(Qe),n=e.getHours(),t=e.getMinutes(),i=e.getSeconds();return t=t<10?"0"+t:t,i=i<10?"0"+i:i,"".concat(n=n<10?"0"+n:n,":").concat(t,":").concat(i)}return 0}),[Qe]),function(e){var n=[];if(H){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,t,i){n.push({multiLine:!("@▁@"===e)})}))}return n});(0,c.useEffect)((function(){_e[Ye]&&Ye!==ce&&Ye!==le&&setTimeout((function(){var e=document.getElementsByClassName("markdown-popup-form")[0],n=window.innerWidth/2-e.offsetWidth/2,t=window.innerHeight/2-e.offsetHeight/2;ln(n),pn(t)}),0)}),[Ye]);var kn=function(e,n,t,i){var o=document.body.clientHeight,r=document.body.clientWidth;return!(e<20&&t>e||e>r-20&&t<e||n<20&&i>n||n>o-20&&i<n)||(document.body.onmousemove=null,document.body.onmouseup=null,!1)};return(0,m.jsxs)(c.Fragment,{children:[(0,m.jsx)("div",{className:"markdown-editor-wrapper",ref:mn,children:(0,m.jsxs)("div",{className:"markdown-editor-container ".concat(K," ").concat(Be?"on-preview":""," ").concat(x?"mini":""," ").concat(Re?"full-screen":""),style:bn,children:[(0,m.jsx)(_,{insertTemp:k,watch:Be,fullScreen:Re,showNullButton:D,showNullProgramButton:H,onActionCallback:xn,hidetoolBar:W,extraUse:Ne}),(0,m.jsxs)("div",{className:"markdown-editor-body",children:[(0,m.jsx)("div",{className:"codemirror-container",children:(0,m.jsx)("textarea",{ref:fn,placeholder:je})}),Be?(0,m.jsxs)("div",{ref:gn,className:"preview-container",children:["stex"===C&&(0,m.jsx)(h,{value:Pe}),"stex"!==C&&(0,m.jsx)(f.Z,{disabledFill:ye,showProgramFill:H,value:Pe})]}):null]})]})}),I?(0,m.jsx)("a",{ref:hn,className:"editor-resize"}):null,Ye===ce&&(0,m.jsx)(Z,{callback:wn,onCancel:yn}),Ye===le&&(0,m.jsx)(V,{callback:wn,onCancel:yn}),(0,m.jsx)(y.Z,{children:_e[Ye]&&Ye!==ce&&Ye!==le?(0,m.jsx)(G.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:sn,top:dn},title:(0,m.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var n=e.clientX-sn,t=e.clientY-dn;document.body.onmousemove=function(e){var i=e.clientX-n,o=e.clientY-t,r=document.getElementsByClassName("markdown-popup-form")[0],a=window.innerWidth-r.offsetWidth,s=window.innerHeight-r.offsetHeight;i=Math.max(0,Math.min(i,a)),o=Math.max(0,Math.min(o,s)),kn(e.clientX,e.clientY,n,t)&&(ln(i),pn(o))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:_e[Ye]}),open:!0,onCancel:yn,footer:null,destroyOnClose:!0,width:Ye===le?"1200px":null,height:Ye===le?"80vh":null,className:"markdown-popup-form",children:_n}):null})]})}},49368:function(e,n,t){"use strict";t.d(n,{Z:function(){return v},I:function(){return w}});var i=t(82242),o=t.n(i),r=t(79800),a=t.n(r),s=t(78241),l=t(8591),c=t(92832),u=t(3113),d=t(47825),p=t(59301),f=t(37712),m=s.Z.useForm,h={width:280,marginRight:10},g={labelCol:{span:5},wrapperCol:{span:19}},v=function(e){var n=e.callback,t=e.onCancel,i=m(),r=a()(i,1)[0],d=(0,p.useRef)();function v(e,n){-1!==e.status?r.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):l.ZP.error(e.message)}return(0,f.jsxs)(s.Z,o()(o()({form:r},g),{},{className:"upload-image-panel",onFinish:function(e){n(e,d.current)},style:{width:470,overflow:"hidden"},children:[(0,f.jsx)(s.Z.Item,{label:"图片地址",required:!0,children:(0,f.jsxs)("div",{className:"flex-container",children:[(0,f.jsx)(s.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,f.jsx)(c.Z,{style:h})}),(0,f.jsx)(x,{onFileChange:function(e){var n=e.target.files[0];d.current=n,w(n,v)}})]})}),(0,f.jsx)(s.Z.Item,{label:"图片描述",name:"alt",children:(0,f.jsx)(c.Z,{style:{width:264}})}),(0,f.jsxs)(s.Z.Item,{style:{textAlign:"right"},children:[(0,f.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(u.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function x(e){var n=e.onFileChange;return(0,f.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,f.jsx)("input",{type:"file",onChange:n})]})}function w(e,n){if(!e)throw new String("没有文件");var t=new FormData;t.append("editormd-image-file",e),t.append("file_param_name","editormd-image-file"),t.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(t){n(JSON.parse(t.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(d.KI,"/api/attachments.json")),i.send(t)}},61832:function(e,n,t){"use strict";t.d(n,{Z:function(){return f}});var i=t(82100),o=t.n(i),r=t(29186),a=t.n(r),s=t(80619),l=t.n(s),c=t(47074),u=t.n(c),d=t(59301),p=t(4676),f=function(e){l()(t,e);var n=u()(t);function t(e){var i;o()(this,t),i=n.call(this,e);var r=window.document;return i.node=r.createElement("div"),r.body.appendChild(i.node),i}return a()(t,[{key:"render",value:function(){var e=this.props.children;return(0,p.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),t}(d.Component)},69924:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var i=t(59301);function o(e,n){var t=(0,i.useRef)();(0,i.useEffect)((function(){t.current=e})),(0,i.useEffect)((function(){if(null!==n){var e=setInterval((function(){t.current()}),n);return function(){return clearInterval(e)}}}),[n])}},48849:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return M}});var i=t(7557),o=t.n(i),r=t(41498),a=t.n(r),s=t(82242),l=t.n(s),c=t(79800),u=t.n(c),d=t(59301),p=t(97682),f=t(99313),m=t(3113),h=t(27092),g=t(32215),v=t(52774),x=t(94398),w=t(23178),_=t(91232),y=t.n(_),b=t(28103),j=t(40848),k=t(19219),S=t(37712),N=(0,p.connect)((function(e){return{user:e.user}}))((function(e){e.user;var n,t=e.item,i=e.getdata,r=e.params,s=(0,d.useRef)(),l=(0,d.useState)(),c=u()(l,2),f=c[0],m=c[1],h=(0,d.useState)(!0),x=u()(h,2),_=x[0],N=x[1];return(0,d.useEffect)((function(){if(s.current){var e=function(){var e,n=new ResizeObserver((function(e){var n,t=y()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;console.log("----",i,e),m(i.target.offsetHeight>=52)}}catch(e){t.e(e)}finally{t.f()}}));return n.observe(null===(e=s.current)||void 0===e?void 0:e.firstElementChild),n}();return function(){var n,t;(null===(n=s.current)||void 0===n?void 0:n.firstElementChild)&&e.unobserve(null===(t=s.current)||void 0===t?void 0:t.firstElementChild)}}}),[s.current]),(0,S.jsxs)("div",{onClick:function(){p.history.push("/classrooms/".concat(r.coursesId,"/program_homework/").concat(r.categoryId,"/answer/").concat(t.id,"/detail"))},style:{padding:"0px 20px",cursor:"pointer"},children:[(0,S.jsx)("div",{className:w.Z.titles,style:{fontWeight:600,fontSize:18,color:"#000000"},children:t.name}),(0,S.jsxs)("div",{style:{display:"flex",marginTop:10},children:[(0,S.jsxs)("div",{style:{flex:1,display:"flex",alignItems:"center",color:"#5F6368"},children:[(0,S.jsx)("img",{style:{width:24,borderRadius:50},src:"".concat(k.Z.IMG_SERVER,"/images/").concat(t.author.image_url)}),(0,S.jsx)("span",{style:{margin:"0px 12px 0px 8px"},children:null==t||null===(n=t.author)||void 0===n?void 0:n.name}),(0,S.jsxs)("span",{children:["发表于",t.created_at]})]}),(0,S.jsxs)("div",{children:[(0,S.jsxs)("span",{style:{color:"#5F6368",cursor:"pointer"},onClick:function(){},children:["回复(",(null==t?void 0:t.descendants_count)||0,")"]}),(0,g.eB)()&&(0,S.jsx)("span",{onClick:function(){var e=a()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.stopPropagation(),e.next=3,(0,v.ZP)("/api/hack_messages/".concat(t.id,"/update_public"),{method:"post"});case 3:0===e.sent.status&&i();case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),style:{color:"#44D7B6",cursor:"pointer",marginLeft:20},children:t.is_public?"取消公开":"公开"})]})]}),(0,S.jsx)("div",{ref:s,style:{margin:"15px 0px",maxHeight:_?52:"",overflow:"hidden"},children:(0,S.jsx)(j.Z,{style:{color:"#434D6C",fontSize:14},value:t.content})}),(null==t?void 0:t.hack_identifier)&&(0,S.jsx)("span",{onClick:function(){var e=a()(o()().mark((function e(n){var i,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.stopPropagation(),!(0,g.dE)()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,(0,v.ZP)("/api/problems/".concat(null==t?void 0:t.hack_identifier,"/start.json"),{method:"get",params:{hack_user_id:null==t||null===(i=t.author)||void 0===i?void 0:i.id}});case 5:(a=e.sent)&&(window.open("/myproblems/".concat(null==a?void 0:a.identifier,"?type=1")),localStorage.setItem("program_homework",[r.coursesId,r.categoryId]));case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),className:w.Z.tips,children:null==t?void 0:t.hack_name}),f&&(0,S.jsx)("div",{onClick:function(e){e.stopPropagation(),N(!_)},children:(0,S.jsx)(b.Z,{dashed:!1,className:"",style:{cursor:"pointer"},children:(0,S.jsxs)("a",{className:"font14 ".concat(w.Z.color999),children:[_?"阅读全文 ":"收起全文 ",(0,S.jsx)("i",{className:"iconfont font14 ".concat(_?"icon-jiantou9":"icon-changyongtubiao-xianxingdaochu-zhuanqu-")})]})})})]})})),M=(0,p.connect)((function(e){return{user:e.user}}))((function(e){var n,t,i,r,s=e.user,c=(0,d.useState)(l()(l()({},(0,p.useParams)()),{},{page:1,per_page:10,type:1,sort_by:"",course_group:(0,g.dE)()?[s.userInfo.course.course_group_id]:[]})),_=u()(c,2),y=_[0],b=_[1],j=(0,d.useState)([]),k=u()(j,2),M=k[0],L=k[1];function C(){return T.apply(this,arguments)}function T(){return(T=a()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v.ZP)("/api/homework_commons/".concat(y.categoryId,"/hack_messages"),{method:"get",params:l()(l()({},y),{},{type:1})});case 2:n=e.sent,L(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,d.useEffect)((function(){C()}),[]),(0,S.jsx)("div",{style:{width:1200,margin:"0px auto"},children:(0,S.jsxs)("div",{style:{marginTop:10,display:"flex"},children:[(0,S.jsxs)("div",{style:{flex:1,marginRight:30,background:"#fff"},children:[(0,S.jsxs)(f.Z,{tabBarStyle:{padding:"0px 10px"},style:{width:"850px"},tabBarExtraContent:(0,g.dE)()&&(0,S.jsx)(m.ZP,{type:"primary",style:{width:88},onClick:function(){p.history.push("/classrooms/".concat(y.coursesId,"/program_homework/").concat(y.categoryId,"/answer/add"))},children:"发表答疑 "}),onChange:function(e){y.sort_by="1"===e?"":"created_at",b(l()({},y)),C()},children:[(0,S.jsx)(f.Z.TabPane,{tab:"最新回复"},"1"),(0,S.jsx)(f.Z.TabPane,{tab:"最新发表"},"2")]}),(null==M||null===(n=M.data)||void 0===n?void 0:n.length)<=0&&(0,S.jsx)(x.Z,{customText:"暂无讨论"}),null==M||null===(t=M.data)||void 0===t?void 0:t.map((function(e){return(0,S.jsx)(N,{item:e,params:y,getdata:C})})),(0,S.jsx)("div",{style:{width:"100%",textAlign:"center",marginTop:10},children:(0,S.jsx)(h.Z,{current:y.page,pageSize:y.per_page,total:null==M?void 0:M.count,hideOnSinglePage:!0,onChange:function(e,n){y.page=e,y.per_page=n,b(l()({},y)),C()}})})]}),(0,S.jsxs)("div",{className:w.Z.right,style:{width:300,height:"100%"},children:[(0,S.jsxs)("div",{style:{display:"flex"},children:[(0,S.jsxs)("div",{style:{flex:1,display:"flex",alignItems:"center"},children:[(0,S.jsx)("span",{style:{marginRight:3,fontSize:20,fontWeight:600,color:"#000"},children:"广播"}),(0,S.jsx)("img",{width:21,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAWCAYAAAAvg9c4AAAAAXNSR0IArs4c6QAABPdJREFUSEullWloHGUYx//vzO7sHDuzm93sZpM2l/SgRyK7xSYxrfYgbdUq6JcixXqAUrxItGAVMT1A+kH7Re1WWppa6afiAYJIi7ZB07vkIARzVJqYbJMmu90zszOzM6/MVEXQotR3mPky8/7e//N7ZuYl+J+jt7fX7/f7i/X19cU/UORemZRSZnBwsKNQKLztdrtHOI57sqGhYcbm3ROUUsoOD4++Mz9f2CtJItE0DaVSqTMWi+27Jyil1DM0NLTfsmgHpZbLhthQSmlfTU3NmkgkUvjPSSmlZGRkZI2maZ2mWdpAGBehpgnd0KBpOkzTLPn9/gei0Wjfv0JHR0cXGpq2xTDNHZTSJsu0OJNaIIRFUc07KXXdgGVZCAQCL7e0tMT/Br3ja3iRaZptlmU9YVHayhBGoAApGTpKhgHCsFCLRaRvp+yEtk9QaiEYDHy0cWPb639CbdjAwADP8/zRkmk9BYADIU4nLUqdycX5Agxdh4cXkLh5E8m5WTD2A4SAZVmEwxVnNm3a9AiJx+MrdSI8nslm25YtqlMaVi6LWab1+2IUFIB9NXQDuUwapmFAUnwYHBhAOp0Ex3nAcRx4QUA4FL62ecuWVnL01Om8V1YkXdewpMoLn6zYC4NhGLhcLng4t4OdnEognUqCIQSSJOPipYvI5gsQBBGyV4KiyAgFgz83NDauImevDtFUJo+ZqXGsW7UcvjK/zQDDEBBCHF+pZBKTU1NOl1mWgYfnMTNzy1FTWbUA6UzWuVce9N2QRKmRfP3d9zSRLOBS9xlsbVsLv893p2TLcjzqhgGtqEEvGWAI47izyx27ft2ppq6uHpIoIFcowqfIkz7Fu4LEjxyhVUtX4cuTn2FxdQiiKILYKe3DbpTtwu4Fw4Bzu8F5PGAZFqnbKWdhRVEQDkegm5YNnVhYFVlJ9uzbb2x++iXXxwf2o0Jxg+N5J4ENs/0RlgVLCFwuNyRJhCAITgX+sgCyubzjXZK88Hq9ttuRMr8SI2d+OHdCqFz8zMkjh1SeqqXy8qBsGIbj0rQs56UGpXCxLCRZhiLLmFdVyF4FmmFAUXzw+RRIogSvV+xdUFX5ILl07drBIh/quHD2bNeK+vLLum7ENXUe+Xweqqo6p6brMEsleDweJ1Eul0MgWA7Too6uYCAAryxDEvlzzU1NbeTClSsHDTHScaG7+/D6pmU9k2nt8/TU+NUl91UP53K5dblcrjKfzzOFQsFpmu01k8mgrCwAC4yjygZXVkYgy9LR1paWF0n3jz0fMMGaN8+f6z68oXnp+V/T1omRgd7ju9t3Pp9IJMTZ2dmHMpnMtnQ6/Wg2mw2pqkqy2SzcbjdcnAiOczuJIxUhVIRCu5qbV39Ivj19+oBSvfytyz/1HG5trLs4NU+O3xge6npj53Mv/PUHPj09HR4bG9s+NzfXnkymatSiCoEX4C8rA+fh4eE4GioPrI1Goz3k1Fdf7KlcEuvsu3z1mN9jjY3fSr/vgX5oV/trr/zTrtDf379wYmIinkqlHrMsi8iyDFnxQRCFsdrq6tW1tbW3yXt79z77y42J44KL5FPJOeJiXUb0/oYdu9/t/OZuW42tpa+v75iqqtvy+RwqwiEIvPjJw+vXv+q8011dXXx/f/9WWZaVQCBwE0Bfe3v7NCHE/rDuOmzw+Pj4p4lEYruLZWeqa2o2xmKxIXvCb487Tm3fsdeDAAAAAElFTkSuQmCC"})," "]}),(0,g.GJ)()&&(0,S.jsx)(m.ZP,{type:"primary",onClick:function(){p.history.push("/classrooms/".concat(y.coursesId,"/program_homework/").concat(y.categoryId,"/answer/add"))},children:"发布广播"})]}),(null==M||null===(i=M.radio_messages)||void 0===i?void 0:i.length)<=0&&(0,S.jsx)(x.Z,{}),null==M||null===(r=M.radio_messages)||void 0===r?void 0:r.map((function(e){return(0,S.jsxs)("div",{onClick:function(){p.history.push("/classrooms/".concat(y.coursesId,"/program_homework/").concat(y.categoryId,"/answer/").concat(e.id,"/detail"))},style:{marginTop:30,cursor:"pointer"},children:[(0,S.jsxs)("div",{className:w.Z.title,style:{fontSize:"16px",fontWeight:600},children:[(0,S.jsx)("span",{style:{color:2===(null==e?void 0:e.message_type)?"#4C7BE6":"#E17E7E"},children:2===(null==e?void 0:e.message_type)?"【题解】":"【通知】"}),(0,S.jsx)("span",{title:e.name,children:e.name})]}),(0,S.jsxs)("div",{style:{marginTop:15,color:"#5F6368"},children:["发表于",e.created_at]})]})}))]})]})})}))},30321:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return hn}});var i=t(82242),o=t.n(i),r=t(7557),a=t.n(r),s=t(41498),l=t.n(s),c=t(79800),u=t.n(c),d=t(59301),p=t(52774),f=t(97682),m=t(8591),h=t(43418),g=t(3113),v=t(66104),x=t(6848),w=t(99313),_=t(61998),y=t(28563),b=t(65327),j=t(40848),k=t(37712),S=(0,f.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks}}))((function(e){var n=e.shixunHomeworks,t=e.dispatch;(0,f.useParams)();return(0,k.jsx)(h.Z,{centered:!0,title:"提示",open:"删除"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:l()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({type:"shixunHomeworks/deleteReply",payload:{object_id:n.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:0===e.sent.status&&(m.ZP.success("删除成功"),t({type:"shixunHomeworks/setActionTabs",payload:{}}),t({type:"shixunHomeworks/getReplyList",payload:o()({},n.actionTabs.params)}));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){t({type:"shixunHomeworks/setActionTabs",payload:{}})},children:(0,k.jsx)("p",{children:"确定要删除该条回复吗?"})})})),N=t(61186),M=t.n(N),L=t(19219),C=t(71418),T=t(27092),Z="bg___F3FV1",A="deseIconSty___gIJAj",P="buttonEdit____8SMk",I="md___cq_mx",E="maskWrap___bHoew",O="desHead___Njyrc",B="mask___o8p8v",D="info___V66Uf",z="upDownSty___Q_kpi",H=t(32215),R=t(15754),G=t(71600),W=t(87512),F=t(18257),Y=t(9198),U=t(19719),V=t(35241),q=t(44589),Q=t(20538),J=t(78386);M().locale("ZH-cn");var K=["","简单","中等","困难"],X=d.createContext({}),$=function(){var e=(0,d.useContext)(X),n=e.setActivatorNodeRef,t=e.listeners;return(0,k.jsx)(g.ZP,o()({type:"text",size:"small",className:z,icon:(0,k.jsx)(x.Z,{title:"可鼠标拖拽进行试题排序,学生端将按照此排序展示",children:(0,k.jsx)(G.Z,{})}),style:{cursor:"move"},ref:n},t))},ee=function(e){var n=(0,U.nB)({id:e["data-row-key"]}),t=n.attributes,i=n.listeners,r=n.setNodeRef,a=n.setActivatorNodeRef,s=n.transform,l=n.transition,c=n.isDragging,u=o()(o()({},e.style),{},{transform:V.ux.Translate.toString(s),transition:l},c?{position:"relative",zIndex:100}:{}),p=(0,d.useMemo)((function(){return{setActivatorNodeRef:a,listeners:i}}),[a,i]);return(0,k.jsx)(X.Provider,{value:p,children:(0,k.jsx)("tr",o()(o()({},e),{},{ref:r,style:u},t))})},ne=(0,f.connect)((function(e){var n=e.shixunHomeworks,t=e.classroomList,i=e.loading,o=e.user;return{shixunHomeworks:n,globalSetting:e.globalSetting,classroomList:t,user:o,loading:i.effects}}))((function(e){var n,t,i,r,s=e.shixunHomeworks,c=e.classroomList,v=(e.globalSetting,e.user,e.loading,e.dispatch,(0,d.useState)(o()(o()({},(0,f.useParams)()),{},{page:1,per_page:10}))),w=u()(v,2),y=w[0],b=w[1],N=(0,d.useState)([]),M=u()(N,2),V=M[0],X=M[1],ne=(0,d.useState)(-1),te=u()(ne,2),ie=(te[0],te[1],(0,d.useState)("")),oe=u()(ie,2),re=(oe[0],oe[1],(0,d.useState)("")),ae=u()(re,2),se=(ae[0],ae[1],c.detailLeftMenus,(0,f.useLocation)(),(0,d.useState)({})),le=u()(se,2),ce=(le[0],le[1],s.workDetail,s.workList),ue=s.workSetting,de=(0,d.useState)("1"),pe=u()(de,2),fe=pe[0],me=pe[1],he=(0,d.useState)(!1),ge=u()(he,2),ve=ge[0],xe=ge[1],we=(0,d.useState)(!1),_e=u()(we,2),ye=_e[0],be=_e[1],je=(0,d.useState)(""),ke=u()(je,2),Se=ke[0],Ne=ke[1],Me=(0,d.useState)(1),Le=u()(Me,2),Ce=Le[0],Te=Le[1],Ze=(0,d.useRef)(null);function Ae(){return Pe.apply(this,arguments)}function Pe(){return(Pe=l()(a()().mark((function e(){var n,t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return xe(!0),e.next=3,(0,p.ZP)("/api/courses/".concat(y.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:o()(o()({},y),{},{id:y.categoryId})});case 3:if(t=e.sent,X(t),xe(!1),y.defaultExpandedRowKeys=["".concat(null==t||null===(n=t.data)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.identifier)],null!=t&&t.hide_description){e.next=14;break}if("2"==fe){e.next=12;break}if(null===(i=ce.homework_status)||void 0===i||!i.includes("导入")){e.next=11;break}return e.abrupt("return");case 11:me(null!=t&&t.description?"1":"2");case 12:e.next=15;break;case 14:me("2");case 15:b(o()({},y));case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,d.useEffect)((function(){ce.homework_status&&Ae()}),[ce]),(0,d.useEffect)((function(){Ze.current&&(Ze.current.clientHeight>200?Te(2):Te(4))}),[null==V?void 0:V.description]);var Ie=function(){var e=l()(a()().mark((function e(n){var t,i,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.active,i=n.over,t.id===(null==i?void 0:i.id)||null==i||!i.id){e.next=7;break}return X((function(e){var n,r=null==e||null===(n=e.data)||void 0===n?void 0:n.findIndex((function(e){return e.identifier===t.id})),a=null==e?void 0:e.data.findIndex((function(e){return e.identifier===(null==i?void 0:i.id)}));return o()(o()({},e),{},{data:(0,q.Rp)(null==e?void 0:e.data,r,a)})})),e.next=5,(0,p.ZP)("/api/courses/".concat(null==y?void 0:y.coursesId,"/homework_commons/change_hack_position.json"),{method:"post",body:{id:null==y?void 0:y.categoryId,origin_identifier:null==t?void 0:t.id,target_identifier:null==i?void 0:i.id}});case 5:0==(null==(r=e.sent)?void 0:r.status)&&(m.ZP.success("排序成功"),Ae());case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsxs)("section",{className:Z,children:[(0,k.jsxs)(C.Z,{spinning:ve,children:[(!(null!=V&&V.hide_description)||(0,H.GJ)())&&(0,k.jsxs)("section",{className:" edu-container",style:{padding:"20px 20px 0 20px",background:"#fff",position:"relative"},children:[!ye&&(0,H.GJ)()&&(0,k.jsxs)("div",{style:{position:"absolute",zIndex:10,right:34,top:30},children:[(null==ue?void 0:ue.hack_edit_permission)&&(0,k.jsx)("span",{className:A,style:{marginLeft:"auto",cursor:"pointer"},onClick:function(){be(!0)},children:(0,k.jsxs)(x.Z,{title:"编辑说明",children:[(0,k.jsx)("i",{className:"iconfont icon-bianji-moren font14"}),(0,k.jsx)("span",{children:"编辑说明"})]})}),(0,k.jsx)("span",{className:A,style:{marginLeft:"20px",cursor:"pointer"},onClick:l()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=V&&V.hide_description){e.next=4;break}h.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"隐藏后,学生端将隐藏作业说明模块",onOk:function(){var e=l()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/homework_commons/".concat(null==y?void 0:y.categoryId,"/hide_description.json"),{method:"post",body:{status:!0}});case 2:0==(null==(n=e.sent)?void 0:n.status)&&(m.ZP.success("隐藏成功"),Ae());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}),e.next=8;break;case 4:return e.next=6,(0,p.ZP)("/api/homework_commons/".concat(null==y?void 0:y.categoryId,"/hide_description.json"),{method:"post",body:{status:!1}});case 6:0==(null==(n=e.sent)?void 0:n.status)&&(m.ZP.success("公开成功"),Ae());case 8:case"end":return e.stop()}}),e)}))),children:(0,k.jsxs)(x.Z,{title:null!=V&&V.hide_description?"公开说明":"隐藏说明",children:[(0,k.jsx)("i",{className:"iconfont icon-xianshiyincang font14"}),(0,k.jsx)("span",{children:null!=V&&V.hide_description?"公开说明":"隐藏说明"})]})})]}),ye?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(R.Z,{defaultValue:null==V?void 0:V.description,watch:!0,height:155,onChange:function(e){Ne(e)}}),(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)(g.ZP,{size:"middle",type:"primary",className:"".concat(P," mr20"),style:{marginLeft:"auto"},htmlType:"submit",onClick:l()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Te(1),e.next=3,(0,p.ZP)("/api/homework_commons/".concat(null==y?void 0:y.categoryId,"/update_description.json"),{method:"post",body:{description:Se}});case 3:0==(null==(n=e.sent)?void 0:n.status)&&(m.ZP.success("编辑成功"),be(!1),Ae());case 5:case"end":return e.stop()}}),e)}))),children:"提交"}),(0,k.jsx)(g.ZP,{size:"middle",type:"primary",ghost:!0,className:P,onClick:function(){be(!1)},children:"取消"})]})]}):!(null==V||!V.description)&&(0,k.jsxs)("div",{ref:Ze,className:E,style:1===Ce?{visibility:"hidden"}:2===Ce?{overflow:"hidden",height:"200px"}:3===Ce||4===Ce?{overflow:"initial"}:void 0,children:[(0,k.jsx)("div",{className:O,children:(0,k.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAYAAACo7RKTAAAAAXNSR0IArs4c6QAAFaNJREFUeF7tXHl8XHW1/557Z5JM0yTtA9qy6dwktMVaKMncAVo2F0Rk0aeg+FCK+tzg8WRR5qYFCdA2dwou+AR9LCpSZVE+ICIi+ACfpOjcSaAthdImudMFCm0hbfZl7u/Ib5KZznJnSdqnrx97/4HOPb/zO7/zO7/fPcv3hACg+xH/NBoaXMnARwjwMeGvxNSqgFZXzSq36AOxIUk3kYcfulDdI1qPJ4iFDF7EwEJiVABoBZV9a9pFWzsnwu8g7UEN7A8NED9RX72np6cNTNOJcB8Thpl5ITHpDK4gohEA7QRaLUCtXqV89dRPx97Mnpwfqq3p4cGTBHgRMUsjPxGMqSAwAS8yaDUResD8aQCHqh7llKoL3ly/PxZxkMdBDZSqAdr9wIyVzHSZonoXVJ92j4P46E0A10OMxkZ2rt46vP1ZEn1ba8G0iMEzJWMCdTFxKxF6IcjDhJOJeR4DCgiDBPwvMVoZVMng0LTGb5+EqdoCCLEITt+cnvYb5sIZWldzwZZTShW0GN2a5roZ8SE0CBYNU3xTbh0YGZoNh/8j52AS7wia9reL8ftnfB9tqr2aBWbnrJ24Rzfta5O/R0O15zBwnpuOFKK/NJqdP/v/qj9p8BsAeq7mQ/fdhOFheeNOy10wegH6S3zPpldGtz01NNL98mHA8CIWmEMKdrCgp0jhVha4SiHv6upT7l4FchaNbHv6UwNd9x83beHtgCq9mbFnZPtzGOxcxTUNxjyafdWrE1XOS0tnHzkqRhvB1ABwA4MbwDgycRgJ3boZ+xf5/xHDvy35e3IOIrpPN+1LJjrnZOnbm+oPi7PzNBiHu/Egwl910z4/2uRfLAStzDcPgb+ih2O/magca43504e49xWAlPSxqoorGlfYD6X/Fr2uvk6Mxl8DoGbP46koP7LhxtfekL9HQ7U1DN7JYG+OPArOCLbE/lRITrv5jIqdo1sbJrKWSm/F2nnN6/uiodp/E+AfT2Rsau8VXCUNPk6ga6pPu2cOBH+9JEYEJ77ntc6+NStne2qOfXTqgmt/BRYLe63rvuiZNrvcV39JQrmjb72A/o13I9vgnT0b0bs2jKrjQ7/xvO+aT5Q05zhRxPD/DxgfzD+GosGwrUeW1h2NuLMlm04l5XONZtcvJjLnvtJaTdr5LNjdWInuDZr2pXIOK6Q9xeAz3ebzeBS9YXlXdDKyWCF/GwOZBkb0i6Bpfy6bn2VoUWZuzP6dVPWz+orOBxJyNvm/ygI5Rkeg5/WwfWoxGZmZLENbDeCkYrTJ916q0E4wN8QihnYrmK8pdVw6Han0Eeq+fwYrpFxRfepdXwBnKaUAV6enC71rlqPi6HNR4f/XBGVvezM8VRp8xyxO/Duvwfd0oHdNC6pOWGp75n6jdiLCRwz/LjAOyTeGgAf0cOyzVpP2JRZ8dy4dbSPw8ETmlLTk9ZwVWNYxqUDbWlJ3ETvO/W5zKqDrA2F7WcKQDO15Zl7kRuf1TZt+QvNLuycqt6SPGv4VgtGUsfmgXQHf4pnU3CzSf7dC/u8xcGWOwRN+rJuxr8tkRLTd2siMnH1TST270ex8shQZLUP7NTN/qhRaGUcGKhb7pKyFLoVivMq95bV7Df6Uu68CuGTj2y8G33D9Ts+cK2YUEzT5/sXmBdNGB3d3F6RXaFmwxb4+EtIeBBIB8j4/BPCsmYdXHn31C4OTYRYNadcJ8M1uY9NvzoihvQkei5MyHsLbQTN26GTmlmMiTf7TIfBcDlsPnagvtyPrm+fNGhwa+LJ8zyxdRLh8dWmbQriTwX5mfDFXRPQzsFKBMhIId5nFZI0Y2ktgPr4YnXxPhA26GTs2sRYXHRFolECpuExAHiQOZB3w0UBjwHdAGXz70tpAPC4sAnazW6wxFlAvDvgWr7KGfraj0JegFEUnaQh4Qw/HEjFCvqfNqL1YQGR8ahUFTY0rYn+IGNrPwDz22ct6kq7KhvCcqp53hntcDwWR9PNPaluiHScEZwWEdL9u2rcUki36341ett9eC5Avi+5W3bR/2NZUe64jxG8nopP8tLQpGLZzA9+sAZah9TLz1JSOif4aaAgkvm7Rtuh6Bs9JDSF6PGja561bos0cdDgnQwiiNUHTXpCkjxj+34Px0cwpx+T6vzH4uosBOBjd2e7uwyddmgne8DJYUhSljCne4Dhw/3R61EVweBQsIjm3EFGbm386dovQz8H8jutGkrJFN7u+V8ggrJC25N0gbnnmrYJPyECzFFfFMupPYI635zH4Vbppf15mUYQQ38mgIVwUNGMP7ouxWk21V7IQBddXKn8Cfq+HYx8rRC+/KP2D/dszdEWUWCM3NyvRoXsHmbls72HA93QzdrW1RDuTHX4qh3daHCTfWYa2iZnrs/YiIdd+N3jVdxicwZ3g+ADKZi7C0JbHcoPWSRp8cgFWSLucwT90U2q5T505MiS+zMwJvzhNaQPE1JLPtZhe4ak55sYO1xu2lM2ONGk3Q/B16bQK0VkB036qFFclamgXCuaMrEma7M26GbvRMrTfMPP5GXOoviMCK17NMJ7k+0TWJe78JJ/8iqI0B1Z0Pms1aT9kwZdn6Uswo1jMkMiGZYxT6L/0Fvs/C+ksGqo9RUD8OWu+xBpfNOb6R3nIzmJ6edDsuiNqaNcI5ltz5iR6isDPJH8XoGVg9rjJtd8N3unfCsUzBeSZAjEk40vsd4OPGrXfFyy+4XLSe4KmXWMZ2nPMfHqm0vAkgbYw81dcFLZTN+2SYwm3zXTLHqgKnVZRPuXF/sH+XrcxNO6qyHcRo7YJLFa40cnMUkNL5y8tQ9sFYK+REW0MmvbeT3/W4EhIO+/dtO1j+YyPxn14NxegWMZl63dP9r351nbpt1MW/yuD4dhthQy+zai71GHnp+k0yeyZZdR+mFk87XZxWIb2c2b+fCkXUDaNouAbgZbYD/arwfe1N8MZ3oWp878JxVuNvnW3wBncgWmL7gCU8pQMzr7f8I8z+JwcwwXap/gqTx8YHHgnO0dMpFzNEOe6pTQJWK2HY67ZkVKVGzW02wXzZen00j93HMXJ56ogLTVoGf573IJByU9RcJIiaCgOfinrPr0rGLZzDnCSppirUqVUHHpsy4a387gAP9XDsZzgNMV7Sd372XHW5RgWlHMD4a7fFdKbZWjLmHlpxg08fviiRu3XBIsfZd7+ZXW6ubFrIoFujm0oyjl6S9cT+9Xg493roZTVQKk8KjEfj/QgvvtleGcszJh/Xw0+YmivgdklMKKHysrUm0ZHnRuyF+zx0NL4KP+Rwe/J3QzaRoTW3APEXQEztqQUo7dC/p8w8IUMg1c88wQ78/K7KsqNutnVPHbDa38C82luc0nD7MfQxUIg4+YsVlOwQtolIHwx52uXCO6xWw/HpnPzGR5raPNgtgsAUpYEza6WfGuPNtV9QgjnkRydeWmuvsyWxau8j2VoDzDzZ9IJKn2Vh8xrXv+OFdK+w+Crk+9kBkZmV9q6uxS23+lL9+0lDREEQANpvMqyaeS7MkWZs6Cla+N+NfhSDEPS7IvBJ/LAbdFBtyofES3XTTvDj07KtOkH9eW734gPMCOj4lhQZsIjQTP2yVLW5baJMu87HB+9KJ+rAtDng2F7leRvGf432KUamzRMK+R/mIEMWcorPEcff2PHtsLGVftZZvFLl0OeKNBZxuxa5pGc+oJC9OmAaf8qH2/L0L7FzBmVYWl8UyoqffOa10v8VSGDzyhujRktxgNvWsjM700NHnfboqHa+QJibQ7TrD3KU5hyKn2VU6RcB5zBr7lujjY8Otzlpk2V1C/kw3FEm2bPFWJkQjAGBXRrIGx/q0SDzwkoK32Vhw8M9S/P56qoHs/Jjcs7/rLmluMqh3f19LnPQ1Hd7ApGjdod7wbqqVw8Ebp0M1ZXTLaooV0vmG/KuYmJHtRN+6KooX1EMP/Bhc+VKql5b2oH4nIwn5s+jog266btLyaTFdJ2M7imGN34Df6EbsbOkWlfh0Xicsh6bgiGY6n1WYb2KDN/PIOGEAuaMS3BL1Vp3Q+Fp1IWsK83fIENggLl1EC463k3OQrlmolIujP9LrfH7XqLnTfoS6d3qwAqUKYJ4sfyuSqKr+ywQPPGXTK/7ji8xk1uWTn2lnmWjYzEX84wLqCgj52ktQztXmbOwQ4lv4bRUO3XBcQdpe5dQTrCM0Ez9qFCNNHm2YeKwZGdpc6nkHJbwOy60jK0lcycc/kQxlK/aetdx8zvzzqIf9RNOwHZOOAMPmLUXgYWt7spzKfSrPkr7Lfc3hUK4JL+Y6mb4Mo/pP2ZwRnoz0pfZfnAUH/M3VWhPXrYTgD1Ik21n4QQD7vOr8gUG23PXrOi4NJAS+zeYjJbIX+r7EXIpkt+DbN95mL8Cr0nojt10/5qIZq2pfUnOfH4C1kG2QEgxuBKME7OeneFLI5FQtqTAJ/lwnuQiJzU78yV2ZkjGodFHJAGnx/rQX26aVflU7ZbrjmhgDR05b5stgvoyik/tLqmkKsifWg5p9Xkv5YFwm7zS8MWgj6WDZNIgqmKyRwJaW8BnJNylSnTxhb7z265/WI8870nomuLVX0jIe1zAN+XziN5eN0gEEl8Tr4YpxRZFaJvBkw7UbA7AG947bfZvuP4ol8KhmMn5FNAvhuCQBE9bJ9YiuIK0UQM/3ow3pekIaI+RcGiQq6KBLklbnhDuwvM/+7GnxT1FGbxcDrGRtYT9LC9N7DLI1ghuIIyXrBqv2HOEc6wbPSJLxZC5PQJyHw8yLsYPBpm8AW5U9FdRN4EdqZqOu2cG3rNteaQHGcZtc3MIiOLJteot3S2ugH+FK+nXnHQExfxHZPdo3S354AzeCukbcjAWYxrgYh+pZt2XrCYFfJ3MJAT5BHwKiiZIchUqUL0jLwFS1F0xPDbYKQCNiLayURfK+SqSJBb4oY3/M8y4wy3eTyg0+PgDHx5qZj+fHAFAvr1cCyFYxmTQYswc+KLk/6QQpfoLfZ9Vsj/DAMfyJGRlEQVtBQdjR/uVWCW2JPUk3RFLaPWZBah1AuiuF7xXt+LI1tOjzvij7lz4xkFSEENmOlUt/pMWZnn/Qtu7kh01x1QBu+Gs0gqQSG05MuZ5801F9klIuVLutmVtzSfPry9qf59RLQX/6Hy6Gg8fk4hVyXpg0dC2laAx4oXmebWO71CPapvlDJQrB7Et+eLVdKHW03aBSw4J7VIRGt1004hFfOl/Ai0Z9bMWYdLlKhlaLJKfXS2hBOBBCcMPuSX/nsaDp56g2G7evzQZUCGiahDN+1jXDFE40BBPWz/PCmTW0oyG+l6QBl8oZRkIeMc7+SRgdHEnhK6dwoxjIS0OwFOwG5zTHn8M16gRC+HFHTTii0mGqo1BERu8Sg3d33bu8A5N/zLj4Lh2GWFahherzL7hGVdm4rJknz/Lg5KdkqlQ51Ta8yupCaBaPnQph7QgoawncpuWSH/I7nQZtoWDNupg3pAGXxetJzsSRsPwtwU37bEf1Y+dGUCakzYG+WnMShTy45fsHzj66VuZjZdIVcl+Rl/6fr6edkpxyQfAv1aD9sXTnr+kHY3g7+Uc9iIbpE9qrKI1/Hmi57u1+OydS8HCKaSGmg0O9vy1TBKLTQl55doVwGRAUhLX6MV8vcxUJla/zgQzTL87czIiM9kBfbd3uWp6UUuK6StZfD89PUS0Z900065iweUwRfKGSeDMDfjKISulMWhec3rczHWk7WytHH5XBUZ0CYzSlbI/3EGHs0znRkMxzI6lSYiliuIbgxW0M5AuUL0U1aU1/N0Y6VuXtm0LSAedzk4qUKThBqAsEeiL/PJ2GbUNTrsZLQpEuhpIjwkmKWhfz99rAR8NZb774gObu5j8F4w1hicO8Mtk+Msw9/PjCkZBg+6Rw/bqYQAdT8ws58Yt9Wces9n9rXjqdTNGN0VRf+rP0J1YNkO9Ziv5Hb45GFkGf7vMuOqHMW7BGHpNJNNZZayHlnYQeYneu8wxtkuaEKZCpXYj/EOJHpPdqEkxYDwCgExNzk8HuXKYq6EWxN7Oi+V1E8KiMuY+cMuxpzIf8vfIyG/RKZmGKP8Xfr4IG5lJpWIz/SScqzEq+TTW8TwfwaMRF9sKQ+p6se8Km1x+wJmB+5uGHs5hwKlKb0Di7rvn/k4iBfUBFcOU9kh+9TiV8oiIIbRt+47EMO7UR0Mb6WjzncBc7lzsgztMWbO+fMQbqc9nUPEyJPKzOqUKUn+NCLZSSS63pZtfzld/hPlNVH6QkU2yatIbJCYTqbrAEi/NxPiSxiqQNURx5nrEu2UVpP2AxZ8RREZU3iVfHSWoS3N7lMoxFPGB/E4Am5YoPTc+piMdYtYODlVdlLoQr3F/nVyHhq4/4ijh8lpJW/l9Cn1i6d6Dyntrye49bQW2zSn18Zgxyo4A9sxdf7VUGvqH6Qjz7uo2Ljke8vwv8qMuS630cO6abvkiMcoJzuumFxtRl29w07JAVsxfqW+T3eJ8hpXHviujFlAWA2mVgKmC/A3XXj8MhiOpVKHluH/HTMKdjEBsIPhWMEL02rSJK4o7z6ly0FgQdohx7HdfXNGqnKciEg5Uze7UqlK1x4JorhPwVHpGa3Eyd790EyN4F0lnJGFqm8GPDVz4ak5BmpVPRSfe19EKQbPI7sR7+mE07MJ8T0bEe/bDHXK4Zgy+1Ko1fU74PUuohkfLSl7UiglSaSEdbPLcNv8xLjBeweyfcDEDVdgXCnG1x7SjnfAeSG0pfCYHI2yRQ93fa3Q2CR8VwK6GHhekQUkRmuj2fkyEbHUizV472a3dKiiqh9M98Xz1T4yDJQohVeZ3JrcR1kh/xMMnJ391qN4ZjS0dCQwOW7ZqPG/mCfdsjszD1Lav/p+e9rFVF6+whnY/h7ZuCEfxVsFT/UxUKvrxv479b2A4kGuwTNE3+uI925CvKcjAQF2hmSDDhIYeU91PeTXw3uYDpDnCajq5XT42a7+qdvS1zfPK+sfHsxA5yXpVKa1jWan68GZ7Lj9uWn/CF5rbqg/iuMK58syJaqwu0dz/gaOysQNLR2PykORlDvROaVQ7h9dSluYR8GWyf7dnEL6aWvSThWkZBTJFDhCNsfLcXJ/B0aGMgBrJIQDpWKdW+tjdntWYm7e/uQ8MbD5gvjujo+K/tfnx3vtSqdvM1jEQYonYfRK+SEY2RmBp6oepJYj3tsJdoZkIJNoAPEkD0h1HRTfYTsAegGgVqh4kmadk9Mp848wioNz/vNpwNXgs9XAbz1Rh+He0+PdG86P92890enfOtPZ00FitBdQvfBWyS9AfeIW99TUM9TyV6SPCGA1yjytpbot/3zqP7jiv7cGSjL4nAPQ/ew0DA2e7HSvP1etniv/QI7sI1oNUlejwvcCTf9AsW73v/c6D853UAMJDfwN/F3Fz8TPqaAAAAAASUVORK5CYII=",width:94})}),(0,k.jsx)(j.Z,{className:I,value:(null==V?void 0:V.description)||""}),2===Ce&&(0,k.jsx)("div",{className:B,children:(0,k.jsxs)("div",{onClick:function(){return Te(3)},children:["展开",(0,k.jsx)("i",{className:"iconfont icon-zhankai4"})]})}),3===Ce&&(0,k.jsx)("div",{className:B,style:{position:"relative",height:30,background:"transparent",paddingTop:5},children:(0,k.jsxs)("div",{onClick:function(){return Te(2)},children:["收起",(0,k.jsx)("i",{className:"iconfont icon-shouqi5"})]})})]})]}),(0,H.dE)()&&!(null==V||!V.group_name)&&(0,k.jsxs)("div",{className:D,children:[(0,k.jsx)("img",{src:"".concat(L.Z.IMG_SERVER,"/images/").concat(null==V||null===(n=V.user)||void 0===n?void 0:n.image_url)}),(0,k.jsxs)("div",{className:"ml20",style:{alignItems:"start"},children:[(0,k.jsx)("b",{children:(null==V?void 0:V.name)||""}),(0,k.jsx)("span",{title:(null==V?void 0:V.group_name)||"",style:{maxWidth:"130px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",wordBreak:"break-all"},children:(null==V?void 0:V.group_name)||""})]}),(0,k.jsxs)("div",{children:[(0,k.jsx)("b",{children:(0,k.jsx)(Y.n,{value:null==V?void 0:V.total_score})}),(0,k.jsx)("span",{children:"总成绩"})]}),(0,k.jsxs)("div",{children:[(0,k.jsx)("b",{children:(null==V?void 0:V.total_time)||"-"}),(0,k.jsx)("span",{children:"总耗时"})]}),(0,k.jsxs)("div",{children:[(0,k.jsx)("b",{style:{color:"#009C0F"},children:null==V?void 0:V.pass_count}),(0,k.jsx)("span",{children:"已通过数"})]}),(0,k.jsxs)("div",{children:[(0,k.jsx)("b",{style:{color:"#FA6400"},children:null==V?void 0:V.doing_count}),(0,k.jsx)("span",{children:"进行中"})]}),(0,k.jsxs)("div",{children:[(0,k.jsx)("b",{style:{color:"#E30000"},children:null==V?void 0:V.not_pass_count}),(0,k.jsx)("span",{children:"未答题数"})]})]}),!(null!==(t=ce.homework_status)&&void 0!==t&&t.includes("导入"))&&(0,k.jsxs)("div",{children:[(0,k.jsxs)("section",{className:" edu-container",style:{padding:"20px",background:"#fff"},children:[(0,H.GJ)()&&(0,k.jsxs)("div",{style:{marginBottom:"10px",fontSize:"12px"},children:["可鼠标拖拽“ ",(0,k.jsx)(G.Z,{})," ”进行试题排序,学生端将按照此排序展示"]}),y.defaultExpandedRowKeys&&(0,k.jsx)(W.LB,{modifiers:[F.DL],onDragEnd:Ie,children:(0,k.jsx)(U.Fo,{items:null==V||null===(i=V.data)||void 0===i?void 0:i.map((function(e){return null==e?void 0:e.identifier})),strategy:U.qw,children:(0,k.jsx)(_.Z,{components:{body:{row:ee}},dataSource:null==V?void 0:V.data,rowKey:function(e){return null==e?void 0:e.identifier},pagination:!1,expandable:{expandIcon:function(e){var n=e.expanded,t=e.onExpand,i=e.record;return n?(0,k.jsx)(x.Z,{title:"收起",children:(0,k.jsx)(Q.Z,{className:z,onClick:function(e){return t(i,e)}})}):(0,k.jsx)(x.Z,{title:"展开",children:(0,k.jsx)(J.Z,{className:z,onClick:function(e){return t(i,e)}})})},expandedRowRender:function(e){var n;return(0,k.jsxs)("div",{style:{padding:"10px 0px 10px 48px",borderRadius:2},children:[(0,k.jsxs)("div",{style:{overflow:"auto",maxHeight:300},children:[(0,k.jsxs)("p",{children:["题目:",null==e?void 0:e.name]}),(0,k.jsxs)("p",{children:["描述:",(0,k.jsx)(j.Z,{value:(null==e?void 0:e.description)||""})]}),!(0,H.dE)()&&(0,k.jsxs)("p",{children:["题目解析:",(0,k.jsx)(j.Z,{style:{fontSize:"14px"},value:(null==e?void 0:e.analysis)||"暂无解析"})]})]}),(0,k.jsxs)("div",{style:{width:"100%",textAlign:"end"},children:[(null==ue?void 0:ue.hack_edit_permission)&&(0,k.jsx)(g.ZP,{className:"mt20",type:"primary",ghost:!0,onClick:function(){window.open("/problems/newedit/".concat(null==e?void 0:e.identifier,"?type=1")),localStorage.setItem("program_homework",[y.coursesId,y.categoryId])},children:"编辑"}),(null==ue?void 0:ue.hack_edit_permission)&&(null==V||null===(n=V.homework_status)||void 0===n?void 0:n.includes("未发布"))&&(0,k.jsx)(g.ZP,{className:"mt20",type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){var n;h.Z.confirm({title:"提示",content:"是否确认删除",okText:"确认",cancelText:"取消",onOk:(n=l()(a()().mark((function n(){var t;return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,p.ZP)("/api/problems/".concat(null==e?void 0:e.identifier,".json"),{method:"delete"});case 2:0===(null==(t=n.sent)?void 0:t.status)&&(m.ZP.info("删除成功"),y.page=1,Ae());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},children:"删除"})]})]})},defaultExpandedRowKeys:y.defaultExpandedRowKeys},columns:null===(r=[(0,H.GJ)()&&{key:"sort",align:"center",width:40,render:function(){return(0,k.jsx)($,{})}},{title:"序号",dataIndex:"index",ellipsis:!0,key:"index",width:55,render:function(e,n,t){return"".concat((y.page-1)*y.per_page+t+1)}},{title:"标题",dataIndex:"name",ellipsis:!0,key:"name"},{title:"难度",dataIndex:"difficult",key:"difficult",width:100,ellipsis:!0,render:function(e,n,t){return(0,k.jsx)("div",{children:K[e]})}},{title:"通过率",dataIndex:"pass_rate",key:"pass_rate",width:100,ellipsis:!0},(0,H.dE)()&&{title:"得分",dataIndex:"score",key:"score",render:function(e){var n="",t=Number(e);return n=t>=0&&t<=60?"c-red":t>=90?"c-green":t>60?"c-orange":"",(0,k.jsx)("span",{className:n,children:e})}},(0,H.dE)()&&{title:"耗时",dataIndex:"time",key:"time",ellipsis:!0,width:100},{title:"知识点",dataIndex:"tag_discipline",ellipsis:!0,key:"tag_discipline",width:200,render:function(e,n){return(0,k.jsx)("span",{style:{backgroundColor:"#ECFAF5",color:"#1B8565",overflow:"hidden",textOverflow:"ellipsis",padding:"2px 6px"},children:e||"--"})}},(0,H.dE)()&&{title:"通过状态",dataIndex:"finish_status",key:"finish_status",render:function(e){return(0,k.jsxs)(k.Fragment,{children:[0===e&&(0,k.jsx)("span",{style:{color:"#E30000"},children:"未答题"}),1===e&&(0,k.jsx)("span",{style:{color:"#FA6400"},children:"进行中"}),2===e&&(0,k.jsx)("span",{style:{color:"#009C0F"},children:"已通过"})]})}},{title:"操作",dataIndex:"identifier",key:"identifier",width:146,align:"right",render:function(e,n,t){return(0,k.jsxs)("div",{children:[(0,k.jsx)("a",{onClick:function(){var n;!(0,H.Rm)()||null!==(n=c.AssistantObject.hack)&&void 0!==n&&n.can_question_eaderboard?window.open("/classrooms/".concat(y.coursesId,"/program_homework/").concat(y.categoryId,"/").concat(e,"/ranking")):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"排行"}),(0,k.jsx)("a",{onClick:l()(a()().mark((function e(){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/problems/".concat(null==n?void 0:n.identifier,"/start.json"),{method:"get"});case 2:(t=e.sent)&&(window.open("/myproblems/".concat(null==t?void 0:t.identifier,"?type=1&backUrl=/classrooms/").concat(y.coursesId,"/program_homework/").concat(y.categoryId,"/detail?tabs=1")),localStorage.setItem("program_homework",[y.coursesId,y.categoryId]));case 4:case"end":return e.stop()}}),e)}))),className:"ml20",children:(0,H.GJ)()?"体验":"进入答题"}),(null==ue?void 0:ue.hack_edit_permission)&&(0,k.jsx)("a",{className:"ml20",onClick:l()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:window.open("/problems/newedit/".concat(null==n?void 0:n.identifier,"?type=1")),localStorage.setItem("program_homework",[y.coursesId,y.categoryId]);case 2:case"end":return e.stop()}}),e)}))),children:"编辑"})]})}}])||void 0===r?void 0:r.filter((function(e){return!!e}))})})})]}),(0,k.jsx)("aside",{style:{padding:"0 20px 20px 20px"},children:(0,k.jsx)(T.Z,{defaultCurrent:1,total:null==V?void 0:V.count,hideOnSinglePage:!0,showTotal:function(e){return(0,k.jsxs)("span",{children:["共",e,"条"]})},current:y.page||1,pageSize:y.per_page||10,onChange:function(e,n){y.page=e,y.per_page=n,b(o()({},y)),Ae()}})})]})]}),(0,k.jsx)(S,{})]})})),te=t(78241),ie=t(95237),oe=t(43604),re=t(92832),ae=t(24905),se=t(94398),le=(0,f.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,classroomList:e.classroomList,loading:e.loading.effects}}))((function(e){var n,t=e.shixunHomeworks,i=e.loading,r=e.dispatch,s=e.classroomList,c=(0,f.useParams)(),p=(0,d.useState)(o()(o()({},{page:1,limit:20,group_ids:[]}),c)),h=u()(p,2),v=h[0],x=h[1],w=((0,f.useLocation)(),t.codeReview),y=(0,d.useState)({}),b=u()(y,2),j=(b[0],b[1],te.Z.useForm());u()(j,1)[0];v.order="code_rate",v.sort="desc",v.category=v.categoryId,(0,d.useEffect)((function(){S(),console.log("params",v)}),[v]),(0,d.useEffect)((function(){"执行代码查重"===t.actionTabs.key&&S()}),[t.actionTabs.key]);var S=function(){var e=l()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r({type:"shixunHomeworks/getCodeReview",payload:o()({},v)});case 2:-2===e.sent.status&&setTimeout((function(){return S()}),1500);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=[{title:"序号",dataIndex:"number",render:function(e,n,t){return v.limit*(v.page-1)+t+1}},{title:"姓名",dataIndex:"username"},{title:"学号",dataIndex:"student_id"},{title:"相似度",dataIndex:"code_rate",render:function(e){return(0,k.jsx)("span",{className:"c-orange",children:e})}},{title:"操作",dataInex:"action",render:function(e,n){return(0,k.jsxs)("div",{children:[(0,k.jsx)("a",{onClick:function(){var e;!(0,H.Rm)()||null!==(e=s.AssistantObject.hack)&&void 0!==e&&e.can_view?window.open("/classrooms/".concat(v.coursesId,"/program_homework/").concat(v.categoryId,"/review_detail/").concat(n.user_id)):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"查看"}),(0,k.jsx)("br",{})]})}}];return(0,k.jsxs)("section",{className:"minH500 bg-white pl30 pr30 pt10",children:[-2===(null==w?void 0:w.status)&&(0,k.jsx)(se.Z,{customText:"正在进行代码查重,请稍候。查重结束后,页面将自动更新显示结果"}),-2!==(null==w?void 0:w.status)&&(0,k.jsxs)("div",{children:[(0,k.jsxs)(ie.Z,{children:[(0,k.jsx)(oe.Z,{flex:"1",children:(0,k.jsxs)("p",{className:"mt10",children:["查重时间:",w.last_review_time,(0,k.jsx)(g.ZP,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){r({type:"shixunHomeworks/setActionTabs",payload:{key:"代码查重",params:v}})},children:"代码查重"})]})}),(0,k.jsxs)(oe.Z,{children:[(0,k.jsx)(re.Z.Search,{allowClear:!0,placeholder:"请输入姓名或者学号搜索",onSearch:function(e){v.search=e,r({type:"shixunHomeworks/getCodeReview",payload:v})},style:{width:200}}),(0,k.jsx)("span",{className:"ml5 c-red"})]})]}),(null===(n=w.group_info)||void 0===n?void 0:n.length)>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(ie.Z,{children:[(0,k.jsx)(oe.Z,{flex:"80px",className:"font14",children:"分班情况:"}),(0,k.jsx)(oe.Z,{flex:"80px",children:(0,k.jsx)(ae.Z,{checked:""==v.group_ids,value:"all",onChange:function(e){delete v.group_ids,v.group_ids=[],v.page=1,x(o()({},v))},children:"全部"})}),(0,k.jsx)(oe.Z,{flex:"1",children:w.group_info&&w.group_info.map((function(e,n){return(0,k.jsxs)(ae.Z,{style:{marginLeft:0},value:e.id,checked:v.group_ids.includes(e.id),onChange:function(n){n.target.checked?v.group_ids.push(e.id):v.group_ids.splice(v.group_ids.indexOf(e.id),1),v.page=1,x(o()({},v))},children:[e.name,"(",e.members_count,")"]})}))})]}),(0,k.jsx)(ie.Z,{className:"font14 c-red mt5",children:(0,k.jsx)(oe.Z,{children:"本页仅显示全部已查重分班"})})]}),(0,k.jsxs)("p",{className:"mt10",children:[(0,k.jsx)("span",{className:"c-red",children:w.copy_reviews_count}),"个疑似抄袭作品(",w.all_reviews_count,"作品)"]}),(0,k.jsx)(_.Z,{className:"mt30",loading:i["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:w.users_reviews,columns:N,onChange:function(e,n,t){"ascend"===t.order&&(v.b_order="asc"),"descend"===t.order&&(v.b_order="desc"),t.order||delete v.b_order,r({type:"shixunHomeworks/getCodeReview",payload:o()({},v)})}}),(0,k.jsx)("aside",{className:"tc mb50 mt30",children:(0,k.jsx)(T.Z,{showSizeChanger:!1,onChange:function(e,n){v.page=e,v.limit=20,r({type:"shixunHomeworks/getCodeReview",payload:o()({},v)})},defaultCurrent:v.page||1,current:v.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:w.copy_reviews_count})})]})]})})),ce=t(50255),ue=t(37205),de=t.n(ue),pe=t(57930),fe=t(57809),me=t(5112),he=t(94001),ge=t(71371),ve=t(45532),xe=t(39248),we=t(89392),_e="form___dWO2F",ye="title___tyrHF",be="content____AOnH",je="pubColSty___jjxFz",ke="selectSty___RPIyk",Se="borderSty___NbRdH",Ne="delSty___Yap2B",Me="delBorder___iWzM8",Le="copHover___DYJF8",Ce=t(69910),Te=t(73244),Ze=t(99204),Ae=pe.default.RangePicker,Pe=fe.default.Option,Ie=(0,f.connect)((function(e){var n=e.shixunHomeworks,t=e.classroomList,i=e.user;return{shixunHomeworks:n,loading:e.loading.effects,user:i,classroomList:t}}))((function(e){var n,t,i,r,s,c,v,w,_,y,j,S,N,L=e.shixunHomeworks,C=e.user,T=(e.loading,e.classroomList),Z=e.dispatch,A=(0,f.useParams)(),P=L.workSetting,I=L.workList,E=L.changeData,O=(0,d.useState)(!0),B=u()(O,2),D=B[0],z=B[1],R=(0,d.useState)(!1),G=u()(R,2),W=G[0],F=G[1],Y=(0,d.useState)([]),U=u()(Y,2),V=U[0],q=U[1],Q=(0,d.useState)([]),J=u()(Q,2),K=J[0],X=J[1],$=(0,d.useRef)(!0),ee=(0,d.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:Ce.Q.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,send_type:void 0,difficult_count:[],difficult_settings:[],late_penalty:0,show_late_code:!0}),ne=u()(ee,2),te=ne[0],re=ne[1];(0,d.useEffect)((function(){return se(),function(){q([].concat())}}),[]);var se=function(){Z({type:"shixunHomeworks/getWorkSetting",payload:o()({},A)})};(0,d.useEffect)((function(){var e,n;((0,H.G5)()||(0,H.Rm)()&&(null!==(e=T.AssistantObject.hack)&&void 0!==e&&e.can_late||null!==(n=T.AssistantObject.hack)&&void 0!==n&&n.can_publish))&&z(!1)}),[C,T]),(0,d.useEffect)((function(){var e;null!=P&&P.course_id&&$.current&&($.current=!1,Object.keys(te).map((function(e){te[e]=P[e]})),te.allow_late&&te.unified_late||(te.late_minus_score=20,te.penalty_type=Ce.Q.Percent),te.unified_setting||(te.unified_late=!1,te.unified_anonymous_comment=!1,te.unified_anonymous_appeal=!1),V=JSON.parse(JSON.stringify(P.group_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.publish_time})))),K=JSON.parse(JSON.stringify(P.allow_late_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.late_time})))),0===te.difficult_settings.length&&(te.difficult_settings=[0,0,0]),re(o()({},te)),q(V.length?de()(V):[{}]),(null===(e=K)||void 0===e?void 0:e.length)<=0?X([{late_minus_score:20}]):X(de()(K)))}),[P]);var le=function(e){var n;if(null!==e.total_score)if(null!=e&&e.work_efficiency&&null===e.eff_score)m.ZP.warning("效率分不能为空");else{var t={shixun_evaluation:e.shixun_evaluation,challenge_settings:e.challenge_settings},i=function(){var n=l()(a()().mark((function n(){return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return F(!0),n.next=3,(0,p.ZP)("/api/homework_commons/".concat(A.categoryId,"/publish_setting.json"),{method:"post",body:o()({},e)});case 3:0===n.sent.status&&(m.ZP.success("更新成功"),se(),Z({type:"shixunHomeworks/getWorkList",payload:o()({},A)})),F(!1);case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();(0,we.isEqual)(E,t)||null!=I&&null!==(n=I.homework_status)&&void 0!==n&&n.includes("未发布")?i():h.Z.confirm({title:"更新成绩",content:"您改动了本次作业的关卡得分设置,这可能导致已完成作业的学生的成绩产生错误。点击“确定”按钮将保存最新设置并按最新设置更新全班成绩。",okText:"确认",cancelText:"取消",onOk:i})}else m.ZP.warning("总分值不能为空")},ce=function(e,n){var t,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"group_id";return n?n.find((function(n){return n[i]===e})):null==P||null===(t=P.group_settings)||void 0===t?void 0:t.find((function(n){return n.group_id[0]===e}))},ue=((null==P?void 0:P.allow_late)||(null==P||P.anonymous_comment),null==P?void 0:P.anonymous_comment),je=function(e){if(!e)return!1;var n=ce(e,null==P?void 0:P.anonymous_comment_settings);return(null==P?void 0:P.anonymous_comment)&&n&&null!==(null==n?void 0:n.evaluation_start)};return(0,k.jsxs)("section",{className:_e,children:[(0,k.jsxs)("div",{className:ye,children:["试题发布",(0,k.jsx)("span",{className:"c-grey-999 font14 ml5",style:{fontWeight:400},children:"作业一旦发布后不可变更试题发布模式"})]}),(0,k.jsx)("div",{className:be,children:(0,k.jsxs)(me.ZP.Group,{disabled:D||!(null!=I&&null!==(n=I.homework_status)&&void 0!==n&&n.includes("未发布"))||!(null!==(t=T.AssistantObject.hack)&&void 0!==t&&t.can_publish)&&(0,H.Rm)(),value:te.send_type,onChange:function(e){te.send_type=e.target.value,re(Object.assign({},te))},children:[(0,k.jsx)(me.ZP,{value:0,children:"固定试题模式"}),(0,k.jsx)(me.ZP,{style:{marginLeft:40},value:1,children:"随机抽题模式"})]})}),1===te.send_type&&(0,k.jsx)("div",{className:be,style:{borderTop:"1px solid #fff"},children:(0,k.jsxs)(ie.Z,{style:{marginLeft:"165px"},children:[(0,k.jsxs)(oe.Z,{style:{color:"#666666"},children:["简单题数",(0,k.jsx)(he.Z,{size:"large",precision:0,disabled:D||!(null!=I&&null!==(i=I.homework_status)&&void 0!==i&&i.includes("未发布")),placeholder:"最大".concat(te.difficult_count[0]||0),min:0,max:te.difficult_count[0]||0,value:te.difficult_settings[0],onChange:function(e){te.difficult_settings[0]=e,re(Object.assign({},te))},className:"ml10 mr20"})]}),(0,k.jsxs)(oe.Z,{style:{color:"#666666"},children:["适中题数",(0,k.jsx)(he.Z,{size:"large",precision:0,disabled:D||!(null!=I&&null!==(r=I.homework_status)&&void 0!==r&&r.includes("未发布")),placeholder:"最大".concat(te.difficult_count[1]||0),min:0,max:te.difficult_count[1]||0,value:te.difficult_settings[1],onChange:function(e){te.difficult_settings[1]=e,re(Object.assign({},te))},className:"ml10 mr20"})]}),(0,k.jsxs)(oe.Z,{style:{color:"#666666"},children:["困难题数",(0,k.jsx)(he.Z,{size:"large",precision:0,disabled:D||!(null!=I&&null!==(s=I.homework_status)&&void 0!==s&&s.includes("未发布")),placeholder:"最大".concat(te.difficult_count[2]||0),min:0,max:te.difficult_count[2]||0,value:te.difficult_settings[2],onChange:function(e){te.difficult_settings[2]=e,re(Object.assign({},te))},className:"ml10 mr20"})]})]})}),(0,k.jsx)("div",{className:"".concat(ye," mt30"),children:"作业发布"}),(0,k.jsxs)("div",{className:be,children:[(0,k.jsxs)(me.ZP.Group,{disabled:D||!(null!=I&&null!==(c=I.homework_status)&&void 0!==c&&c.includes("未发布"))||!(null!==(v=T.AssistantObject.hack)&&void 0!==v&&v.can_publish)&&(0,H.Rm)(),value:te.unified_setting,onChange:function(e){var n;null!=I&&null!==(n=I.homework_status)&&void 0!==n&&n.includes("未发布")?(te.unified_setting=!te.unified_setting,te.unified_setting||(te.unified_late=!1),re(Object.assign({},te)),!1!==te.unified_setting||""!=V?te.unified_setting&&(q([]),X([{late_minus_score:5}])):q(V.concat({}))):m.ZP.error("已发布,不能再修改统一设置")},children:[(0,k.jsx)(me.ZP,{value:!0,disabled:!(null!=P&&P.manage_all_group),children:"统一发布"}),(0,k.jsx)(me.ZP,{style:{marginLeft:70},disabled:0===(null==P||null===(w=P.group_settings)||void 0===w?void 0:w.length),value:!1,children:"分班发布"})]}),0===(null==P||null===(_=P.group_settings)||void 0===_?void 0:_.length)&&(0,k.jsx)("p",{style:{marginLeft:"14px",color:"rgba(0, 0, 0, 0.25)"},children:"(本课堂无分班,仅支持选择“统一发布“)"})]}),(0,k.jsxs)("div",{className:be,style:{borderTop:"1px solid #fff"},children:[te.unified_setting&&(0,k.jsxs)(ie.Z,{align:"middle",className:"ml25",children:[(0,k.jsxs)(ie.Z,{align:"middle",children:[(0,k.jsx)(oe.Z,{className:"c-grey-666",children:"发布时间"}),(0,k.jsx)(oe.Z,{className:"ml10",children:(0,k.jsx)(pe.default,{style:{width:170},placeholder:"请选择发布时间",showTime:{format:"HH:mm"},allowClear:!1,size:"large",format:"YYYY-MM-DD HH:mm",disabledDate:function(e){return(0,Te.Q8)(e,null==P?void 0:P.course_end_date)},disabledTime:function(e){return(0,Te.d0)(e)},disabled:D||M()()>=M()(null==P?void 0:P.publish_time)||!(null!==(y=T.AssistantObject.hack)&&void 0!==y&&y.can_publish)&&(0,H.Rm)(),value:te.publish_time?M()(te.publish_time):"",onChange:function(e,n){te.publish_time=n,""!=te.end_time&&te.end_time||!te.unified_setting||(te.end_time=M()(e).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),re(Object.assign({},te))}})})]}),(0,k.jsxs)(ie.Z,{align:"middle",style:{marginLeft:40},children:[(0,k.jsx)(oe.Z,{className:"c-grey-666",children:"截止时间"}),(0,k.jsx)(oe.Z,{className:"ml10",children:(0,k.jsx)(pe.default,{style:{width:170},allowClear:!1,size:"large",placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:M()((0,b.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:(null==P?void 0:P.allow_late)&&(null==P?void 0:P.homework_status.includes("已截止"))||D||(null==P?void 0:P.allow_late)&&M()()>=M()(null==P?void 0:P.end_time)||!(null!==(j=T.AssistantObject.hack)&&void 0!==j&&j.can_publish)&&(0,H.Rm)(),disabledDate:function(e){return(0,Te.Q8)(e,null==P?void 0:P.course_end_date,te.publish_time)},disabledTime:function(e){return(0,Te.d0)(e,te.publish_time)},value:te.end_time?M()(te.end_time):"",onChange:function(e,n){te.end_time=n,re(Object.assign({},te))}})})]})]}),!te.unified_setting&&(null===(S=V)||void 0===S?void 0:S.length)>0&&(0,k.jsxs)(ie.Z,{className:"ml25",children:[(0,k.jsx)(oe.Z,{span:24,children:(0,k.jsxs)(ie.Z,{children:[(0,k.jsx)(oe.Z,{span:10}),(0,k.jsx)(oe.Z,{span:10,children:(0,k.jsxs)(ie.Z,{className:"c-grey-c ml30",children:[(0,k.jsx)(oe.Z,{flex:"1",children:"(学生收到作业时间)"}),(0,k.jsx)(oe.Z,{flex:"1",children:"(学生“按时”提交作品时间截点)"})]})}),(0,k.jsx)(oe.Z,{span:4})]})}),V&&V.map((function(e,n){var t,i,r,a,s,l,c,u,d;return(0,k.jsx)(oe.Z,{className:0!==n&&"mt20",span:24,children:(0,k.jsxs)(ie.Z,{gutter:[8,16],children:[(0,k.jsx)(oe.Z,{span:10,children:(0,k.jsxs)(ie.Z,{gutter:[8,16],align:"middle",children:[(0,k.jsxs)(oe.Z,{style:{minWidth:80},className:"c-grey-333",children:["发布规则 ",n+1]}),(0,k.jsx)(oe.Z,{flex:"1",style:{maxWidth:300},children:(0,k.jsx)(fe.default,{size:"large",disabled:D||!(null!=P&&null!==(t=P.homework_status)&&void 0!==t&&t.includes("未发布")&&e.id||M()()<M()(null==e?void 0:e.publish_time))&&!(null==e||!e.publish_time),mode:"multiple",className:"ml20 ".concat(ke),style:{width:"100%"},value:e.group_name,placeholder:"请选择分班名称",onChange:function(t){var i;if(null!==(i=T.AssistantObject.hack)&&void 0!==i&&i.can_publish||!(0,H.Rm)()){V[n].group_name=t,V[n].group_id=e.group_id;var r=(0,we.flattenDeep)(V.map((function(e){return e.group_name}))),a=K.map((function(e){var n=(null==e?void 0:e.group_name)||[];return o()(o()({},e),{},{group_name:(0,we.remove)(n,(function(e){return r.includes(e)}))})}));X(a),q(V.slice())}else m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:P.group_settings&&P.group_settings.map((function(e){if(!V.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name)))return(0,k.jsx)(Pe,{value:e.group_name,children:e.group_name},e.id)}))})})]})}),(0,k.jsx)(oe.Z,{span:10,children:(0,k.jsx)("div",{className:"ml30",children:(0,k.jsx)(Ae,{size:"large",allowClear:!1,ranges:{"此刻":[e.publish_time?M()(e.publish_time):M()(),M()()]},disabled:D||!(M()()<=M()(null===(i=ce(e.id))||void 0===i?void 0:i.publish_time))&&[!0,(a=e.id,c=ce(a,null==P?void 0:P.allow_late_settings,"id"),u=ce(a,null==P?void 0:P.anonymous_comment_settings),d=ce(a),(null==P?void 0:P.allow_late)&&c&&M()(null==c?void 0:c.late_time)<=M()()||(null==P?void 0:P.anonymous_comment)&&u&&null!==(null==u?void 0:u.evaluation_start)||null!=(null===(s=(M()(null==d?void 0:d.end_time)<=M()()&&(null==P||null===(l=P.allow_late_settings)||void 0===l?void 0:l.filter((function(e){return e.group_id.includes(a)}))))[0])||void 0===s?void 0:s.late_time))],style:{width:400},placeholder:["请选择发布时间","请选择截止时间"],disabledDate:function(e){return(0,Te.Q8)(e,null==P?void 0:P.course_end_date)},disabledTime:function(e){return(0,Te.d0)(e)},showTime:{format:"HH:mm",defaultValue:[M()((0,b.U6)(),"HH:mm"),M()((0,b.U6)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:e.publish_time&&[M()(e.publish_time),e.end_time?M()(e.end_time):void 0],onChange:function(e,t){var i;null!==(i=T.AssistantObject.hack)&&void 0!==i&&i.can_publish||!(0,H.Rm)()?(V[n].publish_time=t[0],V[n].end_time=t[1],q(de()(V))):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})})}),!D&&(0,k.jsxs)(oe.Z,{className:"ml20",span:2,style:{display:"flex",alignItems:"center"},children:[((null==e?void 0:e.publish_time)&&M()()<M()(null==e?void 0:e.publish_time)||!(null!=e&&e.publish_time))&&0!=n&&(0,k.jsx)(ge.Z,{className:"mr10",onClick:function(){var e;if(null!==(e=T.AssistantObject.hack)&&void 0!==e&&e.can_publish||!(0,H.Rm)()){var t=(0,we.cloneDeep)(K);t.forEach((function(e,t){e.group_name&&(e.group_name=e.group_name.filter((function(e){var t;return!(null!==(t=V[n].group_name)&&void 0!==t&&t.includes(e))})))})),X(t),V=V.filter((function(e,t){return n!==t})),q(V.slice()),setTimeout((function(){return q(V.slice())}),10)}else m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}}),V.length<(null==P||null===(r=P.group_settings)||void 0===r?void 0:r.length)&&(0,k.jsx)(ve.Z,{className:"c-green",onClick:function(){q(V.concat({}))}})]})]})},n)}))]})]}),(0,k.jsx)("div",{className:"".concat(ye," mt30"),children:"学生实验报告代码展示设置"}),(0,k.jsx)("div",{className:be,children:(0,k.jsxs)(ae.Z,{disabled:D,checked:te.show_late_code,onChange:function(){te.show_late_code=!te.show_late_code,re(Object.assign({},te))},children:[(0,k.jsx)("span",{className:"c-black",children:"展示作业截止后最新通关代码"}),(0,k.jsx)("span",{className:"c-grey-666 ml10",children:"(选中后将展示学生截止前未通过,截止后学生通过的代码,否则只展示学生截止前的代码)"})]})}),(0,k.jsx)("div",{className:"".concat(ye," mt30"),children:"补交设置"}),(0,k.jsx)("div",{className:be,children:(0,k.jsxs)(ie.Z,{children:[(0,k.jsx)(ae.Z,{checked:te.allow_late,disabled:D||(null==P?void 0:P.allow_late),onChange:function(e){var n;null!==(n=T.AssistantObject.hack)&&void 0!==n&&n.can_late||!(0,H.Rm)()?(e.target.checked&&h.Z.warning({title:"开启补交提示",width:480,centered:!0,content:(0,k.jsxs)("div",{style:{padding:10,background:"#f5f6f9"},children:[(0,k.jsx)("div",{children:"1.开启补交后不可关闭,补交方式提交保存后不可修改;"}),(0,k.jsx)("div",{children:"2.补交截止时间必须晚于作业截止时间;"}),(0,k.jsx)("div",{children:"3.班级阶段进入“补交中”则不可变更作业截止时间。"})]})}),te.allow_late=!te.allow_late,""==K&&X([{late_minus_score:5}]),re(Object.assign({},te))):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:(0,k.jsx)("span",{style:{fontSize:"14px"},children:"开启补交"})}),(0,k.jsx)(x.Z,{overlayStyle:{width:380,maxWidth:380},title:(0,k.jsxs)("div",{style:{display:"flex",flexFlow:"column"},children:[(0,k.jsx)("span",{children:"补交规则说明"}),(0,k.jsx)("span",{children:"开启补交,学生只在补交时间内才通关则扣除分值,未通关不扣分;"}),(0,k.jsx)("span",{children:"学生在正常作业规定时间内通关,在补交阶段再次通关不扣分。"})]}),children:(0,k.jsx)(xe.Z,{className:"c-grey-666"})})]})}),(null==te?void 0:te.allow_late)&&(0,k.jsxs)("div",{className:be,style:{borderTop:"1px solid #fff",paddingLeft:54},children:[(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{children:"补交方式:"}),(0,k.jsxs)(me.ZP.Group,{disabled:D||(null==P?void 0:P.anonymous_comment)||(null==P?void 0:P.allow_late),value:te.unified_late,onChange:function(e){var n;!(0,H.Rm)()||null!==(n=T.AssistantObject.hack)&&void 0!==n&&n.can_late?(te.unified_late=e.target.value,""!=K||e.target.value||X([{late_minus_score:5}]),re(o()({},te))):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:[(null==te?void 0:te.unified_setting)&&(0,k.jsx)(me.ZP,{value:!0,disabled:!(null!=P&&P.manage_all_group),children:" 统一补交 "}),(null==P||null===(N=P.group_settings)||void 0===N?void 0:N.length)&&(0,k.jsx)(me.ZP,{value:!1,children:" 分班补交 "})]})]}),null!=te&&te.unified_late?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(ie.Z,{align:"middle",className:"mt25",children:[(0,k.jsx)(oe.Z,{children:"补交扣分:"}),(0,k.jsx)(oe.Z,{className:"ml5",children:(0,k.jsx)(Ce.Z,{disabled:D||ue,value:{type:te.penalty_type,inputValue:te.late_minus_score},onChange:function(e){var n;!(0,H.Rm)()||null!==(n=T.AssistantObject.hack)&&void 0!==n&&n.can_late?re(o()(o()({},te),{},{late_minus_score:e.inputValue,penalty_type:e.type})):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})}),(0,k.jsx)(oe.Z,{flex:"1",className:"ml5",children:(0,k.jsx)("span",{className:"c-grey-c ml10",children:te.penalty_type===Ce.Q.Number?"(补交时按照学生总成绩扣分)":"(学生成绩将扣除补交关卡分值的百分比)"})})]}),(0,k.jsxs)(ie.Z,{align:"middle",className:"mt25",children:[(0,k.jsx)(oe.Z,{children:"补交截止时间:"}),(0,k.jsx)(oe.Z,{className:"ml5",children:(0,k.jsx)(pe.default,{size:"large",allowClear:!1,style:{width:170},placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:M()((0,b.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:D||ue,value:te.late_time?M()(te.late_time):"",disabledDate:function(e){return(0,Te.Q8)(e,null==P?void 0:P.course_end_date)},disabledTime:function(e){return(0,Te.d0)(e)},onChange:function(e,n){var t;!(0,H.Rm)()||null!==(t=T.AssistantObject.hack)&&void 0!==t&&t.can_late?(te.late_time=n,re(Object.assign({},te))):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})}),(0,k.jsx)(oe.Z,{children:(0,k.jsx)("span",{className:"c-grey-c ml10",children:"(学生“延时”提交作品的时间截点)"})})]})]}):K.map((function(e,n){var t;return(0,k.jsx)(oe.Z,{span:24,children:(0,k.jsxs)(ie.Z,{className:"mt25",align:"middle",children:[(0,k.jsxs)(oe.Z,{children:[(0,k.jsxs)("span",{style:{minWidth:80,display:"inline-block"},children:["补交规则",n+1,":"]}),(0,k.jsx)(fe.default,{disabled:D||!(null!=I&&null!==(t=I.homework_status)&&void 0!==t&&t.includes("未发布"))&&e.id||(null==P?void 0:P.anonymous_comment),mode:"multiple",style:{width:200},value:"string"==typeof e.group_name?[e.group_name]:e.group_name,placeholder:"请选择分班名称",onChange:function(t){var i;!(0,H.Rm)()||null!==(i=T.AssistantObject.hack)&&void 0!==i&&i.can_late?(K[n].group_name=t,K[n].group_id=e.group_id,X(K.slice())):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:P.group_settings&&P.group_settings.map((function(e){return null!=te&&te.unified_setting&&!K.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))||V.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))&&!K.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))?(0,k.jsx)(Pe,{value:e.group_name,children:e.group_name},e.id):void 0}))})]}),(0,k.jsxs)(oe.Z,{className:"ml20",style:{display:"flex",alignItems:"center"},children:[(0,k.jsx)("div",{children:"补交扣分:"}),(0,k.jsx)(Ce.Z,{disabled:D||je(e.id),value:{type:e.penalty_type,inputValue:e.late_minus_score},onChange:function(e){var t;!(0,H.Rm)()||null!==(t=T.AssistantObject.hack)&&void 0!==t&&t.can_late?(K[n].late_minus_score=e.inputValue,K[n].penalty_type=e.type,X(de()(K))):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}),(0,k.jsxs)(oe.Z,{className:"ml20",children:[(0,k.jsx)("span",{children:"补交截止时间:"}),(0,k.jsx)(pe.default,{disabled:D||je(e.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:M()((0,b.U6)(),"HH:mm")},placeholder:"请选择截止时间",disabledDate:function(e){return(0,Te.Q8)(e,null==P?void 0:P.course_end_date)},disabledTime:function(e){return(0,Te.d0)(e)},format:"YYYY-MM-DD HH:mm",value:null!=e&&e.late_time?M()(e.late_time):void 0,onChange:function(e,t){var i;!(0,H.Rm)()||null!==(i=T.AssistantObject.hack)&&void 0!==i&&i.can_late?(K[n].late_time=t,X(de()(K))):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}),!D&&(0,k.jsxs)(oe.Z,{className:"ml20",children:[n>0&&!e.id&&(0,k.jsx)(ge.Z,{className:"mr10",onClick:function(){K=K.filter((function(e,t){return n!==t})),X(K.slice()),setTimeout((function(){return X(K.slice())}),10)}}),(0,k.jsx)(ve.Z,{className:"c-green",onClick:function(){var e;!(0,H.Rm)()||null!==(e=T.AssistantObject.hack)&&void 0!==e&&e.can_late?X(K.concat({penalty_type:Ce.Q.Percent,late_minus_score:20})):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]})]})},n)}))]}),!D&&(0,k.jsx)(g.ZP,{type:"primary",size:"large",style:{width:138},className:"mt30",loading:W,onClick:function(){return function(){var e,n;if(2!==(null==C||null===(e=C.userInfo)||void 0===e?void 0:e.user_status)){var t=JSON.parse(JSON.stringify(te));if(t.categoryId=A.categoryId,te.unified_setting||(V=null===(n=V)||void 0===n?void 0:n.map((function(e){var n;if(!e.publish_time||!e.end_time)throw m.ZP.error("请把发布时间填写完整"),new String("请把发布时间填写完整");if(!e.group_name)throw m.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null===(n=P.group_settings)||void 0===n?void 0:n.filter((function(n){var t;return null==e||null===(t=e.group_name)||void 0===t?void 0:t.includes(n.group_name)})).map((function(e){return e.group_id||e.id})).toString().split(","),e}))),t.group_settings=V,te.allow_late)if(te.unified_late){if(null===te.late_minus_score||void 0===te.late_minus_score||te.late_minus_score<0||te.late_minus_score>100)throw m.ZP.error("迟交扣分填写区间为0~100"),new String("迟交扣分填写区间为0~100");if(!te.late_time)throw m.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整")}else{var i;K=null===(i=K)||void 0===i?void 0:i.map((function(e){var n;if(null===e.late_minus_score||void 0===e.late_minus_score||e.late_minus_score<0||e.late_minus_score>100)throw m.ZP.error("迟交扣分填写区间为0~100"),new String("迟交扣分填写区间为0~100");if(!e.late_time)throw m.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整");if(!e.group_name)throw m.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null==e||null===(n=e.group_name)||void 0===n||null===(n=n.map((function(e){var n,t=null===(n=P.group_settings)||void 0===n||null===(n=n.filter((function(n){return(null==n?void 0:n.group_name)===e})))||void 0===n?void 0:n[0];return null==t?void 0:t.group_id})))||void 0===n?void 0:n.toString().split(","),e})),t.allow_late_settings=K}1===t.send_type&&(t.difficult_settings=t.difficult_settings.map((function(e){return e||0}))),le(t)}else(0,Ze.Rd)()}()},children:"保存"})]})})),Ee=t(52103);function Oe(e,n){for(var t=[],i=e;i<n;i++)t.push(i);return t}var Be=function(e){var n=new Date,t=M()(e).format("HH");if(M()(e).isSame(M()(n),"day")){var i=M()(n).format("HH"),o=M()(n).format("mm");return{disabledHours:function(){return Oe(0,24).splice(1,1*i-1)},disabledMinutes:function(){return console.log("禁止时间:",t,i),M()(e).isSame(M()(n),"hour")&&t<=i?Oe(0,60).splice(0,o):Oe(60,60)}}}if(M()(e).isSame(M()(),"day")){var r=M()().format("HH"),a=M()().format("mm");return{disabledHours:function(){return Oe(0,24).splice(0,r)},disabledMinutes:function(){return t<=r?Oe(0,a):Oe(60,60)}}}},De=pe.default.RangePicker,ze=fe.default.Option,He=(0,f.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading.effects}}))((function(e){var n,t,i=e.shixunHomeworks,r=(e.loading,e.dispatch),s=(0,f.useParams)(),c=((0,f.useLocation)(),i.workSetting),h=i.workList,v=(i.changeData,(0,d.useState)(!0)),x=u()(v,2),w=x[0],_=x[1],y=(0,d.useState)({}),j=u()(y,2),S=(j[0],j[1],(0,d.useState)(!1)),N=u()(S,2),L=N[0],C=N[1],T=te.Z.useForm(),Z=(u()(T,1)[0],(0,d.useState)([])),A=u()(Z,2),P=A[0],I=A[1],E=(0,d.useState)([]),O=u()(E,2),B=O[0],D=O[1],z=(0,d.useState)([]),H=u()(z,2),R=(H[0],H[1],(0,d.useRef)(!0)),G=(0,d.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,open_code:!1,rank_forbidden:!1,hack_analysis:!1,hack_answer:!1,open_code_type:void 0,hack_analysis_type:0,hack_answer_type:0,comment_public:!0,total_score:"",eff_score:0,rank_forbidden_start:"",rank_forbidden_end:""}),W=u()(G,2),F=W[0],Y=W[1];(0,d.useEffect)((function(){return function(){I([].concat())}}),[]),(0,d.useEffect)((function(){null!=c&&c.can_edit&&_(!1)}),[c]);var U=function(e){return e&&e<M()().startOf("day")};(0,d.useEffect)((function(){var e;null!=c&&c.course_id&&R.current&&(R.current=!1,Object.keys(F).map((function(e){void 0!==c[e]&&(F[e]=c[e])})),F.allow_late&&F.unified_late||(F.late_penalty=5),P=JSON.parse(JSON.stringify(c.group_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.publish_time})))),B=JSON.parse(JSON.stringify(c.allow_late_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.rank_forbidden_start})))),Y(o()({},F)),console.log(F,c,"data"),I(de()(P)),(null===(e=B)||void 0===e?void 0:e.length)<=0?D([{}]):D(de()(B)))}),[c]);var V=function(e){if(console.log(e.total_score,e.eff_score),null!==e.total_score)if(null!=e&&e.work_efficiency&&null===e.eff_score)m.ZP.warning("效率分不能为空");else{e.shixun_evaluation;var n=function(){var n=l()(a()().mark((function n(){return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return C(!0),n.next=3,(0,p.ZP)("/api/homework_commons/".concat(s.categoryId,"/public_setting.json"),{method:"post",body:o()({},e)});case 3:0===n.sent.status&&(m.ZP.success("更新成功"),r({type:"shixunHomeworks/getWorkSetting",payload:o()({},s)}),r({type:"shixunHomeworks/getWorkList",payload:o()({},s)})),C(!1);case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();n()}else m.ZP.warning("总分值不能为空")};return(0,k.jsxs)("section",{className:_e,children:[(0,k.jsx)("div",{className:be,style:{padding:0},children:(0,k.jsxs)(ie.Z,{children:[(0,k.jsxs)(oe.Z,{span:24,className:je,children:[(0,k.jsx)(ae.Z,{checked:F.score_open,disabled:w,onChange:function(e){F.score_open=e.target.checked,Y(Object.assign({},F))},children:(0,k.jsx)("span",{className:"font14",children:"公开成绩"})}),(0,k.jsx)("span",{className:"c-grey-666 font14",children:"(选中,则在作业截止/补交结束时间之后,已提交作品的学生可以查看其它学生的成绩,否则只能查看自己的成绩)"})]}),(0,k.jsxs)(oe.Z,{span:24,className:je,style:{borderBottom:F.open_code?"none":"1px solid #fff"},children:[(0,k.jsx)(ae.Z,{checked:F.open_code,disabled:w,onChange:function(e){F.open_code=e.target.checked,Y(Object.assign({},F))},children:(0,k.jsx)("span",{className:"font14",children:"公开代码"})}),(0,k.jsx)("span",{className:"c-grey-666 font14",children:"(选中,学生可以查看其他学生的代码详情)"})]}),!!F.open_code&&(0,k.jsx)(oe.Z,{span:24,className:je,children:(0,k.jsxs)(me.ZP.Group,{style:{marginLeft:"24px"},disabled:w,value:F.open_code_type,onChange:function(e){F.open_code_type=e.target.value,Y(Object.assign({},F))},children:[(0,k.jsx)(me.ZP,{value:0,children:"任意时间查看"}),(0,k.jsx)(me.ZP,{style:{marginLeft:60},value:1,children:"练习时间结束后"})]})}),(0,k.jsxs)(oe.Z,{span:24,className:je,style:{borderBottom:F.rank_forbidden&&F.unified_setting||!F.unified_setting&&(null===(n=P)||void 0===n?void 0:n.length)>0&&F.rank_forbidden?"none":"1px solid #fff"},children:[(0,k.jsx)(ae.Z,{checked:F.rank_forbidden,disabled:w,onChange:function(e){F.rank_forbidden=e.target.checked,Y(Object.assign({},F))},children:(0,k.jsx)("span",{className:"font14",children:"开启封榜"})}),(0,k.jsx)("span",{className:"c-grey-666 font14",children:"(选中则在设置的这段时间内,学生看不到排行榜信息,其他时间可以查看)"})]}),!!F.rank_forbidden&&F.unified_setting&&(0,k.jsx)(oe.Z,{span:24,className:je,style:{height:"50px",lineHeight:"50px"},children:(0,k.jsx)("div",{style:{marginLeft:"24px"},children:(0,k.jsxs)(ie.Z,{align:"middle",children:[(0,k.jsx)(oe.Z,{children:"开始时间"}),(0,k.jsx)(oe.Z,{className:"ml10",children:(0,k.jsx)(pe.default,{size:"large",style:{width:370},placeholder:"请选择开始时间(学生看不到排行榜的开始时间)",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:U,disabledTime:Be,disabled:w||M()()>M()(c.rank_forbidden_start),value:F.rank_forbidden_start?M()(F.rank_forbidden_start):"",onChange:function(e,n){F.rank_forbidden_start=n,""!=F.end_time&&F.end_time||!F.unified_setting||(F.end_time=M()(e).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Y(Object.assign({},F))}})}),(0,k.jsx)(oe.Z,{className:"ml20",children:"截止时间"}),(0,k.jsx)(oe.Z,{className:"ml10",children:(0,k.jsx)(pe.default,{size:"large",style:{width:370},allowClear:!1,placeholder:"请选择截止时间(学生看不到排行榜的结束时间)",showTime:{format:"HH:mm",defaultValue:M()((0,b.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:w,disabledDate:U,value:F.rank_forbidden_end?M()(F.rank_forbidden_end):"",onChange:function(e,n){F.rank_forbidden_end=n,Y(Object.assign({},F))}})})]})})}),!F.unified_setting&&(null===(t=P)||void 0===t?void 0:t.length)>0&&!!F.rank_forbidden&&(0,k.jsx)(ie.Z,{align:"middle",style:{borderBottom:"1px solid #fff",paddingBottom:"5px",width:"100%"},children:B.map((function(e,n){var t,i,o;return(0,k.jsx)(oe.Z,{span:24,style:{marginLeft:"24px"},children:(0,k.jsxs)(ie.Z,{className:"mt10 ml30",align:"middle",children:[(0,k.jsxs)(oe.Z,{children:[(0,k.jsxs)("span",{style:{color:"#666"},children:["封榜规则",n+1,":"]}),(0,k.jsx)(fe.default,{size:"large",disabled:w||!(null!=h&&null!==(t=h.homework_status)&&void 0!==t&&t.includes("未发布"))&&e.id,mode:"multiple",className:ke,style:{width:250},value:"string"==typeof e.group_name?[e.group_name]:e.group_name,placeholder:"请选择分班名称",onChange:function(t){B[n].group_name=t,B[n].group_id=e.group_id,D(B.slice())},children:c.group_settings&&c.group_settings.map((function(e){return null!=F&&F.unified_setting&&!B.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))||P.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))&&!B.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))?(0,k.jsx)(ze,{value:e.group_name,children:e.group_name},e.id):void 0}))})]}),(0,k.jsx)(oe.Z,{span:15,children:(0,k.jsx)("div",{className:"ml20",children:(0,k.jsx)(De,{size:"large",allowClear:!1,disabled:w||!(null==c||null===(i=c.group_settings)||void 0===i||null===(i=i.filter((function(n){return n.id===e.id})))||void 0===i||null===(i=i[0])||void 0===i||!i.rank_forbidden_start)&&(!(M()()<M()(null==c||null===(o=c.group_settings)||void 0===o||null===(o=o.filter((function(n){return n.id===e.id})))||void 0===o||null===(o=o[0])||void 0===o?void 0:o.rank_forbidden_start))&&[!0,!1]),style:{width:635},placeholder:["开始时间(学生看不到排行榜的开始时间)","结束时间(学生看不到排行榜的结束时间)"],disabledDate:U,disabledTime:Be,showTime:{format:"HH:mm",defaultValue:[M()((0,b.U6)(),"HH:mm"),M()((0,b.U6)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:e.rank_forbidden_start&&[M()(e.rank_forbidden_start),e.rank_forbidden_end?M()(e.rank_forbidden_end):void 0],onChange:function(e,t){B[n].rank_forbidden_start=t[0],B[n].rank_forbidden_end=t[1],D(de()(B))}})})}),!w&&(0,k.jsxs)(oe.Z,{children:[(0,k.jsx)(ve.Z,{className:"c-green",onClick:function(){D(B.concat({}))}}),n>0&&!e.id&&(0,k.jsx)(Ee.Z,{className:"c-red ml10",onClick:function(){B=B.filter((function(e,t){return n!==t})),D(B.slice()),setTimeout((function(){return D(B.slice())}),10)}})]})]})},n)}))}),(0,k.jsxs)(oe.Z,{span:24,className:je,style:{borderBottom:F.hack_analysis?"none":"1px solid #fff"},children:[(0,k.jsx)(ae.Z,{checked:F.hack_analysis,disabled:w,onChange:function(e){F.hack_analysis=e.target.checked,Y(Object.assign({},F))},children:(0,k.jsx)("span",{className:"font14",children:"公开解析"})}),(0,k.jsx)("span",{className:"c-grey-666 font14",children:"(选中,学生可以查看试题的答案解析)"})]}),!!F.hack_analysis&&(0,k.jsx)(oe.Z,{span:24,className:je,children:(0,k.jsxs)(me.ZP.Group,{style:{marginLeft:"24px"},disabled:w,value:F.hack_analysis_type,onChange:function(e){F.hack_analysis_type=e.target.value,Y(Object.assign({},F))},children:[(0,k.jsx)(me.ZP,{value:0,children:"任意时间"}),(0,k.jsx)(me.ZP,{style:{marginLeft:60},value:1,children:"学生通过答题后可查看该题解析/未通过的学生作业截止后"}),(0,k.jsx)(me.ZP,{style:{marginLeft:60},value:2,children:"作业截止后"})]})}),(0,k.jsxs)(oe.Z,{span:24,className:je,style:{borderBottom:F.hack_answer?"none":"1px solid #fff"},children:[(0,k.jsx)(ae.Z,{checked:F.hack_answer,disabled:w,onChange:function(e){F.hack_answer=e.target.checked,Y(Object.assign({},F))},children:(0,k.jsx)("span",{className:"font14",children:"公开答案"})}),(0,k.jsx)("span",{className:"c-grey-666 font14",children:"(选中,学生可以查看试题的答案)"})]}),!!F.hack_answer&&(0,k.jsx)(oe.Z,{span:24,className:je,children:(0,k.jsxs)(me.ZP.Group,{style:{marginLeft:"24px"},disabled:w,value:F.hack_answer_type,onChange:function(e){F.hack_answer_type=e.target.value,Y(Object.assign({},F))},children:[(0,k.jsx)(me.ZP,{value:0,children:"任意时间"}),(0,k.jsx)(me.ZP,{style:{marginLeft:60},value:1,children:"作业截止后"})]})})]})}),!w&&(0,k.jsx)(g.ZP,{type:"primary",size:"large",style:{width:138},className:"mt30",loading:L,onClick:function(){return function(){var e,n=JSON.parse(JSON.stringify(F));if(n.categoryId=s.categoryId,F.unified_setting||(P=null===(e=P)||void 0===e?void 0:e.map((function(e){var n;if(!e.publish_time||!e.end_time)throw m.ZP.error("请把开始时间填写完整"),new String("请把开始时间填写完整");if(!e.group_name)throw m.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null===(n=c.group_settings)||void 0===n?void 0:n.filter((function(n){var t;return null==e||null===(t=e.group_name)||void 0===t?void 0:t.includes(n.group_name)})).map((function(e){return e.group_id||e.id})).toString().split(","),e}))),n.group_settings=P,F.rank_forbidden)if(F.unified_setting){if(!F.rank_forbidden_start)throw m.ZP.error("请把开始时间填写完整"),new String("请把开始时间填写完整");if(!F.rank_forbidden_end)throw m.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整");if(M()(F.rank_forbidden_end)<M()(F.rank_forbidden_start))throw m.ZP.error("截止时间不能早于开始时间"),new String("截止时间不能早于开始时间")}else{var t;B=null===(t=B)||void 0===t?void 0:t.map((function(e){var n;if(!e.rank_forbidden_start)throw m.ZP.error("请把开始时间填写完整"),new String("请把开始时间填写完整");if(!e.rank_forbidden_end)throw m.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整");if(!e.group_name)throw m.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null==e||null===(n=e.group_name)||void 0===n||null===(n=n.map((function(e){var n,t=null===(n=c.group_settings)||void 0===n||null===(n=n.filter((function(n){return(null==n?void 0:n.group_name)===e})))||void 0===n?void 0:n[0];return null==t?void 0:t.group_id})))||void 0===n?void 0:n.toString().split(","),e})),n.group_settingss=B}V(n)}()},children:"保存"})]})})),Re=(0,f.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading.effects}}))((function(e){var n,t=e.shixunHomeworks,i=(e.loading,e.dispatch),r=(0,f.useParams)(),s=t.workSetting,c=t.workList,v=(t.changeData,(0,d.useState)(!0)),x=u()(v,2),w=x[0],_=x[1],y=(0,d.useState)(!1),b=u()(y,2),j=b[0],S=b[1],N=(0,d.useState)(!1),M=u()(N,2),L=(M[0],M[1],te.Z.useForm()),C=(u()(L,1)[0],(0,d.useState)([])),T=u()(C,2),Z=T[0],A=T[1],P=(0,d.useState)([]),I=u()(P,2),E=I[0],O=I[1],B=!(null!=c&&null!==(n=c.homework_status)&&void 0!==n&&n.includes("未发布")),D=(0,d.useRef)(!0),z=(0,d.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,is_onpage_time:!0,training_time_rules:1,hack_settings:[],punish_time:void 0,hack_score_settings:void 0,hack_rank_rule:0}),H=u()(z,2),R=H[0],G=H[1];(0,d.useEffect)((function(){return function(){A([].concat())}}),[]),(0,d.useEffect)((function(){null!=s&&s.can_edit&&_(!1)}),[s]);(0,d.useEffect)((function(){null!=s&&s.course_id&&D.current&&(D.current=!1,Object.keys(R).map((function(e){R[e]=s[e]})),R.allow_late&&R.unified_late||(R.late_penalty=5),Z=JSON.parse(JSON.stringify(s.group_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.publish_time})))),E=JSON.parse(JSON.stringify(s.allow_late_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.late_time})))),F(),G(o()({},R)),A(de()(Z)),O(de()(E)))}),[s]);var W=function(e){if(console.log(e.total_score,e.eff_score),null!==e.total_score){var n=function(){var n=l()(a()().mark((function n(){return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return S(!0),n.next=3,(0,p.ZP)("/api/homework_commons/".concat(r.categoryId,"/hack_score_setting.json"),{method:"post",body:o()({},e)});case 3:0===n.sent.status&&(m.ZP.success("更新成功"),i({type:"shixunHomeworks/getWorkSetting",payload:o()({},r)}),i({type:"shixunHomeworks/getWorkList",payload:o()({},r)})),S(!1);case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();(null==R?void 0:R.hack_score_settings)!==(null==s?void 0:s.hack_score_settings)&&B?h.Z.confirm({title:"更新成绩",content:"您改动了本次作业的得分设置,这可能导致已完成作业的学生的成绩产生错误。点击“确定”按钮将保存最新设置并按最新设置更新全班成绩。",okText:"确认",cancelText:"取消",onOk:n}):n()}else m.ZP.warning("总分值不能为空")},F=function(){var e,n=R.total_score,t=null===(e=R.hack_settings)||void 0===e?void 0:e.length;if(t){var i,o=0;switch(R.hack_score_settings){case 0:var r=(n/t).toFixed(2);R.hack_settings.map((function(e,n){o=n,e.hack_score=r>0?r:0})),i=(n-r*(t-1)).toFixed(2),R.hack_settings[o].hack_score=i>0?i:0;break;case 1:var a=[0,1,3,6],s=0,l=n/(R.hack_settings.filter((function(e){return 1===e.difficult})).length*a[1]+R.hack_settings.filter((function(e){return 2===e.difficult})).length*a[2]+R.hack_settings.filter((function(e){return 3===e.difficult})).length*a[3]);console.log(l,2222),R.hack_settings.map((function(e,n){o=n,e.hack_score=(a[e.difficult]*l).toFixed(2),s+=Number(e.hack_score)}));var c=R.hack_settings[o].hack_score;i=(n-s+Number(c)).toFixed(2),R.hack_settings[o].hack_score=i>0?i:0}}},Y=0===(null==s?void 0:s.send_type)||1===(null==s?void 0:s.send_type)&&2===(null==R?void 0:R.hack_score_settings);return(0,k.jsxs)("section",{className:_e,children:[(0,k.jsxs)(ie.Z,{align:"middle",style:{marginBottom:36},children:[(0,k.jsxs)(ie.Z,{align:"middle",children:[(0,k.jsx)("span",{className:"c-grey-333",children:"总分值"}),(0,k.jsx)(he.Z,{min:0,className:"ml20",style:{width:220},size:"large",value:R.total_score,disabled:w||B,onChange:function(e){R.total_score=e,G(Object.assign({},R)),F()},addonAfter:"分"})]}),(0,k.jsxs)(ie.Z,{align:"middle",style:{marginLeft:60},children:[(0,k.jsx)("span",{className:"c-grey-333",children:"测评单次报错增加时长"}),(0,k.jsx)(he.Z,{className:"ml20",style:{width:220},size:"large",min:0,value:R.punish_time,precision:0,disabled:w,onChange:function(e){R.punish_time=e,G(Object.assign({},R)),F()},addonAfter:"分钟"})]})]}),(0,k.jsx)("div",{className:ye,children:"排行榜时间名次规则"}),(0,k.jsx)("div",{className:"".concat(be," mb30"),children:(0,k.jsxs)(me.ZP.Group,{disabled:w,value:R.hack_rank_rule,onChange:function(e){R.hack_rank_rule=e.target.value,G(Object.assign({},R))},children:[(0,k.jsx)(me.ZP,{value:0,children:"按实际实验时长优先,同成绩下时长短名次靠前"}),(0,k.jsx)(me.ZP,{style:{marginLeft:40},value:1,children:"按学生完成时间先后优先,同成绩下越早名次靠前"})]})}),(0,k.jsx)("div",{className:ye,children:"试题分值"}),(0,k.jsx)("div",{className:be,children:(0,k.jsxs)(me.ZP.Group,{value:R.hack_score_settings,onChange:function(e){R.hack_score_settings=e.target.value,G(Object.assign({},R)),F()},children:[(0,k.jsx)(me.ZP,{value:0,children:"均分比例"}),(0,k.jsx)(me.ZP,{style:{margin:"0 40px"},value:1,children:"难易度"}),(0,k.jsx)(me.ZP,{value:2,children:"自定义分值"})]})}),(0,k.jsx)("div",{className:be,style:{borderTop:"1px solid #fff"},children:(0,k.jsx)("div",{style:{padding:"0px 20px 20px 20px"},children:R.hack_settings&&R.hack_settings.map((function(e,n){return(0,k.jsxs)(ie.Z,{align:"middle",style:{marginTop:20},children:[(0,k.jsx)(oe.Z,{flex:"1",className:"pr10",children:(0,k.jsx)("strong",{children:e.hack_name})}),(0,k.jsx)(oe.Z,{flex:"150px",children:(0,k.jsx)(he.Z,{min:0,step:.1,style:{visibility:Y?"visible":"hidden"},value:e.hack_score,disabled:2!==R.hack_score_settings,onChange:function(e){R.hack_settings[n].hack_score=e;var t=R.hack_settings.reduce((function(e,n){return e+Number(n.hack_score)}),0);R.total_score=t.toFixed(2),G(o()({},R))},size:"large",addonAfter:"分"})}),(0,k.jsxs)(oe.Z,{className:"ml20",style:{lineHeight:"20px"},children:[1===e.difficult&&(0,k.jsx)("span",{className:"tag-style-border-small bg-green c-white mr10",children:"简单"}),2===e.difficult&&(0,k.jsx)("span",{className:"tag-style-border-small bg-blue c-white mr10",children:"适中"}),3===e.difficult&&(0,k.jsx)("span",{className:"tag-style-border-small bg-orange c-white mr10",children:"困难"})]})]},n)}))})}),!w&&(0,k.jsx)(g.ZP,{type:"primary",size:"large",style:{width:138},className:"mt30",loading:j,onClick:function(){return e=JSON.parse(JSON.stringify(R)),void W(e);var e},children:"保存"})]})})),Ge=(0,f.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading.effects}}))((function(e){e.shixunHomeworks,e.loading,e.dispatch;var n,t,i=(0,d.useState)(!0),o=u()(i,2),r=(o[0],o[1],(0,d.useState)(!1)),s=u()(r,2),c=s[0],v=s[1],x=(0,d.useState)([]),w=u()(x,2),y=w[0],b=w[1],j=(0,d.useState)([]),S=u()(j,2),N=S[0],M=S[1],L=(0,d.useState)([]),C=u()(L,2),T=C[0],Z=C[1],A=(0,d.useState)([]),P=u()(A,2),I=P[0],E=P[1],O=(0,d.useState)(!1),B=u()(O,2),D=B[0],z=B[1],H=(0,d.useState)(""),R=u()(H,2),G=R[0],W=R[1],F=(0,f.useParams)();function Y(){return U.apply(this,arguments)}function U(){return(U=l()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/homework_commons/".concat(F.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:n=e.sent,M(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return q.apply(this,arguments)}function q(){return(q=l()(a()().mark((function e(){var n,t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/courses/".concat(null==F?void 0:F.coursesId,"/teachers"),{method:"get",params:{homework_id:F.categoryId,limit:1e3}});case 2:null==(t=e.sent)||null===(n=t.teacher_list)||void 0===n||n.map((function(e){e.key=e.user_id})),Z(null==t?void 0:t.teacher_list),E(null==t?void 0:t.teacher_list);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,d.useEffect)((function(){Y(),V()}),[F]);return(0,k.jsxs)("section",{className:_e,children:[(0,k.jsxs)(ie.Z,{className:be,style:{padding:"20px 30px",gap:20},children:[null==N||null===(n=N.data)||void 0===n?void 0:n.map((function(e){return(0,k.jsxs)(ie.Z,{align:"middle",className:"".concat(Se," ").concat(G===(null==e?void 0:e.id)?Me:""),style:{height:"38px",borderRadius:"2px",padding:"0 12px",color:"#333333",background:"#fff"},children:[(0,k.jsx)("span",{className:"c-grey-333",children:null==e?void 0:e.real_name}),(null==N?void 0:N.can_edit)&&(0,k.jsx)("span",{style:{cursor:"pointer",marginLeft:"20px"},className:"iconfont icon-guanbi11 ".concat(Ne),onMouseEnter:function(){W(e.id)},onMouseLeave:function(){W("")},onClick:l()(a()().mark((function n(){return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,p.ZP)("/api/homework_commons/".concat(F.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:e.id}});case 2:0===n.sent.status&&(m.ZP.info("删除成功"),Y(),V());case 4:case"end":return n.stop()}}),n)})))})]})})),!(null!=N&&N.can_edit)&&!(null!=N&&null!==(t=N.data)&&void 0!==t&&t.length)&&(0,k.jsx)("span",{className:"c-grey-666",children:"暂未添加协作者"}),(null==N?void 0:N.can_edit)&&(0,k.jsx)(g.ZP,{className:Le,style:{height:38,padding:"6px 15px",backgroundColor:"#fff"},type:"primary",ghost:!0,onClick:function(){return v(!0)},children:"添加协作者"})]}),(0,k.jsx)(h.Z,{title:"添加协作者",open:c,confirmLoading:D,onCancel:function(){return v(!1)},onOk:l()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==y.length){e.next=3;break}return m.ZP.info("请选择协作老师"),e.abrupt("return");case 3:return z(!0),e.next=6,(0,p.ZP)("/api/homework_commons/".concat(F.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:y}});case 6:0===e.sent.status&&(m.ZP.info("添加成功"),b([]),Y(),V(),v(!1)),z(!1);case 9:case"end":return e.stop()}}),e)}))),children:(0,k.jsxs)("div",{children:[(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("label",{style:{width:"50px"},children:"姓名:"})," ",(0,k.jsx)(re.Z.Search,{onChange:function(e){Z(I.filter((function(n){return n.name.indexOf(e.target.value)>-1})))}})]}),(0,k.jsx)(_.Z,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(e,n){b(e)},selectedRowKeys:y,getCheckboxProps:function(e){return{disabled:e.is_collaborator}}},pagination:!1,dataSource:T,columns:[{title:"姓名",dataIndex:"name",key:"name"},{title:"角色",dataIndex:"role",key:"role"}]})]})})]})})),We=[{key:"1",label:"发布设置",element:(0,k.jsx)(Ie,{})},{key:"2",label:"评分设置",element:(0,k.jsx)(Re,{})},{key:"3",label:"公开设置",element:(0,k.jsx)(He,{})},{key:"4",label:"协作设置",element:(0,k.jsx)(Ge,{})}],Fe=function(){return(0,k.jsx)(ce.Z,{dataSource:We,style:{marginBottom:52}})},Ye=t(85573),Ue=t.n(Ye),Ve=t(26724),qe=t.n(Ve),Qe=t(11665),Je=(0,f.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading}}))((function(e){var n=e.shixunHomeworks,t=e.loading,i=e.dispatch,r=(0,f.useParams)(),s=((0,f.useLocation)(),(0,d.useState)([])),c=u()(s,2),m=c[0],g=c[1],v=(0,d.useState)([]),x=u()(v,2),w=(x[0],x[1],(0,d.useState)(!0)),y=u()(w,2),b=y[0],j=y[1],S=(0,d.useState)(!1),N=u()(S,2),L=N[0],C=N[1],T=(0,d.useState)(1),Z=u()(T,2),A=Z[0],P=Z[1],I=(0,d.useState)([]),E=u()(I,2),O=(E[0],E[1]),B=(0,d.useState)(!1),D=u()(B,2),z=D[0],H=D[1],R=(0,d.useState)(!1),G=u()(R,2),W=G[0],F=G[1],Y=(0,d.useState)(!1),U=u()(Y,2),V=U[0],q=U[1];(0,d.useEffect)((function(){"代码查重"===n.actionTabs.key?(J.resetFields(),g([]),H(!0),K()):H(!1)}),[n.actionTabs.key]);var Q=te.Z.useForm(),J=u()(Q,1)[0],K=function(){var e=l()(a()().mark((function e(){var n,t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b||L){e.next=11;break}return C(!0),P(A+1),e.next=5,(0,Qe.JG)(o()(o()({},r),{},{page:A}));case 5:t=e.sent,i=de()(t.group_list),null!=t&&t.ungroup_list&&i.push({id:null==t?void 0:t.ungroup_list.id,name:null==t?void 0:t.ungroup_list.name,works_count:null==t?void 0:t.ungroup_list.work_count,last_review_time:null==t?void 0:t.ungroup_list.last_review_time}),g([].concat(de()(m),de()(i))),C(!1),(null===(n=t.group_list)||void 0===n?void 0:n.length)<10&&j(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){i({type:"shixunHomeworks/setActionTabs",payload:{}}),F(!1),j(!0),C(!1),P(1),g([]),J.resetFields()},$=[{title:"",dataIndex:"id",width:280,render:function(e,n){return(0,k.jsx)(ae.Z,{disabled:!(n.works_count>1),value:String(n.id),children:n.name})}},{title:"有效作品数",dataIndex:"works_count"},{title:"上次查重时间",dataIndex:"last_review_time",width:130}];return(0,k.jsxs)(h.Z,{centered:!0,title:"代码查重",keyboard:!1,maskClosable:!1,open:z,okText:"确认",cancelText:"取消",width:820,bodyStyle:{minHeight:200},onOk:l()(a()().mark((function e(){var t,o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=J.getFieldValue(),q(!0),e.next=4,(0,p.ZP)("/api/homework_commons/".concat(r.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:de()(t.group_ids)}});case 4:if(o=e.sent,q(!1),0!==o.status){e.next=12;break}return X(),e.next=10,i({type:"shixunHomeworks/getWorkList",payload:n.actionTabs.params});case 10:f.history.push("/classrooms/".concat(r.coursesId,"/program_homework/").concat(r.categoryId,"/detail?tabs=2")),i({type:"shixunHomeworks/setActionTabs",payload:{key:"执行代码查重"}});case 12:case"end":return e.stop()}}),e)}))),okButtonProps:{loading:V},onCancel:X,children:[(0,k.jsx)("div",{children:"请注意:在执行代码查重操作后,若学生提交新的作品代码,新作品代码不计入本次查重结果。"}),n.codeReviewCourse&&(0,k.jsxs)(te.Z,{form:J,onChange:function(e){O(o()({},J.getFieldValue()))},initialValues:Ue()(Ue()({},"group_ids",[]),"end_time",M()(M()().add(7,"days").format("YYYY-MM-DD HH:mm"))),children:[(0,k.jsx)("div",{className:"flexd-table-header mt20",children:(0,k.jsx)(_.Z,{pagination:!1,dataSource:[],columns:$})}),(0,k.jsx)(te.Z.Item,{name:"group_ids",children:(0,k.jsx)(ae.Z.Group,{className:"w100",children:(0,k.jsx)("div",{style:{width:"100%",maxHeight:260,overflow:"auto"},children:(0,k.jsx)(qe(),{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(e){K()},hasMore:b,useWindow:!1,children:(0,k.jsx)(_.Z,{loading:t.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:$,dataSource:m,pagination:!1})})})})})]}),(0,k.jsx)(ie.Z,{children:(0,k.jsx)(oe.Z,{className:"ml10",children:(0,k.jsx)(ae.Z,{checked:W,onChange:function(e){F(e.target.checked);var n=[];e.target.checked&&(n=m.filter((function(e){return e.works_count>1})).map((function(e){return e.id+""}))),J.setFieldsValue(Ue()({},"group_ids",n))},children:"全选"})})})]})})),Ke=t(57837),Xe=t(38277),$e=t(51402),en=t(48741),nn=t(75842),tn=t(62378),on=t(79549),rn=t(66037),an=t(72739),sn=[tn.Z,on.Z,rn.Z],ln=(0,f.connect)((function(e){var n=e.shixunHomeworks;return{user:e.user,shixunHomeworks:n,classroomList:e.classroomList}}))((function(e){var n,t,i,r=e.user,s=e.classroomList,c=e.shixunHomeworks,v=(0,d.useState)(o()(o()({},(0,f.useParams)()),{},{page:1,per_page:10,rank_type:2,search:"",course_group:(0,H.dE)()?[r.userInfo.course.course_group_id]:[]},(0,f.useParams)())),w=u()(v,2),y=w[0],b=w[1],j=(0,d.useState)([]),S=u()(j,2),N=S[0],M=S[1],L=(0,d.useState)([]),Z=u()(L,2),A=Z[0],P=Z[1],I=(0,d.useState)([]),E=u()(I,2),O=E[0],B=E[1],D=(0,d.useState)(!1),z=u()(D,2),R=z[0],G=z[1],W=(0,d.useState)([{title:"排行",dataIndex:"rank",width:70,fixed:"left",ellipsis:!0,sorter:function(e,n){return e.rank-n.rank},render:function(e,n,t){return e<4?(0,k.jsx)("img",{src:sn[e-1]}):e}},{title:"姓名",dataIndex:"user_name",width:80,fixed:"left",ellipsis:!0,key:"user_name",render:function(e,n,t){return(0,k.jsxs)("span",{children:[n.is_me&&(0,k.jsx)("span",{style:{display:"inline-block",fontSize:12,color:"#CA7720",background:"rgba(255, 181, 56, 0.36)",borderRadius:2,width:16,height:16,textAlign:"center",lineHeight:"16px",transform:"translateY(-1px)"},children:"我"}),e]})}},{title:"学号",dataIndex:"student_id",key:"student_id",width:80,ellipsis:!0,fixed:"left",render:function(e){return e||"- -"}},{title:"班级",dataIndex:"course_group",key:"course_group",ellipsis:!0,width:70,fixed:"left"},{title:"通过",dataIndex:"passed_count",width:60,fixed:"left",ellipsis:!0,key:"passed_count",render:function(e){return e?(0,k.jsxs)("span",{children:[e,"题"]}):""}},{title:"得分",dataIndex:"score",width:50,ellipsis:!0,fixed:"left",key:"score"}]),F=u()(W,2),Y=F[0],U=F[1];function V(e){return q.apply(this,arguments)}function q(){return(q=l()(a()().mark((function e(n){var t,i,c,u,d,f;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return G(!0),e.next=3,(0,p.ZP)("/api/courses/rank_list.json",{method:"get",params:o()(o()({},y),{},{id:y.coursesId,rank_type:2,homework_common_id:y.categoryId})});case 3:if(t=e.sent,M(t),G(!1),-1==t.status){e.next=19;break}if((0,H.dE)()?(1===n&&P([null==t||null===(i=t.course_group)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.id]),null!=t&&t.my_rank?B([o()({is_me:!0},null==t?void 0:t.my_rank)].concat(de()(null==t?void 0:t.rank_list))):B(de()(null==t?void 0:t.rank_list))):B(de()(null==t?void 0:t.rank_list)),1!==n){e.next=19;break}c={title:0===(null==t?void 0:t.hack_rank_rule)?(0,k.jsxs)(x.Z,{title:"总耗时时为做题通过时长和罚时时长的总和,\n 罚时时长=评测出错次数X设置的罚时(当前为".concat(null==t?void 0:t.punish_time,"分)"),children:[(0,k.jsx)("span",{style:{marginRight:3},children:"总耗时"})," ",(0,k.jsx)("span",{style:{fontSize:"14px"},className:"iconfont icon-tishixiaowenhao c-blue"})]}):"完成时间",dataIndex:0===(null==t?void 0:t.hack_rank_rule)?"finish_time":"finish_at",width:0===(null==t?void 0:t.hack_rank_rule)?80:150,ellipsis:!0,fixed:"left",key:"finish_time"},Y.push(c),u=a()().mark((function e(n){var i,c,u;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(u={}).title=null!=t&&t.sent_type?(0,k.jsx)("span",{children:"题目"+(n+1)+"(".concat(null==t||null===(i=t.question_data)||void 0===i||null===(i=i[n])||void 0===i?void 0:i.question_score,")")}):(0,k.jsx)("a",{onClick:l()(a()().mark((function e(){var i,o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/problems/".concat(null==t||null===(i=t.question_data)||void 0===i||null===(i=i[n])||void 0===i?void 0:i.identifier,"/start.json"),{method:"get"});case 2:(o=e.sent)&&(window.open("/myproblems/".concat(null==o?void 0:o.identifier,"?type=1")),localStorage.setItem("program_homework",[y.coursesId,y.categoryId]));case 4:case"end":return e.stop()}}),e)}))),children:"题目"+(n+1)+"(".concat(null==t||null===(c=t.question_data)||void 0===c||null===(c=c[n])||void 0===c?void 0:c.question_score,")")}),u.dataIndex="question_data",u.width=140,u.render=function(e,t){var i,c,u,d,f;return(0,k.jsx)("div",{children:(null==e||null===(i=e[n])||void 0===i?void 0:i.answer_question_time)&&(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:l()(a()().mark((function t(){var i,l,c,u,d,f,g,v,x;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,H.Rm)()||null!==(i=s.AssistantObject.hack)&&void 0!==i&&i.can_view){t.next=3;break}return m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),t.abrupt("return");case 3:if(null!=e&&null!==(l=e[n])&&void 0!==l&&l.open_code){t.next=6;break}return m.ZP.info("暂不允许查看代码"),t.abrupt("return");case 6:return t.next=8,(0,p.ZP)("/api/courses/view_code.json",{method:"get",params:o()(o()({},y),{},{id:y.coursesId,homework_common_id:y.categoryId,hack_user_code_id:null==e||null===(c=e[n])||void 0===c?void 0:c.hack_user_code_id})});case 8:x=t.sent,h.Z.warning({icon:null,width:800,title:(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{children:"代码"}),(0,k.jsxs)("span",{children:["使用语言:",null==e||null===(u=e[n])||void 0===u?void 0:u.current_language]}),(0,k.jsxs)("span",{children:["运行内存:",null==e||null===(d=e[n])||void 0===d?void 0:d.memory,"(KB)"]}),(0,k.jsxs)("span",{children:["运行时长:",null==e||null===(f=e[n])||void 0===f?void 0:f.run_time,"(ms)"]}),(0,k.jsxs)("span",{children:["得分:",null==e||null===(g=e[n])||void 0===g?void 0:g.score]})]}),content:(0,k.jsx)(an.Z,{classroomList:s,user:r,languages:[{language:null==e||null===(v=e[n])||void 0===v?void 0:v.language,code:null==x?void 0:x.code}],v:e,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:e.language,game_id:e.id,diff_code_count:e.diff_code_count})});case 10:case"end":return t.stop()}}),t)})))}),(0,k.jsx)("span",{style:{margin:"0px 10px"},children:(null==e||null===(c=e[n])||void 0===c?void 0:c.answer_question_time)||"- -"}),null!=e&&null!==(u=e[n])&&void 0!==u&&u.submit_count?(0,k.jsxs)(x.Z,{title:"".concat((null==e||null===(d=e[n])||void 0===d?void 0:d.submit_count)||0,"次尝试出错"),children:[(0,k.jsx)("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(null==e||null===(f=e[n])||void 0===f?void 0:f.submit_count)||0]}):null]})})},Y.push(u);case 6:case"end":return e.stop()}}),e)})),d=0;case 13:if(!(d<(null==t||null===(f=t.question_data)||void 0===f?void 0:f.length))){e.next=18;break}return e.delegateYield(u(d),"t0",15);case 15:d++,e.next=13;break;case 18:U(de()(Y));case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,d.useEffect)((function(){Y.splice(7);for(var e=function(e){var n,t,i={};i.title=null!=N&&N.sent_type?(0,k.jsx)("span",{children:"题目"+(e+1)+"(".concat(null==N||null===(n=N.question_data)||void 0===n||null===(n=n[e])||void 0===n?void 0:n.question_score,")")}):(0,k.jsx)("a",{onClick:l()(a()().mark((function n(){var t,i;return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,p.ZP)("/api/problems/".concat(null==N||null===(t=N.question_data)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.identifier,"/start.json"),{method:"get"});case 2:(i=n.sent)&&(window.open("/myproblems/".concat(null==i?void 0:i.identifier,"?type=1")),localStorage.setItem("program_homework",[y.coursesId,y.categoryId]));case 4:case"end":return n.stop()}}),n)}))),children:"题目"+(e+1)+"(".concat(null==N||null===(t=N.question_data)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.question_score,")")}),i.dataIndex="question_data",i.width=140,i.render=function(n,t){var i,c,u,d,f;return(0,k.jsx)("div",{children:(null==n||null===(i=n[e])||void 0===i?void 0:i.answer_question_time)&&(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:l()(a()().mark((function t(){var i,l,c,u,d,f,g,v,x;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,H.Rm)()||null!==(i=s.AssistantObject.hack)&&void 0!==i&&i.can_appraise){t.next=3;break}return m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),t.abrupt("return");case 3:if(null!=n&&null!==(l=n[e])&&void 0!==l&&l.open_code){t.next=6;break}return m.ZP.info("暂不允许查看代码"),t.abrupt("return");case 6:return t.next=8,(0,p.ZP)("/api/courses/view_code.json",{method:"get",params:o()(o()({},y),{},{id:y.coursesId,homework_common_id:y.categoryId,hack_user_code_id:null==n||null===(c=n[e])||void 0===c?void 0:c.hack_user_code_id})});case 8:x=t.sent,h.Z.warning({icon:null,width:800,title:(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{children:"代码"}),(0,k.jsxs)("span",{children:["使用语言:",null==n||null===(u=n[e])||void 0===u?void 0:u.current_language]}),(0,k.jsxs)("span",{children:["运行内存:",null==n||null===(d=n[e])||void 0===d?void 0:d.memory,"(KB)"]}),(0,k.jsxs)("span",{children:["运行时长:",null==n||null===(f=n[e])||void 0===f?void 0:f.run_time,"(ms)"]}),(0,k.jsxs)("span",{children:["得分:",null==n||null===(g=n[e])||void 0===g?void 0:g.score]})]}),content:(0,k.jsx)(an.Z,{classroomList:s,user:r,languages:[{language:null==n||null===(v=n[e])||void 0===v?void 0:v.language,code:null==x?void 0:x.code}],v:n,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:n.language,game_id:n.id,diff_code_count:n.diff_code_count})});case 10:case"end":return t.stop()}}),t)})))}),(0,k.jsx)("span",{style:{margin:"0px 10px"},children:(null==n||null===(c=n[e])||void 0===c?void 0:c.answer_question_time)||"- -"}),null!=n&&null!==(u=n[e])&&void 0!==u&&u.submit_count?(0,k.jsxs)(x.Z,{title:"".concat((null==n||null===(d=n[e])||void 0===d?void 0:d.submit_count)||0,"次尝试出错"),children:[(0,k.jsx)("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(null==n||null===(f=n[e])||void 0===f?void 0:f.submit_count)||0]}):null]})})},Y.push(i)},n=0;n<(null==N||null===(t=N.question_data)||void 0===t?void 0:t.length);n++){var t;e(n)}U(de()(Y))}),[null==N?void 0:N.question_data]),(0,d.useEffect)((function(){var e;null!=r&&null!==(e=r.userInfo)&&void 0!==e&&e.course&&((0,H.dE)()&&(y.course_group=(0,H.dE)()?[r.userInfo.course.course_group_id]:[],b(o()({},y))),V(1))}),[null==r?void 0:r.userInfo]),console.log("----",c,Y);var Q=null==c||null===(n=c.workSetting)||void 0===n?void 0:n.hack_rank_rule;return(0,k.jsx)("div",{style:{width:1200,margin:"0px auto"},children:"封榜中"===(null==N?void 0:N.message)?(0,k.jsx)(se.Z,{customText:"答题时间进入倒计时,暂时封榜,请加速竞技通关答题"}):(0,k.jsxs)("div",{style:{background:"#fff",padding:20},children:[(0,k.jsxs)("div",{style:{display:"inline-flex"},children:[(0,k.jsx)("label",{children:"分班情况:"}),(0,H.GJ)()&&(0,k.jsx)("div",{style:{flex:1},children:(0,k.jsxs)(ae.Z.Group,{className:$e.Z.checkboxgroup,value:A,onChange:function(e){if(1===y.type)P([]),y.course_group=[],y.page=1,b(o()({},y)),V();else if(2===y.type){var n;P(["全部"].concat()),y.course_group=null==N||null===(n=N.course_group)||void 0===n?void 0:n.map((function(e){return e.id})),y.page=1,b(o()({},y)),V()}else P(de()(e.filter((function(e){return"全部"!=e})))),y.course_group=e.filter((function(e){return"全部"!=e})),y.page=1,b(o()({},y)),V()},children:[(0,k.jsx)(ae.Z,{value:"全部",onChange:function(e){e.target.checked?y.type=2:y.type=1},children:"全部分班"}),null==N||null===(t=N.course_group)||void 0===t?void 0:t.map((function(e,n){return(0,k.jsx)(ae.Z,{onChange:function(e){y.type=3},value:e.id,children:null==e?void 0:e.name})}))]})}),(0,H.dE)()&&(0,k.jsxs)(me.ZP.Group,{onChange:function(e){"全部"===e.target.value?(y.course_group=[],y.page=1,b(o()({},y)),V()):(y.course_group=[e.target.value],y.page=1,b(o()({},y)),V())},defaultValue:r.userInfo.course.course_group_id,children:[(0,k.jsx)(me.ZP,{value:"全部",children:"全部分班"}),null==N||null===(i=N.course_group)||void 0===i?void 0:i.map((function(e,n){return(0,k.jsx)(me.ZP,{value:e.id,children:e.name})}))]})]}),(0,k.jsxs)("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:10},children:[(0,k.jsxs)("span",{style:{fontSize:14,color:"#B1BACD"},children:["排行规则:",0===Q?"作业时间段之外的提交不计入排行。当前按实际实验时长优先,同通过题数下时长短名次靠前。":"作业时间段之外的提交不计入排行。当前按完成时间先后优先,同通过题数下完成时间越早名次靠前。"," ",(0,k.jsx)("a",{onClick:function(){h.Z.warning({title:"计分规则",width:500,content:(0,k.jsxs)("div",{children:[0===Q&&(0,k.jsx)("p",{children:"排名规则:经典ACM规则"}),(0,k.jsx)("p",{children:"AC(通过题目)越多,排名越靠前。"}),(0,k.jsx)("p",{children:"AC相同,总用时越少,排名越靠前。"}),0==Q&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("p",{children:"总用时=∑(每一个题目的用时)"}),(0,k.jsx)("p",{children:"每一个题目的用时=比赛开始到提交被通过的时间+罚时"}),(0,k.jsx)("p",{children:"罚时=(通过前)错误代码提交次数*每次罚时"}),(0,k.jsx)("p",{children:"不算罚时的情况:没有通过的题目、(系统)内部错误、编译错误"})]})]})})},children:"点击查看计分规则"})]}),(0,H.GJ)()&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(re.Z.Search,{className:"mr20",onSearch:function(e){y.page=1,y.search=e,b(o()({},y)),V()},placeholder:"请输入用户名/学号进行搜索",style:{width:250,marginLeft:"auto"}}),(0,k.jsx)(g.ZP,{onClick:function(){(0,nn.VY)(o()(o()({},y),{},{id:y.coursesId,rank_type:2,homework_common_id:y.categoryId}))},children:"导出"})]})]}),(0,k.jsx)(C.Z,{spinning:R,children:(0,k.jsx)(_.Z,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(e,n){return 0===n&&(0,H.dE)()&&$e.Z.tables},dataSource:O,columns:Y})}),(0,k.jsx)("div",{style:{width:"100%",textAlign:"center",marginTop:10},children:(0,k.jsx)(T.Z,{current:y.page,pageSize:y.per_page,total:null==N?void 0:N.count,hideOnSinglePage:!0,onChange:function(e,n){y.page=e,y.per_page=n,b(o()({},y)),V()}})})]})})})),cn=t(98990),un=t(96626),dn=t(57978),pn=t(46529),fn=t(48849),mn=[{live:"A",gz:"0个错误",ld:"0个漏洞",gf:"0 - 5%"},{live:"B",gz:"至少1个次要错误",ld:"至少1个次要漏洞",gf:"6% - 10%"},{live:"C",gz:"至少1个主要错误",ld:"至少1个主要漏洞",gf:"11% - 20%"},{live:"D",gz:"至少1个严重错误",ld:"至少1个严重漏洞",gf:"21% - 50%"},{live:"E",gz:"至少1个崩溃错误",ld:"至少1个崩溃漏洞",gf:"超过50%"}],hn=(0,f.connect)((function(e){var n=e.shixunHomeworks,t=e.classroomList,i=e.loading,o=e.user;return{classroomList:t,shixunHomeworks:n,globalSetting:e.globalSetting,user:o,loading:i.effects}}))((function(e){var n,t,i=e.shixunHomeworks,r=e.classroomList,s=(e.globalSetting,e.user),c=(e.loading,e.dispatch),j=(0,f.useParams)(),S=(0,f.useSearchParams)(),N=u()(S,1)[0],M=(0,d.useState)(N.get("tabs")||"0"),L=u()(M,2),C=L[0],T=L[1],Z=(0,d.useState)({}),A=u()(Z,2),P=A[0],I=A[1],E=i.workList,O=i.workSetting,B=(0,d.useState)(!1),D=u()(B,2),z=D[0],R=D[1];j.category=N.get("category_id"),j.order="work_score",j.b_order="desc",(0,d.useEffect)((function(){c({type:"classroomList/getAssistantPermissions",payload:{course_id:j.coursesId}})}),[(0,H.bg)()]);var G,W,F,U,V,q,Q,J,K,X,$=function(){var e;h.Z.confirm({centered:!0,width:530,title:"提示",okText:"确定",cancelText:"取消",content:(0,k.jsxs)("div",{className:"tc font16",children:["你在该实训的学习记录将被清空,无法恢复",(0,k.jsx)("br",{}),"是否确认重做?"]}),onOk:(e=l()(a()().mark((function e(){var n,t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=null===(n=i.workList)||void 0===n?void 0:n.myshixun_identifier,e.next=3,(0,Qe.Fr)({id:t});case 3:e.sent&&(m.ZP.info("已清空本实训的学习记录\n\n请点击“开启挑战”重做课程实验"),c({type:"shixunHomeworks/getWorkList",payload:P}));case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},ee=function e(n){var t,i;n=null!==(t=n)&&void 0!==t&&t.includes(".json")?n:"".concat(n,".json"),h.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,k.jsx)("div",{className:"tc font16",children:"实训已经更新了,正在为您重置!"}),onOk:(i=l()(a()().mark((function t(){var i,o;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,en.$Q)({url:n});case 2:if(i=t.sent){t.next=5;break}return t.abrupt("return");case 5:return m.ZP.success("重置成功,正在进入实践项目!"),t.next=8,(0,en.Ir)({id:i.shixun_identifier});case 8:if(null==(o=t.sent)||!o.game_identifier){t.next=12;break}return(0,b.xg)("/tasks/".concat(o.game_identifier,"?coursesId=").concat(j.coursesId)),t.abrupt("return");case 12:2===(null==o?void 0:o.status)?e(null==o?void 0:o.message):3===(null==o?void 0:o.status)&&te(null==o?void 0:o.message);case 13:case"end":return t.stop()}}),t)}))),function(){return i.apply(this,arguments)})})},te=function(e){h.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,k.jsxs)("div",{className:"tc font16",children:["目前该实践项目尚在内测中,将于",e,"之后开放,谢谢!"]})})},ie=function(){var e=l()(a()().mark((function e(n){var t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!==(t=n)&&void 0!==t&&t.includes(".json")?n:"".concat(n,".json"),e.next=3,(0,en.$Q)({url:n});case 3:if(i=e.sent,console.log(i,"execRes"),null==i||!i.game_identifier){e.next=8;break}return(0,b.xg)("/tasks/".concat(i.game_identifier,"?coursesId=").concat(j.coursesId)),e.abrupt("return");case 8:-3===(null==i?void 0:i.status)?(0,b.eF)():2===(null==i?void 0:i.status)?ee(null==i?void 0:i.message):3===(null==i?void 0:i.status)&&te(null==i?void 0:i.message);case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),oe=[(0,H.dE)()&&{name:"题目",id:"1",compontent:(0,k.jsx)(ne,{})},{name:(0,H.GJ)()?"作业列表":"作业情况",id:"0",compontent:(0,k.jsx)(Y.Z,{setExportParams:I}),forceRender:!0},!(0,H.dE)()&&{name:"题目",id:"1",compontent:(0,k.jsx)(ne,{})},{name:"排名",id:"5",compontent:(0,k.jsx)(ln,{})},{name:"代码查重",id:"2",compontent:(0,k.jsx)(le,{})},{name:"重做记录",id:"9",compontent:(0,k.jsx)(pn.Z,{})},{name:"设置",id:"3",compontent:null!==(n=E.homework_status)&&void 0!==n&&n.includes("导入")?(0,k.jsx)(dn.Z,{}):(0,k.jsx)(Fe,{}),forceRender:!0},{name:"解答&讨论",id:"6",compontent:(0,k.jsx)(fn.default,{})}].filter((function(e){return!!e})).filter((function(e){var n,t;return(0,H.dE)()?"代码查重"!==e.name&&"设置"!==e.name:(0,H.dE)()||"已截止"!==(null==E||null===(n=E.homework_status)||void 0===n?void 0:n[0])?"质量检测"!==e.name:!E.code_review&&"未发布"!==(null==E||null===(t=E.homework_status)||void 0===t?void 0:t[0])||"代码查重"!==e.name})).filter((function(e){return!!E.open_code_quality_analysis||"质量检测"!==e.name})).filter((function(e){var n;return null===(n=E.homework_status)||void 0===n||!n.includes("导入")||((0,H.dE)()?["0","1"].includes(e.id):["0","1","3"].includes(e.id))}));return(0,k.jsxs)("section",{children:[(0,k.jsxs)("div",{className:"edu-container",children:[E.homework_name&&(0,k.jsxs)("section",{className:"animated fadeIn",children:[(0,k.jsx)("aside",{className:"mt10",children:E.category&&(0,k.jsxs)(v.Z,{separator:">",children:[(0,k.jsx)(v.Z.Item,{children:(0,k.jsx)(f.Link,{to:"/classrooms/".concat(null==j?void 0:j.coursesId,"/program_homework"),children:E.course_name})}),(0,k.jsx)(v.Z.Item,{children:(0,k.jsx)(f.Link,{to:"/classrooms/".concat(null==j?void 0:j.coursesId,"/program_homework/").concat(E.category.main?"":E.category.category_id),children:E.category.category_name})}),(0,k.jsx)(v.Z.Item,{children:"作业详情"})]})}),(0,k.jsxs)("aside",{className:[$e.Z.title,"mt20"].join(" "),children:[(0,k.jsx)(f.Link,{to:"/classrooms/".concat(E.course_id,"/program_homework/").concat(E.category.main?"":E.category.category_id),children:(0,k.jsx)(y.Z,{className:"font16 c-black"})}),(0,k.jsx)(x.Z,{title:E.homework_name,placement:"bottom",children:(0,k.jsx)("strong",{className:"font20 ml5",children:E.homework_name})}),(0,k.jsx)(b.VV,{temporary:!0,status:E.homework_status})]})]}),(0,k.jsx)("aside",{className:"mt30 relative ".concat($e.Z.workListTabWrap),children:(0,k.jsx)(w.Z,{type:"card",defaultActiveKey:C,activeKey:C,tabBarExtraContent:null!==(t=E.homework_status)&&void 0!==t&&t.includes("导入")&&(0,H.GJ)()?(0,k.jsx)(g.ZP,{icon:(0,k.jsx)("span",{className:"iconfont icon-shixun3 translateY1"}),onClick:function(){c({type:"classroomList/setActionTabs",payload:{key:"补充成绩",name:null==E?void 0:E.homework_name,id:null==E?void 0:E.homework_id,type:"hack"}})},type:"primary",children:"补充成绩"}):(0,k.jsxs)("aside",{className:$e.Z.workListTabButton,children:[(0,H.dE)()&&!(null!==(G=E.homework_status)&&void 0!==G&&G.includes("导入"))&&(0,k.jsx)("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"},children:(0,k.jsxs)(g.ZP,{onClick:l()(a()().mark((function e(){var n,t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/problems/".concat(null===(n=i.workList)||void 0===n?void 0:n.start_identifier,"/start.json"),{method:"get"});case 2:(t=e.sent)&&(window.open("/myproblems/".concat(null==t?void 0:t.identifier,"?type=1&backUrl=/classrooms/").concat(j.coursesId,"/program_homework/").concat(j.categoryId,"/detail?tabs=1")),localStorage.setItem("program_homework",[null==j?void 0:j.coursesId,null==j?void 0:j.categoryId]));case 4:case"end":return e.stop()}}),e)}))),type:"primary",children:[null!==(W=E.homework_status)&&void 0!==W&&W.includes("已截止")?"查看作业":"进入练习"," "]})}),(0,H.dE)()&&(null===(F=i.workList)||void 0===F?void 0:F.redo_work)&&(0,k.jsx)(g.ZP,{onClick:$,type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-dahuizhongzuo3x"}),children:"重做"}),(null===(U=i.workList)||void 0===U?void 0:U.shixun_status)>1&&(null===(V=i.workList)||void 0===V?void 0:V.time_status)<5&&(0,H.dE)()&&(0,k.jsx)(g.ZP,{type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var e,n,t;(0,Ze.tJ)(c,!0)&&(null!==(e=i.workList)&&void 0!==e&&null!==(e=e.task_operation)&&void 0!==e&&null!==(e=e[1])&&void 0!==e&&e.includes("/")?ie(null===(n=i.workList)||void 0===n||null===(n=n.task_operation)||void 0===n?void 0:n[1]):(0,b.xg)("/tasks/".concat(null===(t=i.workList)||void 0===t||null===(t=t.task_operation)||void 0===t?void 0:t[1])))},children:null===(q=i.workList)||void 0===q||null===(q=q.task_operation)||void 0===q?void 0:q[0]}),(null===(Q=i.workList)||void 0===Q?void 0:Q.commit_des)&&(null===(J=i.workList)||void 0===J?void 0:J.commit_des)&&(0,k.jsx)(g.ZP,{type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var e;(0,b.xg)("/classrooms/".concat(j.coursesId,"/shixun_homework/").concat(j.categoryId,"/").concat(null===(e=i.workList)||void 0===e?void 0:e.id,"/commitsummary"))},children:null===(K=i.workList)||void 0===K?void 0:K.commit_des}),(null==O?void 0:O.hack_edit_permission)&&"未发布"===(null==E||null===(X=E.homework_status)||void 0===X?void 0:X[0])&&(0,k.jsx)(g.ZP,{type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-bianji2"}),onClick:function(){var e;null!==(e=r.AssistantObject.hack)&&void 0!==e&&e.can_create||!(0,H.Rm)()?f.history.push("/classrooms/".concat(j.coursesId,"/program_homework/").concat(j.categoryId,"/edit")):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"编辑作业"}),(0,H.GJ)()&&E.publish_immediately&&(0,k.jsx)(g.ZP,{type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){var e,n;null!==(e=r.AssistantObject.hack)&&void 0!==e&&e.can_publish||!(0,H.Rm)()?2!==(null==s||null===(n=s.userInfo)||void 0===n?void 0:n.user_status)?c({type:"classroomList/setActionTabs",payload:{key:"立即发布",selectArrs:[j.categoryId],selectArrsAll:[E],params:j,detail:!0,type:2,manage_all_group:null==O?void 0:O.manage_all_group}}):(0,Ze.Rd)():m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"立即发布"}),(0,H.GJ)()&&E.end_immediately&&(0,k.jsx)(g.ZP,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){var e;null!==(e=r.AssistantObject.hack)&&void 0!==e&&e.can_stop||!(0,H.Rm)()?c({type:"classroomList/setActionTabs",payload:{key:"立即截止",params:j,type:2,detail:!0,selectArrs:[j.categoryId]}}):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"立即截止"})]}),onChange:function(e){var n;"5"!==e||null!==(n=r.AssistantObject.hack)&&void 0!==n&&n.can_exam_leaderboard||!(0,H.Rm)()?(T(e),"0"===e&&c({type:"shixunHomeworks/getWorkList",payload:j})):m.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:oe.map((function(e,n){return(0,k.jsx)(w.Z.TabPane,{tab:e.name,forceRender:e.forceRender,children:e.compontent},e.id)}))})})]}),(0,k.jsx)(Je,{}),(0,k.jsx)(Ke.Z,{courseEndTime:null==E?void 0:E.course_end_date,successCallback:function(){c({type:"shixunHomeworks/getWorkList",payload:o()({},j)})},visible:"立即截止"===r.actionTabs.key,homeworkIds:[j.categoryId],courseId:j.coursesId,isBatch:!1}),(0,k.jsx)(Xe.Z,{courseEndTime:null==E?void 0:E.course_end_date}),(0,k.jsx)(cn.Z,{onOk:function(){c({type:"shixunHomeworks/getWorkList",payload:o()({},j)})}}),(0,k.jsx)(un.Z,{onOk:function(){c({type:"shixunHomeworks/getWorkList",payload:o()({},j)})}}),(0,k.jsxs)(h.Z,{open:z,title:"规则说明",width:800,footer:null,onCancel:function(){R(!1)},children:[(0,k.jsx)("p",{children:"一、等级规则"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"1. 缺陷等级"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:(0,k.jsx)(_.Z,{dataSource:mn,columns:[{title:"等级",dataIndex:"live"},{title:"缺陷评估规则",dataIndex:"gz"},{title:"漏洞评估规则",dataIndex:"ld"},{title:"代码规范评估规则",dataIndex:"gf"}],pagination:!1})}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"注:代码规范评估规则中数值来源为计算技术债务时间占开发所有代码所需要的时间的比例(Technical Debt Ratio)"}),(0,k.jsx)("p",{style:{marginLeft:"20px"},children:"Technical Debt Ratio = 技术债务时间 / 开发时间"}),(0,k.jsx)("p",{style:{marginLeft:"20px"},children:"技术债务时间为修复所有问题所需要的时间。"}),(0,k.jsx)("p",{children:"二、复杂度规则"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"根据代码路径数计算的数值,每当一个函数的控制流分叉时,复杂度计数器就会自增一。"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"每个程序语言的关键字对应的复杂度数据不同,但每个函数的最小复杂度为1。(特定语言的详细数据略)"}),(0,k.jsx)("p",{children:"三、代码质量分规则"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"代码质量分 = 0.5*缺陷分数 + 0.3*漏洞分数 + 0.2*代码规范性分数"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"其中:"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"缺陷/漏洞/代码规范性分数计算规则为:100 - 100 *((100*崩溃数 + 5*严重数 + 3*主要数 + 1*次数)/ 代码行数)"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"注:分数为空的代表不支持的文件格式。"})]})]})}))},38277:function(e,n,t){"use strict";var i=t(7557),o=t.n(i),r=t(85573),a=t.n(r),s=t(41498),l=t.n(s),c=t(82242),u=t.n(c),d=t(37205),p=t.n(d),f=t(79800),m=t.n(f),h=t(39647),g=t.n(h),v=t(59301),x=t(78241),w=t(8591),_=t(43418),y=t(95237),b=t(5112),j=t(94001),k=t(43604),S=t(57930),N=t(24905),M=t(61186),L=t.n(M),C=t(52774),T=t(32215),Z=t(65327),A=t(97682),P=t(23448),I=t(69597),E=t(73244),O=t(37712),B=["classroomList","dispatch","courseEndTime","onWindowBack"];n.Z=(0,A.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){var n,t,i,r,s,c,d,f,h,M,D,z=e.classroomList,H=e.dispatch,R=e.courseEndTime,G=e.onWindowBack,W=g()(e,B),F=(0,A.useParams)(),Y=x.Z.useForm(),U=m()(Y,1)[0],V=(0,v.useState)(1),q=m()(V,2),Q=q[0],J=q[1],K=(0,v.useState)([]),X=m()(K,2),$=X[0],ee=X[1],ne=(0,v.useState)(0),te=m()(ne,2),ie=(te[0],te[1]),oe=(0,v.useState)(2e3),re=m()(oe,2),ae=(re[0],re[1],(0,v.useState)(!0)),se=m()(ae,2),le=(se[0],se[1]),ce=(0,v.useState)(!1),ue=m()(ce,2),de=ue[0],pe=(ue[1],(0,v.useState)(!1)),fe=m()(pe,2),me=fe[0],he=(fe[1],(0,v.useState)([])),ge=m()(he,2),ve=ge[0],xe=ge[1],we=(0,v.useState)(!0),_e=m()(we,2),ye=_e[0],be=_e[1],je=(0,v.useState)(!(null!==(n=z.actionTabs)&&void 0!==n&&null!==(n=n.selectArrsAll)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.send_type)),ke=m()(je,2),Se=ke[0],Ne=ke[1],Me=(0,v.useState)([0,0,0]),Le=m()(Me,2),Ce=Le[0],Te=Le[1];(0,v.useEffect)((function(){if("立即发布"===z.actionTabs.key){var e,n,t,i;if(Ie(),null!==(e=z.actionTabs)&&void 0!==e&&null!==(e=e.selectArrsAll)&&void 0!==e&&null!==(e=e[0])&&void 0!==e&&e.can_publish)Te(p()(null===(t=z.actionTabs)||void 0===t||null===(t=t.selectArrsAll)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.difficult_count));else Te(p()(null===(i=z.actionTabs)||void 0===i||null===(i=i.selectArrsAll)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.difficult_settings));if(Ne(!(null!==(n=z.actionTabs)&&void 0!==n&&null!==(n=n.selectArrsAll)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.send_type)),Ze(),2===z.actionTabs.type){var o,r=null===(o=z.actionTabs.selectArrsAll)||void 0===o?void 0:o[0];be(r.unified_setting)}else be(!1)}}),[z.actionTabs]),(0,v.useEffect)((function(){if(de){if(me)return;H({type:"classroomList/setActionTabs",payload:{}}),(0,T.GJ)()?(H({type:"classroomList/getClassroomTeacherCommonList",payload:u()(u()({},z.actionTabs.params),{},{type:1})}),H({type:"shixunHomeworks/getWorkList",payload:u()({},F)})):H({type:"classroomList/getClassroomCommonList",payload:u()({},z.actionTabs.params)})}}),[de]);var Ze=function(){var e=l()(o()().mark((function e(n){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,(0,I.c_)(u()(u()({},F),{},{page:n||Q,limit:2e4,homework_id:1===z.actionTabs.type?"":z.actionTabs.selectArrs[0]}));case 3:null==(t=e.sent)||t.course_groups.map((function(e,n){e.key=e.id,e.title=e.name,e.disabled=e.is_published})),t&&(ee(p()(null==t?void 0:t.course_groups)),ie(null==t?void 0:t.course_groups_count),le(!1),n||U.setFieldsValue(a()(a()({},"publish_time",L()(L()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),"end_time",L()(L()(new Date((0,Z.qd)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm")))));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Ae=function(){(0,T.GJ)()?z.actionTabs.detail?(H({type:"shixunHomeworks/setActionTabs",payload:{}}),H({type:"shixunHomeworks/getWorkList",payload:u()({},F)}),H({type:"shixunHomeworks/getWorkSetting",payload:u()({},F)})):H({type:"classroomList/getClassroomTeacherCommonList",payload:u()(u()({},z.actionTabs.params),{},{type:5,category:z.actionTabs.params.categoryId})}):H({type:"classroomList/getClassroomCommonList",payload:u()({},z.actionTabs.params)})},Pe=function(){var e=l()(o()().mark((function e(){var n,t,i,r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,T.Rm)()||null!==(n=z.AssistantObject.hack)&&void 0!==n&&n.can_publish){e.next=4;break}return w.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),De(!1),e.abrupt("return");case 4:if(!((i=u()({},U.getFieldsValue())).end_time<=i.publish_time)){e.next=9;break}return w.ZP.info("截止时间不能大于或等于发布时间"),De(!1),e.abrupt("return");case 9:if(!((null==ve?void 0:ve.length)<=0&&!ye&&$.length>0)){e.next=13;break}return w.ZP.info("发布班级不能为空"),De(!1),e.abrupt("return");case 13:if(0!==Ce.reduce((function(e,n){return e+n}))||Se){e.next=17;break}return w.ZP.info("简单适中困难题数相加不能为0"),De(!1),e.abrupt("return");case 17:return r={homework_ids:p()(z.actionTabs.selectArrs),group_ids:ve.length>0?ve.map((function(e){return e.id})):null===(t=z.detailCommonHomeworksList)||void 0===t?void 0:t.course_groups,end_time:L()(i.end_time).format("YYYY-MM-DD HH:mm"),publish_time:L()(i.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:null==Ce?void 0:Ce.map((function(e){return e})),send_type:Se?"0":"1",unified_setting:!ve.length},De(!0),e.next=21,(0,C.ZP)("/api/courses/".concat(F.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:u()({},r)});case 21:if(0!==e.sent.status){e.next=35;break}if(De(!1),(0,Z.L9)(["教学课堂","图文作业","立即发布"]),w.ZP.success("发布成功"),H({type:"classroomList/setActionTabs",payload:{key:"清除选择数据"}}),!G){e.next=30;break}return G(),e.abrupt("return");case 30:W.onCallback&&W.onCallback(),Ae(),"0"===localStorage.getItem("Noviceguide")||H({type:"shixunHomeworks/setActionTabs",payload:{key:"底部弹窗",type:13,text:(0,O.jsx)("div",{children:"最后,咱们给教学课堂添加一名学生~点击“添加学生”,在弹窗页面中输入并搜索学生姓名,点击“确定”就可以为您的课堂添加第一位学生啦~"})}}),e.next=36;break;case 35:De(!1);case 36:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ie=function(){J(1),ee([]),xe([])},Ee=(0,v.useState)(!1),Oe=m()(Ee,2),Be=Oe[0],De=Oe[1];return(0,O.jsxs)(_.Z,{width:600,confirmLoading:Be,centered:!0,title:"发布作业",open:"立即发布"===z.actionTabs.key,okText:"发布作业",cancelText:"暂不发布",onOk:Pe,onCancel:function(){Ie(),H({type:"classroomList/setActionTabs",payload:{}}),G?G():Ae()},children:[(0,O.jsxs)("p",{className:"tc",children:["学生将立即收到作业",(0,O.jsx)("br",{}),'本操作只对"未发布"的作业有效']}),$&&(0,O.jsxs)(x.Z,{form:U,children:[(0,O.jsxs)("div",{style:{paddingLeft:0},children:[2===z.actionTabs.type&&(0,O.jsxs)(y.Z,{style:{marginBottom:"10px"},children:[(0,O.jsx)("span",{className:"mr5",children:"试题发送:"}),(0,O.jsxs)(b.ZP.Group,{value:Se,disabled:!(null!==(t=z.actionTabs)&&void 0!==t&&null!==(t=t.selectArrsAll)&&void 0!==t&&null!==(t=t[0])&&void 0!==t&&t.can_publish),onChange:function(e){Ne(e.target.value)},children:[(0,O.jsx)(b.ZP,{value:!0,children:"全部固定试题"}),(0,O.jsx)(b.ZP,{className:"ml20",value:!1,children:"随机抽取"})]})]}),!Se&&(0,O.jsxs)(y.Z,{style:{marginBottom:"10px"},children:[(0,O.jsx)("span",{style:{marginRight:65}}),(0,O.jsxs)("span",{children:["简单题数 ",(0,O.jsx)(j.Z,{value:Ce[0],onChange:function(e){Ce[0]=e,Te(p()(Ce))},min:0,disabled:!(null!==(i=z.actionTabs)&&void 0!==i&&null!==(i=i.selectArrsAll)&&void 0!==i&&null!==(i=i[0])&&void 0!==i&&i.can_publish),placeholder:"最大".concat(null===(r=z.actionTabs)||void 0===r||null===(r=r.selectArrsAll)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.difficult_count)||void 0===r?void 0:r[0]),max:null===(s=z.actionTabs)||void 0===s||null===(s=s.selectArrsAll)||void 0===s||null===(s=s[0])||void 0===s||null===(s=s.difficult_count)||void 0===s?void 0:s[0],style:{width:60}})]}),(0,O.jsxs)("span",{style:{margin:"0px 40px"},children:["适中题数 ",(0,O.jsx)(j.Z,{value:Ce[1],onChange:function(e){Ce[1]=e,Te(p()(Ce))},min:0,disabled:!(null!==(c=z.actionTabs)&&void 0!==c&&null!==(c=c.selectArrsAll)&&void 0!==c&&null!==(c=c[0])&&void 0!==c&&c.can_publish),max:null===(d=z.actionTabs)||void 0===d||null===(d=d.selectArrsAll)||void 0===d||null===(d=d[0])||void 0===d||null===(d=d.difficult_count)||void 0===d?void 0:d[1],placeholder:"最大".concat(null===(f=z.actionTabs)||void 0===f||null===(f=f.selectArrsAll)||void 0===f||null===(f=f[0])||void 0===f||null===(f=f.difficult_count)||void 0===f?void 0:f[1]),style:{width:60}})]}),(0,O.jsxs)("span",{children:["困难题数 ",(0,O.jsx)(j.Z,{value:Ce[2],onChange:function(e){Ce[2]=e,Te(p()(Ce))},min:0,disabled:!(null!==(h=z.actionTabs)&&void 0!==h&&null!==(h=h.selectArrsAll)&&void 0!==h&&null!==(h=h[0])&&void 0!==h&&h.can_publish),placeholder:"最大".concat(null===(M=z.actionTabs)||void 0===M||null===(M=M.selectArrsAll)||void 0===M||null===(M=M[0])||void 0===M||null===(M=M.difficult_count)||void 0===M?void 0:M[2]),max:null===(D=z.actionTabs)||void 0===D||null===(D=D.selectArrsAll)||void 0===D||null===(D=D[0])||void 0===D||null===(D=D.difficult_count)||void 0===D?void 0:D[2],style:{width:60}})]})]}),(0,O.jsxs)(y.Z,{className:"mt30",align:"middle",children:[(0,O.jsx)(k.Z,{children:(0,O.jsx)(x.Z.Item,{name:"publish_time",label:"发布时间",children:(0,O.jsx)(S.default,{style:{width:170,marginRight:"25px"},disabledDate:function(e){return(0,E.Q8)(e,R)},disabledTime:function(e){return(0,E.d0)(e)},placeholder:"请选择发布时间",showTime:{format:"HH:mm",defaultValue:L()((0,Z.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1})})}),(0,O.jsx)(k.Z,{className:"ml20",children:(0,O.jsx)(x.Z.Item,{name:"end_time",label:"截止时间",children:(0,O.jsx)(S.default,{style:{width:170},placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:L()((0,Z.U6)(),"HH:mm")},disabledDate:function(e){return(0,E.Q8)(e,R,U.getFieldValue("publish_time"))},disabledTime:function(e){return(0,E.d0)(e,U.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})})})]}),2===z.actionTabs.type&&(0,O.jsxs)(y.Z,{style:{marginBottom:"10px"},children:[(0,O.jsx)("span",{className:"mr5",children:"发布设置:"}),(0,O.jsxs)(b.ZP.Group,{value:ye,onChange:function(e){be(e.target.value),xe([])},children:[(0,O.jsx)(b.ZP,{value:!0,disabled:!z.actionTabs.manage_all_group,children:"统一发布"}),(0,O.jsx)(b.ZP,{className:"ml20",disabled:$.length<=0,value:!1,children:"分班发布"})]})]}),$.length<=0&&2===z.actionTabs.type&&(0,O.jsx)("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"},children:'课堂无分班,仅支持选择“统一发布"'})]}),(1===z.actionTabs.type||!ye)&&$.length>0&&(0,O.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"},children:[(0,O.jsxs)("span",{style:{flex:1},children:[(0,O.jsx)(N.Z,{checked:ve.length===$.length,onChange:function(e){ve.length===$.length?xe([]):xe($.filter((function(e){return!e.is_published})))},children:"全选"})," "]}),(0,O.jsx)("span",{style:{width:16}}),(0,O.jsxs)("span",{style:{flex:1},children:["已选择",ve.length||0,"个分班"]})]}),(1===z.actionTabs.type||!ye)&&$.length>0&&(0,O.jsx)(P.Z,{data:$,selectedRowKeys:ve,setSelectedRowKeys:xe})]})]})}))},46529:function(e,n,t){"use strict";var i=t(7557),o=t.n(i),r=t(41498),a=t.n(r),s=t(79800),l=t.n(s),c=t(70236),u=t.n(c),d=t(59301),p=t(59028),f=t(78241),m=t(99313),h=t(61998),g=t(27092),v=t(97682),x=t(52774),w=t(61186),_=t.n(w),y=t(37712);p.Z.Dragger;n.Z=(0,v.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){u()(e);var n=(0,v.useParams)(),t=f.Z.useForm(),i=(l()(t,1)[0],(0,d.useState)(!0)),r=l()(i,2),s=r[0],c=r[1],p=(0,d.useState)(!1),w=l()(p,2),b=w[0],j=w[1],k=(0,d.useState)({type:window.location.href.indexOf("program_homework")>-1?2:1,limit:10,page:1}),S=l()(k,2),N=S[0],M=S[1],L=[{name:"全部",value:"",question_type:0},{name:"单选题",value:"SINGLE",question_type:0},{name:"多选题",value:"MULTIPLE",question_type:1},{name:"判断题",value:"JUDGMENT",question_type:2},{name:"填空题",value:"COMPLETION",question_type:3},{name:"简答题",value:"SUBJECTIVE",question_type:4},{name:"实训题",value:"SHIXUN",question_type:5},{name:"编程题",value:"PROGRAM",question_type:6},{name:"组合题",value:"COMBINATION",question_type:7},{name:"程序填空题",value:"BPROGRAM",question_type:8}];function C(){return T.apply(this,arguments)}function T(){return(T=a()(o()().mark((function e(){var t,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(!0),t=window.location.href.indexOf("exercise")>-1?"/api/exercises/".concat(null==n?void 0:n.categoryId,"/redo_logs.json"):"/api/homework_commons/".concat(null==n?void 0:n.categoryId,"/redo_logs.json"),e.next=4,(0,x.ZP)(t,{method:"get",params:N});case 4:i=e.sent,j(!1),0===(null==i?void 0:i.status)&&c(null==i?void 0:i.data);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,d.useEffect)((function(){C()}),[]);var Z=[{title:"姓名",dataIndex:"user_name"},{title:"学号",dataIndex:"student_id"},{title:"班级",dataIndex:"course_group_name"},window.location.href.indexOf("exercise")>-1&&{title:"题型",dataIndex:"question_type",render:function(e,n,t){var i;return null===(i=L.find((function(n){return n.question_type===e})))||void 0===i?void 0:i.name}},window.location.href.indexOf("exercise")>-1&&{title:"试题名称",dataIndex:"question_name"},window.location.href.indexOf("exercise")>-1&&{title:"关卡名称",dataIndex:"challenge_name"},window.location.href.indexOf("exercise")<=-1&&{title:"任务名称",dataIndex:"task_name",width:"40%"},{title:"操作",dataIndex:"redo_type",render:function(e,n,t){var i;return null===(i=[{id:1,name:"打回重做"},{id:2,name:"恢复初始代码"},{id:3,name:"重置代码仓库"}].find((function(n){return n.id===e})))||void 0===i?void 0:i.name}},{title:"恢复初始代码时间",dataIndex:"created_at",render:function(e,n,t){return _()(e).format("YYYY-MM-DD HH:mm:ss")}}].filter((function(e){return!!e}));return(0,y.jsxs)("div",{style:{padding:"0px 30px",background:"#fff",paddingBottom:30},children:[(0,y.jsx)(m.Z,{destroyInactiveTabPane:!0,onChange:function(e){N.type=e,N.page=1,N.limit=10,M(N),C()},items:[window.location.href.indexOf("program_homework")<=-1&&{key:"1",label:"打回重做",children:(0,y.jsx)(h.Z,{className:"mt20",loading:b,columns:[{title:"姓名",dataIndex:"user_name"},{title:"学号",dataIndex:"student_id"},{title:"班级",dataIndex:"course_group_name"},{title:"打回重做时间",dataIndex:"created_at",render:function(e,n,t){return _()(e).format("YYYY-MM-DD HH:mm:ss")}},{title:"操作人",dataIndex:"operator"}],dataSource:null==s?void 0:s.list,pagination:!1})},{key:"2",label:"重置代码",children:(0,y.jsx)(h.Z,{className:"mt20",loading:b,columns:Z,dataSource:null==s?void 0:s.list,pagination:!1})}].filter((function(e){return!!e}))}),(0,y.jsx)(g.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:function(e,n){N.page=e,N.limit=n,M(N),C()},current:N.page,total:s.count,pageSize:N.limit,style:{marginTop:20}})]})}))},23448:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var i=t(7557),o=t.n(i),r=t(41498),a=t.n(r),s=t(79800),l=t.n(s),c=t(59301),u=t(92832),d=t(24905),p=t(95237),f="leftdiv___aBzsX",m="listClass___bxIEW",h="spantitle___v_Vc4",g="rightdiv___xWu4M",v=t(94398),x=t(37712),w=function(e){var n=e.data,t=(e.value,e.handleChangePage,e.setSelectedRowKeys),i=e.selectedRowKeys,r=(e.onChange,(0,c.useState)([])),s=l()(r,2),w=s[0],_=s[1],y=(0,c.useState)([]),b=l()(y,2),j=b[0],k=b[1],S=(0,c.useState)([]),N=l()(S,2),M=N[0],L=N[1],C=(0,c.useState)(1),T=l()(C,2),Z=(T[0],T[1],(0,c.useState)()),A=l()(Z,2);A[0],A[1];return(0,c.useEffect)((function(){_(n),k([]),L([])}),[n]),(0,c.useEffect)((function(){t&&(k(i),L(i))}),[i]),(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,x.jsxs)("div",{className:f,children:[(0,x.jsx)(u.Z.Search,{size:"middle",onChange:function(){var e=a()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_(n.filter((function(e){var n;return null==e||null===(n=e.name)||void 0===n?void 0:n.includes(t.target.value)})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),placeholder:"可输入班级名称查询"}),0===w.length&&(0,x.jsx)(v.Z,{styles:{margin:"70px auto"},customText:"暂无分班"}),(0,x.jsx)("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"},children:(0,x.jsx)(d.Z.Group,{value:j.map((function(e){return"".concat(e.id)})),onChange:function(e){t(w.filter((function(n){return e.includes("".concat(n.id))})))},style:{marginTop:"10px",flexDirection:"column"},children:w.map((function(e,n){return(0,x.jsx)(p.Z,{style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200},children:(0,x.jsx)(d.Z,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:e.is_published,value:"".concat(e.id),children:(0,x.jsxs)("div",{className:m,children:[(0,x.jsx)("span",{className:h,style:{width:e.is_published?"108px":"170px"},children:e.name}),e.is_published&&(0,x.jsx)("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"},children:"已发布"})]})})},e.id)}))})})]}),(0,x.jsxs)("div",{className:g,children:[(0,x.jsx)(u.Z.Search,{onChange:function(e){L(j.filter((function(n){return n.name.includes(e.target.value)})))},size:"middle",placeholder:"可输入班级名称查询"}),0===M.length&&(0,x.jsx)(v.Z,{styles:{margin:"70px auto"},customText:"暂未选择分班"}),M.length>0&&(0,x.jsx)("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"},children:(0,x.jsx)("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0},children:M.map((function(e,n){return(0,x.jsxs)(p.Z,{justify:"space-between",style:{marginTop:"10px"},children:[(0,x.jsx)("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"},children:e.name}),(0,x.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC",style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){t(j.filter((function(n){return"".concat(n.id)!="".concat(e.id)})))}})]},e.id)}))})})]})]})}},62378:function(e,n,t){"use strict";t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0Y3QjUwMCIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptMSAzSDYuMzk1YTMuNTAxIDMuNTAxIDAgMCAxLS44NTcgMS4yNDVjLS4zMi4yOTQtLjc1Mi41NTEtMS4yOTcuNzcyTDQgOS4xMDlWMTAuOWMuNDQ4LS4xNTQuODItLjMxNSAxLjExNy0uNDgzLjIyMi0uMTI2LjQ1LS4yODIuNjg1LS40NjZsLjIzNi0uMTk0VjE1SDhWN1pNNC44MTIgMGMuMTc1IDAgLjM1LjE2LjQzOC4zMThsMS4zMTMgMi4zMDlzLTIuOC4xNi00LjQ2MyAxLjY3MkwuMDg4LjcxNkMwIC42MzYgMCAuNTU3IDAgLjQ3OCAwIC4xNTkuMjYzIDAgLjUyNSAwWm04LjY2MyAwYy4yNjMgMCAuNTI1LjIzOS41MjUuNDc4IDAgLjA4IDAgLjE1OS0uMDg4LjIzOEwxMS45IDQuMjJjLTEuNjYyLTEuNDMzLTQuNDYzLTEuNTkyLTQuNDYzLTEuNTkyTDguNzUuMzE4QzguNzUuMTYgOC45MjUgMCA5LjE4OCAwWiIvPjwvc3ZnPg=="},79549:function(e,n,t){"use strict";t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0I5QzRDRiIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptLjA1IDNjLS42NzUgMC0xLjIwMy4wOTItMS41ODQuMjc2YTIuMDU2IDIuMDU2IDAgMCAwLS44ODcuNzk0Yy0uMTguMjk2LS4zMS42OTEtLjM5NCAxLjE4NmwtLjAzOC4yNTUgMi4wMDQuMTc3Yy4wNTUtLjQ0My4xNjQtLjc1My4zMjYtLjkyOGEuODE0LjgxNCAwIDAgMSAuNjI2LS4yNjMuODEuODEgMCAwIDEgLjYxMS4yNTVjLjE2Mi4xNy4yNDMuMzc1LjI0My42MTQgMCAuMjIyLS4wODEuNDU2LS4yNDUuNzAzLS4xNjQuMjQ3LS41MzkuNjA4LTEuMTI0IDEuMDg0LS45Ni43NzYtMS42MTMgMS40NS0xLjk2MiAyLjAyYTQuMzYzIDQuMzYzIDAgMCAwLS41ODggMS41NTJMNCAxNWg2di0xLjc4MUg2Ljg3N2MuMTg0LS4xOTcuMzQzLS4zNTYuNDc5LS40NzguMTM2LS4xMjIuNDA1LS4zMzQuODA4LS42MzguNjc3LS41MjMgMS4xNDUtMS4wMDIgMS40MDEtMS40MzguMjU3LS40MzcuMzg2LS44OTUuMzg2LTEuMzc0IDAtLjQ1LS4xMTItLjg1OC0uMzM2LTEuMjJhMi4wNDMgMi4wNDMgMCAwIDAtLjkyNC0uODA4QzguMzAxIDcuMDg4IDcuNzUzIDcgNy4wNSA3Wk00LjgxMiAwYy4xNzUgMCAuMzUuMTYuNDM3LjMxOGwxLjMxMyAyLjMwOXMtMi44LjE2LTQuNDYzIDEuNjcyTC4wODguNzE2QzAgLjYzNiAwIC41NTcgMCAuNDc4IDAgLjE1OS4yNjMgMCAuNTI1IDBabTguNjYyIDBjLjI2MyAwIC41MjUuMjM5LjUyNS40NzggMCAuMDggMCAuMTU5LS4wODguMjM4TDExLjkgNC4yMmMtMS42NjItMS40MzMtNC40NjMtMS41OTItNC40NjMtMS41OTJMOC43NS4zMThDOC43NS4xNiA4LjkyNSAwIDkuMTg4IDBaIi8+PC9zdmc+"},66037:function(e,n,t){"use strict";t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0QwOUYxOCIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptLS4wNjIgM2MtLjgyNiAwLTEuNDY0LjE3Mi0xLjkxNS41MTctLjQuMzA3LS42ODYuNzMzLS44NTYgMS4yNzhsLS4wNTguMjEgMS45MDguMzY0Yy4wNTItLjM4My4xNTMtLjY1MS4zMDItLjgwNGEuNzcyLjc3MiAwIDAgMSAuNTgtLjIzYy4yMyAwIC40MTIuMDcuNTQ0LjIxMS4xMzMuMTQuMTk5LjMzLjE5OS41NjVhLjg4Ljg4IDAgMCAxLS4yNjUuNjM4Ljg5Ljg5IDAgMCAxLS42NjIuMjcgMS4zNSAxLjM1IDAgMCAxLS4xNTgtLjAxMmwtLjEwNC0uMDE1LS4xMDUgMS41MzZjLjI3OC0uMDg1LjQ5Ni0uMTI3LjY1NC0uMTI3LjI5OCAwIC41MzMuMDk5LjcwNy4yOTYuMTczLjE5Ny4yNi40NzUuMjYuODMzIDAgLjM1Mi0uMDkuNjM0LS4yNy44NDVhLjg1Mi44NTIgMCAwIDEtLjY3Ny4zMTYuODYyLjg2MiAwIDAgMS0uNjM2LS4yNWMtLjE0My0uMTQ0LS4yNTQtLjM4NC0uMzMzLS43MjNsLS4wMzYtLjE3N0w0IDEyLjgyNmMuMTMyLjQ4Mi4zMjEuODgyLjU2NyAxLjIuMjQ2LjMxOS41Ni41Ni45NDIuNzI2LjM4MS4xNjUuOTAyLjI0OCAxLjU2My4yNDguNjc3IDAgMS4yMjQtLjExMiAxLjY0LS4zMzUuNDE2LS4yMjMuNzM1LS41NDIuOTU2LS45NTUuMjIxLS40MTQuMzMyLS44NDUuMzMyLTEuMjk2IDAtLjM1OS0uMDY3LS42NjctLjItLjkyNmExLjYzMyAxLjYzMyAwIDAgMC0uNTYzLS42MjVjLS4xNDktLjA5OS0uMzYzLS4xODUtLjY0NC0uMjU5LjM0Ny0uMjA0LjYwNi0uNDQxLjc3OC0uNzEyYTEuNjYgMS42NiAwIDAgMCAuMjU3LS45MDggMS44MiAxLjgyIDAgMCAwLS42MzQtMS40MkM4LjU3MSA3LjE4OSA3Ljg4NiA3IDYuOTM4IDdaTTQuODEzIDBjLjE3NSAwIC4zNS4xNy40MzcuMzM4bDEuMzEzIDIuNDUzcy0yLjguMTctNC40NjMgMS43NzZMLjA4OC43NjFDMCAuNjc3IDAgLjU5MiAwIC41MDcgMCAuMTcuMjYzIDAgLjUyNSAwWm04LjY2MiAwYy4yNjMgMCAuNTI1LjI1NC41MjUuNTA3IDAgLjA4NSAwIC4xNy0uMDg4LjI1NEwxMS45IDQuNDgzQzEwLjIzOCAyLjk2IDcuNDM3IDIuNzkgNy40MzcgMi43OUw4Ljc1LjMzOEM4Ljc1LjE3IDguOTI1IDAgOS4xODggMFoiLz48L3N2Zz4="},23178:function(e,n){"use strict";n.Z={flex_box_center:"flex_box_center___oaxfO",flex_space_between:"flex_space_between___NQ5Gm",flex_box_vertical_center:"flex_box_vertical_center___UGzY9",flex_box_center_end:"flex_box_center_end___SnN1r",flex_box_column:"flex_box_column___c0981",right:"right___sOpmg",title:"title___Nmi5q",titles:"titles___PaouY",tips:"tips___h2FE4"}},51402:function(e,n){"use strict";n.Z={flex_box_center:"flex_box_center___eQ57b",flex_space_between:"flex_space_between___PVjBV",flex_box_vertical_center:"flex_box_vertical_center___ghTL_",flex_box_center_end:"flex_box_center_end___z8oKm",flex_box_column:"flex_box_column___JQV5n",title:"title___w80Ja",workListTabWrap:"workListTabWrap___YRwm7",workListTabButton:"workListTabButton___ebGCB",tables:"tables___AYvHM",checkboxgroup:"checkboxgroup___fZHgL"}},66104:function(e,n,t){"use strict";t.d(n,{Z:function(){return T}});var i=t(92310),o=t.n(i),r=t(75440),a=t(47413),s=t(59301),l=t(92343),c=t(36355),u=t(78386),d=t(91857);const p=e=>{let{children:n}=e;const{getPrefixCls:t}=s.useContext(c.E_),i=t("breadcrumb");return s.createElement("li",{className:`${i}-separator`,"aria-hidden":"true"},""===n?n:n||"/")};p.__ANT_BREADCRUMB_SEPARATOR=!0;var f=p,m=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t};function h(e,n,t,i){if(null==t)return null;const{className:r,onClick:l}=n,c=m(n,["className","onClick"]),u=Object.assign(Object.assign({},(0,a.Z)(c,{data:!0,aria:!0})),{onClick:l});return void 0!==i?s.createElement("a",Object.assign({},u,{className:o()(`${e}-link`,r),href:i}),t):s.createElement("span",Object.assign({},u,{className:o()(`${e}-link`,r)}),t)}function g(e,n){return(t,i,o,r,a)=>{if(n)return n(t,i,o,r);const s=function(e,n){if(void 0===e.title||null===e.title)return null;const t=Object.keys(n).join("|");return"object"==typeof e.title?e.title:String(e.title).replace(new RegExp(`:(${t})`,"g"),((e,t)=>n[t]||e))}(t,i);return h(e,t,s,a)}}var v=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t};const x=e=>{const{prefixCls:n,separator:t="/",children:i,menu:o,overlay:r,dropdownProps:a,href:l}=e;const c=(e=>{if(o||r){const t=Object.assign({},a);if(o){const e=o||{},{items:n}=e,i=v(e,["items"]);t.menu=Object.assign(Object.assign({},i),{items:null==n?void 0:n.map(((e,n)=>{var{key:t,title:i,label:o,path:r}=e,a=v(e,["key","title","label","path"]);let c=null!=o?o:i;return r&&(c=s.createElement("a",{href:`${l}${r}`},c)),Object.assign(Object.assign({},a),{key:null!=t?t:n,label:c})}))})}else r&&(t.overlay=r);return s.createElement(d.Z,Object.assign({placement:"bottom"},t),s.createElement("span",{className:`${n}-overlay-link`},e,s.createElement(u.Z,null)))}return e})(i);return null!=c?s.createElement(s.Fragment,null,s.createElement("li",null,c),t&&s.createElement(f,null,t)):null},w=e=>{const{prefixCls:n,children:t,href:i}=e,o=v(e,["prefixCls","children","href"]),{getPrefixCls:r}=s.useContext(c.E_),a=r("breadcrumb",n);return s.createElement(x,Object.assign({},o,{prefixCls:a}),h(a,o,t,i))};w.__ANT_BREADCRUMB_ITEM=!0;var _=w,y=t(17313),b=t(83116),j=t(37613);const k=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},(0,y.Wf)(e)),{color:e.itemColor,fontSize:e.fontSize,[t]:{fontSize:e.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:e.linkColor,transition:`color ${e.motionDurationMid}`,padding:`0 ${e.paddingXXS}px`,borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",marginInline:-e.marginXXS,"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover}},(0,y.Qy)(e)),"li:last-child":{color:e.lastItemColor},[`${n}-separator`]:{marginInline:e.separatorMargin,color:e.separatorColor},[`${n}-link`]:{[`\n > ${t} + span,\n > ${t} + a\n `]:{marginInlineStart:e.marginXXS}},[`${n}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${t}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover,a:{color:e.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${e.componentCls}-rtl`]:{direction:"rtl"}})}};var S=(0,b.Z)("Breadcrumb",(e=>{const n=(0,j.TS)(e,{});return[k(n)]}),(e=>({itemColor:e.colorTextDescription,lastItemColor:e.colorText,iconFontSize:e.fontSize,linkColor:e.colorTextDescription,linkHoverColor:e.colorText,separatorColor:e.colorTextDescription,separatorMargin:e.marginXS}))),N=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t};function M(e){const{breadcrumbName:n,children:t}=e,i=N(e,["breadcrumbName","children"]),o=Object.assign({title:n},i);return t&&(o.menu={items:t.map((e=>{var{breadcrumbName:n}=e,t=N(e,["breadcrumbName"]);return Object.assign(Object.assign({},t),{title:n})}))}),o}var L=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t};const C=e=>{const{prefixCls:n,separator:t="/",style:i,className:u,rootClassName:d,routes:p,items:m,children:h,itemRender:v,params:w={}}=e,_=L(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:y,direction:b,breadcrumb:j}=s.useContext(c.E_);let k;const N=y("breadcrumb",n),[C,T]=S(N),Z=function(e,n){return(0,s.useMemo)((()=>e||(n?n.map(M):null)),[e,n])}(m,p);const A=g(N,v);if(Z&&Z.length>0){const e=[],n=m||p;k=Z.map(((i,o)=>{const{path:r,key:l,type:c,menu:u,overlay:d,onClick:p,className:m,separator:h,dropdownProps:g}=i,v=((e,n)=>{if(void 0===n)return n;let t=(n||"").replace(/^\//,"");return Object.keys(e).forEach((n=>{t=t.replace(`:${n}`,e[n])})),t})(w,r);void 0!==v&&e.push(v);const _=null!=l?l:o;if("separator"===c)return s.createElement(f,{key:_},h);const y={},b=o===Z.length-1;u?y.menu=u:d&&(y.overlay=d);let{href:j}=i;return e.length&&void 0!==v&&(j=`#/${e.join("/")}`),s.createElement(x,Object.assign({key:_},y,(0,a.Z)(i,{data:!0,aria:!0}),{className:m,dropdownProps:g,href:j,separator:b?"":t,onClick:p,prefixCls:N}),A(i,w,n,e,j))}))}else if(h){const e=(0,r.Z)(h).length;k=(0,r.Z)(h).map(((n,i)=>{if(!n)return n;const o=i===e-1;return(0,l.Tm)(n,{separator:o?"":t,key:i})}))}const P=o()(N,null==j?void 0:j.className,{[`${N}-rtl`]:"rtl"===b},u,d,T),I=Object.assign(Object.assign({},null==j?void 0:j.style),i);return C(s.createElement("nav",Object.assign({className:P,style:I},_),s.createElement("ol",null,k)))};C.Item=_,C.Separator=f;var T=C},51581:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(n,t,i){return t&&e(n.prototype,t),i&&e(n,i),n}}(),o=t(59301),r=s(o),a=s(t(12708));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function n(e){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.scrollListener=t.scrollListener.bind(t),t.eventListenerOptions=t.eventListenerOptions.bind(t),t.mousewheelListener=t.mousewheelListener.bind(t),t}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}(n,e),i(n,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,n={get passive(){e=!0}};try{document.addEventListener("test",null,n),document.removeEventListener("test",null,n)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){var e=this.props.useCapture;return this.isPassiveSupported()&&(e={useCapture:this.props.useCapture,passive:!0}),e}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var n=this.props.getScrollParent&&this.props.getScrollParent();return null!=n?n:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var n=window;!1===this.props.useWindow&&(n=e),n.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),n.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),n.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,n=window,t=this.getParentElement(e),i=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,r=void 0!==n.pageYOffset?n.pageYOffset:o.scrollTop;i=this.props.isReverse?r:this.calculateOffset(e,r)}else i=this.props.isReverse?t.scrollTop:e.scrollHeight-t.scrollTop-t.clientHeight;i<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=t.scrollHeight,this.beforeScrollTop=t.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,n){return e?this.calculateTopPosition(e)+(e.offsetHeight-n-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,n=this.filterProps(this.props),t=n.children,i=n.element,o=n.hasMore,a=(n.initialLoad,n.isReverse),s=n.loader,l=(n.loadMore,n.pageStart,n.ref),c=(n.threshold,n.useCapture,n.useWindow,n.getScrollParent,function(e,n){var t={};for(var i in e)n.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}(n,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));c.ref=function(n){e.scrollComponent=n,l&&l(n)};var u=[t];return o&&(s?a?u.unshift(s):u.push(s):this.defaultLoader&&(a?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),r.default.createElement(i,c,u)}}]),n}(o.Component);l.propTypes={children:a.default.node.isRequired,element:a.default.node,hasMore:a.default.bool,initialLoad:a.default.bool,isReverse:a.default.bool,loader:a.default.node,loadMore:a.default.func.isRequired,pageStart:a.default.number,ref:a.default.func,getScrollParent:a.default.func,threshold:a.default.number,useCapture:a.default.bool,useWindow:a.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},n.default=l,e.exports=n.default},26724:function(e,n,t){e.exports=t(51581)}}]); |