"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[73927,71212,90269],{78592:function(e,n,t){t.d(n,{JW:function(){return T},Jd:function(){return C},Kl:function(){return D},L5:function(){return h},MH:function(){return R},MI:function(){return Q},Qo:function(){return _},SO:function(){return m},Tf:function(){return j},XO:function(){return p},Xy:function(){return y},Y0:function(){return Z},Ye:function(){return X},Yv:function(){return G},ZH:function(){return U},am:function(){return M},bD:function(){return H},fA:function(){return B},fY:function(){return A},g6:function(){return f},g7:function(){return J},gT:function(){return w},gn:function(){return L},h$:function(){return Y},hG:function(){return b},i8:function(){return z},j3:function(){return O},lH:function(){return E},li:function(){return x},n4:function(){return v},pU:function(){return N},qK:function(){return g},sA:function(){return k},sP:function(){return S},t$:function(){return P},zl:function(){return I}});var i=t(7557),r=t.n(i),c=t(41498),a=t.n(c),s=t(82242),o=t.n(s),l=t(94171),u=(0,t(83287).oP)(),d={};function p(e){return(0,l.U2)("tasks/".concat(e,".json"),d)}function f(e){return(0,l.U2)("myshixuns/".concat(e,"/challenges.json"))}function m(e,n){return(0,l.U2)("myshixuns/".concat(e,"/subject_challenges.json"),n)}function h(e,n,t){return(0,l.U2)("tasks/".concat(e,"/star.json"),{shixun_id:n,star:t})}function x(e,n){return(0,l.U2)("tasks/".concat(e,"/rep_content.json"),o()(o()({},n),d))}function v(e,n){return(0,l.v_)("myshixuns/".concat(e,"/update_file.json"),n)}function g(e,n){return(0,l.U2)("tasks/".concat(e,"/reset_original_code.json"),o()(o()({},n),d))}function j(e,n){return(0,l.v_)("myshixuns/".concat(e,"/reset_repository.json"),n)}function b(e,n){return(0,l.U2)("tasks/".concat(e,"/reset_passed_code.json"),o()(o()({},n),d))}function y(e,n){return(0,l.v_)("tasks/".concat(e,"/game_build.json"),o()(o()({},n),d))}function _(e,n){return(0,l.U2)("tasks/".concat(e,"/game_status.json"),o()(o()({},n),d))}function I(e,n){return(0,l.v_)("tasks/".concat(e,"/choose_build.json"),o()(o()({},n),d))}function A(e){return(0,l.U2)("myshixuns/".concat(e,"/get_remaining_time.json"))}function w(e){return(0,l.U2)("tasks/".concat(e,"/picture_display.json"),d)}function Z(e){return(0,l.v_)("tasks/".concat(e,"/plus_or_cancel_praise.json"))}function N(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.v_)("myshixuns/".concat(e,"/repository.json"),n)}function k(e,n){return(0,l.U2)("myshixuns/".concat(e,"/start.json"),n||{})}function M(e,n){return(0,l.U2)("myshixuns/".concat(e,"/reset_pod.json"),n)}function C(e,n){return(0,l.ZP)("/api/tasks/".concat(e,"/reboot_esc.json"),{method:"post",body:n})}function P(e){return(0,l.U2)("tasks/".concat(e,"/check_test_sets.json"))}function E(e){return(0,l.U2)("tasks/".concat(e,"/get_answer_info.json"))}function S(e){return(0,l.U2)("tasks/".concat(e,"/get_choose_answer.json"))}function R(e){return(0,l.U2)("tasks/".concat(e,"/unlock_choose_answer.json"))}function O(e,n){return(0,l.U2)("tasks/".concat(e,"/unlock_answer.json"),{answer_id:n})}function T(e,n,t){return(0,l.v_)("tasks/".concat(e,"/set_games_status.json"),{result:n,data:t})}function D(e,n){return(0,l.U2)("myshixuns/".concat(e,"/active_pod.json"),n)}function z(e,n){return(0,l.U2)("tasks/".concat(e,"/rank_list.json"),n)}function B(e,n){return(0,l.v_)("tasks/".concat(e,"/close_windows_vnc.json"),{tpi_id:n})}function U(e,n){return(0,l.U2)("tasks/".concat(e,"/commit_files.json"),n)}function L(e,n){return(0,l.U2)("tasks/".concat(e,"/pull_files.json"),n)}function Y(e,n){return(0,l.v_)("tasks/".concat(e,"/log_output"),n)}function G(e,n){return(0,l.U2)("tasks/".concat(e,"/stop_log_output.json"),n)}function Q(e){return W.apply(this,arguments)}function W(){return(W=a()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(n.id,"/add_file.json"),{method:"post",body:n}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(e){return V.apply(this,arguments)}function V(){return(V=a()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(n.id,"/delete_git_file.json"),{method:"Delete",body:n}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(e){return F.apply(this,arguments)}function F(){return(F=a()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(n.id,"/mv_file.json"),{method:"post",body:n}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function X(e,n){return(0,l.ZP)("/api/shixuns/".concat(e,"/set_start_permanent.json"),{method:"put",body:n})}null!=u&&u.homework_common_id&&(d.homework_common_id=null==u?void 0:u.homework_common_id),null!=u&&u.exercisesId&&(d.exercise_id=null==u?void 0:u.exercisesId)},90269:function(e,n,t){t.d(n,{z:function(){return Z},Z:function(){return N}});var i=t(7557),r=t.n(i),c=t(41498),a=t.n(c),s=t(82242),o=t.n(s),l=t(37205),u=t.n(l),d=t(79800),p=t.n(d),f=t(59301),m=t(54580),h=t(8591),x=t(43418),v=t(3113),g=t(91689),j=t(59120),b=t(37712),y="  ";function _(e){if(0==e)return"0 Byte";var n=parseInt(""+Math.floor(Math.log(e)/Math.log(1024)),10);return(e/Math.pow(1024,n)).toFixed(1)+" "+["Bytes","KB","MB","GB","TB"][n]}var I=t(61481),A=t(89392);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var w=m.Z.Dragger;function Z(e){var n=[];return e&&e.length>0&&(n=e.map((function(e){return{uid:e.id,id:e.id,name:e.title+y+e.filesize,url:e.url,filesize:e.filesize,status:"done",response:{id:e.id}}}))),n}var N=function(e){var n=e.value,t=e.onChange,i=e.action,c=e.data,s=e.className,l=e.maxSize,d=void 0===l?150:l,Z=e.title,N=void 0===Z?"上传附件":Z,k=e.showRemoveModal,M=void 0!==k&&k,C=e.accept,P=void 0===C?"":C,E=e.additionalText,S=e.isDragger,R=e.number,O=void 0===R?1e3:R,T=e.aloneClear,D=void 0!==T&&T,z=(0,f.useState)(!1),B=p()(z,2),U=B[0],L=B[1],Y=(0,f.useState)(n||[]),G=p()(Y,2),Q=G[0],W=G[1],H=(0,f.useState)(1),V=p()(H,2),J=V[0],F=V[1];(0,f.useEffect)((function(){n&&(1===J&&W(u()(n)),F(2),O===(null==n?void 0:n.length)&&L(!0))}),[n]);var X,q=function(){setTimeout((function(){Q.pop(),W(u()(Q))}),500)},K={multiple:!0,disabled:U,accept:P,withCredentials:!0,fileList:Q,beforeUpload:function(e,n){var t=e.size/1024/1024;return Q.concat(n).length>O?(Q.pop(),W(u()(Q)),h.ZP.error("最多只能上传".concat(O,"个文件")),D?Promise.reject():(q(),!1)):t=O?L(!0):L(!1),W(u()(Q)),Q=Q.map((function(e){var n,t;null!=e&&null!==(n=e.response)&&void 0!==n&&n.id&&(e.url="/api/attachments/".concat(null==e||null===(t=e.response)||void 0===t?void 0:t.id));return-1===e.name.indexOf(y)&&(e.name="".concat(e.name).concat(y).concat(_(e.size))),o()({},e)})),console.log("info:",e,Q),t(Q)):h.ZP.error(null===(i=e.file)||void 0===i||null===(i=i.response)||void 0===i?void 0:i.message)},onRemove:(X=a()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=function(){var e=a()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n.response?n.response.id:n.id)){e.next=8;break}return e.next=4,(0,j.JZ)(n.response?n.response.id:n.uid);case 4:return t=e.sent,e.abrupt("return",Promise.resolve(t));case 8:return e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),!M){e.next=5;break}return e.abrupt("return",new Promise((function(e,n){var i;x.Z.confirm({centered:!0,width:530,okText:"确定",cancelText:"取消",title:"提示",content:(0,b.jsx)("div",{className:"tc font16",children:"是否确认删除?"}),onOk:(i=a()(r()().mark((function n(){return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t();case 2:n.sent,h.ZP.success("删除成功"),e(!0);case 5:case"end":return n.stop()}}),n)}))),function(){return i.apply(this,arguments)}),onCancel:function(){return e(!1)}})})));case 5:return e.next=7,t();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)}))),function(e){return X.apply(this,arguments)})};return(0,b.jsxs)("div",{className:"multi-upload ".concat(s||""),children:[S&&(0,b.jsxs)(w,o()(o()({},K),{},{children:[(0,b.jsx)("p",{className:"ant-upload-drag-icon",children:(0,b.jsx)(I.Z,{})}),(0,b.jsxs)("p",{className:"ant-upload-text",children:["点击上传图标,选择要上传的文件或将文件拖拽到此",(0,b.jsx)("br",{}),"(单个文件最大限制为",d,"MB)"," "]}),E]})),!S&&(0,b.jsxs)(m.Z,o()(o()({},K),{},{children:[(0,b.jsxs)(v.ZP,{disabled:U,className:"upload_button",children:[(0,b.jsx)("img",{className:"aBtn_img",src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4="}),N]}),(0,b.jsxs)("span",{onClick:function(e){e.preventDefault(),e.stopPropagation()},className:"upload_text",children:["(单个文件最大",d,"MB)"," "]})]}))]})}},32831:function(e,n,t){t.d(n,{Z:function(){return _}});var i=t(82242),r=t.n(i),c=t(7557),a=t.n(c),s=t(41498),o=t.n(s),l=t(79800),u=t.n(l),d=t(59301),p={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},f=t(3113),m=t(70557),h=t(63631),x=t(6848),v=t(83287),g=t(94280),j=t(13767),b=t(91689),y=t(37712),_=function(e){var n,t,i,c,s,l,_,I=e.editOffice,A=void 0===I?"view":I,w=e.data,Z=(e.theme,e.type),N=e.filename,k=e.monacoEditor,M=e.className,C=e.style,P=e.close,E=e.onClose,S=e.hasMask,R=e.disabledDownload,O=e.onImgDimensions,T=e.showNodata,D=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),z=u()(D,2),B=(z[0],z[1],(0,d.useState)("")),U=u()(B,2),L=(U[0],U[1]),Y=(0,d.useState)(),G=u()(Y,2),Q=G[0],W=G[1],H="build"===window.ENV?"/react/build":"",V=location.host.startsWith("localhost")?b.Z.PROXY_SERVER:b.Z.API_SERVER,J=(0,d.useRef)();null!==(n=w)&&void 0!==n&&n.startsWith("/api")&&"txt"!==Z&&(w=b.Z.API_SERVER+w),N&&(k.filename=N),(0,d.useEffect)((function(){var e,n=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==n||n.map((function(e){var n=e.split("=");"_educoder_session"===n[0]&&L(n[1])}))}),[]),(0,d.useEffect)((function(){"office"===Z&&F()}),[Z,w]);var F=function(){var e=o()(a()().mark((function e(){var n,t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=w,w.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=5,(0,g.gJ)({attachment_id:t});case 5:i=e.sent,W(i);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){q()},q=function(){(0,v.Nd)(N||"educoder",decodeURIComponent(w))};return(0,y.jsxs)("div",{style:r()({},C||{}),className:"".concat(S&&p.bgBlack," ").concat(Z?p.wrp:"hide"),children:[P&&(0,y.jsxs)("div",{className:p.close,ref:J,children:[!!O&&(0,y.jsx)(x.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,y.jsx)("span",{onClick:function(){E(),O()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!R&&(0,y.jsx)(x.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,y.jsx)("span",{onClick:q,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(x.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,y.jsx)("span",{className:"",onClick:E,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(p[M]," ").concat(M," ").concat(p.monaco," ").concat("txt"===Z?"show":"hide"),children:"txt"===Z&&(0,y.jsx)(h.ZP,r()({},k))}),"audio"===Z&&(0,y.jsx)("audio",{src:(null===(t=w)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(i=w)&&void 0!==i&&i.startsWith("/api")?w:"data:image/png;base64,".concat(w),autoPlay:!0}),"video"===Z&&(0,y.jsx)(y.Fragment,{children:(null===(c=w)||void 0===c?void 0:c.indexOf("http"))>-1||null!==(s=w)&&void 0!==s&&s.startsWith("/api")?(0,y.jsx)("video",{controls:!0,src:"".concat(w),autoPlay:!0}):(0,y.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(w),autoPlay:!0})}),"office"===Z&&Q&&(0,y.jsx)("iframe",{src:"".concat(H,"/office.html?key=").concat(Q.key,"&url=").concat(V+Q.url,"&callbackUrl=").concat(V+Q.callbackUrl,"&fileType=").concat(Q.fileType,"&title=").concat(Q.title,"&model=").concat(A,"&officeServer=").concat(b.Z.ONLYOFFICE,"&disabledDownload=").concat(!!R)}),"html"===Z&&(0,y.jsx)("iframe",{src:w+"&disposition=inline"}),"pdf"===Z&&(0,y.jsx)("iframe",{src:"".concat(H,"/js/pdfview/index.html?url=").concat(w,"&disabledDownload=").concat(!!R)}),"image"===Z&&(0,y.jsx)("img",{src:(null===(l=w)||void 0===l?void 0:l.indexOf("http"))>-1||null!==(_=w)&&void 0!==_&&_.startsWith("/api")?w:"data:image/png;base64,".concat(w)}),("other"===Z||"download"===Z)&&(0,y.jsx)(y.Fragment,{children:T?(0,y.jsx)(j.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,y.jsx)(f.ZP,{icon:(0,y.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:X,children:"下载"})}):(0,y.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:X,children:[(0,y.jsx)(m.Z,{}),"点击下载"]})})]})}},71212:function(e,n,t){t.d(n,{Z:function(){return G}});var i=t(82242),r=t.n(i),c=t(37205),a=t.n(c),s=t(91232),o=t.n(s),l=t(79800),u=t.n(l),d=t(59301),p=(t(88831),t(32834)),f=t.n(p),m=t(11690);var h=[],x=["