text: (window["webpackJsonphocode-web"]=window["webpackJsonphocode-web"]||[]).push([[0],{1281:function(e,t,a){},1314:function(e,t,a){},1315:function(e,t,a){},1316:function(e,t,a){},1317:function(e,t,a){},1318:function(e,t,a){e.exports=a.p+"static/media/hoanthanh.c18c22ed.svg"},1319:function(e,t,a){e.exports=a.p+"static/media/user.316d47a9.svg"},1320:function(e,t,a){e.exports=a.p+"static/media/chuahoanthanh.a6ac73da.svg"},1321:function(e,t,a){e.exports=a.p+"static/media/padlock-unlock.f593928a.svg"},1322:function(e,t,a){},1333:function(e,t,a){},1334:function(e,t,a){},1335:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),i=a(29),o=a.n(i),s=(a(807),a(808),a(27)),c=a(192),l=a(15),u=a(16),m=a(18),p=a(17),d=a(19),h=a(1420),f=a(1337),g=a(28),b=a.n(g),E=(a(825),function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this.props,t=e.classes,a=e.course;return console.log(a),r.a.createElement(h.a,{container:!0,direction:"column",style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},className:"".concat(t.courseItem," hvr-bounce-in")},r.a.createElement(h.a,{item:!0,style:{width:"100%",overflow:"hidden",display:"flex",justifyContent:"center",alignItems:"center"}},r.a.createElement("img",{src:a.background_image,style:{width:"50px",objectFit:"cover",height:"50px",borderRadius:"50%",marginTop:"10px"},alt:""})),r.a.createElement(h.a,{item:!0,container:!0,justify:"center",style:{padding:"10px 0"}},r.a.createElement(h.a,{item:!0},r.a.createElement("div",{style:{margin:"5px 0",textAlign:"center",textTransform:"uppercase",color:"#595959",fontWeight:"bold",fontFamily:"'Yanone Kaffeesatz', sans-serif"}},a.course_name),r.a.createElement("div",{style:{margin:"5px 0",textAlign:"center",color:"#909090",fontFamily:"'Yanone Kaffeesatz', sans-serif"}},"Task \u0111\xe3 l\xe0m: ",a.task_solved.tasks_complete,"/",a.task_solved.task_count))))}}]),t}(n.Component)),v=Object(f.a)({courseItem:{borderRadius:"4px",boxShadow:"0px 1px 3px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)",overflow:"hidden",background:"#EEEEEE",cursor:"pointer"}})(E),y=(a(829),function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={courses:[]},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/courses").then((function(t){var a=t.data;e.setState({courses:a})}))}},{key:"render",value:function(){var e=this.props.classes,t=this.state.courses;return r.a.createElement(h.a,{container:!0,className:e.CourseContainer,justify:"center"},r.a.createElement(h.a,{item:!0,xs:12,sm:12,style:{padding:"0px 60px"}},r.a.createElement("div",{className:"gallery"},t.map((function(e){return r.a.createElement(s.b,{className:"item",key:e.id,style:{textDecoration:"none"},to:"/courses/".concat(e.id,"/tasks")},r.a.createElement(v,{course:e}))})))))}}]),t}(n.Component)),x=Object(f.a)({CourseContainer:{paddingTop:"100px",background:"#DDDDDD",minHeight:"100vh"},courseItem:{borderRadius:"4px",boxShadow:"0px 1px 3px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)",overflow:"hidden",background:"#EEEEEE",cursor:"pointer"}})(y),k=a(30),C=(a(831),a(42)),_=function(e){e?b.a.defaults.headers.common.Authorization="Bearer ".concat(e):delete b.a.defaults.headers.common.Authorization},O=a(246),j=a.n(O),S=function(e){return{type:"SET_CURRENT_USER",payload:e}},w=function(){return function(e){localStorage.removeItem("AuthToken"),localStorage.removeItem("token"),localStorage.removeItem("permissions"),_(!1),e(S({}))}},T=function(e,t){return function(a){console.log({minitask_id:e,task_id:t}),b.a.post("https://hocodevn.com/api/v1/auth/updateusercourse",{minitask_id:e,task_id:t}).then((function(e){console.log(e.data),a({type:"ADD_CODEPOINT",payload:e.data})})).catch((function(e){return console.log(e)}))}},N=function(){return function(e){b.a.get("https://hocodevn.com/auth/userinfo").then((function(t){e({type:"GET_USER",payload:t.data})})).catch((function(e){return console.log(e)}))}},L=function(){return function(e){e({type:"SET_UNDEFINED_NEXT_MINITASK",payload:void 0})}},I=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).onLogout=function(e){e.preventDefault(),a.props.logoutUser(),a.props.history.push("/login")},a.onLogout=a.onLogout.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.props.getUser()}},{key:"render",value:function(){return r.a.createElement("nav",{className:"course-header"},r.a.createElement("input",{type:"checkbox",id:"nav",className:"hidden"}),r.a.createElement("label",{htmlFor:"nav",className:"nav-btn"},r.a.createElement("i",null),r.a.createElement("i",null),r.a.createElement("i",null)),r.a.createElement("div",{className:"logo"},r.a.createElement("a",{href:"/"},r.a.createElement("img",{src:a(834),alt:"",style:{height:"40px"}}))),r.a.createElement("div",{className:"nav-wrapper"},r.a.createElement("div",{className:"left-menu"},r.a.createElement("a",{href:"/dsa"},"Th\xf4ng tin c\xe1 nh\xe2n")),r.a.createElement("div",{className:"right-menu"},r.a.createElement("div",{className:"code-point"},this.props.user.codepoint),r.a.createElement("div",{className:"nav-name"},r.a.createElement("div",{className:"nameMenu"},this.props.user.firstname),r.a.createElement("ul",{className:"nameSubmenu"},r.a.createElement("li",null,r.a.createElement("a",{href:"giang"},"Th\xf4ng tin c\xe1 nh\xe2n")),r.a.createElement("li",null,r.a.createElement("a",{href:"/",onClick:this.onLogout},"\u0110\u0103ng xu\u1ea5t")))),r.a.createElement("div",{className:"desktop-hide"}," ",r.a.createElement("a",{href:"/dsa",onClick:this.onLogout},"\u0110\u0103ng xu\u1ea5t")))))}}]),t}(n.Component),D=Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{logoutUser:w,getUser:N})(I),R=function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(D,{history:this.props.history}),r.a.createElement(x,null))}}]),t}(n.Component),F=(a(835),function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"renderMiniItem",value:function(e){return"hoanthanh"===e.status?r.a.createElement(s.b,{to:"/tasks/".concat(e.id),style:{display:"flex",textDecoration:"none",color:"#595959",fontFamily:"'Yanone Kaffeesatz', sans-serif"}},r.a.createElement("div",null),r.a.createElement("div",{style:{flexGrow:1}},e.mini_task_name),r.a.createElement("div",{style:{width:"1em"}},r.a.createElement("img",{style:{width:"100%"},src:a(836),alt:"Kiwi standing on oval"}))):"chuahoanthanh"===e.status&&!0===e.vitri?r.a.createElement("a",{href:"giang",style:{display:"flex",textDecoration:"none",color:"#595959",fontFamily:"'Yanone Kaffeesatz', sans-serif"}},r.a.createElement("div",null),r.a.createElement("div",{style:{flexGrow:1}},e.mini_task_name),r.a.createElement("div",{style:{width:"1em"}},r.a.createElement("img",{style:{width:"100%"},src:a(837),alt:"Kiwi standing on oval"}))):"chuahoanthanh"===e.status&&!1===e.vitri?r.a.createElement(s.b,{to:"/tasks/".concat(e.id),style:{display:"flex",textDecoration:"none",color:"#595959",fontFamily:"'Yanone Kaffeesatz', sans-serif"}},r.a.createElement("div",null),r.a.createElement("div",{style:{flexGrow:1}},e.mini_task_name),r.a.createElement("div",{style:{width:"1em"}},r.a.createElement("img",{style:{width:"100%",backgroundColor:"#F5F5F5",borderRadius:"50%"},src:a(838),alt:"Kiwi standing on oval"}))):"yeucaumokhoa"===e.status?r.a.createElement("div",{style:{display:"flex",textDecoration:"none",color:"#595959",fontFamily:"'Yanone Kaffeesatz', sans-serif"}},r.a.createElement("div",null),r.a.createElement("div",{style:{flexGrow:1}},e.mini_task_name),r.a.createElement("div",{className:"unlock",style:{display:"flex"}},r.a.createElement("div",{style:{width:"1em"}},r.a.createElement("img",{style:{width:"100%"},src:a(839),alt:"Kiwi standing on oval"})),r.a.createElement("div",{className:"hidden",style:{display:"none"}},e.point_unlock))):void 0}},{key:"render",value:function(){var e=this,t=this.props,a=t.classes,n=t.task;return r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{container:!0,direction:"column",className:"".concat(a.TaskItem)},r.a.createElement(h.a,{item:!0,container:!0,direction:"column",alignItems:"center"},r.a.createElement(h.a,{xs:6,md:6,item:!0,style:{padding:"8px",backgroundColor:"white",borderRadius:"9px",marginBottom:"-20px",zIndex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:" nowrap",textAlign:"center",width:"200px",fontFamily:"'Yanone Kaffeesatz', sans-serif",boxShadow:"0px 0px 0px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)"}},n.task_name)),r.a.createElement(h.a,{item:!0,style:{height:"200px",width:"100%",overflow:"hidden"}}," ",r.a.createElement("img",{src:n.background_image,style:{height:"100%",width:"100%",borderRadius:"4px 4px 0 0"},alt:""})),r.a.createElement(h.a,{item:!0,container:!0,direction:"column",style:{padding:"10px 0",background:"#EEEEEE",boxShadow:"0px 0px 0px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)"}}," ",n.minitasks.map((function(t){return r.a.createElement(h.a,{item:!0,className:"".concat(a.MiniTaskItem),key:t.id}," ",e.renderMiniItem(t))})))))}}]),t}(n.Component)),M=Object(f.a)({TaskItem:{borderRadius:"4px",overflow:"hidden",marginBottom:"50px"},MiniTaskItem:{margin:"5px",backgroundColor:"white",padding:"5px 10px",paddingTop:"10px",borderRadius:"9px",boxShadow:"0px 0px 0px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)"}})(F),z=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={tasks:[]},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/courses/".concat(this.props.courseId,"/tasks")).then((function(t){var a=t.data;e.setState({tasks:a})}))}},{key:"render",value:function(){var e=this.props.classes,t=this.state.tasks;return r.a.createElement(h.a,{container:!0,className:e.TasksContainer,justify:"center"},r.a.createElement(h.a,{item:!0,xs:12,sm:6,style:{padding:"0px 10px"}},t.map((function(e){return r.a.createElement(M,{key:e.id,task:e})}))))}}]),t}(n.Component),A=Object(f.a)({TasksContainer:{paddingTop:100,background:"#DDDDDD",minHeight:"100vh"}})(z),U=(a(840),function(e){function t(){var e,a;Object(l.a)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(a=Object(m.a)(this,(e=Object(p.a)(t)).call.apply(e,[this].concat(r)))).onLogout=function(e){e.preventDefault(),a.props.logoutUser(),a.props.history.push("/login")},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.props.getUser()}},{key:"render",value:function(){return r.a.createElement("nav",{className:"task-header"},r.a.createElement("input",{type:"checkbox",id:"nav",className:"hidden"}),r.a.createElement("label",{htmlFor:"nav",className:"nav-btn"},r.a.createElement("i",null),r.a.createElement("i",null),r.a.createElement("i",null)),r.a.createElement("div",{className:"logo"},r.a.createElement("a",{href:"/"},r.a.createElement("img",{src:a(841),alt:"",style:{height:"40px"}}))),r.a.createElement("div",{className:"nav-wrapper"},r.a.createElement("div",{className:"left-menu"},r.a.createElement("a",{href:"/dsa"},"Th\xf4ng tin c\xe1 nh\xe2n")),r.a.createElement("div",{className:"right-menu"},r.a.createElement("div",{className:"code-point"},this.props.user.codepoint),r.a.createElement("div",{className:"nav-name"},r.a.createElement("div",{className:"nameMenu"},this.props.user.firstname),r.a.createElement("ul",{className:"nameSubmenu"},r.a.createElement("li",null,r.a.createElement("a",{href:"giang"},"Th\xf4ng tin c\xe1 nh\xe2n")),r.a.createElement("li",null,r.a.createElement("a",{href:"giang",onClick:this.onLogout},"\u0110\u0103ng xu\u1ea5t")))),r.a.createElement("div",{className:"desktop-hide"}," ",r.a.createElement("a",{href:"/dsa",onClick:this.onLogout},"\u0110\u0103ng xu\u1ea5t")))))}}]),t}(n.Component)),B=Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{logoutUser:w,getUser:N})(U),P=function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this.props.match.params;return r.a.createElement(r.a.Fragment,null,r.a.createElement(B,{history:this.props.history}),r.a.createElement(A,{courseId:e.courseId}))}}]),t}(n.Component),H=a(482),W=a.n(H),G=a(493),V=a(643),q=a.n(V),K=(a(921),function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this.props.classes;return r.a.createElement("div",{className:e.DescContainer},r.a.createElement("div",{style:{fontFamily:' "Share Tech Mono", monospace ',display:"flex",color:"#44BFA3"}},r.a.createElement("div",{style:{flexGrow:1,marginRight:10}},"\u0110\u1ed9 kh\xf3: ",this.props.level),r.a.createElement("div",{style:{marginRight:"10px"}},this.props.code_point)),r.a.createElement("div",{className:"md_desc",style:{padding:"16px"}}," ",r.a.createElement(q.a,{escapeHtml:!1,source:this.props.mini_task_desc,renderers:{linkReference:function(e){return e.href?r.a.createElement("a",{href:e.$ref},e.children):"[".concat(e.children[0].props.children,"]")},heading:function(e){return r.a.createElement("p",{className:"md_heading"},e.children)},inlineCode:function(e){return r.a.createElement("code",{className:"md_code"},e.children)}}})))}}]),t}(n.Component)),Y=Object(f.a)({DescContainer:{background:"#ffffff",position:"relative",height:"100%",overflow:"auto",borderRadius:"4px",boxShadow:"0px 1px 3px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)",padding:"10px 10px"}})(K),J=a(247),X=a.n(J),Q=a(645),Z=a.n(Q),$=a(646),ee=a.n($),te=(a(922),a(188)),ae=a(6),ne=a(644),re=a(1424),ie=a(361),oe=a.n(ie),se=a(363),ce=a.n(se),le=Object(ae.a)({paper:{border:"1px solid #d3d4d5"}})((function(e){return r.a.createElement(ne.a,Object.assign({style:{paddingLeft:"5px",paddingRight:"5px"},elevation:0,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},e))})),ue=Object(ae.a)((function(e){return{root:{minHeight:"unset","&:focus":{"& .MuiListItemIcon-root, & .MuiListItemText-primary":{color:e.palette.common.white}}}}}))(re.a);var me=Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{logoutUser:w})((function(e){var t=r.a.useState(null),a=Object(te.a)(t,2),n=a[0],i=a[1];return r.a.createElement("div",null,r.a.createElement(oe.a,{"aria-controls":"customized-menu","aria-haspopup":"true",variant:"contained",onClick:function(e){i(e.currentTarget)},style:{color:"#282828"}}),r.a.createElement(le,{id:"customized-menu",anchorEl:n,keepMounted:!0,open:Boolean(n),onClose:function(){i(null)}},r.a.createElement(ue,null,r.a.createElement(ce.a,{style:{fontSize:16}}),r.a.createElement(s.b,{to:"/profile/account",style:{textDecoration:"none"}},r.a.createElement("p",{style:{fontSize:12,marginLeft:"3px"}},"Th\xf4ng tin c\xe1 nh\xe2n"))),r.a.createElement(ue,{onClick:e.logoutUser},r.a.createElement(X.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:12,marginLeft:"3px"}},"\u0110\u0103ng xu\u1ea5t"))))})),pe=function(e){function t(){var e,a;Object(l.a)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(a=Object(m.a)(this,(e=Object(p.a)(t)).call.apply(e,[this].concat(r)))).onLogout=function(e){e.preventDefault(),a.props.logoutUser(),a.props.history.push("/login")},a.onBack=function(e){e.preventDefault(),a.props.history.goBack()},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){console.log(this.props.history),this.props.getUser()}},{key:"render",value:function(){return r.a.createElement("nav",{className:"minitask-header"},r.a.createElement("input",{type:"checkbox",id:"nav",className:"hidden"}),r.a.createElement("label",{htmlFor:"nav",className:"nav-btn"},r.a.createElement("i",null),r.a.createElement("i",null),r.a.createElement("i",null)),r.a.createElement("div",{className:"logo"},r.a.createElement(s.b,{to:"/profile"},r.a.createElement("img",{src:"/logo.png",alt:"",style:{height:"40px"}}))),r.a.createElement("div",{className:"minitaskName_mobi"},this.props.minitaskName)," ",r.a.createElement("div",{className:"nav-wrapper"},r.a.createElement("div",{className:"desktop-hide1"},r.a.createElement("div",{className:"logo1"},r.a.createElement(s.b,{to:"/profile"},r.a.createElement("img",{src:"/logo.png",alt:"",style:{height:"40px"}})))),r.a.createElement("div",{className:"left-menu",style:{display:"flex",alignItems:"center"}},r.a.createElement("div",{onClick:this.onBack,style:{display:"flex",alignItems:"center",cursor:"pointer"}},r.a.createElement(Z.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:14,marginLeft:"3px"}},"Back")),r.a.createElement("div",{className:"miniTask_name",style:{display:"flex",justifyContent:"center",flexGrow:1}},r.a.createElement("div",null,this.props.minitaskName))),r.a.createElement("div",{className:"right-menu"},r.a.createElement("div",{className:"code-point",style:{fontSize:14,margin:"0px 4px",color:"#4978cc"}},"S\u1ed1 \u0110\u1eadu: ",this.props.user.codepoint),r.a.createElement("div",{className:"nav-name",style:{fontSize:14}},this.props.user.firstname),r.a.createElement("div",{className:"nav_usermenu "},r.a.createElement(me,null)),r.a.createElement("div",{className:"desktop-hide"},r.a.createElement("div",{style:{display:"flex",alignItems:"center",cursor:"pointer"}},r.a.createElement(ee.a,{style:{fontSize:16}}),r.a.createElement(s.b,{to:"/profile",style:{fontSize:14,marginLeft:"3px",textDecoration:"none",fontFamily:" Nunito Sans, sans-serif"}},"Trang c\xe1 nh\xe2n"))),r.a.createElement("div",{className:"desktop-hide"},r.a.createElement("div",{onClick:this.onBack,style:{display:"flex",alignItems:"center",cursor:"pointer"}},r.a.createElement(X.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:14,marginLeft:"3px"},onClick:this.onLogout},"\u0110\u0103ng xu\u1ea5t"))))))}}]),t}(n.Component),de=Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{logoutUser:w,getUser:N})(pe),he=a(177),fe=(a(923),a(307),a(308),a(309),a(924),a(310),a(311),a(312),a(313),a(314),a(315),a(316),a(317),function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this;return r.a.createElement(he.Controlled,{className:"CodeMirrorCustom",value:this.props.userCode,options:{mode:"text/x-java",theme:"darcula",lineNumbers:!0,highlightSelectionMatches:!0,indentUnit:4,tabSize:4,lineWrapping:!0,dragDrop:!1,autoCloseBrackets:!0,spellcheck:!0,autocorrect:!0,extraKeys:{"Ctrl-Space":"autocomplete"}},MarkText:{from:{line:0,ch:1},to:{line:3,ch:1},css:"font-size:5px"},onBeforeChange:function(t,a,n){e.props.updateUserCode(n)},onChange:function(e,t,a){}})}}]),t}(n.Component)),ge=a(268),be=a(647),Ee=a(1485),ve=a(1426),ye=a(409),xe=a(1493),ke=a(1428),Ce=a(1429),_e=a(367),Oe=a.n(_e);a(544);function je(e){var t=e.children,a=e.value,n=e.index,i=Object(ge.a)(e,["children","value","index"]);return r.a.createElement(ye.a,Object.assign({component:"div",role:"tabpanel",hidden:a!==n,id:"nav-tabpanel-".concat(n),"aria-labelledby":"nav-tab-".concat(n)},i),r.a.createElement("div",{style:{padding:"10px 20px",background:"#f5f5f5"}},t))}function Se(e){return{id:"nav-tab-".concat(e),"aria-controls":"nav-tabpanel-".concat(e)}}function we(e){return r.a.createElement(ve.a,Object.assign({style:{minHeight:"100%",minWidth:"200px"},component:"a",onClick:function(e){e.preventDefault()}},e))}var Te=Object(be.a)((function(e){return{root:{flexGrow:1,backgroundColor:e.palette.background.paper}}}));function Ne(e){var t=Te(),a=r.a.useState(1),n=Object(te.a)(a,2),i=n[0],o=n[1];var s=e.unit_tests||[],c=e.result;return console.log(c),r.a.createElement("div",{className:t.root,style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"}},r.a.createElement(Ee.a,{style:{minHeight:"30px"},variant:"fullWidth",value:i,onChange:function(e,t){o(t)},"aria-label":"nav tabs example"},r.a.createElement(we,Object.assign({label:"Danh s\xe1ch test",href:"/drafts"},Se(0))),r.a.createElement(we,Object.assign({label:"K\u1ebft qu\u1ea3",href:"/trash"},Se(1)))),r.a.createElement("div",{className:"scroll_test",style:{position:"relative",width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:"#f5f5f5"}},r.a.createElement(je,{value:i,index:0},r.a.createElement(r.a.Fragment,null,s.map((function(e,t){return r.a.createElement(xe.a,{key:t},r.a.createElement(ke.a,{expandIcon:r.a.createElement(Oe.a,null),"aria-controls":"panel1a-content",id:"panel1a-header"},r.a.createElement("div",{style:{display:"flex",width:"100%"}},r.a.createElement("div",{style:{flexGrow:1,fontFamily:' "Share Tech Mono", monospace '}},"Test ",t+1))),r.a.createElement(Ce.a,null,r.a.createElement("div",null,r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,style:{fontFamily:' "Share Tech Mono", monospace '}},"Input:"," "),r.a.createElement(h.a,{item:!0,style:{marginLeft:10}},e.inputs.map((function(e,t){return r.a.createElement("div",{key:t,style:{fontFamily:' "Share Tech Mono", monospace '}},"param",t+1,": ",e.value)}))," ")),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,style:{fontFamily:' "Share Tech Mono", monospace '}},"Output mong \u0111\u1ee3i: ",e.expected_output)))))})))),r.a.createElement(je,{value:i,index:1},function(e){return void 0===e.stdout?void 0!==e.errorRuntime?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{color:"#ff1a1a",fontFamily:" 'Share Tech Mono', monospace",fontSize:14}},"Code ch\u1ea1y qu\xe1 l\xe2u, vui l\xf2ng th\u1eed l\u1ea1i.")):r.a.createElement("div",null,"ch\u01b0a th\u1ef1c thi"):""!==e.error?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{color:"#ff1a1a",fontFamily:" 'Share Tech Mono', monospace",fontSize:14}},e.error)):"true"===e.stdout.WASSUCCESSFUL?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{color:"#19b280",fontFamily:" 'Share Tech Mono', monospace",fontSize:14}},r.a.createElement("div",null," Th\u1eddi gian test: ",e.stdout.COMPLETEDIN),r.a.createElement("div",null,"K\u1ebft qu\u1ea3: Passed"))):"false"===e.stdout.WASSUCCESSFUL?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{color:"#ff1a1a",fontFamily:" 'Share Tech Mono', monospace",fontSize:14}},r.a.createElement("div",null,"S\u1ed1 l\u01b0\u1ee3ng test \u0111\xfang:"," ",e.stdout.RUNCOUNT-e.stdout.GETFAILURECOUNT,"/",e.stdout.RUNCOUNT),r.a.createElement("div",null,"K\u1ebft qu\u1ea3: Failed"),e.stdout.GETALLFAILURE.map((function(e,t){return r.a.createElement("div",{key:t},e.DETAIL)})))):void 0}(c))))}var Le=a(101),Ie=a.n(Le);function De(e){var t=e.children,a=e.value,n=e.index,i=Object(ge.a)(e,["children","value","index"]);return r.a.createElement(ye.a,Object.assign({component:"div",role:"tabpanel",hidden:a!==n,id:"nav-tabpanel-".concat(n),"aria-labelledby":"nav-tab-".concat(n)},i),r.a.createElement("div",{style:{padding:"10px 20px",background:"#f5f5f5"}},t))}function Re(e){return r.a.createElement(ve.a,Object.assign({style:{minHeight:"100%",minWidth:"200px"},component:"a",onClick:function(e){e.preventDefault()}},e))}var Fe=Object(be.a)((function(e){return{root:{flexGrow:1,backgroundColor:e.palette.background.paper}}}));function Me(e){var t=Fe(),a=r.a.useState(0),n=Object(te.a)(a,2),i=n[0],o=n[1];var s,c=e.unit_tests||[];return r.a.createElement("div",{className:t.root,style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"}},!0===e.isLoading?r.a.createElement("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},r.a.createElement("div",null,r.a.createElement("div",{className:"sweet-loading"},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:e.isLoading}))," ")):r.a.createElement(r.a.Fragment,null,r.a.createElement(Ee.a,{style:{minHeight:"30px"},variant:"fullWidth",value:i,onChange:function(e,t){o(t)},"aria-label":"nav tabs example"},r.a.createElement(Re,Object.assign({label:"Danh s\xe1ch test",href:"/drafts"},{id:"nav-tab-".concat(s=0),"aria-controls":"nav-tabpanel-".concat(s)}))),r.a.createElement("div",{className:"scroll_test",style:{position:"relative",width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:"#f5f5f5"}},r.a.createElement(De,{value:i,index:0},function(e){return r.a.createElement(r.a.Fragment,null,e.map((function(e,t){return r.a.createElement(xe.a,{key:t},r.a.createElement(ke.a,{expandIcon:r.a.createElement(Oe.a,null),"aria-controls":"panel1a-content",id:"panel1a-header"},r.a.createElement("div",{style:{display:"flex",width:"100%"}},r.a.createElement("div",{style:{flexGrow:1,fontFamily:' "Share Tech Mono", monospace '}},"Test ",t+1))),r.a.createElement(Ce.a,null,r.a.createElement("div",null,r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,style:{fontFamily:' "Share Tech Mono", monospace '}},"Input:"," "),r.a.createElement(h.a,{item:!0,style:{marginLeft:10}},e.inputs.map((function(e,t){return r.a.createElement("div",{key:t,style:{fontFamily:' "Share Tech Mono", monospace '}},"> param",t+1,": ",e.value)}))," ")),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,style:{fontFamily:' "Share Tech Mono", monospace '}},"Output mong \u0111\u1ee3i: ",e.expected_output)))))})))}(c)))))}var ze=a(1430),Ae=(a(930),a(193)),Ue=a.n(Ae),Be=a(110),Pe=(a(545),a(237)),He=a.n(Pe),We=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).handleClickSnack=function(){a.setState({open:!0})},a.handleCloseSnack=function(){a.setState({open:!1})},a.state={minitask:{},result:{},userCode:"",isLoading:!1,isLoadingComponent:!0,open:!1},a.executeCode=a.executeCode.bind(Object(k.a)(a)),a.submitCode=a.submitCode.bind(Object(k.a)(a)),a.updateUserCode=a.updateUserCode.bind(Object(k.a)(a)),a.resetCode=a.resetCode.bind(Object(k.a)(a)),a.createFileTest=a.createFileTest.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;this.props.setUndefinedNextMinitask();var t=this.props.match.params;b.a.get("https://hocodevn.com/api/v1/minitasks/".concat(t.minitaskId)).then((function(t){var a=t.data;e.setState((function(e,t){return{minitask:a,isLoadingComponent:!1}})),e.setState((function(e,t){return{minitask:a}})),e.setState((function(e,t){return{userCode:a.template_code}}))}))}},{key:"componentDidUpdate",value:function(e){var t=this;e.match.params.minitaskId!==this.props.match.params.minitaskId&&(this.props.setUndefinedNextMinitask(),console.log("next "),this.setState((function(e,t){return{result:{}}})),b.a.get("https://hocodevn.com/api/v1/minitasks/".concat(this.props.match.params.minitaskId)).then((function(e){var a=e.data;t.setState((function(e,t){return{minitask:a,isLoadingComponent:!1}})),t.setState((function(e,t){return{minitask:a}})),t.setState((function(e,t){return{userCode:a.template_code}}))})))}},{key:"updateUserCode",value:function(e){this.setState({userCode:e})}},{key:"beautifyCode",value:function(e){var t=He()(e,{max_preserve_newlines:2});this.setState((function(e,a){return{userCode:t}})),this.handleClickSnack()}},{key:"resetCode",value:function(){var e=this,t=Ue.a.mixin({customClass:{confirmButton:"btn btn-success comfirmFesetCodeBtn",cancelButton:"btn btn-danger cancelCodeBtn"},buttonsStyling:!1});t.fire({title:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a code \u0111\xe3 l\u01b0u?",text:"B\u1ea1n s\u1ebd kh\xf4ng th\u1ec3 ho\xe0n t\xe1c!",type:"warning",showCancelButton:!0,confirmButtonText:"X\xf3a",cancelButtonText:"H\u1ee7y!",reverseButtons:!0}).then((function(n){n.value?(e.setState((function(e,t){return{userCode:a.template_code}})),t.fire("\u0110\xe3 reset!","","success")):n.dismiss===Ue.a.DismissReason.cancel&&t.fire("\u0110\xe3 h\u1ee7y","","error")}));var a=this.state.minitask}},{key:"createFileTest",value:function(e){var t="";return void 0!==e.id&&(!0===e.output_type_func.includes("[]")?(t="import static org.junit.Assert.assertArrayEquals;\n    import org.junit.Test;\n    import org.junit.runners.JUnit4;\n    public class TestFixture {\n    public TestFixture(){}\n ",e.unit_tests.forEach((function(a,n){var r="";a.inputs.forEach((function(e){!0===e.type.includes("[]")?r+="new ".concat(e.type," ").concat(e.value,","):r+="".concat(e.value,",")}));var i=r.substring(0,r.length-1);"double[]"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertArrayEquals("test ').concat(n+1,'", new ').concat(e.output_type_func," ").concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"),0);\n  }\n"):t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertArrayEquals("test ').concat(n+1,'", new ').concat(e.output_type_func," ").concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"));\n  }\n")})),t+="}"):(t="import static org.junit.Assert.assertEquals;\n    import org.junit.Test;\n    import org.junit.runners.JUnit4;\n    public class TestFixture {\n    public TestFixture(){}\n ",e.unit_tests.forEach((function(a,n){var r="";a.inputs.forEach((function(e){!0===e.type.includes("[]")?r+="new ".concat(e.type," ").concat(e.value,","):r+="".concat(e.value,",")}));var i=r.substring(0,r.length-1);"double"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", ').concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"),0);\n  }\n"):"String"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", "').concat(a.expected_output,'", s.').concat(e.name_func,"(").concat(i,"));\n  }\n"):t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", ').concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"));\n  }\n")})),t+="}")),t}},{key:"executeCode",value:function(){this.setState((function(e,t){return{result:{}}}));var e=this.state.minitask,t=this.createFileTest(e),a="import java.lang.Math; \n public class Solution {\n    public Solution(){}\n    ".concat(this.state.userCode,"\n    }");this.setState((function(e,t){return{isLoading:!0}})),console.log(t),b.a.post("https://hocodevn.com/api/runner/java",{code:a,test:t}).then(function(e){console.log(e);var t=e.data.stderr,a=e.data.stdout;this.setState((function(e,n){return{result:{error:t,stdout:a}}})),this.setState((function(e,t){return{isLoading:!1}}))}.bind(this)).catch(function(e){this.setState((function(t,a){return{isLoading:!1,result:{errorRuntime:e}}})),console.log(e)}.bind(this))}},{key:"submitCode",value:function(){this.setState((function(e,t){return{result:{}}}));var e=this.state.minitask,t=this.createFileTest(e),n="import java.lang.Math; \n public class Solution {\n    public Solution(){}\n    ".concat(this.state.userCode,"\n    }");this.setState((function(e,t){return{isLoading:!0}})),b.a.post("https://hocodevn.com/api/runner/java",{code:n,test:t}).then(function(e){console.log(e);var t=e.data.stderr,n=e.data.stdout;this.setState((function(e,a){return{result:{error:t,stdout:n}}})),this.setState((function(e,t){return{isLoading:!1}})),"true"===this.state.result.stdout.WASSUCCESSFUL&&(this.props.submitUpdateMinitask(this.state.minitask.id,this.state.minitask.task_id),Ue.a.fire({type:"success",title:"Ch\xfac m\u1eebng, b\u1ea1n \u0111\xe3 ho\xe0n th\xe0nh b\xe0i th\u1ef1c h\xe0nh n\xe0y",width:600,padding:"3em",customClass:"hidden_alert",backdrop:'\n                rgba(0,0,123,0.4)\n                url("'.concat(a(546),'") \n                center center\n                no-repeat\n              ')}),Object(Be.b)("Ch\xfac m\u1eebng, b\u1ea1n \u0111\xe3 ho\xe0n th\xe0nh b\xe0i th\u1ef1c h\xe0nh n\xe0y!",{containerId:"B"}))}.bind(this)).catch(function(e){this.setState((function(t,a){return{isLoading:!1,result:{errorRuntime:e}}})),console.log(e)}.bind(this))}},{key:"render",value:function(){var e=this,t=this.state,a=t.minitask,n=t.result,i=this.state.isLoadingComponent;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"fit layout-code"},r.a.createElement(ze.a,{anchorOrigin:{vertical:"bottom",horizontal:"center"},key:"bottom,center",open:this.state.open,onClose:this.handleCloseSnack,ContentProps:{"aria-describedby":"message-id"},className:"success",autoHideDuration:2e3,message:r.a.createElement("span",{id:"message-id"},"Th\xe0nh c\xf4ng")}),r.a.createElement("div",{className:"layout-code-header"},r.a.createElement(de,{minitaskName:a.mini_task_name,history:this.props.history})),i?r.a.createElement("div",{className:"sweet-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100vh"}},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:i})):r.a.createElement("div",{className:"layout-code-body"},r.a.createElement("div",{className:"split-panel fit"},r.a.createElement("div",{className:"stretch fit"},r.a.createElement(G.a,{className:"splitHorizontal",sizes:[25,75],minSize:0,expandToMin:!1,gutterSize:4,gutterAlign:"center",snapOffset:30,dragInterval:1,direction:"horizontal",cursor:"col-resize"},r.a.createElement("div",{className:"split-panel-first "},r.a.createElement(Y,{mini_task_desc:a.mini_task_desc,code_point:a.code_point,level:a.level})),r.a.createElement("div",{className:"split-panel-second "},r.a.createElement("div",{className:"coding-area"},r.a.createElement(G.a,{className:"splitVertical",sizes:[75,25],minSize:100,expandToMin:!1,gutterSize:4,gutterAlign:"center",snapOffset:30,dragInterval:1,direction:"vertical",cursor:"row-resize"},r.a.createElement("div",null,r.a.createElement("div",{className:"codeEditor"},r.a.createElement(fe,{userCode:this.state.userCode,updateUserCode:this.updateUserCode}),r.a.createElement("div",{className:"reset_code",style:{position:"absolute",bottom:10,right:20,zIndex:9}},r.a.createElement("button",{onClick:this.resetCode,style:{fontSize:12,padding:"6px 8px",cursor:"pointer",background:"#ef5350",fontWeight:"bold"}},"Reset code")),r.a.createElement("div",{className:"reset_code",style:{position:"absolute",bottom:10,right:110,zIndex:9}},r.a.createElement("button",{onClick:function(){return e.beautifyCode(e.state.userCode)},style:{fontSize:12,padding:"6px 8px",cursor:"pointer",background:"#3d5afe",fontWeight:"bold"}},"Beautifier code")))),r.a.createElement("div",{className:"resultPanel"},void 0!==this.state.result.stdout||void 0!==this.state.result.errorRuntime?r.a.createElement(Ne,{unit_tests:a.unit_tests,result:this.state.result}):r.a.createElement(Me,{isLoading:this.state.isLoading,unit_tests:a.unit_tests})))),r.a.createElement("div",{className:"runtest-area",style:{minHeight:"40px",padding:"10px 20px",display:"flex",alignItems:"center",justifyContent:"flex-end"}},r.a.createElement("div",{style:{marginLeft:20,color:"#4DBF9D"}},function(){if(void 0!==n&&void 0!==n.stdout&&void 0!==n.stdout.WASSUCCESSFUL)return r.a.createElement(r.a.Fragment,null,n.stdout.RUNCOUNT-n.stdout.GETFAILURECOUNT,"/",n.stdout.RUNCOUNT)}()),r.a.createElement("div",{style:{marginLeft:30}}),r.a.createElement("div",{style:{marginLeft:10}},r.a.createElement("button",{onClick:this.submitCode,className:"submitCode_btn ".concat(this.state.isLoading&&"disable_btn"),disabled:this.state.isLoading},"N\u1ed9p b\xe0i")),void 0!==this.props.user.next_minitask?r.a.createElement("div",{style:{marginLeft:30,fontSize:12}},""===this.props.user.next_minitask.id?r.a.createElement(s.b,{to:"/profile/course",style:{textDecoration:"none",color:"#595959"}},"Qua b\xe0i m\u1edbi"):r.a.createElement(s.b,{to:"/tasks/".concat(this.props.user.next_minitask.id),style:{textDecoration:"none",color:"#595959"}},"Qua b\xe0i m\u1edbi")):r.a.createElement("div",null))))," "))),r.a.createElement(Be.a,{enableMultiContainer:!0,containerId:"B",position:Be.b.POSITION.TOP_RIGHT})))}}]),t}(n.Component),Ge=Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{submitUpdateMinitask:T,setUndefinedNextMinitask:L})(We),Ve=(a(932),function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).handleClickSnack=function(){a.setState({open:!0})},a.handleCloseSnack=function(){a.setState({open:!1})},a.state={minitask:{},result:{},userCode:"",isLoading:!1,isLoadingComponent:!0,open:!1},a.executeCode=a.executeCode.bind(Object(k.a)(a)),a.submitCode=a.submitCode.bind(Object(k.a)(a)),a.updateUserCode=a.updateUserCode.bind(Object(k.a)(a)),a.resetCode=a.resetCode.bind(Object(k.a)(a)),a.createFileTest=a.createFileTest.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.match.params;b.a.get("https://hocodevn.com/api/v1/minitasks/".concat(t.minitaskId)).then((function(t){var a=t.data;e.setState((function(e,t){return{minitask:a,isLoadingComponent:!1}})),e.setState((function(e,t){return{userCode:a.template_code}}))}))}},{key:"componentDidUpdate",value:function(e){var t=this;e.match.params.minitaskId!==this.props.match.params.minitaskId&&(this.props.setUndefinedNextMinitask(),console.log("next "),this.setState((function(e,t){return{result:{}}})),b.a.get("https://hocodevn.com/api/v1/minitasks/".concat(this.props.match.params.minitaskId)).then((function(e){var a=e.data;t.setState((function(e,t){return{minitask:a}})),t.setState((function(e,t){return{userCode:a.template_code}}))})))}},{key:"updateUserCode",value:function(e){this.setState({userCode:e})}},{key:"beautifyCode",value:function(e){var t=He()(e,{max_preserve_newlines:2});this.setState((function(e,a){return{userCode:t}})),this.handleClickSnack()}},{key:"resetCode",value:function(){var e=this,t=Ue.a.mixin({customClass:{confirmButton:"btn btn-success comfirmFesetCodeBtn",cancelButton:"btn btn-danger cancelCodeBtn"},buttonsStyling:!1});t.fire({title:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a code \u0111\xe3 l\u01b0u?",text:"B\u1ea1n s\u1ebd kh\xf4ng th\u1ec3 ho\xe0n t\xe1c!",type:"warning",showCancelButton:!0,confirmButtonText:"X\xf3a",cancelButtonText:"H\u1ee7y!",reverseButtons:!0}).then((function(n){n.value?(e.setState((function(e,t){return{userCode:a.template_code}})),t.fire("\u0110\xe3 reset!","","success")):n.dismiss===Ue.a.DismissReason.cancel&&t.fire("\u0110\xe3 h\u1ee7y","","error")}));var a=this.state.minitask}},{key:"createFileTest",value:function(e){var t="";return void 0!==e.id&&(!0===e.output_type_func.includes("[]")?(t="import static org.junit.Assert.assertArrayEquals;\n    import org.junit.Test;\n    import org.junit.runners.JUnit4;\n    public class TestFixture {\n    public TestFixture(){}\n ",e.unit_tests.forEach((function(a,n){var r="";a.inputs.forEach((function(e){!0===e.type.includes("[]")?r+="new ".concat(e.type," ").concat(e.value,","):r+="".concat(e.value,",")}));var i=r.substring(0,r.length-1);"double[]"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertArrayEquals("test ').concat(n+1,'", ').concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"),0);\n  }\n"):t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertArrayEquals("test ').concat(n+1,'", new ').concat(e.output_type_func," ").concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"));\n  }\n")})),t+="}"):(t="import static org.junit.Assert.assertEquals;\n    import org.junit.Test;\n    import org.junit.runners.JUnit4;\n    public class TestFixture {\n    public TestFixture(){}\n ",e.unit_tests.forEach((function(a,n){var r="";a.inputs.forEach((function(e){!0===e.type.includes("[]")?r+="new ".concat(e.type," ").concat(e.value,","):r+="".concat(e.value,",")}));var i=r.substring(0,r.length-1);"double"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", ').concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"),0);\n  }\n"):"String"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", "').concat(a.expected_output,'", s.').concat(e.name_func,"(").concat(i,"));\n  }\n"):t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", ').concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"));\n  }\n")})),t+="}")),t}},{key:"executeCode",value:function(){this.setState((function(e,t){return{result:{}}}));var e=this.state.minitask,t=this.createFileTest(e),a="import java.lang.Math; \n public class Solution {\n    public Solution(){}\n    ".concat(this.state.userCode,"\n    }");this.setState((function(e,t){return{isLoading:!0}})),console.log(t),b.a.post("https://hocodevn.com/api/runner/java",{code:a,test:t}).then(function(e){console.log(e);var t=e.data.stderr,a=e.data.stdout;this.setState((function(e,n){return{result:{error:t,stdout:a}}})),this.setState((function(e,t){return{isLoading:!1}}))}.bind(this)).catch(function(e){this.setState((function(t,a){return{isLoading:!1,result:{errorRuntime:e}}})),console.log(e)}.bind(this))}},{key:"submitCode",value:function(){this.setState((function(e,t){return{result:{}}}));var e=this.state.minitask,t=this.createFileTest(e),n="import java.lang.Math; \n public class Solution {\n    public Solution(){}\n    ".concat(this.state.userCode,"\n    }");this.setState((function(e,t){return{isLoading:!0}})),b.a.post("https://hocodevn.com/api/runner/java",{code:n,test:t}).then(function(e){console.log(e);var t=e.data.stderr,n=e.data.stdout;this.setState((function(e,a){return{result:{error:t,stdout:n}}})),this.setState((function(e,t){return{isLoading:!1}})),"true"===this.state.result.stdout.WASSUCCESSFUL&&(this.props.submitUpdateMinitask(this.state.minitask.id,this.state.minitask.task_id),Ue.a.fire({type:"success",title:"Ch\xfac m\u1eebng, b\u1ea1n \u0111\xe3 ho\xe0n th\xe0nh b\xe0i th\u1ef1c h\xe0nh n\xe0y",width:600,padding:"3em",customClass:"hidden_alert",backdrop:'\n                rgba(0,0,123,0.4)\n                url("'.concat(a(546),'") \n                center center\n                no-repeat\n              ')}),Object(Be.b)("Ch\xfac m\u1eebng, b\u1ea1n \u0111\xe3 ho\xe0n th\xe0nh b\xe0i th\u1ef1c h\xe0nh n\xe0y!",{containerId:"B"}))}.bind(this)).catch(function(e){this.setState((function(t,a){return{isLoading:!1,result:{errorRuntime:e}}})),console.log(e)}.bind(this))}},{key:"render",value:function(){var e=this,t=this.state,n=t.minitask,i=t.result,o=this.state.isLoadingComponent;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"fit layout-code"},r.a.createElement(ze.a,{anchorOrigin:{vertical:"bottom",horizontal:"center"},key:"bottom,center",open:this.state.open,onClose:this.handleCloseSnack,ContentProps:{"aria-describedby":"message-id"},className:"success",autoHideDuration:2e3,message:r.a.createElement("span",{id:"message-id"},"Th\xe0nh c\xf4ng")}),r.a.createElement("div",{className:"layout-code-header"},r.a.createElement(de,{minitaskName:n.mini_task_name,history:this.props.history})),o?r.a.createElement("div",{className:"sweet-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100vh"}},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:o})):r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:4,md:4},r.a.createElement(Y,{mini_task_desc:n.mini_task_desc,code_point:n.code_point,level:n.level})),r.a.createElement(h.a,{item:!0,container:!0,style:{flexDirection:"column"},xs:12,sm:8,md:8},r.a.createElement(h.a,{item:!0,style:{flexGrow:1}},r.a.createElement("div",{className:"coding-area"},r.a.createElement("div",{className:"codeEditor"},r.a.createElement(fe,{userCode:this.state.userCode,updateUserCode:this.updateUserCode}),r.a.createElement("div",{className:"reset_code",style:{position:"absolute",bottom:10,right:20,zIndex:9}},r.a.createElement("button",{onClick:this.resetCode,style:{fontSize:12,padding:"6px 8px",cursor:"pointer",background:"#ef5350",fontWeight:"bold"}},"Reset code")),r.a.createElement("div",{className:"reset_code",style:{position:"absolute",bottom:10,right:110,zIndex:9}},r.a.createElement("button",{onClick:function(){return e.beautifyCode(e.state.userCode)},style:{fontSize:12,padding:"6px 8px",cursor:"pointer",background:"#3d5afe",fontWeight:"bold"}},"Beautifier code"))),r.a.createElement("div",{className:"resultPanel"},void 0!==this.state.result.stdout||void 0!==this.state.result.errorRuntime?r.a.createElement(Ne,{unit_tests:n.unit_tests,result:this.state.result}):r.a.createElement(Me,{isLoading:this.state.isLoading,unit_tests:n.unit_tests})))),r.a.createElement(h.a,{item:!0},r.a.createElement("div",{className:"runtest-area",style:{minHeight:"40px",padding:"10px 20px",display:"flex",alignItems:"center",justifyContent:"flex-end"}},r.a.createElement("div",{style:{marginLeft:20,color:"#4DBF9D"}},function(){if(void 0!==i&&void 0!==i.stdout&&void 0!==i.stdout.WASSUCCESSFUL)return r.a.createElement(r.a.Fragment,null,i.stdout.RUNCOUNT-i.stdout.GETFAILURECOUNT,"/",i.stdout.RUNCOUNT)}()),r.a.createElement("div",{style:{marginLeft:30}},r.a.createElement("button",{className:"execute_btn ".concat(this.state.isLoading&&"disable_btn"),style:{display:"flex",alignItems:"center"},onClick:this.executeCode,disabled:this.state.isLoading},this.state.isLoading?"\u0110ang th\u1ef1c thi":"Th\u1ef1c thi",r.a.createElement("img",{src:a(933),alt:"",style:{height:"10px",marginLeft:"3px"}}))),r.a.createElement("div",{style:{marginLeft:10}},r.a.createElement("button",{onClick:this.submitCode,className:"submitCode_btn ".concat(this.state.isLoading&&"disable_btn"),disabled:this.state.isLoading},"N\u1ed9p b\xe0i")),void 0!==this.props.user.next_minitask?r.a.createElement("div",{style:{marginLeft:30,fontSize:12}},r.a.createElement(s.b,{to:"/tasks/".concat(this.props.user.next_minitask.id),style:{textDecoration:"none",color:"#595959"}},"Qua b\xe0i m\u1edbi")):r.a.createElement("div",null))))),r.a.createElement(Be.a,{enableMultiContainer:!0,containerId:"B",position:Be.b.POSITION.TOP_RIGHT})))}}]),t}(n.Component)),qe=Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{submitUpdateMinitask:T,setUndefinedNextMinitask:L})(Ve),Ke=function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this.props.match;return r.a.createElement(r.a.Fragment,null,r.a.createElement(W.a,{minDeviceWidth:701},r.a.createElement(Ge,{match:e,history:this.props.history})),r.a.createElement(W.a,{maxDeviceWidth:700},r.a.createElement(qe,{match:e,history:this.props.history})))}}]),t}(n.Component),Ye=a(1431),Je=a(297),Xe=a.n(Je);a(934);function Qe(){return r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",align:"center"},"Copyright \xa9 ",r.a.createElement(s.b,{color:"inherit",to:"/"},"Hocodevn.com")," ",(new Date).getFullYear(),".")}var Ze=function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.props.auth.isAuthenticated&&this.props.history.push("/profile")}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.auth.isAuthenticated&&this.props.history.push("/profile")}},{key:"render",value:function(){return r.a.createElement(h.a,{className:"containerMain",style:{height:"inherit",width:"100%",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}},r.a.createElement(h.a,{style:{display:"flex",flexDirection:"column",width:"100%",padding:40,paddingTop:0,height:"inherit"}},r.a.createElement(h.a,{container:!0,className:"header-homepage"},r.a.createElement(h.a,{className:"HeaderLeftHome",item:!0,xs:12,md:4,sm:4,style:{marginBottom:0}},r.a.createElement("div",{className:"logo logo-homepage"},r.a.createElement(s.b,{to:"/profile"},r.a.createElement("img",{src:"/logo.png",alt:"",style:{height:"80px",paddingTop:35}})))),r.a.createElement(h.a,{className:"HeaderRightHome",item:!0,xs:12,md:8,sm:8,container:!0},r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/searchcert",style:{textDecoration:"none",marginLeft:"30px"}},r.a.createElement(Ye.a,{style:{background:"#2b2b2b",color:"white",fontWeight:600,boxShadow:"none",fontSize:"16px",paddingLeft:"20px",paddingRight:"20px"},startIcon:r.a.createElement(Xe.a,null),variant:"contained"},"Tra Ch\u1ee9ng Ch\u1ec9"))),r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/login",style:{textDecoration:"none",marginLeft:"30px"}},r.a.createElement(Ye.a,{style:{background:"#2196f3",color:"white",fontWeight:600,fontSize:"16px",boxShadow:"none",width:"125px"},variant:"contained"},"\u0110\u0103ng nh\u1eadp"))),r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/signup",style:{textDecoration:"none",marginLeft:"30px"}},r.a.createElement(Ye.a,{style:{background:"#7bccd5",color:"white",fontWeight:600,boxShadow:"none",fontSize:"16px",width:"125px"},variant:"contained"},"\u0110\u0103ng k\xfd"))))),r.a.createElement(h.a,{style:{flexGrow:1,padding:10,marginBottom:"30px"},container:!0},r.a.createElement(h.a,{className:"left-block-homepage",item:!0,xs:12,sm:6,md:6,style:{}},r.a.createElement("div",null,r.a.createElement(ye.a,{component:"h1",variant:"h2",color:"textPrimary",gutterBottom:!0,style:{color:"#009688",fontWeight:600,fontSize:"4em"}},"WELLCOME TO HOCODE")),r.a.createElement("div",null,r.a.createElement(ye.a,{variant:"h5",color:"textSecondary",paragraph:!0},"H\u1ecdc v\xe0 r\xe8n luy\u1ec7n kh\u1ea3 n\u0103ng l\u1eadp tr\xecnh v\u1edbi h\u01a1n"," ",r.a.createElement("span",{className:"span-red MuiTypography-h5"},"30")," b\xe0i th\u1ef1c h\xe0nh"," ",r.a.createElement("span",{className:"span-red MuiTypography-h5"},"JAVA"),". C\xf2n ch\u1ea7n ch\u1edd g\xec n\u1eefa, h\xe3y tham gia ngay."),r.a.createElement(h.a,{container:!0,spacing:2,className:"left-block-home-button"},r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/profile",style:{textDecoration:"none"}},r.a.createElement(Ye.a,{variant:"contained",color:"primary",style:{color:"#fff",background:"#ff5252",fontWeight:600,boxShadow:"none",fontSize:"16px",padding:"8px 32px"}},"B\u1eaft \u0111\u1ea7u")))))),r.a.createElement(h.a,{className:"image-homepage",container:!0,item:!0,xs:12,sm:6,md:6,style:{padding:"8px"}},r.a.createElement("div",{style:{background:'url("/codeEdit3.jpg") no-repeat left center',backgroundSize:"cover",width:"100%",display:"flex",borderRadius:"16px 4px"}}))),r.a.createElement(Qe,null)))}}]),t}(n.Component),$e=Object(f.a)({cardGrid:{paddingTop:32,paddingBottom:32},card:{height:"100%",display:"flex",flexDirection:"column"}})(Object(C.b)((function(e){return{auth:e.rootReducer.auth}}),{})(Ze)),et=a(31),tt=a(1434),at=a(1432),nt=a(1477),rt=a(1433),it=(a(935),/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),ot=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{6,}$/,st=Object(f.a)({root:{"& label.Mui-focused":{color:"#3f51b5"},"& .MuiInput-underline:after":{borderBottomColor:"#3f51b5"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"#3f51b5"},"&:hover fieldset":{borderColor:"#3f51b5"},"&.Mui-focused fieldset":{borderColor:"#3f51b5"}}}})(at.a);function ct(){return r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",align:"center"},"Copyright \xa9 ",r.a.createElement(s.b,{color:"inherit",to:"/"},"hocodevn.com")," ",(new Date).getFullYear(),".")}var lt=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).onChange=function(e){var t=!1,n=a.state.errorForm;"email"===e.target.id&&(!1===it.test(e.target.value)?(t=!0,n.email="*Email kh\xf4ng \u0111\xfang \u0111\u1ecbnh d\u1ea1ng vd: nguyenvana@gmail.com"):n.email=""),"password"===e.target.id&&(!1===ot.test(e.target.value)?(t=!0,n.password="*M\u1eadt kh\u1ea9u c\u1ea7n c\xf3 \xedt nh\u1ea5t 6 k\xfd t\u1ef1, 1 s\u1ed1, 1 ch\u1eef In v\xe0 1 ch\u1eef th\u01b0\u1eddng v\xe0 kh\xf4ng ch\u1ee9a k\xfd t\u1ef1 \u0111\u1eb7c bi\u1ec7t"):n.password=""),"password2"===e.target.id&&(e.target.value!==a.state.password?(t=!0,n.password2="*B\u1ea1n c\u1ea7n nh\u1eadp m\u1eadt kh\u1ea9u gi\u1ed1ng tr\xean"):n.password2=""),t&&a.setState({errorForm:n}),a.setState(Object(et.a)({},e.target.id,e.target.value))},a.onSubmit=function(e){e.preventDefault();var t="";if(a.state.password!==a.state.password2&&(t="*M\u1eadt kh\u1ea9u nh\u1eadp l\u1ea1i kh\xf4ng tr\xf9ng"),""===a.state.password2.trim()&&(t="*Nh\u1eadp l\u1ea1i m\u1eadt kh\u1ea9u kh\xf4ng th\u1ec3 \u0111\u1ec3 tr\u1ed1ng"),""===a.state.password.trim()&&(t="*M\u1eadt kh\u1ea9u kh\xf4ng th\u1ec3 \u0111\u1ec3 tr\u1ed1ng"),""===a.state.email.trim()&&(t="*Email kh\xf4ng th\u1ec3 \u0111\u1ec3 tr\u1ed1ng"),!1===it.test(String(a.state.email).toLowerCase())&&(t="*Email kh\xf4ng \u0111\xfang \u0111\u1ecbnh d\u1ea1ng"),""===a.state.firstName.trim()&&(t="*T\xean kh\xf4ng th\u1ec3 \u0111\u1ec3 tr\u1ed1ng"),""===a.state.lastName.trim()&&(t="*H\u1ecd kh\xf4ng th\u1ec3 \u0111\u1ec3 tr\u1ed1ng"),""!==t.trim())return a.props.errors.message=t,void a.setState({errors:a.props.errors});var n={lastName:a.state.lastName,firstName:a.state.firstName,email:a.state.email,password:a.state.password};console.log(n),a.props.registerUser(n,a.props.history)},a.state={lastName:"",firstName:"",email:"",password:"",password2:"",errors:{},errorForm:{lastName:"",firstName:"",email:"",password:"",password2:""}},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.props.auth.isAuthenticated&&this.props.history.push("/profile")}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.auth.isAuthenticated&&this.props.history.push("/profile"),e.errors&&(e.errors.message="*"+e.errors.message,this.setState({errors:e.errors}))}},{key:"_checkError",value:function(e){return null===e&&""===e}},{key:"render",value:function(){var e=this.state.errors,t=this.props.classes;return r.a.createElement(rt.a,{component:"main",maxWidth:"xs"},r.a.createElement(tt.a,null),r.a.createElement("div",{className:t.paper},r.a.createElement(nt.a,{justifyContent:"center",borderBottom:24,color:"rgba(255, 255, 255, 0.1)"},r.a.createElement("div",{className:"logo"},r.a.createElement(s.b,{to:"/profile"},r.a.createElement("img",{src:"/logo.png",alt:"",style:{height:"80px"}})))),r.a.createElement(ye.a,{component:"h1",variant:"h5"},"\u0110\u0103ng k\xfd"),r.a.createElement("form",{className:t.form,noValidate:!0,onSubmit:this.onSubmit},r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6},r.a.createElement(st,{autoComplete:"lname",name:"lastName",variant:"outlined",required:!0,fullWidth:!0,id:"lastName",label:"H\u1ecd",autoFocus:!0,value:this.state.lastName,onChange:this.onChange})),r.a.createElement(h.a,{item:!0,xs:12,sm:6},r.a.createElement(st,{variant:"outlined",required:!0,fullWidth:!0,id:"firstName",label:"T\xean",name:"firstName",autoComplete:"fname",value:this.state.firstname,onChange:this.onChange})),r.a.createElement(h.a,{item:!0,xs:12},r.a.createElement(st,{variant:"outlined",required:!0,fullWidth:!0,id:"email",label:"\u0110\u1ecba ch\u1ec9 Email",name:"email",autoComplete:"email",value:this.state.email,onChange:this.onChange,error:""!==this.state.errorForm.email.trim(),helperText:this.state.errorForm.email})),r.a.createElement(h.a,{item:!0,xs:12},r.a.createElement(st,{variant:"outlined",required:!0,fullWidth:!0,name:"password",label:"M\u1eadt kh\u1ea9u",type:"password",id:"password",autoComplete:"current-password",value:this.state.password,onChange:this.onChange,error:""!==this.state.errorForm.password.trim(),helperText:this.state.errorForm.password})),r.a.createElement(h.a,{item:!0,xs:12},r.a.createElement(st,{variant:"outlined",required:!0,fullWidth:!0,name:"password2",label:"Nh\u1eadp l\u1ea1i M\u1eadt kh\u1ea9u",type:"password",id:"password2",autoComplete:"current-password2",value:this.state.password2,onChange:this.onChange,error:""!==this.state.errorForm.password2.trim(),helperText:this.state.errorForm.password2}))),r.a.createElement("div",null,r.a.createElement("div",{className:"error_show"},e.message)),r.a.createElement(Ye.a,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",className:t.submit},"T\u1ea1o t\xe0i kho\u1ea3n"),r.a.createElement(h.a,{container:!0,justify:"flex-end"},r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/login",variant:"body2"},"B\u1ea1n \u0111\xe3 c\xf3 t\xe0i kho\u1ea3n r\u1ed3i, \u0110\u0103ng nh\u1eadp ngay"))))),r.a.createElement(nt.a,{mt:5},r.a.createElement(ct,null)))}}]),t}(r.a.Component),ut=Object(f.a)({"@global":{body:{backgroundColor:"white"}},paper:{marginTop:50,display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:8,backgroundColor:"#3f51b5"},form:{width:"100%",marginTop:8},submit:{margin:"16px 0px"}})(Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors}}),{registerUser:function(e,t){return function(a){b.a.post("https://hocodevn.com/api/v1/signup",e).then((function(e){return t.push("/login")})).catch((function(e){return a({type:"GET_ERRORS",payload:e.response.data})}))}}})(lt)),mt=a(1440),pt=a(723),dt=a(725),ht=a(273),ft=a(1435),gt=a(1439),bt=a(1438),Et=a(1436),vt=a(1437),yt=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).onSubmitSearch=function(){a.setState({isLoading:!0,rows:[]}),b.a.get("https://hocodevn.com/api/v1/certs/search/".concat(a.state.searchID)).then((function(e){a.setState({rows:e.data,isLoading:!1}),console.log(a.state.rows)})).catch((function(e){return a.setState({isLoading:!1})}))},a.handleChange=function(e){a.setState({searchID:e.target.value})},a.state={errors:{},searchID:"",rows:[],isLoading:!1},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this.props.classes;return r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{container:!0,direction:"column",style:{height:"100%",backgroundColor:"whitesmoke"}},r.a.createElement(h.a,{className:"HeaderLeftHome",item:!0},r.a.createElement(h.a,{container:!0,className:"header-homepage",style:{backgroundColor:"white"}},r.a.createElement(h.a,{className:"HeaderLeftHome",item:!0,xs:12,md:4,sm:4,style:{marginBottom:0}},r.a.createElement("div",{className:"logo logo-homepage"},r.a.createElement(s.b,{to:"/profile"},r.a.createElement("div",{style:{height:"56px",margin:16,background:'url("/logo.png") no-repeat left center',backgroundSize:"contain"}})))),r.a.createElement(h.a,{className:"HeaderRightHome",item:!0,xs:12,md:8,sm:8,container:!0},r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/searchcert",style:{textDecoration:"none",marginLeft:"30px"}},r.a.createElement(Ye.a,{style:{background:"#2b2b2b",color:"white",fontWeight:600,boxShadow:"none",fontSize:"16px",paddingLeft:"20px",paddingRight:"20px"},startIcon:r.a.createElement(Xe.a,null),variant:"contained"},"Tra Ch\u1ee9ng Ch\u1ec9"))),r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/login",style:{textDecoration:"none",marginLeft:"30px"}},r.a.createElement(Ye.a,{style:{background:"#2196f3",color:"white",fontWeight:600,fontSize:"16px",boxShadow:"none",width:"125px"},variant:"contained"},"\u0110\u0103ng nh\u1eadp"))),r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/signup",style:{textDecoration:"none",marginLeft:"30px"}},r.a.createElement(Ye.a,{style:{background:"#7bccd5",color:"white",fontWeight:600,boxShadow:"none",fontSize:"16px",width:"125px"},variant:"contained"},"\u0110\u0103ng k\xfd")))))),r.a.createElement(h.a,{className:"HeaderLeftHome",item:!0},r.a.createElement(h.a,{container:!0,direction:"column",justify:"center",alignItems:"center",style:{height:"100%",padding:"64px"}},r.a.createElement(ht.a,{onSubmit:this.onSubmitSearch,component:"form",className:e.rootSearch},r.a.createElement(dt.a,{className:e.input,placeholder:"M\xe3 Ch\u1ee9ng Ch\u1ec9",inputProps:{"aria-label":"m\xe3 ch\u1ee9ng ch\u1ec9"},onChange:this.handleChange}),r.a.createElement(pt.a,{onClick:this.onSubmitSearch,className:e.iconButton,"aria-label":"search"},r.a.createElement(Xe.a,null))),r.a.createElement(ht.a,{className:e.root},r.a.createElement(ft.a,{className:e.table,"aria-label":"simple table"},r.a.createElement(Et.a,null,r.a.createElement(vt.a,null,r.a.createElement(bt.a,null,"ID"),r.a.createElement(bt.a,{align:"right"},"Tr\u1ea1ng th\xe1i"),r.a.createElement(bt.a,{align:"right"},"Th\u1eddi gian c\u1eadp nh\u1eadp"))),r.a.createElement(gt.a,null,this.state.rows.map((function(e){return r.a.createElement(vt.a,{key:e.id},r.a.createElement(bt.a,{component:"th",scope:"row"},e.search_id),r.a.createElement(bt.a,{align:"right"},e.status),r.a.createElement(bt.a,{align:"right"},Date(e.timestamp).toLocaleString("vi")))})))),this.state.isLoading?r.a.createElement("div",{style:{display:"flex",justifyContent:"center",height:"200px",alignItems:"center",flexDirection:"column",margin:"32px"}},r.a.createElement(mt.a,{size:64,style:{margin:"32px"}})):r.a.createElement(r.a.Fragment,null," "),0!==this.state.rows.length||this.state.isLoading?r.a.createElement(r.a.Fragment,null):r.a.createElement("div",{style:{display:"flex",justifyContent:"center",height:"200px",alignItems:"center",flexDirection:"column",margin:"32px"}},r.a.createElement("svg",{width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},r.a.createElement("g",{fill:"none",fillRule:"evenodd"},r.a.createElement("g",{transform:"translate(24 31.67)"},r.a.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),r.a.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),r.a.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),r.a.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),r.a.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),r.a.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),r.a.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},r.a.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),r.a.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),r.a.createElement("p",null,"No Data")))))))}}]),t}(r.a.Component),xt=Object(f.a)((function(e){return{root:{width:"100%",overflowX:"auto"},table:{},searchIcon:{width:7,height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},inputRoot:{color:"inherit"},inputInput:{padding:7,width:"100%"},search:{position:"relative",marginLeft:0,width:"100%"},rootSearch:{padding:"2px 16px",display:"flex",alignItems:"center",width:400,marginBottom:24,paddingLeft:"36px"},input:{flex:1},iconButton:{padding:16}}}),{withTheme:!0})(yt),kt=a(372),Ct=a.n(kt),_t=(a(551),a(952),function(e){function t(){var e,a;Object(l.a)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(a=Object(m.a)(this,(e=Object(p.a)(t)).call.apply(e,[this].concat(r)))).handleChange=function(e){a.props.handleMarkdownChange(e)},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement(Ct.a,{className:"react_mde_custom",label:"",value:this.props.mini_task_desc,onChange:this.handleChange,options:{spellChecker:!1}}))}}]),t}(n.Component)),Ot=a(168),jt=a(38),St=a.n(jt),wt=a(60),Tt=a(104),Nt=(a(954),a(429),a(430),function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this,t=this.props.inputList||[],a="";return""!==this.props.name_func&&(a="public ".concat(this.props.output_type_func," ").concat(this.props.name_func,"(").concat(t.map((function(e){return"".concat(e.input_type," ").concat(e.input_name)})).join(),"){ \n    \n      }")),r.a.createElement(he.Controlled,{value:a,options:{mode:"javascript",theme:"material",lineNumbers:!0,highlightSelectionMatches:!0,indentUnit:4,tabSize:4,lineWrapping:!0,dragDrop:!1,autoCloseBrackets:!0,spellcheck:!0,autocorrect:!0,extraKeys:{"Ctrl-Space":"autocomplete"},readOnly:!0},MarkText:{from:{line:0,ch:1},to:{line:3,ch:1},css:"font-size:5px"},onBeforeChange:function(t,a,n){e.props.updateTemplateCode(n)},onChange:function(e,t,a){}})}}]),t}(n.Component)),Lt=(a(955),a(1441));function It(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}var Dt=[{value:"int",label:"Interger"},{value:"String",label:"String"},{value:"double",label:"Double"},{value:"double[]",label:"Double Array"},{value:"String[]",label:"String Array"},{value:"int[]",label:"Interger Array"}],Rt={menu:function(e){return function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?It(Object(a),!0).forEach((function(t){Object(et.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):It(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},e,{zIndex:999})}},Ft=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={name:"",name_func:"",output_type_func:"int",point_unlock:0,status:"yeucaumokhoa",vitri:!1,mini_task_desc:"",level:"hard",user_code:"",unit_tests:[],taskId:"",inputList:[],coursesOption:[],courses:[],tasksOption:[],course_id:"",task_id:""},a.output_type_func=r.a.createRef(),a.courses_ref=r.a.createRef(),a.tasks_ref=r.a.createRef(),a.handleSimpleInputChange=a.handleSimpleInputChange.bind(Object(k.a)(a)),a.onSelectChange=a.onSelectChange.bind(Object(k.a)(a)),a.onCoursesSelectChange=a.onCoursesSelectChange.bind(Object(k.a)(a)),a.onTasksSelectChange=a.onTasksSelectChange.bind(Object(k.a)(a)),a.onSelectChange=a.onSelectChange.bind(Object(k.a)(a)),a.handleMarkdownChange=a.handleMarkdownChange.bind(Object(k.a)(a)),a.handleSubmit=a.handleSubmit.bind(Object(k.a)(a)),a.updateTemplateCode=a.updateTemplateCode.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/courses").then((function(t){var a=t.data,n=a.filter((function(e){return e.tasks.length>0})),r=n.map((function(e){return{value:e.id,label:e.course_name}}));e.setState({courses:n,coursesOption:r,tasksOption:a[0].tasks.map((function(e){return{value:e.id,label:e.task_name}}))}),e.setState({course_id:a[0].id,task_id:a[0].tasks[0].id})}))}},{key:"handleSimpleInputChange",value:function(e){var t=e.target,a=t.value,n=t.name;this.setState((function(e,t){return Object(et.a)({},n,a)}))}},{key:"handleMarkdownChange",value:function(e){this.setState({mini_task_desc:e})}},{key:"handleSubmit",value:function(){var e=Object(wt.a)(St.a.mark((function e(){var t,a;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="public ".concat(this.state.output_type_func," ").concat(this.state.name_func,"(").concat(this.state.inputList.map((function(e){return"".concat(e.input_type," ").concat(e.input_name)})).join(),")\n{ \n}"),a={template_code:t,unit_tests:this.state.unit_tests,course_id:this.state.course_id,task_id:this.state.task_id,name:this.state.name,name_func:this.state.name_func,output_type_func:this.state.output_type_func,point_unlock:0,status:"yeucaumokhoa",vitri:!1,mini_task_desc:"",level:"hard"},console.log(a);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onSelectChange",value:function(e){var t=this.output_type_func.current.props.name;this.setState(Object(et.a)({},t,e.value))}},{key:"onCoursesSelectChange",value:function(){var e=Object(wt.a)(St.a.mark((function e(t){var a,n,r;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState((function(e,t){return{tasksOption:[]}})),console.log(t),n=this.courses_ref.current.props.name,e.next=5,this.state.courses.find((function(e){return e.id===t.value}));case 5:r=e.sent,console.log(r),this.setState((a={},Object(et.a)(a,n,t.value),Object(et.a)(a,"tasksOption",r.tasks.map((function(e){return{value:e.id,label:e.task_name}}))),Object(et.a)(a,"task_id",r.tasks[0].id),a));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onTasksSelectChange",value:function(e){var t=this.tasks_ref.current.props.name;this.setState(Object(et.a)({},t,e.value))}},{key:"updateTemplateCode",value:function(e){this.setState({template_code:e})}},{key:"addInput",value:function(){this.setState({inputList:[].concat(Object(Ot.a)(this.state.inputList),[{input_name:"",input_type:"int"}]),unit_tests:[]})}},{key:"handleListInputNameChange",value:function(e,t){this.state.inputList[t].input_name=e.target.value,this.setState({inputList:this.state.inputList})}},{key:"handleListInputTypeChange",value:function(e,t){this.state.inputList[t].input_type=e.value,this.setState({inputList:this.state.inputList})}},{key:"addTest",value:function(){for(var e=this.state.inputList.length,t=[],a=0;a<e;a++)t.push({value:"",type:"int"});this.setState({unit_tests:[].concat(Object(Ot.a)(this.state.unit_tests),[{inputs:t,expected_output:" "}])})}},{key:"handleOutputTestChange",value:function(e,t){this.state.unit_tests[t].expected_output=e.target.value,this.setState({unit_tests:this.state.unit_tests})}},{key:"handleInputTestChange",value:function(e,t,a){this.state.unit_tests[t].inputs[a].value=e.target.value,this.setState({unit_tests:this.state.unit_tests})}},{key:"render",value:function(){var e=this,t=this.props.classes;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},r.a.createElement("div",null,"T\u1ea1o b\xe0i th\u1ef1c h\xe0nh")),r.a.createElement(h.a,{container:!0,className:t.CreateMiniTaskBodyContainer,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement(h.a,{style:{background:"aliceblue",padding:"8px"}},void 0!==this.state.coursesOption[0]?r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"Ch\u1ecdn kh\xf3a h\u1ecdc:"),r.a.createElement(Tt.a,{styles:Rt,options:this.state.coursesOption,ref:this.courses_ref,name:"course_id",defaultValue:this.state.coursesOption[0],onChange:this.onCoursesSelectChange})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"Ch\u1ecdn task:"),r.a.createElement(Tt.a,{styles:Rt,options:this.state.tasksOption,ref:this.tasks_ref,name:"task_id",defaultValue:this.state.tasksOption[0],onChange:this.onTasksSelectChange}))):"",r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0},r.a.createElement("div",null,"T\xean b\xe0i th\u1ef1c h\xe0nh:"),r.a.createElement("input",{name:"name",className:"input-createminitask",onChange:this.handleSimpleInputChange})),r.a.createElement(h.a,{item:!0},r.a.createElement("div",null,"T\xean Function:"),r.a.createElement("input",{name:"name_func",className:"input-createminitask",onChange:this.handleSimpleInputChange}))),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,xs:12,md:12}," ",r.a.createElement("div",{style:{marginBottom:10,marginTop:10}},"Ki\u1ec3u tr\u1ea3 v\u1ec1:"),r.a.createElement(Tt.a,{className:"select_type",styles:Rt,options:Dt,ref:this.output_type_func,name:"output_type_func",defaultValue:Dt[0],onChange:this.onSelectChange}))),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,xs:12,md:12},r.a.createElement("div",{style:{marginBottom:10,marginTop:10}},"M\xf4 t\u1ea3 b\xe0i to\xe1n:"),r.a.createElement(_t,{handleMarkdownChange:this.handleMarkdownChange,mini_task_desc:this.state.mini_task_desc}))))),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",{className:"codeEditorCreateMiniTask"},r.a.createElement(Nt,{output_type_func:this.state.output_type_func,name_func:this.state.name_func,inputList:this.state.inputList,updateTemplateCode:this.updateTemplateCode})),r.a.createElement(h.a,{container:!0,style:{marginTop:20}},r.a.createElement(h.a,{item:!0,xs:12,md:12,sm:12,style:{background:"aliceblue",padding:"10px"}},r.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px 0px"}},r.a.createElement("button",{onClick:function(t){return e.addInput(t)}},"Th\xeam tham s\u1ed1")),r.a.createElement("div",{style:{maxHeight:"20vh",position:"relative",overflowY:"scroll",overflowX:"hidden"}},this.state.inputList.map((function(t,a){return r.a.createElement("div",{key:a},r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:6,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12},"T\xean tham s\u1ed1:"),r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement("input",{className:"input-createminitask",value:t.input_name,onChange:function(t){return e.handleListInputNameChange(t,a)}}))),r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:6,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12},"ki\u1ec3u tham s\u1ed1:"),r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement(Tt.a,{options:Dt,defaultValue:Dt[0],onChange:function(t){return e.handleListInputTypeChange(t,a)}})))),r.a.createElement(Lt.a,{style:{margin:"5px auto",width:"50%"}}))}))," ")),r.a.createElement(Lt.a,{style:{margin:"20px auto",width:"50%"}}),r.a.createElement(h.a,{item:!0,xs:12,md:12,sm:12,style:{background:"aliceblue",padding:"10px"}},r.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px 0px"}},r.a.createElement("button",{onClick:function(t){return e.addTest(t)}},"Th\xeam test")),r.a.createElement("div",{style:{maxHeight:"30vh",position:"relative",overflowY:"scroll",overflowX:"hidden"}},this.state.unit_tests.map((function(t,a){return r.a.createElement("div",{key:a,style:{padding:10}}," ","Test ",a+1,r.a.createElement(ht.a,{style:{padding:10}},r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},"Inputs:"),t.inputs.map((function(t,n){return r.a.createElement(h.a,{item:!0,xs:12,sm:4,md:4,key:n},r.a.createElement("input",{className:"input-createminitask",value:t.value,onChange:function(t){return e.handleInputTestChange(t,a,n)},placeholder:"param ".concat(n+1)}))}))),r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},"Out put"),r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},r.a.createElement("input",{className:"output_createminitask",value:t.expected_output,onChange:function(t){return e.handleOutputTestChange(t,a)}})))))}))))),r.a.createElement(h.a,{container:!0,style:{justifyContent:"flex-end",padding:"10px"}},r.a.createElement(h.a,{item:!0},r.a.createElement("button",{onClick:this.handleSubmit},"submit"))))))}}]),t}(n.Component),Mt=Object(f.a)({CreateMiniTaskBodyContainer:{minHeight:"100vh",padding:40}})(Ft),zt=function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(Mt,null))}}]),t}(n.Component),At=a(1481),Ut=a(1460),Bt=a(373),Pt=function(e,t){if(e===Bt.d){var a=t.username,n=t.password,r=new Request("https://hocodevn.com/api/v1/login",{method:"POST",body:JSON.stringify({email:a,password:n}),headers:new Headers({"Content-Type":"application/json"})});return fetch(r).then((function(e){if(e.status<200||e.status>=300)throw new Error(e.statusText);return e.json()})).then((function(e){var t=e.token,a=j()(t);localStorage.setItem("AuthToken",t),localStorage.setItem("token",t),localStorage.setItem("permissions",a.data.role)}))}if(e===Bt.e)return localStorage.removeItem("token"),localStorage.removeItem("AuthToken"),localStorage.removeItem("permissions"),Promise.resolve();if(e===Bt.b){var i=t.status;return 401===i||403===i?(localStorage.removeItem("token"),localStorage.removeItem("AuthToken"),localStorage.removeItem("permissions"),Promise.reject()):Promise.resolve()}return e===Bt.a?localStorage.getItem("token")||localStorage.getItem("AuthToken")?Promise.resolve():Promise.reject():e===Bt.c?localStorage.getItem("permissions")?Promise.resolve():Promise.reject():Promise.reject("Unknown method")},Ht=a(722),Wt=function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){return r.a.createElement(Ht.a,{push:!0,to:"/"})}}]),t}(n.Component),Gt=[],Vt=a(141),qt=a(1442);function Kt(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Yt(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Kt(Object(a),!0).forEach((function(t){Object(et.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Kt(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var Jt={},Xt={},Qt={},Zt={},$t=function(e){var t=e.apiUrl,a=e.type,n=e.resource,r=e.params,i="",o={},s={};switch(console.log("[params, type, resource]"),console.log(r),console.log(a),console.log(n),a){case"GET_MANY_REFERENCE":s[r.target]=r.id,i="".concat(t,"/").concat(n,"?").concat(Object(Vt.stringify)(s));break;case"GET_LIST":if(r.pagination){var c=r.pagination,l=c.page,u=c.perPage;s.limit=u||100,s.offset=l?(l-1)*s.limit:0}if(r.sort){var m=r.sort,p=m.field,d=m.order;s.order_by="".concat("DESC"===d?"-":"")+p}if(r.filter){var h=Qt[n];Object.keys(r.filter).forEach((function(e){var t=r.filter[e]instanceof Object?JSON.stringify(r.filter[e]):r.filter[e];if(h&&h[e]){var a=h[e].min,n=h[e].max;(!a||t.length>=a)&&(t=n&&t.length>n?t.slice(0,n):t,s[e]=t)}else s[e]=t;(!s[e]||s[e]&&0===s[e].length)&&delete s[e]}))}i="".concat(t,"/").concat(n,"?").concat(Object(Vt.stringify)(s));break;case"GET_ONE":i="".concat(t,"/").concat(n,"/").concat(r.id);break;case"GET_MANY":var f=Zt[n],g=f?Object(et.a)({},f,r.ids.join(",")):{ids:r.ids.join(",")};i="".concat(t,"/").concat(n,"?").concat(Object(Vt.stringify)(g));break;case"UPDATE":i="".concat(t,"/").concat(n,"/").concat(r.id),o.method="PUT",o.body=JSON.stringify(r.data);break;case"CREATE":i="".concat(t,"/").concat(n),o.method="POST",o.body=JSON.stringify(r.data);break;case"DELETE":i="".concat(t,"/").concat(n,"/").concat(r.id),o.method="DELETE";break;default:throw new Error("Unsupported fetch action type ".concat(a))}return{url:i,options:o}},ea=function(e){var t=e.response,a=e.type,n=e.resource,r=e.params,i=t.headers,o=t.json,s=Jt[n],c=Xt[n];switch(a){case"GET_LIST":case"GET_MANY_REFERENCE":if(!i.has("x-total-count"))throw new Error("The X-Total-Count header is missing in the HTTP Response. The jsonServer REST client expects responses for lists of resources to contain this header with the total number of results to build the pagination. If you are using CORS, did you declare X-Total-Count in the Access-Control-Expose-Headers header?");return{data:s?o.map((function(e){return Yt({},e,{id:"".concat(s.map((function(t){return e[t]})).join("/"))})})):c?o.map((function(e){return e.hasOwnProperty("id")?e:Yt({},e,{id:e[c]})})):o,total:parseInt(i.get("x-total-count"),10)};case"CREATE":return{data:Yt({},r.data,{id:s?s.map((function(e){return o[e]})).join("/"):c?o[c]:o.id})};default:return{data:o||{}}}},ta=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qt.a.fetchJson;return function(){var a=Object(wt.a)(St.a.mark((function a(n,r,i){var o,s,c;return St.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return o=$t({apiUrl:e,type:n,resource:r,params:i}),s=o.url,c=o.options,a.abrupt("return",t(s,c).then((function(e){return ea({response:e,type:n,resource:r,params:i})})));case 2:case"end":return a.stop()}}),a)})));return function(e,t,n){return a.apply(this,arguments)}}()}("https://hocodevn.com/api/v1/curd",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.headers||(t.headers=new Headers({Accept:"application/json"}));var a=localStorage.getItem("token");return t.headers.set("Authorization","Bearer ".concat(a)),qt.a.fetchJson(e,t)})),aa=a(1482),na=a(400),ra=a(150),ia=a(249),oa=a(654),sa=a.n(oa),ca=a(657),la=a.n(ca),ua=a(649),ma=a.n(ua),pa=a(650),da=a.n(pa),ha=a(651),fa=a.n(ha),ga=a(653),ba=a.n(ga),Ea=a(652),va=a.n(Ea),ya=a(655),xa=a.n(ya),ka=a(656),Ca=a.n(ka),_a={books:r.a.createElement(ma.a,{style:{marginRight:1}}),events:r.a.createElement(da.a,{style:{marginRight:1}}),courses:r.a.createElement(fa.a,{style:{marginRight:1}}),tasks:r.a.createElement(va.a,{style:{marginRight:1}}),minitasks:r.a.createElement(ba.a,{style:{marginRight:1}}),profile:r.a.createElement(sa.a,{style:{marginRight:1}}),certs:r.a.createElement(xa.a,{style:{marginRight:1}}),users:r.a.createElement(Ca.a,{style:{marginRight:1}})},Oa=function(e){var t="";switch(e){case"Books":t="S\xe1ch l\u1eadp tr\xecnh";break;case"Events":t="S\u1ef1 ki\u1ec7n";break;case"Courses":t="Ch\u1ee7 \u0111\u1ec1";break;case"Tasks":t="Ch\u1ee7 \u0111\u1ec1 con";break;case"Minitasks":t="B\xe0i h\u1ecdc";break;case"Certs":t="Ch\u1ee9ng ch\u1ec9";break;case"Users":t="Ng\u01b0\u1eddi d\xf9ng";break;default:t=e}return t},ja=Object(C.b)((function(e){return{resources:Object(ia.b)(e)}}))((function(e){var t=e.resources,a=e.onMenuClick,n=e.logout;return r.a.createElement("div",null,r.a.createElement(s.b,{to:"/profile",style:{textDecoration:"none"}},r.a.createElement(re.a,null,r.a.createElement(la.a,{style:{fontSize:23,color:"#1f74be"}}),r.a.createElement("p",{style:{fontSize:14,marginLeft:"1.2em",color:"#1f74be"}},"Quay l\u1ea1i trang ch\u1ee7"))),t?t.map((function(e){return e.hasList?r.a.createElement(na.a,{key:e.name,to:"/".concat(e.name),primaryText:"".concat(Oa((t=e.name,t.toLowerCase().split(" ").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" ")))),onClick:a,leftIcon:_a[e.name]}):null;var t})):"",r.a.createElement(ra.a,{small:n,medium:null}))})),Sa=function(e){return r.a.createElement(aa.a,Object.assign({},e,{menu:ja}))},wa=a(720),Ta=a(669),Na=a.n(Ta),La=a(670),Ia=a.n(La),Da=Object(wa.a)({palette:{primary:Na.a,secondary:{main:"#1f74be"},error:Ia.a}}),Ra=a(1478),Fa=a(1484),Ma=a(1450),za=a(1451),Aa=a(1452),Ua=a(1356),Ba=a(1495),Pa=a(1488),Ha=a(1453),Wa=a(1489),Ga=a(671),Va=a(1352),qa=function(e){return r.a.createElement(Ga.a,e,r.a.createElement(Va.a,{label:"Save",submitOnEnter:!0}),r.a.createElement(Va.a,{label:"Save and Continue Editing",redirect:!1,submitOnEnter:!1,variant:"flat"}),r.a.createElement(Ua.a,null))},Ka=a(1486),Ya=function(e){return r.a.createElement(Ka.a,e)},Ja=function(e){return r.a.createElement(Ra.a,Object.assign({},e,{title:"Danh s\xe1ch S\xe1ch l\u1eadp tr\xecnh",filters:r.a.createElement(Ya,null),bulkActionButtons:!1}),r.a.createElement(Fa.a,null,r.a.createElement(Ma.a,{source:"title",sortable:!1}),r.a.createElement(za.a,{className:"thumbNailView",source:"image",sortable:!1}),r.a.createElement(Aa.a,null),r.a.createElement(Ua.a,null)))},Xa=function(e){return r.a.createElement(Ba.a,Object.assign({},e,{title:"T\u1ea1o S\xe1ch l\u1eadp tr\xecnh"}),r.a.createElement(Pa.a,{redirect:"show"},r.a.createElement(Ha.a,{resettable:!0,source:"title"}),r.a.createElement(Ha.a,{resettable:!0,source:"image"}),r.a.createElement(Ha.a,{resettable:!0,multiline:!0,source:"content"})))},Qa=function(e){return r.a.createElement(Wa.a,Object.assign({},e,{title:"S\u1eeda S\xe1ch l\u1eadp tr\xecnh"}),r.a.createElement(Pa.a,{toolbar:r.a.createElement(qa,null)},r.a.createElement(Ha.a,{resettable:!0,source:"id",disabled:!0}),r.a.createElement(Ha.a,{resettable:!0,source:"title"}),r.a.createElement(Ha.a,{resettable:!0,source:"image"}),r.a.createElement(Ha.a,{resettable:!0,multiline:!0,source:"content"})))},Za=function(e){return r.a.createElement(Ga.a,e,r.a.createElement(Va.a,{label:"Save",submitOnEnter:!0}),r.a.createElement(Va.a,{label:"Save and Continue Editing",redirect:!1,submitOnEnter:!1,variant:"flat"}),r.a.createElement(Ua.a,null))},$a=function(e){return r.a.createElement(Ka.a,e)},en=function(e){return r.a.createElement(Ra.a,Object.assign({},e,{title:"Danh s\xe1ch Ch\u1ee7 \u0111\u1ec1",filters:r.a.createElement($a,null),bulkActionButtons:!1}),r.a.createElement(Fa.a,null,r.a.createElement(Ma.a,{source:"course_name",sortable:!1}),r.a.createElement(Ma.a,{source:"total_minitask",sortable:!1}),r.a.createElement(za.a,{className:"thumbNailView",source:"background_image",sortable:!1}),r.a.createElement(Aa.a,null),r.a.createElement(Ua.a,null)))},tn=function(e){return r.a.createElement(Ba.a,Object.assign({},e,{title:"T\u1ea1o Ch\u1ee7 \u0111\u1ec1"}),r.a.createElement(Pa.a,{redirect:"show"},r.a.createElement(Ha.a,{resettable:!0,source:"course_name"}),r.a.createElement(Ha.a,{resettable:!0,source:"background_image"}),r.a.createElement(Ha.a,{resettable:!0,multiline:!0,source:"course_desc"})))},an=function(e){return r.a.createElement(Wa.a,Object.assign({},e,{title:"S\u1eeda Ch\u1ee7 \u0111\u1ec1"}),r.a.createElement(Pa.a,{toolbar:r.a.createElement(Za,null)},r.a.createElement(Ha.a,{resettable:!0,source:"id",disabled:!0}),r.a.createElement(Ha.a,{resettable:!0,source:"course_name"}),r.a.createElement(Ha.a,{resettable:!0,source:"background_image"}),r.a.createElement(Ha.a,{resettable:!0,multiline:!0,source:"course_desc"})))},nn=function(e){return r.a.createElement(Ga.a,e,r.a.createElement(Va.a,{label:"Save",submitOnEnter:!0}),r.a.createElement(Va.a,{label:"Save and Continue Editing",redirect:!1,submitOnEnter:!1,variant:"flat"}),r.a.createElement(Ua.a,null))},rn=function(e){return r.a.createElement(Ka.a,e)},on=function(e){return r.a.createElement(Ra.a,Object.assign({},e,{title:"Danh s\xe1ch S\u1ef1 ki\u1ec7n",filters:r.a.createElement(rn,null),bulkActionButtons:!1}),r.a.createElement(Fa.a,null,r.a.createElement(Ma.a,{source:"title",sortable:!1}),r.a.createElement(Ma.a,{source:"link",sortable:!1}),r.a.createElement(za.a,{className:"thumbNailView",source:"image",sortable:!1}),r.a.createElement(Aa.a,null),r.a.createElement(Ua.a,null)))},sn=function(e){return r.a.createElement(Ba.a,Object.assign({},e,{title:"T\u1ea1o S\u1ef1 ki\u1ec7n"}),r.a.createElement(Pa.a,{redirect:"show"},r.a.createElement(Ha.a,{resettable:!0,source:"title"}),r.a.createElement(Ha.a,{resettable:!0,source:"link"}),r.a.createElement(Ha.a,{resettable:!0,source:"image"}),r.a.createElement(Ha.a,{resettable:!0,multiline:!0,source:"content"})))},cn=function(e){return r.a.createElement(Wa.a,Object.assign({},e,{title:"S\u1eeda S\u1ef1 ki\u1ec7n"}),r.a.createElement(Pa.a,{toolbar:r.a.createElement(nn,null)},r.a.createElement(Ha.a,{resettable:!0,source:"id",disabled:!0}),r.a.createElement(Ha.a,{resettable:!0,source:"title"}),r.a.createElement(Ha.a,{resettable:!0,source:"link"}),r.a.createElement(Ha.a,{resettable:!0,source:"image"}),r.a.createElement(Ha.a,{resettable:!0,multiline:!0,source:"content"})))},ln=a(1454),un=(a(1281),function(e){function t(){var e,a;Object(l.a)(this,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(a=Object(m.a)(this,(e=Object(p.a)(t)).call.apply(e,[this].concat(r)))).handleChange=function(e){a.props.handleMarkdownChange(e)},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){return r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement(Ct.a,{style:{width:"350px"},className:"react_mde_custom",label:"",value:this.props.mini_task_desc,onChange:this.handleChange,options:{spellChecker:!1}}))}}]),t}(n.Component)),mn=(a(623),a(237).js),pn=function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this,t=this.props.inputList||[],a="";""!==this.props.name_func&&(a="public ".concat(this.props.output_type_func," ").concat(this.props.name_func,"(").concat(t.map((function(e){return"".concat(e.input_type," ").concat(e.input_name)})).join(),"){ \n    \n      }"));var n=mn(a,{indent_size:2});return r.a.createElement(he.Controlled,{value:n,options:{mode:"javascript",theme:"material",lineNumbers:!0,highlightSelectionMatches:!0,indentUnit:4,tabSize:4,lineWrapping:!0,dragDrop:!1,autoCloseBrackets:!0,spellcheck:!0,autocorrect:!0,extraKeys:{"Ctrl-Space":"autocomplete"},readOnly:!0},MarkText:{from:{line:0,ch:1},to:{line:3,ch:1},css:"font-size:5px"},onBeforeChange:function(t,a,n){e.props.updateTemplateCode(n)},onChange:function(e,t,a){}})}}]),t}(n.Component),dn=a(237).js,hn=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).createFileTest=a.createFileTest.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"createFileTest",value:function(e){var t="";return!0===e.output_type_func.includes("[]")?(t="import static org.junit.Assert.assertArrayEquals;\n    import org.junit.Test;\n    import org.junit.runners.JUnit4;\n    public class TestFixture {\n    public TestFixture(){}\n ",e.unit_tests.forEach((function(a,n){var r="";a.inputs.forEach((function(e){!0===e.type.includes("[]")?r+="new ".concat(e.type," ").concat(e.value,","):r+="".concat(e.value,",")}));var i=r.substring(0,r.length-1);"double[]"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertArrayEquals("test ').concat(n+1,'", ').concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"),0);\n  }\n"):t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertArrayEquals("test ').concat(n+1,'", new ').concat(e.output_type_func," ").concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"));\n  }\n")})),t+="}"):(t="import static org.junit.Assert.assertEquals;\n    import org.junit.Test;\n    import org.junit.runners.JUnit4;\n    public class TestFixture {\n    public TestFixture(){}\n ",e.unit_tests.forEach((function(a,n){var r="";a.inputs.forEach((function(e){!0===e.type.includes("[]")?r+="new ".concat(e.type," ").concat(e.value,","):r+="".concat(e.value,",")}));var i=r.substring(0,r.length-1);"double"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", ').concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"),0);\n  }\n"):"String"===e.output_type_func?t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", "').concat(a.expected_output,'", s.').concat(e.name_func,"(").concat(i,"));\n  }\n"):t+=" @Test\n    public void myTestFunction".concat(n+1,'(){\n    Solution s = new Solution();\n  assertEquals("test ').concat(n+1,'", ').concat(a.expected_output,", s.").concat(e.name_func,"(").concat(i,"));\n  }\n")})),t+="}"),t}},{key:"render",value:function(){var e=this,t={output_type_func:this.props.output_type_func,unit_tests:this.props.unit_tests,name_func:this.props.name_func},a=dn(this.createFileTest(t),{indent_size:2});return r.a.createElement(he.Controlled,{value:a,options:{mode:"javascript",theme:"material",lineNumbers:!0,highlightSelectionMatches:!0,indentUnit:4,tabSize:4,lineWrapping:!0,dragDrop:!1,autoCloseBrackets:!0,spellcheck:!0,autocorrect:!0,extraKeys:{"Ctrl-Space":"autocomplete"},readOnly:!0},MarkText:{from:{line:0,ch:1},to:{line:3,ch:1},css:"font-size:5px"},onBeforeChange:function(t,a,n){e.props.updateTemplateCode(n)},onChange:function(e,t,a){}})}}]),t}(n.Component);a(624);function fn(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}var gn=[{value:"int",label:"Interger"},{value:"String",label:"String"},{value:"double",label:"Double"},{value:"double[]",label:"Double Array"},{value:"String[]",label:"String Array"},{value:"int[]",label:"Interger Array"}],bn=[{value:"easy",label:"Easy"},{value:"medium",label:"Medium"},{value:"hard",label:"Hard"}],En={menu:function(e){return function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(a),!0).forEach((function(t){Object(et.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):fn(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},e,{zIndex:999})}},vn=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={name:"",name_func:"",output_type_func:"int",point_unlock:0,status:"yeucaumokhoa",vitri:!1,mini_task_desc:"",level:"easy",user_code:"",unit_tests:[],taskId:"",inputList:[],coursesOption:[],courses:[],tasksOption:[],course_id:"",task_id:"",code_point:0},a.output_type_func=r.a.createRef(),a.courses_ref=r.a.createRef(),a.tasks_ref=r.a.createRef(),a.level_ref=r.a.createRef(),a.handleSimpleInputChange=a.handleSimpleInputChange.bind(Object(k.a)(a)),a.onSelectChange=a.onSelectChange.bind(Object(k.a)(a)),a.onCoursesSelectChange=a.onCoursesSelectChange.bind(Object(k.a)(a)),a.onTasksSelectChange=a.onTasksSelectChange.bind(Object(k.a)(a)),a.onSelectChange=a.onSelectChange.bind(Object(k.a)(a)),a.handleMarkdownChange=a.handleMarkdownChange.bind(Object(k.a)(a)),a.handleSubmit=a.handleSubmit.bind(Object(k.a)(a)),a.updateTemplateCode=a.updateTemplateCode.bind(Object(k.a)(a)),a.handleRemoveInput=a.handleRemoveInput.bind(Object(k.a)(a)),a.handleRemoveUnitTest=a.handleRemoveUnitTest.bind(Object(k.a)(a)),a.onLevelSelectChange=a.onLevelSelectChange.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/courses").then((function(t){var a=t.data,n=a.filter((function(e){return e.tasks.length>0})),r=n.map((function(e){return{value:e.id,label:e.course_name}}));e.setState({courses:n,coursesOption:r,tasksOption:a[0].tasks.map((function(e){return{value:e.id,label:e.task_name}}))}),console.log(a),e.setState({course_id:a[0].id,task_id:0===a[0].tasks.length?"":a[0].tasks[0].id})}))}},{key:"handleSimpleInputChange",value:function(e){var t=e.target,a=t.value,n=t.name;this.setState((function(e,t){return Object(et.a)({},n,a)}))}},{key:"handleMarkdownChange",value:function(e){this.setState({mini_task_desc:e})}},{key:"handleSubmit",value:function(){var e=Object(wt.a)(St.a.mark((function e(){var t,a;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="public ".concat(this.state.output_type_func," ").concat(this.state.name_func,"(").concat(this.state.inputList.map((function(e){return"".concat(e.input_type," ").concat(e.input_name)})).join(),")\n{ \n}"),a={template_code:t,unit_tests:this.state.unit_tests,task_id:this.state.task_id,mini_task_name:this.state.name,name_func:this.state.name_func,output_type_func:this.state.output_type_func,point_unlock:0,status:"chuahoanthanh",vitri:!1,mini_task_desc:this.state.mini_task_desc,level:this.state.level,code_point:parseInt(this.state.code_point),input_list:this.state.inputList},b.a.post("https://hocodevn.com/api/v1/minitasks",a).then((function(e){window.location.reload(),Object(Be.b)("T\u1ea1o b\xe0i th\u1ef1c h\xe0nh th\xe0nh c\xf4ng!",{containerId:"B"}),console.log(e)})),console.log(a);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onSelectChange",value:function(e){var t=this.output_type_func.current.props.name;this.setState(Object(et.a)({},t,e.value))}},{key:"onCoursesSelectChange",value:function(){var e=Object(wt.a)(St.a.mark((function e(t){var a,n,r;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState((function(e,t){return{tasksOption:[]}})),console.log(t),n=this.courses_ref.current.props.name,e.next=5,this.state.courses.find((function(e){return e.id===t.value}));case 5:r=e.sent,console.log(r),this.setState((a={},Object(et.a)(a,n,t.value),Object(et.a)(a,"tasksOption",r.tasks.map((function(e){return{value:e.id,label:e.task_name}}))),Object(et.a)(a,"task_id",r.tasks[0].id),a));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onTasksSelectChange",value:function(e){var t=this.tasks_ref.current.props.name;this.setState(Object(et.a)({},t,e.value))}},{key:"onLevelSelectChange",value:function(e){var t=this.level_ref.current.props.name;this.setState(Object(et.a)({},t,e.value)),console.log(t,e)}},{key:"updateTemplateCode",value:function(e){this.setState({template_code:e})}},{key:"addInput",value:function(){this.setState({inputList:[].concat(Object(Ot.a)(this.state.inputList),[{input_name:"",input_type:"int"}]),unit_tests:[]})}},{key:"handleRemoveInput",value:function(e){this.state.inputList.splice(e,1),this.setState({inputList:this.state.inputList,unit_tests:[]})}},{key:"handleRemoveUnitTest",value:function(e){this.state.unit_tests.splice(e,1),this.setState({unit_tests:this.state.unit_tests})}},{key:"handleListInputNameChange",value:function(e,t){this.state.inputList[t].input_name=e.target.value,this.setState({inputList:this.state.inputList})}},{key:"handleListInputTypeChange",value:function(e,t){this.state.inputList[t].input_type=e.value,this.setState({inputList:this.state.inputList})}},{key:"addTest",value:function(){var e=[];this.state.inputList.forEach((function(t,a){e.push({value:"",type:t.input_type})})),this.setState({unit_tests:[].concat(Object(Ot.a)(this.state.unit_tests),[{inputs:e,expected_output:" "}])})}},{key:"handleOutputTestChange",value:function(e,t){this.state.unit_tests[t].expected_output=e.target.value,this.setState({unit_tests:this.state.unit_tests})}},{key:"handleInputTestChange",value:function(e,t,a){this.state.unit_tests[t].inputs[a].value=e.target.value,this.setState({unit_tests:this.state.unit_tests})}},{key:"render",value:function(){var e=this,t=this.props.classes;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},r.a.createElement("div",null,"T\u1ea1o b\xe0i th\u1ef1c h\xe0nh")),r.a.createElement(h.a,{container:!0,className:t.CreateMiniTaskBodyContainer,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement(h.a,{style:{background:"aliceblue",padding:"8px"}},void 0!==this.state.coursesOption[0]?r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"Ch\u1ecdn ch\u1ee7 \u0111\u1ec1:"),r.a.createElement(Tt.a,{styles:En,options:this.state.coursesOption,ref:this.courses_ref,name:"course_id",defaultValue:this.state.coursesOption[0],onChange:this.onCoursesSelectChange})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"Ch\u1ecdn ch\u1ee7 \u0111\u1ec1 con:"),r.a.createElement(Tt.a,{styles:En,options:this.state.tasksOption,ref:this.tasks_ref,name:"task_id",defaultValue:this.state.tasksOption[0],onChange:this.onTasksSelectChange}))):"",r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"T\xean b\xe0i th\u1ef1c h\xe0nh:"),r.a.createElement("input",{name:"name",className:"input-createminitask",onChange:this.handleSimpleInputChange})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"T\xean Function:"),r.a.createElement("input",{name:"name_func",className:"input-createminitask",onChange:this.handleSimpleInputChange})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"S\u1ed1 \u0111\u1eadu:"),r.a.createElement("input",{name:"code_point",className:"input-createminitask",onChange:this.handleSimpleInputChange})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"Ch\u1ecdn \u0111\u1ed9 kh\xf3:"),r.a.createElement(Tt.a,{styles:En,options:bn,ref:this.level_ref,name:"level",defaultValue:bn[0],onChange:this.onLevelSelectChange}))),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,xs:12,md:12}," ",r.a.createElement("div",{style:{marginBottom:10,marginTop:10}},"Ki\u1ec3u tr\u1ea3 v\u1ec1:"),r.a.createElement(Tt.a,{className:"select_type",styles:En,options:gn,ref:this.output_type_func,name:"output_type_func",defaultValue:gn[0],onChange:this.onSelectChange}))),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,xs:12,md:12},r.a.createElement("div",{style:{marginBottom:10,marginTop:10}},"M\xf4 t\u1ea3 b\xe0i to\xe1n:"),r.a.createElement(un,{handleMarkdownChange:this.handleMarkdownChange,mini_task_desc:this.state.mini_task_desc}))))),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",{className:"codeEditorCreateMiniTask"},r.a.createElement(pn,{output_type_func:this.state.output_type_func,name_func:this.state.name_func,inputList:this.state.inputList,updateTemplateCode:this.updateTemplateCode})),r.a.createElement(h.a,{container:!0,style:{marginTop:20}},r.a.createElement(h.a,{item:!0,xs:12,md:12,sm:12,style:{background:"aliceblue",padding:"10px"}},r.a.createElement("div",null,this.state.inputList.map((function(a,n){return r.a.createElement("div",{key:n},r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:5,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12},"T\xean tham s\u1ed1:"),r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement("input",{className:"input-createminitask",value:a.input_name,onChange:function(t){return e.handleListInputNameChange(t,n)}}))),r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:5,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12},"kKi\u1ec3u tham s\u1ed1:"),r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement(Tt.a,{options:gn,defaultValue:gn[0],onChange:function(t){return e.handleListInputTypeChange(t,n)}}))),r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:2,style:{alignItems:"flex-end"}},r.a.createElement(h.a,{item:!0},r.a.createElement(Ye.a,{className:t.button,variant:"contained",style:{color:"white",background:"#ca0000"},onClick:function(){e.handleRemoveInput(n)}},"x\xf3a")))),r.a.createElement(Lt.a,{style:{margin:"5px auto",width:"50%"}}))}))," "),r.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px 0px"}},r.a.createElement(Ye.a,{variant:"contained",style:{background:"#2a92ed",color:"white"},className:t.button,onClick:function(t){return e.addInput(t)}},"Th\xeam tham s\u1ed1"))),r.a.createElement(Lt.a,{style:{margin:"20px auto",width:"50%"}}))),r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:12,md:12},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12,style:{justifyContent:"center",textAlign:"center"}}," ","T\u1ea1o unit test"),r.a.createElement(h.a,{item:!0,xs:12,md:12,sm:12,style:{background:"aliceblue",padding:"10px"}},r.a.createElement("div",null,this.state.unit_tests.map((function(a,n){return r.a.createElement("div",{key:n,style:{padding:10}}," ","Test ",n+1,r.a.createElement(ht.a,{style:{padding:10}},r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},"Inputs:"),a.inputs.map((function(t,a){return r.a.createElement(h.a,{item:!0,xs:12,sm:4,md:4,key:a},r.a.createElement("input",{className:"input-createminitask",value:t.value,onChange:function(t){return e.handleInputTestChange(t,n,a)},placeholder:"param ".concat(a+1)}))}))),r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},"Out put"),r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},r.a.createElement("input",{className:"output_createminitask",value:a.expected_output,onChange:function(t){return e.handleOutputTestChange(t,n)}}))),r.a.createElement(h.a,{container:!0,style:{justifyContent:"center"}},r.a.createElement(h.a,{item:!0},r.a.createElement(Ye.a,{className:t.button,variant:"contained",style:{color:"white",background:"#ca0000"},onClick:function(){e.handleRemoveUnitTest(n)}},"x\xf3a")))))}))),r.a.createElement("div",null,r.a.createElement("div",{className:"codeEditorShowUnitTest"},r.a.createElement(hn,{output_type_func:this.state.output_type_func,name_func:this.state.name_func,unit_tests:this.state.unit_tests}))),r.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px 0px"}},r.a.createElement(Ye.a,{className:t.button,style:{background:"#2a92ed",color:"white"},variant:"contained",onClick:function(t){return e.addTest(t)}},"Th\xeam test"))),r.a.createElement(h.a,{container:!0,item:!0,xs:12,md:12,sm:12,style:{justifyContent:"flex-end",padding:"10px"}},r.a.createElement(h.a,{item:!0},r.a.createElement(Ye.a,{variant:"contained",style:{background:"#2fbe6f ",color:"white"},className:t.button,onClick:this.handleSubmit},"submit"))))),r.a.createElement(Be.a,{enableMultiContainer:!0,containerId:"B",position:Be.b.POSITION.TOP_RIGHT}))}}]),t}(n.Component),yn=Object(f.a)({CreateMiniTaskBodyContainer:{minHeight:"100vh",padding:40},button:{textTransform:"none"}})(vn);function xn(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}var kn=[{value:"int",label:"Interger"},{value:"String",label:"String"},{value:"double",label:"Double"},{value:"double[]",label:"Double Array"},{value:"String[]",label:"String Array"},{value:"int[]",label:"Interger Array"}],Cn=[{value:"easy",label:"Easy"},{value:"medium",label:"Medium"},{value:"hard",label:"Hard"}],_n={menu:function(e){return function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?xn(Object(a),!0).forEach((function(t){Object(et.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):xn(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},e,{zIndex:999})}},On=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={name:"",name_func:"",output_type_func:"int",point_unlock:0,status:"yeucaumokhoa",vitri:!1,mini_task_desc:"",level:"",user_code:"",unit_tests:[],taskId:"",inputList:[],coursesOption:[],courses:[],tasksOption:[],course_id:"",task_id:"",code_point:0,course:{value:"",label:""},task:{value:"",label:""},output_type_func_select:kn[0],level_ref_select:Cn[0],courses_option_select:{value:"",label:""},task_option_select:{value:"",label:""}},a.output_type_func=r.a.createRef(),a.courses_ref=r.a.createRef(),a.tasks_ref=r.a.createRef(),a.level_ref=r.a.createRef(),a.handleSimpleInputChange=a.handleSimpleInputChange.bind(Object(k.a)(a)),a.onSelectChange=a.onSelectChange.bind(Object(k.a)(a)),a.onCoursesSelectChange=a.onCoursesSelectChange.bind(Object(k.a)(a)),a.onTasksSelectChange=a.onTasksSelectChange.bind(Object(k.a)(a)),a.onSelectChange=a.onSelectChange.bind(Object(k.a)(a)),a.handleMarkdownChange=a.handleMarkdownChange.bind(Object(k.a)(a)),a.handleSubmit=a.handleSubmit.bind(Object(k.a)(a)),a.updateTemplateCode=a.updateTemplateCode.bind(Object(k.a)(a)),a.handleRemoveInput=a.handleRemoveInput.bind(Object(k.a)(a)),a.handleRemoveUnitTest=a.handleRemoveUnitTest.bind(Object(k.a)(a)),a.onLevelSelectChange=a.onLevelSelectChange.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e,t=this;b.a.get("https://hocodevn.com/api/v1/minitasks/".concat(this.props.minitasksId)).then((function(a){console.log(a.data),e=a.data;var n=kn.find((function(t){return t.value===e.output_type_func})),r=Cn.find((function(t){return t.value===e.level}));t.setState({template_code:e.template_code,unit_tests:e.unit_tests,task_id:e.task_id,name:e.mini_task_name,name_func:e.name_func,output_type_func:e.output_type_func,point_unlock:e.point_unlock,status:e.status,vitri:e.vitri,mini_task_desc:e.mini_task_desc,level:e.level,code_point:e.code_point,inputList:e.input_list||[],output_type_func_select:n,level_ref_select:r})})),b.a.get("https://hocodevn.com/api/v1/courses").then((function(a){for(var n=a.data,r=n.filter((function(e){return e.tasks.length>0})),i=r.map((function(e){return{value:e.id,label:e.course_name}})),o=[],s=function(e){n[e].tasks.map((function(t){o.push({value:t.id,label:t.task_name,courses:{value:n[e].id,label:n[e].course_name},tasksoption:n[e].tasks.map((function(e){return{value:e.id,label:e.task_name}}))})}))},c=0;c<n.length;c++)s(c);var l=o.find((function(t){return t.value===e.task_id}));console.log(o),console.log(l),t.setState({courses:r,coursesOption:i,tasksOption:l.tasksoption,courses_option_select:l.courses,task_option_select:l})}))}},{key:"handleSimpleInputChange",value:function(e){var t=e.target,a=t.value,n=t.name;this.setState((function(e,t){return Object(et.a)({},n,a)}))}},{key:"handleMarkdownChange",value:function(e){this.setState({mini_task_desc:e})}},{key:"handleSubmit",value:function(){var e=Object(wt.a)(St.a.mark((function e(){var t,a;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="public ".concat(this.state.output_type_func," ").concat(this.state.name_func,"(").concat(this.state.inputList.map((function(e){return"".concat(e.input_type," ").concat(e.input_name)})).join(),")\n{ \n}"),a={template_code:t,unit_tests:this.state.unit_tests,task_id:this.state.task_id,mini_task_name:this.state.name,name_func:this.state.name_func,output_type_func:this.state.output_type_func,point_unlock:0,status:"chuahoanthanh",vitri:!1,mini_task_desc:this.state.mini_task_desc,level:this.state.level,code_point:parseInt(this.state.code_point),input_list:this.state.inputList},b.a.put("https://hocodevn.com/api/v1/curd/minitasks/".concat(this.props.minitasksId),a).then((function(e){Object(Be.b)("S\u1eeda b\xe0i th\xe0nh c\xf4ng!",{containerId:"B"}),console.log(e)})),console.log(a);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onSelectChange",value:function(e){var t=this.output_type_func.current.props.name;this.setState(Object(et.a)({},t,e.value))}},{key:"onCoursesSelectChange",value:function(){var e=Object(wt.a)(St.a.mark((function e(t){var a,n,r;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState((function(e,t){return{tasksOption:[]}})),console.log(t),n=this.courses_ref.current.props.name,e.next=5,this.state.courses.find((function(e){return e.id===t.value}));case 5:r=e.sent,console.log(r),this.setState((a={},Object(et.a)(a,n,t.value),Object(et.a)(a,"tasksOption",r.tasks.map((function(e){return{value:e.id,label:e.task_name}}))),Object(et.a)(a,"task_id",r.tasks[0].id),Object(et.a)(a,"courses_option_select",t),a));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onTasksSelectChange",value:function(e){var t,a=this.tasks_ref.current.props.name;this.setState((t={},Object(et.a)(t,a,e.value),Object(et.a)(t,"task_option_select",e),t))}},{key:"onLevelSelectChange",value:function(e){var t=this.level_ref.current.props.name;this.setState(Object(et.a)({},t,e.value)),console.log(t,e)}},{key:"updateTemplateCode",value:function(e){this.setState({template_code:e})}},{key:"addInput",value:function(){this.setState({inputList:[].concat(Object(Ot.a)(this.state.inputList),[{input_name:"",input_type:"int"}]),unit_tests:[]})}},{key:"handleRemoveInput",value:function(e){this.state.inputList.splice(e,1),this.setState({inputList:this.state.inputList,unit_tests:[]})}},{key:"handleRemoveUnitTest",value:function(e){this.state.unit_tests.splice(e,1),this.setState({unit_tests:this.state.unit_tests})}},{key:"handleListInputNameChange",value:function(e,t){this.state.inputList[t].input_name=e.target.value,this.setState({inputList:this.state.inputList})}},{key:"handleListInputTypeChange",value:function(e,t){this.state.inputList[t].input_type=e.value,this.setState({inputList:this.state.inputList})}},{key:"addTest",value:function(){var e=[];this.state.inputList.forEach((function(t,a){e.push({value:"",type:t.input_type})})),this.setState({unit_tests:[].concat(Object(Ot.a)(this.state.unit_tests),[{inputs:e,expected_output:" "}])})}},{key:"handleOutputTestChange",value:function(e,t){this.state.unit_tests[t].expected_output=e.target.value,this.setState({unit_tests:this.state.unit_tests})}},{key:"handleInputTestChange",value:function(e,t,a){this.state.unit_tests[t].inputs[a].value=e.target.value,this.setState({unit_tests:this.state.unit_tests})}},{key:"render",value:function(){var e=this,t=this.props.classes;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},r.a.createElement("div",null,"S\u1eeda b\xe0i th\u1ef1c h\xe0nh")),r.a.createElement(h.a,{container:!0,className:t.CreateMiniTaskBodyContainer,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement(h.a,{style:{background:"aliceblue",padding:"8px"}},void 0!==this.state.coursesOption[0]?r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"Ch\u1ecdn ch\u1ee7 \u0111\u1ec1:"),r.a.createElement(Tt.a,{styles:_n,options:this.state.coursesOption,ref:this.courses_ref,name:"course_id",onChange:this.onCoursesSelectChange,value:this.state.courses_option_select})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"Ch\u1ecdn ch\u1ee7 \u0111\u1ec1 con:"),r.a.createElement(Tt.a,{styles:_n,options:this.state.tasksOption,ref:this.tasks_ref,name:"task_id",onChange:this.onTasksSelectChange,value:this.state.task_option_select}))):"",r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"T\xean b\xe0i th\u1ef1c h\xe0nh:"),r.a.createElement("input",{name:"name",className:"input-createminitask",onChange:this.handleSimpleInputChange,value:this.state.name})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"T\xean Function:"),r.a.createElement("input",{name:"name_func",className:"input-createminitask",onChange:this.handleSimpleInputChange,value:this.state.name_func})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"S\u1ed1 \u0111\u1eadu:"),r.a.createElement("input",{name:"code_point",type:"number",className:"input-createminitask",onChange:this.handleSimpleInputChange,value:this.state.code_point})),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",null,"Ch\u1ecdn \u0111\u1ed9 kh\xf3:"),r.a.createElement(Tt.a,{styles:_n,options:Cn,value:this.state.level_ref_select,defaultValue:Cn[0],ref:this.level_ref,name:"level",onChange:this.onLevelSelectChange}))),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,xs:12,md:12}," ",r.a.createElement("div",{style:{marginBottom:10,marginTop:10}},"Ki\u1ec3u tr\u1ea3 v\u1ec1:"),r.a.createElement(Tt.a,{className:"select_type",styles:_n,options:kn,ref:this.output_type_func,name:"output_type_func",value:this.state.output_type_func_select,defaultValue:kn[0],onChange:this.onSelectChange}))),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,container:!0,xs:12,md:12},r.a.createElement(h.a,{item:!0,xs:12,md:12},r.a.createElement("div",{style:{marginBottom:10,marginTop:10}},"M\xf4 t\u1ea3 b\xe0i to\xe1n:")),r.a.createElement(un,{handleMarkdownChange:this.handleMarkdownChange,mini_task_desc:this.state.mini_task_desc}))))),r.a.createElement(h.a,{item:!0,xs:12,sm:6,md:6},r.a.createElement("div",{className:"codeEditorCreateMiniTask"},r.a.createElement(pn,{output_type_func:this.state.output_type_func,name_func:this.state.name_func,inputList:this.state.inputList,updateTemplateCode:this.updateTemplateCode})),r.a.createElement(h.a,{container:!0,style:{marginTop:20}},r.a.createElement(h.a,{item:!0,xs:12,md:12,sm:12,style:{background:"aliceblue",padding:"10px"}},r.a.createElement("div",null,this.state.inputList.map((function(a,n){return r.a.createElement("div",{key:n},r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:5,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12},"T\xean tham s\u1ed1:"),r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement("input",{className:"input-createminitask",value:a.input_name,onChange:function(t){return e.handleListInputNameChange(t,n)}}))),r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:5,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12},"ki\u1ec3u tham s\u1ed1:"),r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement(Tt.a,{options:kn,onChange:function(t){return e.handleListInputTypeChange(t,n)}}))),r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:2,style:{alignItems:"flex-end"}},r.a.createElement(h.a,{item:!0},r.a.createElement(Ye.a,{className:t.button,variant:"contained",style:{color:"white",background:"#ca0000"},onClick:function(){e.handleRemoveInput(n)}},"x\xf3a")))),r.a.createElement(Lt.a,{style:{margin:"5px auto",width:"50%"}}))}))," "),r.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px 0px"}},r.a.createElement(Ye.a,{variant:"contained",style:{background:"#2a92ed",color:"white"},className:t.button,onClick:function(t){return e.addInput(t)}},"Th\xeam tham s\u1ed1"))),r.a.createElement(Lt.a,{style:{margin:"20px auto",width:"50%"}}))),r.a.createElement(h.a,{item:!0,container:!0,xs:12,sm:12,md:12},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12,style:{justifyContent:"center",textAlign:"center"}}," ","T\u1ea1o unit test"),r.a.createElement(h.a,{item:!0,xs:12,md:12,sm:12,style:{background:"aliceblue",padding:"10px"}},r.a.createElement("div",null,this.state.unit_tests.map((function(a,n){return r.a.createElement("div",{key:n,style:{padding:10}}," ","Test ",n+1,r.a.createElement(ht.a,{style:{padding:10}},r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},"Inputs:"),a.inputs.map((function(t,a){return r.a.createElement(h.a,{item:!0,xs:12,sm:4,md:4,key:a},r.a.createElement("input",{className:"input-createminitask",value:t.value,onChange:function(t){return e.handleInputTestChange(t,n,a)},placeholder:"param ".concat(a+1)}))}))),r.a.createElement(h.a,{container:!0,spacing:1},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},"Out put"),r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},r.a.createElement("input",{className:"output_createminitask",value:a.expected_output,onChange:function(t){return e.handleOutputTestChange(t,n)}}))),r.a.createElement(h.a,{container:!0,style:{justifyContent:"center"}},r.a.createElement(h.a,{item:!0},r.a.createElement(Ye.a,{className:t.button,variant:"contained",style:{color:"white",background:"#ca0000"},onClick:function(){e.handleRemoveUnitTest(n)}},"x\xf3a")))))}))),r.a.createElement("div",null,r.a.createElement("div",{className:"codeEditorShowUnitTest"},r.a.createElement(hn,{output_type_func:this.state.output_type_func,name_func:this.state.name_func,unit_tests:this.state.unit_tests}))),r.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px 0px"}},r.a.createElement(Ye.a,{className:t.button,style:{background:"#2a92ed",color:"white"},variant:"contained",onClick:function(t){return e.addTest(t)}},"Th\xeam test"))),r.a.createElement(h.a,{container:!0,item:!0,xs:12,md:12,sm:12,style:{justifyContent:"flex-end",padding:"10px"}},r.a.createElement(h.a,{item:!0},r.a.createElement(Ye.a,{variant:"contained",style:{background:"#2fbe6f ",color:"white"},className:t.button,onClick:this.handleSubmit},"Thay \u0111\u1ed5i"))))),r.a.createElement(Be.a,{enableMultiContainer:!0,containerId:"B",position:Be.b.POSITION.TOP_RIGHT}))}}]),t}(n.Component),jn=Object(f.a)({CreateMiniTaskBodyContainer:{minHeight:"100vh",padding:40},button:{textTransform:"none"}})(On),Sn=function(e){return r.a.createElement(Ka.a,e)},wn=function(e){return r.a.createElement(Ra.a,Object.assign({},e,{title:"Danh s\xe1ch B\xe0i h\u1ecdc",filters:r.a.createElement(Sn,null),bulkActionButtons:!1}),r.a.createElement(Fa.a,null,r.a.createElement(Ma.a,{source:"mini_task_name",sortable:!1}),r.a.createElement(ln.a,{source:"code_point",sortable:!1}),r.a.createElement(Ma.a,{source:"output_type_func",sortable:!1}),r.a.createElement(Ma.a,{source:"template_code",sortable:!1}),r.a.createElement(Aa.a,null),r.a.createElement(Ua.a,null)))},Tn=function(e){return r.a.createElement(yn,null)},Nn=function(e){return r.a.createElement(jn,{minitasksId:e.id})},Ln=a(1456),In=a(1455),Dn=function(e){return r.a.createElement(Ga.a,e,r.a.createElement(Va.a,{label:"Save",submitOnEnter:!0}),r.a.createElement(Va.a,{label:"Save and Continue Editing",redirect:!1,submitOnEnter:!1,variant:"flat"}),r.a.createElement(Ua.a,null))},Rn=function(e){return r.a.createElement(Ka.a,e)},Fn=function(e){return r.a.createElement(Ra.a,Object.assign({},e,{title:"Danh s\xe1ch Ch\u1ee7 \u0111\u1ec1 con",filters:r.a.createElement(Rn,null),bulkActionButtons:!1}),r.a.createElement(Fa.a,null,r.a.createElement(Ma.a,{source:"task_name",sortable:!1}),r.a.createElement(za.a,{className:"thumbNailView",source:"background_image",sortable:!1}),r.a.createElement(Aa.a,null),r.a.createElement(Ua.a,null)))},Mn=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={course:[],isLoading:!0},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/courses").then((function(t){e.setState({course:t.data,isLoading:!1})}))}},{key:"render",value:function(){var e=this.state.course.map((function(e){var t={};return t.id=e.id,t.name=e.course_name,t}));return r.a.createElement(Ba.a,Object.assign({},this.props,{title:"T\u1ea1o Ch\u1ee7 \u0111\u1ec1 con"}),r.a.createElement(Pa.a,{redirect:"show"},r.a.createElement(Ha.a,{source:"task_name"}),r.a.createElement(Ha.a,{source:"background_image"}),this.state.isLoading?r.a.createElement(In.a,null):r.a.createElement(Ln.a,{source:"course_id",choices:e})))}}]),t}(n.Component),zn=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={course:[],isLoading:!0},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/courses").then((function(t){e.setState({course:t.data,isLoading:!1})}))}},{key:"render",value:function(){var e=this.state.course.map((function(e){var t={};return t.id=e.id,t.name=e.course_name,t}));return r.a.createElement(Wa.a,Object.assign({},this.props,{title:"S\u1eeda Ch\u1ee7 \u0111\u1ec1 con"}),r.a.createElement(Pa.a,{toolbar:r.a.createElement(Dn,null)},r.a.createElement(Ha.a,{resettable:!0,source:"id",disabled:!0}),r.a.createElement(Ha.a,{source:"task_name"}),r.a.createElement(Ha.a,{source:"background_image"}),this.state.isLoading?r.a.createElement(In.a,null):r.a.createElement(Ln.a,{source:"course_id",choices:e})))}}]),t}(n.Component),An=a(1458),Un=a(1457),Bn=function(e){return r.a.createElement(Ga.a,e,r.a.createElement(Va.a,{label:"Save",submitOnEnter:!0}),r.a.createElement(Va.a,{label:"Save and Continue Editing",redirect:!1,submitOnEnter:!1,variant:"flat"}),r.a.createElement(Ua.a,null))},Pn=function(e){return r.a.createElement(Ka.a,e)},Hn=function(e){function t(){var e;return Object(l.a)(this,t),(e=Object(m.a)(this,Object(p.a)(t).call(this))).handleChange=function(t){var a=t.target.id;e.setState(Object(et.a)({},a,t.target.value))},e.onChangeImage=function(t){var a=t.target,n=new FileReader;n.readAsDataURL(a.files[0]),n.onload=function(t){e.setState({electronic_signature:t.target.result})}},e.handleSubmit=function(t){t.preventDefault();var a=e.state.data;a.name=e.state.name,a.name_site=e.state.name_site,a.review_point=parseInt(e.state.review_point),a.electronic_signature=e.state.electronic_signature,console.log(a),e.setState({isLoading:!0}),b.a.post("https://hocodevn.com/api/v1/curd/configs",a).then((function(t){console.log(t.data),e.setState({name:t.data.name,review_point:t.data.review_point,electronic_signature:t.data.electronic_signature,data:t.data,isLoading:!1})}))},e.state={name:"",name_site:"hocode",review_point:0,electronic_signature:"",isLoading:!0,data:{}},e}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/curd/configs/byname/".concat(this.state.name_site)).then((function(t){console.log(t.data),e.setState({name:t.data.name,review_point:t.data.review_point,electronic_signature:t.data.electronic_signature,data:t.data,isLoading:!1})}))}},{key:"render",value:function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{container:!0,spacing:3,className:"configFormContainer"},r.a.createElement(h.a,{item:!0,xs:3,className:"configFormContainerItem"},r.a.createElement(Un.a,{style:{padding:12}},r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement("div",null,this.state.isLoading?r.a.createElement(In.a,{height:77}):r.a.createElement(at.a,{id:"name",label:"T\xean Ch\u1ee9ng Ch\u1ec9",margin:"normal",defaultValue:this.state.name,onChange:this.handleChange,variant:"outlined",fullWidth:!0})),r.a.createElement("div",null,this.state.isLoading?r.a.createElement(In.a,{height:77}):r.a.createElement(at.a,{id:"review_point",label:"Point T\u1ed1t Nghi\u1ec7p",margin:"normal",type:"number",defaultValue:this.state.review_point,onChange:this.handleChange,variant:"outlined",fullWidth:!0})),r.a.createElement("div",null,this.state.isLoading?r.a.createElement(In.a,{height:77}):r.a.createElement(Ye.a,{className:"MuiFormControl-marginNormal",variant:"contained",component:"label",fullWidth:!0},"T\u1ea3i Ch\u1eef K\xfd",r.a.createElement("input",{id:"electronic_signature",type:"file",accept:"image/*",onChange:this.onChangeImage,style:{display:"none"}}))),r.a.createElement("div",null,this.state.isLoading?r.a.createElement(In.a,{height:120}):r.a.createElement(An.a,{style:{width:"auto",height:"auto"},className:"MuiFormControl-marginNormal",src:this.state.electronic_signature?this.state.electronic_signature:"https://icon-library.net/images/no-image-available-icon/no-image-available-icon-6.jpg",variant:"rounded"})),r.a.createElement(Ye.a,{type:"submit",color:"primary",className:"MuiFormControl-marginNormal",style:{backgroundColor:"#3f51b5",color:"#fff"},fullWidth:!0},"L\u01b0u c\xe0i \u0111\u1eb7t")))),r.a.createElement(h.a,{item:!0,xs:9,className:"configFormContainerItem"},r.a.createElement(Ra.a,Object.assign({},this.props,{title:"Danh s\xe1ch Ch\u1ee9ng ch\u1ec9",filters:r.a.createElement(Pn,null),bulkActionButtons:!1}),r.a.createElement(Fa.a,null,r.a.createElement(Ma.a,{source:"user_id",sortable:!1}),r.a.createElement(Ma.a,{source:"status",sortable:!1}),r.a.createElement(Ma.a,{source:"timestamp",sortable:!1}),r.a.createElement(Aa.a,null),r.a.createElement(Ua.a,null))))))}}]),t}(n.Component),Wn=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={course:[],isLoading:!0},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/courses").then((function(t){e.setState({course:t.data,isLoading:!1})}))}},{key:"render",value:function(){return r.a.createElement(Ba.a,Object.assign({},this.props,{title:"T\u1ea1o Ch\u1ee9ng ch\u1ec9"}),r.a.createElement(Pa.a,{redirect:"show"},r.a.createElement(Ha.a,{source:"user_id"}),r.a.createElement(Ha.a,{source:"status"})))}}]),t}(n.Component),Gn=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={course:[],isLoading:!0},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;b.a.get("https://hocodevn.com/api/v1/courses").then((function(t){e.setState({course:t.data,isLoading:!1})}))}},{key:"render",value:function(){return r.a.createElement(Wa.a,Object.assign({},this.props,{title:"S\u1eeda Ch\u1ee9ng ch\u1ec9"}),r.a.createElement(Pa.a,{toolbar:r.a.createElement(Bn,null)},r.a.createElement(Ha.a,{resettable:!0,source:"id",disabled:!0}),r.a.createElement(Ha.a,{source:"user_id"}),r.a.createElement(Ha.a,{source:"status"})))}}]),t}(n.Component),Vn=a(1459),qn=function(e){return r.a.createElement(Ga.a,e,r.a.createElement(Va.a,{label:"Save",submitOnEnter:!0}),r.a.createElement(Va.a,{label:"Save and Continue Editing",redirect:!1,submitOnEnter:!1,variant:"flat"}),r.a.createElement(Ua.a,null))},Kn=function(e){return r.a.createElement(Ka.a,e)},Yn=function(e){return r.a.createElement(Ra.a,Object.assign({},e,{title:"Danh s\xe1ch Ng\u01b0\u1eddi d\xf9ng",filters:r.a.createElement(Kn,null),bulkActionButtons:!1}),r.a.createElement(Fa.a,null,r.a.createElement(Ma.a,{source:"email",sortable:!1}),r.a.createElement(Ma.a,{source:"firstname",sortable:!1}),r.a.createElement(Ma.a,{source:"lastname",sortable:!1}),r.a.createElement(ln.a,{source:"codepoint",sortable:!1}),r.a.createElement(Ma.a,{source:"role",sortable:!1}),r.a.createElement(za.a,{className:"thumbNailView",source:"avatar",sortable:!1}),r.a.createElement(Aa.a,null),r.a.createElement(Ua.a,null)))},Jn=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){return r.a.createElement(Ba.a,Object.assign({},this.props,{title:"T\u1ea1o Ng\u01b0\u1eddi d\xf9ng m\u1edbi"}),r.a.createElement(Pa.a,{redirect:"show"},r.a.createElement(Ha.a,{source:"email"}),r.a.createElement(Ha.a,{source:"password"}),r.a.createElement(Ha.a,{source:"firstname"}),r.a.createElement(Ha.a,{source:"lastname"}),r.a.createElement(Vn.a,{source:"codepoint"}),r.a.createElement(Ha.a,{source:"avatar"}),r.a.createElement(Ln.a,{source:"role",choices:[{id:"user",name:"Sinh Vi\xean"},{id:"mod",name:"Gi\xe1o Vi\xean"},{id:"admin",name:"Qu\u1ea3n Tr\u1ecb Vi\xean"}]})))}}]),t}(n.Component),Xn=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){return r.a.createElement(Wa.a,Object.assign({},this.props,{title:"S\u1eeda Ng\u01b0\u1eddi D\xf9ng"}),r.a.createElement(Pa.a,{toolbar:r.a.createElement(qn,null)},r.a.createElement(Ha.a,{source:"email"}),r.a.createElement(Ha.a,{source:"password"}),r.a.createElement(Ha.a,{source:"firstname"}),r.a.createElement(Ha.a,{source:"lastname"}),r.a.createElement(Vn.a,{source:"codepoint"}),r.a.createElement(Ha.a,{source:"avatar"}),r.a.createElement(Ln.a,{source:"role",choices:[{id:"user",name:"Sinh Vi\xean"},{id:"mod",name:"Gi\xe1o Vi\xean"},{id:"admin",name:"Qu\u1ea3n Tr\u1ecb Vi\xean"}]})))}}]),t}(n.Component),Qn=a(76),Zn=a(697),$n=a.n(Zn),er=a(625),tr=a(215),ar=a(492),nr=a(102),rr=a(1479),ir=a(701),or=a(70),sr=a(166),cr=a(1480),lr=a(265),ur=a(14),mr=a(698);function pr(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function dr(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?pr(Object(a),!0).forEach((function(t){Object(et.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):pr(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var hr=a(1282),fr={isAuthenticated:!1,user:{},loading:!1},gr={};function br(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Er(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?br(Object(a),!0).forEach((function(t){Object(et.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):br(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var vr={avatar:"",codepoint:0,email:"",firstname:"",id:"",lastname:"",isUserLoading:!1},yr=Object(sr.c)({auth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CURRENT_USER":return dr({},e,{isAuthenticated:!hr(t.payload),user:t.payload});default:return e}},errors:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"GET_ERRORS":return t.payload;default:return e}},user:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_CODEPOINT":return Er({},e,{},t.payload,{isUserLoading:!1});case"GET_USER":return Er({},e,{},t.payload);case"CHANGE_USER_INFO":return Er({},e,{avatar:t.payload.avatar,codepoint:t.payload.codepoint,email:t.payload.email,firstname:t.payload.firstname,lastname:t.payload.lastname,isUserLoading:!1});case"SET_UNDEFINED_NEXT_MINITASK":return Er({},e,{next_minitask:t.payload});case"CHANGE_LOADING":return Er({},e,{isUserLoading:t.payload});default:return e}}}),xr={},kr=Object(Qn.a)({basename:"/admin"}),Cr=function(e){var t=e.authProvider,a=e.dataProvider,n=e.i18nProvider,r=void 0===n?er.a:n,i=e.history,o=e.locale,s=void 0===o?"vi":o,c=Object(sr.c)({admin:tr.a,form:cr.a,router:or.f,i18n:Object(ar.a)(s,r(s)),rootReducer:yr}),l=St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(ur.a)([Object(rr.a)(a,t,r)].map(ur.e));case 2:case"end":return e.stop()}}),e)})),u=Object(lr.a)(),m=Object(sr.e)((function(e,t){return c(t.type!==nr.f?e:void 0,t)}),xr,Object(sr.d)(Object(sr.a)(u,ir.a,Object(or.e)(i),mr.a)));return u.run(l),m}({authProvider:Pt,dataProvider:ta,i18nProvider:function(e){return $n.a},history:kr}),_r=function(){return r.a.createElement(At.a,{appLayout:Sa,authProvider:Pt,catchAll:Wt,customRoutes:Gt,dataProvider:ta,title:"Hocode Admin",theme:Da,history:kr,locale:"vi"},(function(e){var t=localStorage.getItem("permissions");return["admin"===t?r.a.createElement(Ut.a,{name:"books",list:Ja,create:Xa,edit:Qa}):null,"admin"===t?r.a.createElement(Ut.a,{name:"events",list:on,create:sn,edit:cn}):null,r.a.createElement(Ut.a,{name:"courses",list:en,create:tn,edit:an}),r.a.createElement(Ut.a,{name:"tasks",list:Fn,create:Mn,edit:zn}),r.a.createElement(Ut.a,{name:"minitasks",list:wn,create:Tn,edit:Nn}),"admin"===t?r.a.createElement(Ut.a,{name:"users",list:Yn,create:Jn,edit:Xn}):null,"admin"===t?r.a.createElement(Ut.a,{name:"certs",list:Hn,create:Wn,edit:Gn}):null]}))},Or=a(1467),jr=a(139),Sr=a(1490),wr=a(1341),Tr=a(1473),Nr=a(712),Lr=a.n(Nr),Ir=a(715),Dr=a.n(Ir),Rr=a(714),Fr=a.n(Rr),Mr=a(713),zr=a.n(Mr),Ar=a(717),Ur=a.n(Ar),Br=a(716),Pr=a.n(Br),Hr=Object(f.a)({root:{"& label.Mui-focused":{color:"#3f51b5"},"& .MuiInput-underline:after":{borderBottomColor:"#3f51b5"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"#3f51b5"},"&:hover fieldset":{borderColor:"#3f51b5"},"&.Mui-focused fieldset":{borderColor:"#3f51b5"}}}})(at.a),Wr=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).getApi=Object(wt.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([b.a.get("https://hocodevn.com/auth/userinfo").then((function(e){a.setState({firstName:e.data.firstname,lastName:e.data.lastname,avatar:e.data.avatar})})).catch((function(e){return console.log(e)}))]);case 2:a.setState({isLoading:!1});case 3:case"end":return e.stop()}}),e)}))),a.onChange=function(e){var t=!1;if(a.setState({errors:{message:""}}),"password"===e.target.id)if(!1===ot.test(e.target.value)){t=!0;var n=a.state.errorForm;n.password="*M\u1eadt kh\u1ea9u c\u1ea7n c\xf3 \xedt nh\u1ea5t 6 k\xfd t\u1ef1, 1 s\u1ed1, 1 ch\u1eef In v\xe0 1 ch\u1eef th\u01b0\u1eddng v\xe0 kh\xf4ng ch\u1ee9a k\xfd t\u1ef1 \u0111\u1eb7c bi\u1ec7t"}else n.password="";"password2"===e.target.id&&(e.target.value!==a.state.password?(t=!0,n.password2="*B\u1ea1n c\u1ea7n nh\u1eadp m\u1eadt kh\u1ea9u gi\u1ed1ng tr\xean"):n.password2=""),t&&a.setState({errorForm:n}),a.setState(Object(et.a)({},e.target.id,e.target.value))},a.onSubmit=function(){var e=Object(wt.a)(St.a.mark((function e(t){var n,r;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),n="",a.state.password!==a.state.password2&&(n="*M\u1eadt kh\u1ea9u nh\u1eadp l\u1ea1i kh\xf4ng tr\xf9ng"),""===a.state.firstName.trim()&&(n="*T\xean kh\xf4ng th\u1ec3 \u0111\u1ec3 tr\u1ed1ng"),""===a.state.lastName.trim()&&(n="*H\u1ecd kh\xf4ng th\u1ec3 \u0111\u1ec3 tr\u1ed1ng"),""===n.trim()){e.next=9;break}return a.props.errors.message=n,a.setState({errors:a.props.errors}),e.abrupt("return");case 9:return r={lastName:a.state.lastName,firstName:a.state.firstName,password:a.state.password,avatar:a.state.image},console.log(a.props.auth.user.data.id),a.setState((function(e,t){return{isLoading:!0}})),e.next=14,a.props.changeUserInfo(r,a.props.auth.user.data.id);case 14:setTimeout((function(){a.setState((function(e,t){return{isLoading:!1}}))}),0);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a.state={isLoading:!0,lastName:"",firstName:"",password:"",password2:"",avatar:"",errors:{},errorForm:{lastName:"",firstName:"",password:"",password2:""},image:null,url:"",urlPreview:""},a.handleChangeImage=a.handleChangeImage.bind(Object(k.a)(a)),a.toBase64=a.toBase64.bind(Object(k.a)(a)),a.ImgToBase64=a.ImgToBase64.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.getApi()}},{key:"handleChangeImage",value:function(){var e=Object(wt.a)(St.a.mark((function e(t){var a,n,r;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.target.files[0]){e.next=8;break}return a=t.target.files[0],n=URL.createObjectURL(a),e.next=5,this.ImgToBase64(a);case 5:return r=e.sent,e.next=8,this.setState({image:r,urlPreview:n});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toBase64",value:function(e){return new Promise((function(t,a){var n=new FileReader;n.readAsDataURL(e),n.onload=function(){return t(n.result)},n.onerror=function(e){return a(e)}}))}},{key:"ImgToBase64",value:function(){var e=Object(wt.a)(St.a.mark((function e(t){var a;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.toBase64(t).catch((function(e){return e}));case 2:if(!((a=e.sent)instanceof Error)){e.next=6;break}return console.log("Error: ",a.message),e.abrupt("return");case 6:return e.abrupt("return",a);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_checkError",value:function(e){return null===e&&""===e}},{key:"render",value:function(){var e=this.state,t=e.errors,a=e.isLoading,n=this.props.classes;return r.a.createElement(h.a,{container:!0,spacing:3,style:{height:"100%"}},!0===a||!0===this.props.user.isUserLoading?r.a.createElement("div",{className:"sweet-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100vh"}},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:!0})):r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{item:!0,xs:12,sm:5,md:5},r.a.createElement(ht.a,{style:{padding:16,minHeight:300,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},r.a.createElement("div",{style:{fontWeight:"bold"}},"Th\xf4ng tin c\xe1 nh\xe2n")," ",r.a.createElement("div",null,"H\u1ecd v\xe0 t\xean: ",this.props.user.lastname," ",this.props.user.firstname),r.a.createElement("div",null,"Email: ",this.props.user.email))),r.a.createElement(h.a,{item:!0,xs:12,sm:7,md:7},r.a.createElement(ht.a,{style:{padding:16}},r.a.createElement(rt.a,{component:"main",maxWidth:"xs"},r.a.createElement(tt.a,null),r.a.createElement("div",{className:n.paper},r.a.createElement(ye.a,{component:"h1",variant:"h5"}),r.a.createElement("form",{className:n.form,noValidate:!0,onSubmit:this.onSubmit},r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,sm:6},r.a.createElement(Hr,{autoComplete:"lname",name:"lastName",variant:"outlined",fullWidth:!0,id:"lastName",label:"H\u1ecd",value:this.state.lastName,onChange:this.onChange,inputProps:{style:{fontSize:12}},InputLabelProps:{style:{fontSize:12}}})),r.a.createElement(h.a,{item:!0,xs:12,sm:6},r.a.createElement(Hr,{variant:"outlined",fullWidth:!0,id:"firstName",label:"T\xean",name:"firstName",autoComplete:"fname",value:this.state.firstName,onChange:this.onChange,inputProps:{style:{fontSize:12}},InputLabelProps:{style:{fontSize:12}}})),r.a.createElement(h.a,{item:!0,xs:12},r.a.createElement(Hr,{variant:"outlined",fullWidth:!0,name:"password",label:"M\u1eadt kh\u1ea9u m\u1edbi",type:"password",id:"password",autoComplete:"current-password",value:this.state.password,onChange:this.onChange,error:""!==this.state.errorForm.password.trim(),helperText:this.state.errorForm.password,inputProps:{style:{fontSize:12}},InputLabelProps:{style:{fontSize:12}}})),r.a.createElement(h.a,{item:!0,xs:12},r.a.createElement(Hr,{variant:"outlined",fullWidth:!0,name:"password2",label:"Nh\u1eadp l\u1ea1i M\u1eadt kh\u1ea9u m\u1edbi",type:"password",id:"password2",autoComplete:"current-password2",value:this.state.password2,onChange:this.onChange,error:""!==this.state.errorForm.password2.trim(),helperText:this.state.errorForm.password2,inputProps:{style:{fontSize:12}},InputLabelProps:{style:{fontSize:12}}})),r.a.createElement(h.a,{item:!0,xs:12},r.a.createElement("div",null,"Thay \u0111\u1ed5i avatar"),r.a.createElement("div",null," ",""!==this.state.urlPreview?r.a.createElement("img",{style:{width:40,height:40},src:this.state.urlPreview,alt:""}):r.a.createElement("img",{style:{width:40,height:40},src:this.state.avatar,alt:""})),r.a.createElement("div",null,r.a.createElement("label",{htmlFor:"files",style:{padding:"4px 6px",borderRadius:"4px",cursor:"pointer",background:"#2098d1",color:"white",boxShadow:"0px 1px 3px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)"}},"Ch\u1ecdn \u1ea3nh"),r.a.createElement("input",{id:"files",type:"file",onChange:this.handleChangeImage,style:{visibility:"hidden"}})))),r.a.createElement("div",null,r.a.createElement("div",{className:"error_show"},t.message)),r.a.createElement(Ye.a,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",className:n.submit},"L\u01b0u th\xf4ng tin"))))))))}}]),t}(r.a.Component),Gr=Object(f.a)({"@global":{body:{backgroundColor:"white"}},paper:{display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:8,backgroundColor:"#3f51b5"},form:{width:"100%",marginTop:8},submit:{margin:"16px 0px"}})(Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{changeUserInfo:function(e,t){return function(a){console.log(e),a({type:"CHANGE_LOADING",payload:!0}),b.a.post("https://hocodevn.com/auth/userinfoupdate",{id:t,avatar:e.avatar,password:e.password,firstname:e.firstName,lastname:e.lastName}).then((function(e){console.log(e.data),a({type:"CHANGE_USER_INFO",payload:e.data})})).catch((function(e){return console.log(e)}))}}})(Wr)),Vr=a(635),qr=a(636),Kr=a(637),Yr=a(244),Jr=a(398),Xr=a.n(Jr),Qr=a(1491),Zr=(a(1314),function(){var e=[Vr.a[500],qr.a[500],Kr.a[500],Yr.a[500]];return e[Math.floor(Math.random()*e.length)]}),$r=function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this.props,t=e.classes,a=e.course;return r.a.createElement(h.a,{container:!0,direction:"column",style:{height:"100%",display:"flex",alignItems:"center"},className:"".concat(t.courseItem," hvr-bounce-in")},r.a.createElement(h.a,{item:!0,style:{width:"100%",overflow:"hidden",height:"150px",display:"flex",justifyContent:"center",alignItems:"center",background:"url(".concat(a.background_image,") no-repeat center"),backgroundSize:"cover"}}),r.a.createElement(h.a,{item:!0,container:!0,justify:"center",style:{padding:"10px 0 0 0"}},r.a.createElement(h.a,{item:!0,xs:!0},r.a.createElement("div",{style:{margin:"0px 12px",textTransform:"uppercase",color:"#595959",fontWeight:"bold"}},r.a.createElement(ye.a,{gutterBottom:!0,variant:"h5",component:"h2"},a.course_name)),r.a.createElement("div",{style:{margin:"5px 12px 10px",color:"#909090"}},r.a.createElement(Qr.a,{name:"read-only",value:a.rating_value,"read-only":!0,precision:.1,size:"large"})," ",r.a.createElement(ye.a,{variant:"body1",color:"textSecondary",component:"p",style:{height:40,overflow:"hidden",wordBreak:"break-word"}},a.course_desc)),r.a.createElement(Lt.a,{light:!0}),r.a.createElement("div",{style:{margin:"8px 12px",textAlign:"center",color:"#909090"}},r.a.createElement(h.a,{container:!0,direction:"row",justify:"center",alignItems:"center"},r.a.createElement(h.a,{item:!0,xs:!0,style:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},r.a.createElement(An.a,{className:t.smallAvatar,style:{backgroundColor:Zr()}},a.user_create?a.user_create.charAt(0).toUpperCase():"H"),r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p"},a.user_create?a.user_create:"Hocode")),r.a.createElement(h.a,{item:!0,xs:!0,style:{display:"flex",alignItems:"center",justifyContent:"flex-end"}},r.a.createElement(Xr.a,{style:{padding:"2px 4px",boxSizing:"content-box",borderRadius:"4px"},fontSize:"small"}),r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p"},a.total_minitask)))))))}}]),t}(n.Component),ei=Object(f.a)({courseItem:{borderRadius:"4px",boxShadow:"0px 1px 3px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)",overflow:"hidden",background:"white",cursor:"pointer"},smallAvatar:{height:"24px",width:"24px",marginRight:"4px",fontSize:"1rem",fontWeight:"600"}})($r),ti=(a(1315),function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).getApi=Object(wt.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([b.a.get("https://hocodevn.com/api/v1/courses").then((function(e){var t=e.data;console.log(t),a.setState({courses:t})}))]);case 2:a.setState({isLoading:!1});case 3:case"end":return e.stop()}}),e)}))),a.state={isLoading:!0,courses:[]},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.getApi()}},{key:"render",value:function(){var e=this.props.classes,t=this.state,a=t.courses,n=t.isLoading,i=this.props.url;return r.a.createElement(h.a,{container:!0,className:e.CourseContainer,justify:"center"},n?r.a.createElement("div",{className:"sweet-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%"}},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:n})):r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{item:!0,xs:12,sm:12,style:{padding:"0px 60px"}},r.a.createElement(h.a,{container:!0,spacing:2},a.map((function(e){return r.a.createElement(h.a,{key:e.id,item:!0,xs:12,sm:4,md:4},r.a.createElement(s.b,{style:{textDecoration:"none"},to:"".concat(i,"/courses/").concat(e.id,"/tasks")},r.a.createElement(ei,{course:e})))}))))))}}]),t}(n.Component)),ai=Object(f.a)({CourseContainer:{paddingTop:"30px",minHeight:"100vh"},courseItem:{borderRadius:"4px",boxShadow:"0px 1px 3px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)",overflow:"hidden",background:"#EEEEEE",cursor:"pointer"}})(ti),ni=a(1462),ri=a(1492),ii=a(1461),oi=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).getApi=Object(wt.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([b.a.get("https://hocodevn.com/auth/usercourse").then((function(e){var t=e.data;console.log(t),a.setState({courses:t.course_info})})),b.a.get("https://hocodevn.com/api/v1/events").then((function(e){var t=e.data;console.log(t),a.setState({events:t})})),b.a.get("https://hocodevn.com/api/v1/books").then((function(e){var t=e.data;console.log(t),a.setState({books:t})})),b.a.get("https://hocodevn.com/api/v1/dailyminitask").then((function(e){var t=e.data;console.log(t),a.setState({daily_minitasks:t})}))]);case 2:a.setState({isLoading:!1});case 3:case"end":return e.stop()}}),e)}))),a.state={isLoading:!0,courses:[],events:[],books:[],daily_minitask:{}},a.getApi=a.getApi.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.getApi()}},{key:"renderLevelMinitaskChip",value:function(e){return e.level=e.level.toLowerCase().split(" ").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" "),console.log(e.level),"Easy"===e.level?r.a.createElement(ri.a,{style:{background:"#76d38e",color:"white"},size:"small",label:"".concat(e.level)}):"Medium"===e.level?r.a.createElement(ri.a,{style:{background:"#1d97c6",color:"white"},size:"small",label:"".concat(e.level)}):r.a.createElement(ri.a,{style:{background:"red",color:"white"},size:"small",label:"".concat(e.level)})}},{key:"render",value:function(){var e=this,t=this.state.isLoading,a=this.props.classes,n=this.props.url;return r.a.createElement(h.a,{container:!0,spacing:3,style:{height:"100vh"}},t?r.a.createElement("div",{className:"sweet-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100vh"}},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:t})):r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{item:!0,xs:12,sm:5,md:5},r.a.createElement(ht.a,{className:a.paper},r.a.createElement(h.a,{container:!0,style:{marginBottom:15}},r.a.createElement(h.a,{item:!0,style:{flexGrow:1}},r.a.createElement("div",{style:{fontWeight:"bold"}},"Ch\u1ee7 \u0111\u1ec1 g\u1ea7n \u0111\xe2y")," ")),0===this.state.courses.length?r.a.createElement("div",{style:{}},"B\u1ea1n ch\u01b0a th\u1ef1c hi\u1ec7n b\xe0i th\u1ef1c h\xe0nh n\xe0o."):this.state.courses.map((function(e){return r.a.createElement(r.a.Fragment,{key:e.course_id},r.a.createElement(h.a,{container:!0,style:{alignItems:"center",flexWrap:"unset"}},r.a.createElement(h.a,{item:!0},r.a.createElement("img",{className:a.img,style:{width:"50px",height:"50px",objectFit:"cover",borderRadius:"8px"},alt:"complex",src:e.background_image})),r.a.createElement(h.a,{item:!0,style:{flexGrow:1,padding:10}},r.a.createElement(ii.a,{title:"T\xean ch\u1ee7 \u0111\u1ec1",placement:"top"},r.a.createElement("div",{style:{fontWeight:"bold"}},r.a.createElement(s.b,{className:"item",key:e.course_id,style:{textDecoration:"none"},to:"".concat(n,"/courses/").concat(e.course_id,"/tasks")},e.course_name))),r.a.createElement(ii.a,{title:"S\u1ed1 l\u01b0\u1ee3ng b\xe0i h\u1ecdc \u0111\xe3 ho\xe0n th\xe0nh",placement:"top"},r.a.createElement("div",{style:{color:"#9d9d9d"}},e.completed_tasks_count,"/",e.total_tasks_count))),r.a.createElement(h.a,{item:!0},r.a.createElement(ii.a,{title:"Ti\u1ebfn \u0111\u1ed9",placement:"top"},r.a.createElement(ni.a,{variant:"determinate",value:e.completed_tasks_count/e.total_tasks_count*100,style:{width:115}})))),r.a.createElement(Lt.a,{style:{margin:"auto"}})," ")})))),r.a.createElement(h.a,{item:!0,xs:12,sm:7,md:7},r.a.createElement(ht.a,{className:a.paper},r.a.createElement(h.a,{container:!0,style:{marginBottom:15}},r.a.createElement(h.a,{item:!0,style:{flexGrow:1}},r.a.createElement("div",{style:{fontWeight:"bold"}},"Th\xe1ch th\u1ee9c m\u1edbi")," ")),this.state.daily_minitasks.map((function(t){return r.a.createElement(r.a.Fragment,{key:t.id},r.a.createElement(h.a,{container:!0,style:{alignItems:"center",flexWrap:"unset"}},r.a.createElement(h.a,{item:!0},r.a.createElement("img",{className:a.img,style:{width:"50px",height:"50px",objectFit:"cover",borderRadius:"8px"},alt:"complex",src:t.avatar})),r.a.createElement(h.a,{item:!0,style:{flexGrow:1,padding:10}},r.a.createElement("div",{style:{fontWeight:"bold"}},r.a.createElement(s.b,{className:"item",style:{textDecoration:"none"},to:"/tasks/".concat(t.id)},t.mini_task_name)),r.a.createElement("div",{style:{display:"flex",alignItems:"center"}},r.a.createElement(ii.a,{title:"S\u1ed1 \u0111\u1eadu",placement:"top"},r.a.createElement("div",{style:{color:"#9d9d9d"}},"S\u1ed1 \u0111\u1eadu: ",t.code_point)),r.a.createElement(ii.a,{title:"\u0110\u1ed9 kh\xf3",placement:"top"},r.a.createElement("div",{style:{marginLeft:10}},e.renderLevelMinitaskChip(t)))))),r.a.createElement(Lt.a,{style:{margin:"auto"}})," ")}))))))}}]),t}(r.a.Component),si=Object(f.a)({paper:{padding:16,marginTop:16,minHeight:300},card:{maxWidth:"100%"},media:{height:180,objectFit:"cover"}})(Object(C.b)((function(e){return{user:e.rootReducer.user}}),{})(oi)),ci=(a(1316),function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this.props.Certificate;return r.a.createElement(h.a,{style:{minWidth:"1000px",minHeight:"700px",background:'url("/certificateBackground.jpg") no-repeat',backgroundSize:"100%",position:"relative"}},r.a.createElement(h.a,{container:!0,style:{justifyContent:"center",position:"absolute",top:"37%"}},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},r.a.createElement("p",{style:{fontFamily:"'Dancing Script', cursive",fontSize:40,margin:"15px 0px",textAlign:"center"}},void 0===e.user?"":e.user.lastname," ",void 0===e.user?"":e.user.firstname)),r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12,style:{margin:"0px 135px"}}," ",r.a.createElement("div",null,r.a.createElement("p",{style:{fontFamily:"'Dancing Script', cursive",fontSize:30,margin:"20px 0px",textAlign:"center"}},"For successfully completing the Hocode program.")),r.a.createElement("div",null,r.a.createElement("p",{style:{margin:"20px 0px",textAlign:"center",textTransform:"uppercase",fontWeight:"bold",fontSize:20}},"ID:  ",void 0===e.cert?"":e.cert.search_id)))),r.a.createElement(h.a,{style:{position:"absolute",left:"22%",bottom:"14%",transform:"translateX(-50%)"}},void 0===e.cert?"":e.cert.timestamp),r.a.createElement(h.a,{style:{position:"absolute",right:"20%",bottom:"10%",transform:"translateX(50%)"}},void 0===e.config?"":r.a.createElement("img",{src:e.config.electronic_signature,style:{height:90},alt:"electronic_signature"})))}}]),t}(n.Component)),li=Object(f.a)({},{withTheme:!0})(Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{})(ci)),ui=a(708),mi=a.n(ui),pi=a(1465),di=a(1463),hi=a(1464),fi=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).getApi=Object(wt.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([b.a.get("https://hocodevn.com/api/v1/curd/configs/byname/hocode").then((function(e){console.log(e.data);var t=e.data;a.setState({review_point:t.review_point})})),b.a.get("https://hocodevn.com/auth/userinfo").then((function(e){console.log(e.data),a.setState({user_codepoint:e.data.codepoint})})),b.a.get("https://hocodevn.com/auth/completeminitask").then((function(e){var t=e.data;console.log(t),a.setState({minitasks:t})}))]);case 2:a.setState({isLoading:!1});case 3:case"end":return e.stop()}}),e)}))),a.getCertificate=Object(wt.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.setState({openDialogCertificate:!0}),a.setState({isLoadingCert:!0}),e.next=4,Promise.all([b.a.get("https://hocodevn.com/api/v1/auth/reviewcert").then((function(e){var t=e.data;console.log(e.data),a.setState({certificate:t}),a.setState({isLoadingCert:!1})}))]);case 4:case"end":return e.stop()}}),e)}))),a.handleDialogCertificateOpen=function(){a.getCertificate()},a.handleDialogCertificateClose=function(){a.setState({openDialogCertificate:!1})},a.renderDialog=function(e){if(void 0!==e.cert)return"Inactive"===e.cert.status?r.a.createElement(di.a,{dividers:!0},r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{marginLeft:4,textAlign:"center"}},"B\u1ea1n s\u1ebd nh\u1eadn \u0111\u01b0\u1ee3c ch\u1ee9ng ch\u1ec9 n\u1ebfu s\u1ed1 \u0111\u1eadu c\u1ee7a b\u1ea1n l\u1edbn h\u01a1n"," ",a.state.review_point)):r.a.createElement(r.a.Fragment,null,r.a.createElement(di.a,{dividers:!0},r.a.createElement(h.a,{container:!0,spacing:2},r.a.createElement(h.a,{item:!0,xs:12,md:12,sm:12,style:{display:"flex",alignItems:"center"}},r.a.createElement(li,{ref:function(e){return a.CertificateRef=e},Certificate:a.state.certificate})))),r.a.createElement(hi.a,{id:"customized-dialog-title",onClose:a.handleDialogCertificateClose},r.a.createElement(h.a,{style:{display:"flex",justifyContent:"flex-end"}},r.a.createElement(mi.a,{trigger:function(){return r.a.createElement(Ye.a,{style:{background:"#1ECD97",color:"#fff"},variant:"contained"},"In ch\u1ee9ng ch\u1ec9")},content:function(){return a.CertificateRef}}))))},a.state={minitasks:[],openDialogCertificate:!1,isLoading:!0,certificate:{},review_point:0,user_codepoint:0,isLoadingCert:!1},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.getApi()}},{key:"render",value:function(){var e=this.props.classes;return r.a.createElement(r.a.Fragment,null,this.state.isLoading?r.a.createElement("div",{className:"sweet-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100vh"}},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:this.state.isLoading})):r.a.createElement(h.a,{container:!0,spacing:2,style:{height:"100%",maxHeight:400}},r.a.createElement(h.a,{item:!0,xs:12,sm:4,md:4},r.a.createElement(ht.a,{style:{height:"100%",padding:10,display:"flex",alignItems:"center",justifyContent:"center"}},r.a.createElement(h.a,{container:!0,direction:"column",alignItems:"center"},r.a.createElement(h.a,{item:!0,container:!0,style:{justifyContent:"center"}},r.a.createElement(h.a,{item:!0,xs:4,sm:4,md:4,style:{display:"flex",justifyContent:"center"}},r.a.createElement("img",{style:{width:"100px",height:"100px",borderRadius:"50%"},alt:"avatar",src:this.props.user.avatar}))),r.a.createElement(h.a,{item:!0},r.a.createElement(ye.a,{variant:"h5",gutterBottom:!0,style:{color:"#4978cc"}},this.props.user.lastname," ",this.props.user.firstname)),r.a.createElement(h.a,{item:!0,style:{textAlign:"center"}},r.a.createElement(ye.a,{variant:"h5",style:{color:"#4978cc"}},this.props.user.codepoint),r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{marginLeft:4,color:"#4978cc"}},"\u0110i\u1ec3m t\xedch l\u0169y")),r.a.createElement(h.a,{item:!0,style:{textAlign:"center",marginTop:"20px"}},r.a.createElement(ye.a,{variant:"h5",style:{color:"#4978cc"}},this.state.minitasks.length),r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{marginLeft:4,color:"#4978cc"}},"B\xe0i th\u1ef1c h\xe0nh \u0111\xe3 ho\xe0n th\xe0nh")),r.a.createElement(h.a,{item:!0,style:{textAlign:"center",marginTop:"20px"}},r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{marginLeft:4,textAlign:"center"}},"B\u1ea1n s\u1ebd nh\u1eadn \u0111\u01b0\u1ee3c ch\u1ee9ng ch\u1ec9 n\u1ebfu s\u1ed1 \u0111\u1eadu c\u1ee7a b\u1ea1n l\u1edbn h\u01a1n"," ",this.state.review_point)),r.a.createElement(h.a,{item:!0,style:{textAlign:"center"}},r.a.createElement(Ye.a,{variant:"contained",style:{background:"#1ECD97",color:"#fff"},onClick:this.handleDialogCertificateOpen},"X\xe9t ch\u1ee9ng ch\u1ec9"))))),r.a.createElement(h.a,{item:!0,xs:12,sm:8,md:8},r.a.createElement(ht.a,{style:{minHeight:400,overflowY:"auto",display:"flex",flexDirection:"column"}},r.a.createElement(h.a,{container:!0,style:{padding:10}},r.a.createElement(h.a,{item:!0,style:{flexGrow:1}},r.a.createElement("div",{style:{fontWeight:"bold"}},"Danh s\xe1ch b\xe0i th\u1ef1c h\xe0nh \u0111\xe3 ho\xe0n th\xe0nh"),"")),r.a.createElement(h.a,{container:!0,style:{padding:30}},0!==this.state.minitasks.length?this.state.minitasks.map((function(t){return r.a.createElement(r.a.Fragment,{key:t.id},r.a.createElement(h.a,{container:!0,style:{alignItems:"center"}},r.a.createElement(h.a,{item:!0},r.a.createElement("img",{className:e.img,style:{width:"50px",height:"50px",objectFit:"cover",borderRadius:"8px"},alt:"complex",src:t.avatar})),r.a.createElement(h.a,{item:!0,style:{flexGrow:1,padding:10}},r.a.createElement("div",{style:{fontWeight:"bold"}},r.a.createElement(s.b,{className:"item",style:{textDecoration:"none"},to:"/tasks/".concat(t.id)},t.mini_task_name)),r.a.createElement("div",{style:{color:"#9d9d9d"}},"S\u1ed1 \u0111\u1eadu: ",t.code_point))),r.a.createElement(Lt.a,{style:{margin:"auto",width:"100%"}})," ")})):r.a.createElement(h.a,{container:!0,justify:"center",alignItems:"center",style:{flexGrow:1}},r.a.createElement(h.a,{item:!0},r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{marginLeft:4}},"B\u1ea1n ch\u01b0a ho\xe0n th\xe0nh b\xe0i th\u1ef1c h\xe0nh n\xe0o.")))))),r.a.createElement(pi.a,{maxWidth:!1,open:this.state.openDialogCertificate,onClose:this.handleDialogCertificateClose,"aria-labelledby":"customized-dialog-title"}," ",!0===this.state.isLoadingCert?r.a.createElement("div",{className:"sweet-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100vw",height:"100vh",overflow:"hidden"}},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:this.state.isLoadingCert})):this.renderDialog(this.state.certificate))))}}]),t}(n.Component),gi=Object(f.a)({},{withTheme:!0})(Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{})(fi)),bi=a(489),Ei=a.n(bi),vi=(a(1317),function(e){function t(){return Object(l.a)(this,t),Object(m.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(u.a)(t,[{key:"renderLevelMinitaskChip",value:function(e){return e.level=e.level.toLowerCase().split(" ").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" "),console.log(e.level),"Easy"===e.level?r.a.createElement(ri.a,{style:{background:"#76d38e",color:"white"},size:"small",label:"".concat(e.level)}):"Medium"===e.level?r.a.createElement(ri.a,{style:{background:"#1d97c6",color:"white"},size:"small",label:"".concat(e.level)}):r.a.createElement(ri.a,{style:{background:"red",color:"white"},size:"small",label:"".concat(e.level)})}},{key:"renderMiniItem",value:function(e){return"hoanthanh"===e.status?r.a.createElement(s.b,{to:"/tasks/".concat(e.id),style:{display:"flex",textDecoration:"none",color:"#595959",alignItems:"center"}},r.a.createElement(ii.a,{title:"T\xean b\xe0i th\u1ef1c h\xe0nh",placement:"top-start"},r.a.createElement("div",{style:{flexGrow:1}}," ",e.mini_task_name)),r.a.createElement(ii.a,{title:"S\u1ed1 \u0111\u1eadu",placement:"top"},r.a.createElement("div",{style:{fontSize:12,margin:"0px 4px",color:"#4978cc",marginLeft:10,height:30},className:"centerDiv"},r.a.createElement("div",null,r.a.createElement("p",{style:{textAlign:"center",verticalAlign:"middle",lineHeight:"30px",margin:0}},e.code_point)),r.a.createElement("div",null,r.a.createElement(Ei.a,{style:{fontSize:24,marginRight:1}})))),r.a.createElement(ii.a,{title:"\u0110\u1ed9 kh\xf3",placement:"top"},r.a.createElement("div",{className:"level-minitask",style:{marginLeft:0}},this.renderLevelMinitaskChip(e))),r.a.createElement(ii.a,{title:"Ho\xe0n th\xe0nh",placement:"top"},r.a.createElement("div",{style:{width:"20px",display:"flex",alignItems:"center",marginLeft:10}},r.a.createElement("img",{style:{width:"100%"},src:a(1318),alt:"Kiwi standing on oval"})))):"chuahoanthanh"===e.status&&!0===e.vitri?r.a.createElement("a",{href:"giang",style:{display:"flex",textDecoration:"none",color:"#595959"}},r.a.createElement("div",null),r.a.createElement("div",{style:{flexGrow:1}},e.mini_task_name),r.a.createElement("div",{style:{width:"1em"}},r.a.createElement("img",{style:{width:"100%"},src:a(1319),alt:"Kiwi standing on oval"}))):"chuahoanthanh"===e.status&&!1===e.vitri?r.a.createElement(s.b,{to:"/tasks/".concat(e.id),style:{display:"flex",textDecoration:"none",color:"#595959",alignItems:"center"}},r.a.createElement(ii.a,{title:"T\xean b\xe0i th\u1ef1c h\xe0nh",placement:"top-start"},r.a.createElement("div",{style:{flexGrow:1}},e.mini_task_name)),r.a.createElement(ii.a,{title:"S\u1ed1 \u0111\u1eadu",placement:"top"},r.a.createElement("div",{style:{fontSize:12,margin:"0px 4px",color:"#4978cc",marginLeft:10}},e.code_point,r.a.createElement(Ei.a,{style:{fontSize:16,marginRight:1}}))),r.a.createElement(ii.a,{title:"\u0110\u1ed9 kh\xf3",placement:"top"},r.a.createElement("div",{className:"level-minitask",style:{marginLeft:10}}," ",this.renderLevelMinitaskChip(e))),r.a.createElement(ii.a,{title:"Ch\u01b0a ho\xe0n th\xe0nh",placement:"top"},r.a.createElement("div",{style:{width:"20px",display:"flex",alignItems:"center",marginLeft:10}},r.a.createElement("img",{style:{width:"100%",backgroundColor:"#F5F5F5",borderRadius:"50%"},src:a(1320),alt:"Kiwi standing on oval"})))):"yeucaumokhoa"===e.status?r.a.createElement("div",{style:{display:"flex",textDecoration:"none",color:"#595959"}},r.a.createElement("div",null),r.a.createElement("div",{style:{flexGrow:1}},e.mini_task_name),r.a.createElement("div",{className:"unlock",style:{display:"flex"}},r.a.createElement("div",{style:{width:"1em"}},r.a.createElement("img",{style:{width:"100%"},src:a(1321),alt:"Kiwi standing on oval"})),r.a.createElement("div",{className:"hidden",style:{display:"none"}},e.point_unlock))):void 0}},{key:"render",value:function(){var e=this,t=this.props,a=t.classes,n=t.task;return r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{container:!0,direction:"column",className:"".concat(a.TaskItem)},r.a.createElement(h.a,{item:!0,container:!0,direction:"column",alignItems:"center"},r.a.createElement(h.a,{xs:6,md:6,item:!0,style:{padding:"8px",backgroundColor:"white",borderRadius:"9px",marginBottom:"-20px",zIndex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:" nowrap",textAlign:"center",width:"200px",boxShadow:"0px 0px 0px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)"}},n.task_name)),r.a.createElement(h.a,{item:!0,style:{height:"200px",width:"100%",overflow:"hidden"}}," ",r.a.createElement("img",{src:n.background_image,style:{height:"100%",width:"100%",borderRadius:"4px 4px 0 0"},alt:""})),r.a.createElement(h.a,{item:!0,container:!0,direction:"column",style:{padding:"10px 0",background:"white",boxShadow:"0px 0px 0px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)"}}," ",n.minitasks.map((function(t){return r.a.createElement(h.a,{item:!0,className:"".concat(a.MiniTaskItem),key:t.id}," ",e.renderMiniItem(t))})))))}}]),t}(n.Component)),yi=Object(f.a)({TaskItem:{borderRadius:"4px",overflow:"hidden",marginBottom:"50px",boxShadow:"rgba(0, 0, 0, 0.2) 0px 0px 0px 0px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 2px 1px -1px"},MiniTaskItem:{margin:"5px",backgroundColor:"#dddddd",padding:"5px 10px",paddingTop:"10px",borderRadius:"9px",boxShadow:"0px 0px 0px 0px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 2px 1px -1px rgba(0,0,0,0.12)"}})(vi),xi=function(e){var t=Object(c.f)(e,{path:"/profile/courses/:courseId/tasks"});return t&&t.params||{}},ki=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={tasks:[],isLoading:!0,course:{}},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.location,a=xi(t.pathname);console.log(a),b.a.get("https://hocodevn.com/api/v1/auth/courses/".concat(a.courseId,"/tasks")).then((function(t){console.log(t.data);var a=t.data.reverse();e.setState({tasks:a,isLoading:!1})})),b.a.get("https://hocodevn.com/api/v1/courses/".concat(a.courseId)).then((function(t){var a=t.data;console.log(a),e.setState({course:a})}))}},{key:"onClickRating",value:function(e){var t=this.props.location,a=xi(t.pathname),n=this.state.course;null===n.rating&&(n.rating=[]),n.rating.push(e),n.rating_value=Ci(n.rating),this.setState({course:n}),b.a.put("https://hocodevn.com/api/v1/curd/courses/".concat(a.courseId),n).then((function(e){}))}},{key:"render",value:function(){var e=this,t=this.props.classes,a=this.state,n=a.tasks,i=a.course,o=this.state.isLoading;return r.a.createElement(h.a,{container:!0,className:t.TasksContainer,justify:"center"},o?r.a.createElement("div",{className:"sweet-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100vh"}},r.a.createElement(Ie.a,{sizeUnit:"px",size:50,color:"#AEA8A8",loading:o})):r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{item:!0,xs:12,sm:12,style:{marginBottom:30}},r.a.createElement(ht.a,null,r.a.createElement(h.a,{container:!0,style:{padding:30}},r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement(ye.a,{variant:"h5",component:"h3"},i.course_name)),r.a.createElement(h.a,{item:!0,xs:12,sm:12},r.a.createElement("p",null,i.course_desc)),r.a.createElement(h.a,{item:!0,xs:12,sm:12,container:!0,style:{justifyContent:"space-between"}},r.a.createElement(h.a,{item:!0,style:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},r.a.createElement(An.a,{className:t.smallAvatar,style:{backgroundColor:Zr()}}," ",i.user_create?i.user_create.charAt(0).toUpperCase():"H"),r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{marginLeft:4}},""!==i.user_create?i.user_create:"Hocode")),r.a.createElement(h.a,{style:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},r.a.createElement(Xr.a,null),r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{marginLeft:4}},i.total_minitask," b\xe0i h\u1ecdc")),r.a.createElement(h.a,{item:!0,style:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},r.a.createElement(Qr.a,{name:"a",value:i.rating_value,"read-only":"true",precision:.5,size:"large",onChange:function(t,a){e.onClickRating(a)}}),r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{marginLeft:4}},"\u0110\xe1nh gi\xe1(",i.rating?i.rating.length:0,")")))))),r.a.createElement(h.a,{item:!0,xs:12,sm:6,style:{padding:"0px 10px"}},n.map((function(e){return r.a.createElement(yi,{key:e.id,task:e})})))))}}]),t}(n.Component),Ci=function(e){return e.reduce((function(e,t){return e+t}))/e.length},_i=Object(f.a)({card:{height:150,width:"100%"},TasksContainer:{minHeight:"100vh"}})(ki),Oi=a(1466),ji=a(709),Si=a.n(ji),wi=(a(1322),Object(ae.a)({paper:{border:"1px solid #d3d4d5"}})((function(e){return r.a.createElement(ne.a,Object.assign({style:{paddingLeft:"5px",paddingRight:"5px"},elevation:0,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},e))}))),Ti=Object(ae.a)((function(e){return{root:{minHeight:"unset",height:"25px","&:focus":{"& .MuiListItemIcon-root, & .MuiListItemText-primary":{color:e.palette.common.white}}}}}))(re.a);var Ni=Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{logoutUser:w})((function(e){var t=r.a.useState(null),a=Object(te.a)(t,2),n=a[0],i=a[1];return r.a.createElement("div",{style:{marginLeft:3}},r.a.createElement(oe.a,{"aria-controls":"customized-menu","aria-haspopup":"true",variant:"contained",onClick:function(e){i(e.currentTarget)},style:{color:"#282828"}}),r.a.createElement(wi,{id:"customized-menu",anchorEl:n,keepMounted:!0,open:Boolean(n),onClose:function(){i(null)}},r.a.createElement(Ti,null,r.a.createElement(ce.a,{style:{fontSize:16}}),r.a.createElement(s.b,{to:"/profile/account",style:{textDecoration:"none"},onClick:function(){i(null)}},r.a.createElement("p",{style:{fontSize:12,marginLeft:"3px",textDecoration:"none"}},"Th\xf4ng tin c\xe1 nh\xe2n"))),r.a.createElement(Ti,{onClick:e.logoutUser},r.a.createElement(X.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:12,marginLeft:"3px"}},"\u0110\u0103ng xu\u1ea5t"))))})),Li=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).state={},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this.props.classes;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",flexGrow:1}},r.a.createElement("div",{style:{display:"flex"}},"mod"===this.props.user.role||"admin"===this.props.user.role?r.a.createElement(s.b,{to:"/profile/minitasks/createminitask",style:{textDecoration:"none",display:"flex",justifyContent:"center",alignItems:"center"}},r.a.createElement(Oi.a,{variant:"extended","aria-label":"like",style:{height:"32px",fontSize:"10px",background:"#dbe4f8",color:"#1f74be",marginLeft:10}},r.a.createElement(Si.a,{style:{fontSize:14,marginRight:2}}),r.a.createElement("div",{className:"dangBaiTap"},"\u0110\u0103ng b\xe0i th\u1ef1c h\xe0nh"))):""),r.a.createElement("div",{style:{flexGrow:1,display:"flex",justifyContent:"flex-end",alignItems:"center"}},r.a.createElement("div",{style:{fontSize:12,margin:"0px 4px",color:"#4978cc",marginLeft:10,display:"flex",alignItems:"center"}},r.a.createElement("div",null,"S\u1ed1 \u0111\u1eadu: ",this.props.user.codepoint),"              ",r.a.createElement("div",null)),r.a.createElement("div",{style:{color:"#595959",fontSize:"20px",padding:"5px"}}," ",r.a.createElement("div",null,this.props.user.firstname," ")),r.a.createElement(An.a,{className:e.mobileHide,style:{width:"30px",height:"30px",marginLeft:10},alt:"Remy Sharp",src:this.props.user.avatar}),r.a.createElement(Ni,null))))}}]),t}(r.a.Component),Ii=Object(ae.a)((function(e){return{searchComponent:{padding:"2px 15px 2px 4px",display:"flex",alignItems:"center",background:"#ebebeb",height:"35px",borderRadius:"unset!important"},inputSearchComponent:{marginLeft:e.spacing(1),flex:1,fontSize:12},iconButtonSearchComponent:{padding:10},mobileHide:Object(et.a)({},e.breakpoints.down("sm"),{display:"none"})}}),{withTheme:!0})(Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{getUser:N})(Li)),Di=a(1468),Ri=a(1469),Fi=a(1470),Mi=a(710),zi=a.n(Mi),Ai=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).getApi=Object(wt.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([b.a.get("https://hocodevn.com/api/v1/books").then((function(e){var t=e.data;console.log(t),a.setState({books:t})})),b.a.get("https://hocodevn.com/api/v1/events").then((function(e){var t=e.data;console.log(t),a.setState({events:t})}))]);case 2:a.setState({isLoading:!1});case 3:case"end":return e.stop()}}),e)}))),a.handleClickDialogReadmoreOpen=function(e,t,n){a.setState({openDialogReadmore:!0,bookcontent:e,bookImage:t,booktitlet:n})},a.handleDialogReadmoreClose=function(){a.setState({openDialogReadmore:!1})},a.state={daily_minitask:{},isLoading:!0,books:[],events:[],openDialogReadmore:!1,bookcontent:"",booktitlet:"",bookImage:""},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.props.getUser(),this.getApi()}},{key:"limitText",value:function(e,t){var a=e;return e.length>t&&(a=e.substring(0,t)),a}},{key:"render",value:function(){var e=this,t=this.props.classes,a=function(a,n,i){return r.a.createElement(h.a,{xs:!0,item:!0},r.a.createElement("p",{style:{fontWeight:"bold"}},"books"===n?"S\xe1ch l\u1eadp tr\xecnh":""," ","events"===n?"S\u1ef1 ki\u1ec7n n\u1ed5i b\u1eadt":""),r.a.createElement(zi.a,{indicators:!1,interval:i},a.map((function(a){return r.a.createElement(r.a.Fragment,{key:a.id},r.a.createElement(h.a,{item:!0,xs:12,sm:12,md:12},r.a.createElement(h.a,{style:{marginTop:10,marginBottom:10}},r.a.createElement(Un.a,{className:t.card},r.a.createElement(Di.a,{onClick:function(){"books"===n&&e.handleClickDialogReadmoreOpen(a.content,a.image,a.title),"events"===n&&window.open(a.link,"_blank")}},r.a.createElement("div",{style:{width:"100%",height:"books"===n?"200px":"60px",background:"url(".concat(a.image,") no-repeat center"),backgroundSize:"cover"}}),r.a.createElement(Ri.a,null,r.a.createElement(ye.a,{gutterBottom:!0,variant:"h5",component:"h2",style:{height:55,overflow:"hidden",wordBreak:"break-word"}},a.title),a.content.length>100?r.a.createElement(r.a.Fragment,null,r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",component:"p",style:{height:48,overflow:"hidden",wordBreak:"break-word"}},e.limitText(a.content,100),"...")):a.content))))))}))),r.a.createElement(pi.a,{open:e.state.openDialogReadmore,onClose:e.handleDialogReadmoreClose,"aria-labelledby":"customized-dialog-title"},r.a.createElement(hi.a,{id:"customized-dialog-title",onClose:e.handleDialogReadmoreClose},e.state.booktitlet),r.a.createElement(di.a,{dividers:!0},r.a.createElement(h.a,{container:!0,direction:"row",justify:"center",alignItems:"center"},r.a.createElement(h.a,{item:!0,xs:4,style:{background:"url(".concat(e.state.bookImage,") no-repeat center"),backgroundSize:"cover",height:"300px"}}),r.a.createElement(h.a,{item:!0,xs:8,style:{padding:"16px"}},r.a.createElement(Fi.a,{id:"alert-dialog-description"},e.state.bookcontent))))))};return r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{container:!0,direction:"column",justify:"center",style:{height:"100%",flexWrap:"unset"}},"undefined"!==typeof this.state.books&&this.state.books.length>0?a(this.state.books,"books",8e3):null,"undefined"!==typeof this.state.events&&this.state.events.length>0?a(this.state.events,"events",12e3):null))}}]),t}(r.a.Component),Ui=Object(ae.a)((function(e){return{card:{display:"flex"},details:{display:"flex",flexDirection:"column"},content:{flex:"1 0 auto"},cover:{width:151},controls:{display:"flex",alignItems:"center",paddingLeft:e.spacing(1),paddingBottom:e.spacing(1)}}}),{withTheme:!0})(Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{getUser:N})(Ai)),Bi=(a(1333),function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).onLogout=function(e){e.preventDefault(),console.log(a.props),a.props.logoutUser(),a.props.history.push("/login")},a.state={courses:[],mobileOpen:!1,menu:1},a.handleDrawerToggle=a.handleDrawerToggle.bind(Object(k.a)(a)),a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"handleDrawerToggle",value:function(){this.setState({mobileOpen:!this.state.mobileOpen})}},{key:"onClickMenuItem",value:function(e){var t=this;return function(a){t.setState({menu:e})}}},{key:"render",value:function(){var e=this.props,t=e.classes,a=e.theme,n=e.container,i=this.state.mobileOpen,o=this.props.match,l=o.path,u=o.url;console.log("[path]"),console.log(l);var m=this.props.location.pathname,p=r.a.createElement("div",{style:{height:"100%",overflow:"hidden"}},r.a.createElement("div",{className:t.toolbar,style:{borderBottom:"1px solid rgba(76, 87, 102, .1)",minHeight:65,display:"flex",alignItems:"center",justifyContent:"center"}},r.a.createElement("div",{className:"logo"},r.a.createElement(s.b,{to:"/profile"},r.a.createElement("img",{src:"/logo.png",alt:"",style:{height:"40px"}})))),r.a.createElement(wr.a,{className:"menuLeftDrawer",style:{height:"100%"}},r.a.createElement(h.a,{container:!0,direction:"column",style:{height:"100%"}},r.a.createElement(s.b,{to:"".concat(u,"/overview")},r.a.createElement(re.a,{selected:m==="".concat(u,"/overview")||m==="".concat(u)||m==="".concat(u,"/"),onClick:this.onClickMenuItem(1)},r.a.createElement(Lr.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:14,marginLeft:"8px"}},"Trang ch\u1ee7"))),r.a.createElement(s.b,{to:"".concat(u,"/course")},r.a.createElement(re.a,{selected:m==="".concat(u,"/course"),onClick:this.onClickMenuItem(1)},r.a.createElement(zr.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:14,marginLeft:"8px"}},"Ch\u1ee7 \u0111\u1ec1"))),r.a.createElement(s.b,{to:"".concat(u,"/print")},r.a.createElement(re.a,{selected:m==="".concat(u,"/print"),onClick:this.onClickMenuItem(1)},r.a.createElement(Fr.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:14,marginLeft:"8px"}},"Nh\u1eadt k\xfd luy\u1ec7n t\u1eadp"))),"mod"===this.props.user.role||"admin"===this.props.user.role?r.a.createElement(s.b,{to:"/admin"},r.a.createElement(re.a,{selected:m==="".concat(u,"/admin"),onClick:this.onClickMenuItem(1)},r.a.createElement(Dr.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:14,marginLeft:"8px"}},"Qu\u1ea3n l\xfd"))):"",r.a.createElement(h.a,{item:!0,xs:!0,style:{display:"flex",flexDirection:"column",justifyContent:"flex-end",marginBottom:"65px"}},r.a.createElement(s.b,{to:"".concat(u,"/account")},r.a.createElement(re.a,{selected:m==="".concat(u,"/account"),onClick:this.onLogout},r.a.createElement(Pr.a,{style:{fontSize:16}}),r.a.createElement("p",{style:{fontSize:14,marginLeft:"8px"}},"\u0110\u0103ng xu\u1ea5t")))," "))));return r.a.createElement("div",{className:t.root},r.a.createElement(tt.a,null),r.a.createElement(Or.a,{position:"fixed",className:t.appBar},r.a.createElement(Tr.a,null,r.a.createElement(pt.a,{"aria-label":"open drawer",edge:"start",onClick:this.handleDrawerToggle,className:t.menuButton},r.a.createElement(Ur.a,null)),r.a.createElement(Ii,null))),r.a.createElement("nav",{className:" ".concat(t.drawerMain," drawerMain "),"aria-label":"nav main"},r.a.createElement(Sr.a,{smUp:!0,implementation:"css"},r.a.createElement(jr.a,{container:n,variant:"temporary",anchor:"rtl"===a.direction?"right":"left",open:i,onClose:this.handleDrawerToggle,classes:{paper:t.drawerPaper},ModalProps:{keepMounted:!0}},p)),r.a.createElement(Sr.a,{xsDown:!0,implementation:"css"},r.a.createElement(jr.a,{classes:{paper:t.drawerPaper},variant:"permanent",open:!0},p))),r.a.createElement("nav",{className:t.navRight,"aria-label":"nav right"},r.a.createElement(Ui,null)),r.a.createElement("main",{className:t.content},r.a.createElement("div",{className:t.toolbar}),r.a.createElement(c.d,null,r.a.createElement(c.b,{exact:!0,path:l},r.a.createElement(si,{url:u})),r.a.createElement(c.b,{path:"".concat(l,"/overview")},r.a.createElement(si,{url:u})),r.a.createElement(c.b,{path:"".concat(l,"/course")},r.a.createElement(ai,{url:u})),r.a.createElement(c.b,{path:"".concat(l,"/courses/:courseId/tasks")},r.a.createElement(_i,{location:this.props.location})),r.a.createElement(c.b,{path:"".concat(l,"/print")},r.a.createElement(gi,{userData:this.props.user})),r.a.createElement(c.b,{path:"".concat(l,"/account")},r.a.createElement(Gr,null)),r.a.createElement(c.b,{exact:!0,path:"".concat(l,"/minitasks/createminitask")},r.a.createElement(ht.a,{style:{padding:10}},r.a.createElement(yn,{location:this.props.location}))))))}}]),t}(r.a.Component)),Pi=Object(ae.a)((function(e){var t,a,n;return{root:{display:"flex",background:"#fff"},drawerMain:Object(et.a)({},e.breakpoints.up("sm"),{width:240,flexShrink:0}),navRight:(t={top:"65px",order:2,width:"225px",height:"calc(100vh - 65px)",display:"none",padding:"16px 32px",position:"relative",overflow:"hidden",flexShrink:0},Object(et.a)(t,e.breakpoints.up("md"),{display:"block"}),Object(et.a)(t,"background","white"),t),appBar:(a={},Object(et.a)(a,e.breakpoints.up("sm"),{width:"calc(100% - ".concat(240,"px)"),marginLeft:240}),Object(et.a)(a,"background","#fff"),Object(et.a)(a,"boxShadow","unset!important"),Object(et.a)(a,"borderBottom","1px solid rgba(76, 87, 102, .1)"),a),menuButton:(n={marginRight:e.spacing(2)},Object(et.a)(n,e.breakpoints.up("sm"),{display:"none"}),Object(et.a)(n,"borderRadius","unser !important"),n),toolbar:e.mixins.toolbar,drawerPaper:{width:240},content:{flexGrow:1,padding:e.spacing(3),background:"#f3f3f3"},searchComponent:{padding:"2px 15px 2px 4px",display:"flex",alignItems:"center",background:"#ebebeb",height:"35px",borderRadius:"unset!important"},inputSearchComponent:{marginLeft:e.spacing(1),flex:1,fontSize:12},iconButtonSearchComponent:{padding:10}}}),{withTheme:!0})(Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors,user:e.rootReducer.user}}),{logoutUser:w})(Bi)),Hi=a(1471),Wi=a(1487);a(1334);function Gi(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}var Vi=Object(f.a)({root:{"& label.Mui-focused":{color:"#3f51b5"},"& .MuiInput-underline:after":{borderBottomColor:"#3f51b5"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"#3f51b5"},"&:hover fieldset":{borderColor:"#3f51b5"},"&.Mui-focused fieldset":{borderColor:"#3f51b5"}}}})(at.a);function qi(){return r.a.createElement(ye.a,{variant:"body2",color:"textSecondary",align:"center"},"Copyright \xa9 ",r.a.createElement(s.b,{color:"inherit",to:"/"},"hocodevn.com")," ",(new Date).getFullYear(),".")}var Ki=function(e){function t(e){var a;return Object(l.a)(this,t),(a=Object(m.a)(this,Object(p.a)(t).call(this,e))).onChange=function(e){a.setState(Object(et.a)({},e.target.id,e.target.value))},a.handleChange=function(e){return function(t){a.setState(function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Gi(Object(a),!0).forEach((function(t){Object(et.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Gi(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},a.state,Object(et.a)({},e,t.target.checked)))}},a.onSubmitTest=function(e){a.setState({email:"thiennd@gmail.com",password:"Thien123"})},a.onSubmit=function(){var e=Object(wt.a)(St.a.mark((function e(t){var n;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),a.setState({isLoading:!0}),n={email:a.state.email,password:a.state.password,remember:a.state.remember},Promise.all([a.props.loginUser(n)]).then((function(e){a.setState({isLoading:!1})}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a.state={email:"",password:"",remember:!0,isLoading:!1,errors:{}},a}return Object(d.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.props.auth.isAuthenticated&&this.props.history.push("/profile")}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.auth.isAuthenticated&&this.props.history.push("/profile"),e.errors&&(e.errors.message="*"+e.errors.message,this.setState({errors:e.errors}))}},{key:"render",value:function(){var e=this.state.errors,t=this.props.classes;return r.a.createElement(rt.a,{component:"main",maxWidth:"xs"},r.a.createElement(tt.a,null),r.a.createElement("div",{className:t.paper},r.a.createElement(nt.a,{justifyContent:"center",borderBottom:24,color:"rgba(255, 255, 255, 0.1)"},r.a.createElement("div",{className:"logo"},r.a.createElement(s.b,{to:"/profile"},r.a.createElement("img",{src:"/logo.png",alt:"",style:{height:"80px"}})))),r.a.createElement(ye.a,{component:"h1",variant:"h5"},"\u0110\u0103ng nh\u1eadp"),r.a.createElement("form",{className:t.form,noValidate:!0,onSubmit:this.onSubmit},r.a.createElement("div",null,r.a.createElement("div",{className:"error_show"},e.message)),r.a.createElement(Vi,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email",name:"email",onChange:this.onChange,value:this.state.email,autoComplete:"email",autoFocus:!0}),r.a.createElement(Vi,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:this.onChange,value:this.state.password}),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,xs:!0},r.a.createElement(Hi.a,{control:r.a.createElement(Wi.a,{value:"remember",color:"primary",onChange:this.handleChange("remember"),checked:this.state.remember}),label:"L\u01b0u t\xe0i kho\u1ea3n"}))),r.a.createElement(Ye.a,{fullWidth:!0,variant:"contained",onClick:this.onSubmitTest},"T\xe0i kho\u1ea3n admin test"),r.a.createElement(Ye.a,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",className:t.submit},this.state.isLoading?r.a.createElement(mt.a,{size:22,color:"#fff",style:{margin:2}}):"\u0110\u0103ng nh\u1eadp"),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,xs:!0},r.a.createElement(s.b,{to:"#",variant:"body2"})),r.a.createElement(h.a,{item:!0},r.a.createElement(s.b,{to:"/signup",variant:"body1"},"N\u1ebfu b\u1ea1n ch\u01b0a c\xf3 t\xe0i kho\u1ea3n, H\xe3y \u0111\u0103ng k\xfd ngay"))),r.a.createElement(h.a,{container:!0},r.a.createElement(h.a,{item:!0,xs:!0},r.a.createElement(s.b,{to:"#",variant:"body2"})),r.a.createElement(h.a,{item:!0},r.a.createElement(ye.a,{variant:"subtitle1"},r.a.createElement("a",{href:"https://docs.google.com/forms/d/e/1FAIpQLScGsL9g_Hot55sUbVHb0O7uBsWtkBrDE65fmETvflcxvuCdvw/viewform?usp=sf_link",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",color:"#ff5722!important"}},"\u0110\u0103ng k\xfd tr\u1edf th\xe0nh gi\xe1o vi\xean")))))),r.a.createElement(nt.a,{mt:8},r.a.createElement(qi,null)))}}]),t}(r.a.Component),Yi=Object(f.a)({"@global":{body:{backgroundColor:"white"}},paper:{marginTop:50,display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:8,backgroundColor:"#3f51b5"},form:{width:"100%",marginTop:8},submit:{margin:"16px 0px"}})(Object(C.b)((function(e){return{auth:e.rootReducer.auth,errors:e.rootReducer.errors}}),{loginUser:function(e){return function(t){return b.a.post("https://hocodevn.com/api/v1/login",e).then((function(a){var n=a.data.token,r=j()(n);e.remember&&(localStorage.setItem("AuthToken",n),localStorage.setItem("token",n),localStorage.setItem("permissions",r.data.role),_(n)),console.log(r),t(S(r))})).catch((function(e){return t({type:"GET_ERRORS",payload:e.response.data})}))}}})(Ki)),Ji=Object(C.b)((function(e){return{auth:e.rootReducer.auth}}))((function(e){var t=e.component,a=e.auth,n=Object(ge.a)(e,["component","auth"]);return r.a.createElement(c.b,Object.assign({},n,{render:function(e){return!0===a.isAuthenticated?r.a.createElement(t,e):r.a.createElement(c.a,{to:"/login"})}}))}));if(localStorage.AuthToken){var Xi=localStorage.AuthToken;_(Xi);var Qi=j()(Xi);Cr.dispatch(S(Qi));var Zi=Date.now()/1e3;Qi.exp<Zi&&(Cr.dispatch(w()),window.location.href="./login")}var $i=function(){return r.a.createElement(C.a,{store:Cr},r.a.createElement(C.a,{store:Cr},r.a.createElement(s.a,null,r.a.createElement("div",{className:"App"},r.a.createElement(c.d,null,r.a.createElement(c.b,{path:"/",exact:!0,component:$e}),r.a.createElement(c.b,{path:"/home",exact:!0,component:$e}),r.a.createElement(c.b,{path:"/login",exact:!0,component:Yi}),r.a.createElement(c.b,{path:"/signup",exact:!0,component:ut}),r.a.createElement(c.b,{path:"/reactmde",exact:!0,component:_t}),r.a.createElement(c.b,{path:"/searchcert",component:xt}),r.a.createElement(Ji,{path:"/courses",exact:!0,component:R}),r.a.createElement(Ji,{path:"/courses/:courseId/tasks",component:P}),r.a.createElement(Ji,{path:"/tasks/:minitaskId",component:Ke}),r.a.createElement(c.b,{path:"/createminitask",exact:!0,component:zt}),r.a.createElement(Ji,{path:"/admin",component:_r}),r.a.createElement(Ji,{path:"/profile",component:Pi}),r.a.createElement(c.b,{render:function(){return r.a.createElement("div",null,"404 Page Not Found")}}))))))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));a(1476).a({dsn:"https://cd5ce2da28be4dcfaea42bfa2f637fba@sentry.io/1827293"}),o.a.render(r.a.createElement($i,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},544:function(e,t,a){},546:function(e,t,a){e.exports=a.p+"static/media/giphy.eb842a55.gif"},623:function(e,t,a){},624:function(e,t,a){},802:function(e,t,a){e.exports=a(1335)},807:function(e,t,a){},808:function(e,t,a){},825:function(e,t,a){},829:function(e,t,a){},831:function(e,t,a){},834:function(e,t,a){e.exports=a.p+"static/media/logo.b54be03d.png"},835:function(e,t,a){},836:function(e,t,a){e.exports=a.p+"static/media/hoanthanh.c18c22ed.svg"},837:function(e,t,a){e.exports=a.p+"static/media/user.316d47a9.svg"},838:function(e,t,a){e.exports=a.p+"static/media/chuahoanthanh.a6ac73da.svg"},839:function(e,t,a){e.exports=a.p+"static/media/padlock-unlock.f593928a.svg"},840:function(e,t,a){},841:function(e,t,a){e.exports=a.p+"static/media/logo.b54be03d.png"},921:function(e,t,a){},922:function(e,t,a){},923:function(e,t,a){},930:function(e,t,a){},932:function(e,t,a){},933:function(e,t,a){e.exports=a.p+"static/media/play-button.8b3ac6fe.svg"},934:function(e,t,a){},935:function(e,t,a){},950:function(e,t){},952:function(e,t,a){},954:function(e,t,a){},955:function(e,t,a){}},[[802,1,2]]]);
  //# sourceMappingURL=main.b30569b3.chunk.js.map