@cocalc/static
Version:
CoCalc's static frontend Webpack-based build system and framework
1 lines • 174 kB
JavaScript
"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[5730],{64445:(t,e,n)=>{n.d(e,{Bw:()=>s,Dg:()=>c,Eb:()=>i,lJ:()=>o,sm:()=>r,uz:()=>a});var r="student",s=6e4,a=6e5,i=5e5,o=4e6,c="GRADING-GUIDE.md"},99918:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(t){var e=t.get("last_collect").keySeq().toJS(),n=t.get("nbgrader_scores"),r={succeeded:0,failed:0,not_attempted:0,attempted:0};if(null==n)r.not_attempted=e.length;else{var s=!0,i=!1,o=void 0;try{for(var c,u=e[Symbol.iterator]();!(s=(c=u.next()).done);s=!0)r[a(c.value,n)]+=1}catch(t){i=!0,o=t}finally{try{s||null==u.return||u.return()}finally{if(i)throw o}}}return r.attempted=r.succeeded+r.failed,r}function a(t,e){var n=null==e?void 0:e.get(t);if(null==n)return"not_attempted";var s,a,i=!0,o=!1,c=void 0;try{for(var u,l=n[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var _=(s=u.value,a=2,function(t){if(Array.isArray(t))return t}(s)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,s,a=[],i=!0,o=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){o=!0,s=t}finally{try{i||null==n.return||n.return()}finally{if(o)throw s}}return a}}(s,a)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(s,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());if(_[0],"string"==typeof _[1])return"failed"}}catch(t){o=!0,c=t}finally{try{i||null==l.return||l.return()}finally{if(o)throw c}}return"succeeded"}n.d(e,{K:()=>s,n:()=>a})},98846:(t,e,n)=>{n.d(e,{P1:()=>m,fB:()=>y,tH:()=>v,Kk:()=>p,KU:()=>b});var r=n(32295),s=n(3886),a=n(24620),i=n(30126),o=n(13435);function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t,e,n,r,s,a,i){try{var o=t[a](i),c=o.value}catch(t){return void n(t)}o.done?e(c):Promise.resolve(c).then(r,s)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},_(t)}function d(t,e){return!e||"object"!==h(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(t,e){return f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},f(t,e)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,s,a=[],i=!0,o=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){o=!0,s=t}finally{try{i||null==n.return||n.return()}finally{if(o)throw s}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var h=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};var p=5,v=25,y=!1,m=((0,r.createTypedMap)(),function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(h,t);var e,n,c=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=_(e);if(n){var s=_(this).constructor;t=Reflect.construct(r,arguments,s)}else t=r.apply(this,arguments);return d(this,t)});function h(){return l(this,h),c.apply(this,arguments)}var y=h.prototype;return y.any_assignment_uses_peer_grading=function(){var t=!0,e=!1,n=void 0;try{for(var r,s=this.get_assignments()[Symbol.iterator]();!(t=(r=s.next()).done);t=!0){var a=g(r.value,2)[1];if(a.getIn(["peer_grade","enabled"])&&!a.get("deleted"))return!0}}catch(t){e=!0,n=t}finally{try{t||null==s.return||s.return()}finally{if(e)throw n}}return!1},y.get_peers_that_graded_student=function(t,e){var n=[],r=this.get_assignment(t);if(null==r)return n;var s=r.getIn(["peer_grade","map"]);if(null==s)return n;var a=!0,i=!1,o=void 0;try{for(var c,u=s[Symbol.iterator]();!(a=(c=u.next()).done);a=!0){var l=g(c.value,2),_=l[0];l[1].includes(e)&&n.push(_)}}catch(t){i=!0,o=t}finally{try{a||null==u.return||u.return()}finally{if(i)throw o}}return n},y.get_shared_project_id=function(){return this.getIn(["settings","shared_project_id"])},y.get_pay=function(){var t=this.get("settings");return null!=t&&t.get("student_pay")&&t.get("pay")||""},y.get_datastore=function(){var t=this.get("settings");if(null!=t&&null!=t.get("datastore")){var e=t.get("datastore");return"boolean"==typeof e||Array.isArray(e)?e:void console.warn("course/get_datastore: encountered faulty value:",e)}},y.get_envvars=function(){var t=this.getIn(["settings","envvars"]);if(null!=t)return"function"==typeof(null==t?void 0:t.toJS)?t.toJS():void console.warn("course/get_envvars: encountered faulty value:",t)},y.get_allow_collabs=function(){return!!this.getIn(["settings","allow_collabs"])},y.get_email_invite=function(){var t,e=this.getIn(["settings","email_invite"]);if(e)return e;var n=null!==(t=r.redux.getStore("customize").get("site_name"))&&void 0!==t?t:o.SITE_NAME;return"Hello!\n\nWe will use ".concat(n," for the course *{title}*.\n\nPlease sign up!\n\n--\n\n{name}")},y.get_students=function(){return this.get("students")},y.get_student_name=function(t){var e,n,r,s,a=this.resolve({student_id:t}).student;if(null==a)return"Unknown Student";if((null===(e=a.get("first_name"))||void 0===e?void 0:e.trim())||(null===(n=a.get("last_name"))||void 0===n?void 0:n.trim()))return[null===(r=a.get("first_name",""))||void 0===r?void 0:r.trim(),null===(s=a.get("last_name",""))||void 0===s?void 0:s.trim()].join(" ");var i=a.get("account_id");if(null==i)return a.has("email_address")?a.get("email_address"):"Unknown Student";var o=this.redux.getStore("users");if(null==o)throw Error("users must be defined");var c=o.get_name(i);return(null==c?void 0:c.trim())?c:a.has("email_address")?a.get("email_address"):"Unknown Student"},y.get_student_name_extra=function(t){var e=this.resolve({student_id:t}).student;if(null==e)return{simple:"Unknown",full:"Unknown Student"};var n=e.get("email_address"),r=this.get_student_name(t),s="";if((e.has("first_name")||e.has("last_name"))&&e.has("account_id")){var a=this.redux.getStore("users");if(null!=a){var i=a.get_name(e.get("account_id"));null!=i&&(s=' (You call them "'.concat(e.has("first_name")," ").concat(e.has("last_name"),'", but they call themselves "').concat(i,'".)'))}}return{simple:r,full:n?"".concat(r," <").concat(n,">").concat(s):r}},y.get_student_sort_name=function(t){var e=this.resolve({student_id:t}).student;if(null==e)return t;if(e.has("first_name")||e.has("last_name"))return[e.get("last_name",""),e.get("first_name","")].join(" ");var n=e.get("account_id");if(null==n)return e.has("email_address")?e.get("email_address"):t;var r=this.redux.getStore("users");return null==r?t:[r.get_last_name(n),r.get_first_name(n)].join(" ")},y.get_student_email=function(t){return this.getIn(["students",t,"email_address"],"")},y.get_student_ids=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[];t.deleted=!!t.deleted;var n=!0,r=!1,s=void 0;try{for(var a,i=this.get("students")[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var o=g(a.value,2),c=o[0],u=o[1];!!u.get("deleted")==t.deleted&&e.push(c)}}catch(t){r=!0,s=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw s}}return e},y.get_student_project_ids=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.include_deleted,n=t.deleted_only,r=[],s=!0,a=!1,i=void 0;try{for(var o,c=this.get("students")[Symbol.iterator]();!(s=(o=c.next()).done);s=!0){var u=g(o.value,2),l=u[1],_=l.get("project_id");n?e&&l.get("deleted")&&r.push(_):e?r.push(_):l.get("deleted")||r.push(_)}}catch(t){a=!0,i=t}finally{try{s||null==c.return||c.return()}finally{if(a)throw i}}return r},y.get_student=function(t){return this.getIn(["students",t])},y.get_student_project_id=function(t){return this.getIn(["students",t,"project_id"])},y.get_sorted_students=function(){var t=this,e=[],n=!0,r=!1,s=void 0;try{for(var i,o=this.get("students")[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var c=g(i.value,2)[1];c.get("deleted")||e.push(c)}}catch(t){r=!0,s=t}finally{try{n||null==o.return||o.return()}finally{if(r)throw s}}return e.sort((function(e,n){return(0,a.cmp)(t.get_student_sort_name(e.get("student_id")),t.get_student_sort_name(n.get("student_id")))})),e},y.get_grade=function(t,e){var n=this.resolve({assignment_id:t}).assignment;if(null==n)return"";var r=n.getIn(["grades",e],"");return null==r?"":r},y.get_nbgrader_scores=function(t,e){var n,r=this.resolve({assignment_id:t}).assignment;return null===(n=null==r?void 0:r.getIn(["nbgrader_scores",e]))||void 0===n?void 0:n.toJS()},y.get_nbgrader_score_ids=function(t){var e,n=this.resolve({assignment_id:t}).assignment,r=null===(e=null==n?void 0:n.get("nbgrader_score_ids"))||void 0===e?void 0:e.toJS();if(null!=r)return r},y.get_comments=function(t,e){var n=this.resolve({assignment_id:t}).assignment;if(null==n)return"";var r=n.getIn(["comments",e],"");return null==r?"":r},y.get_due_date=function(t){var e=this.resolve({assignment_id:t}).assignment;if(null!=e){var n=e.get("due_date");return null!=n?new Date(n):void 0}},y.get_assignments=function(){return this.get("assignments")},y.get_sorted_assignments=function(){var t=[],e=!0,n=!1,r=void 0;try{for(var s,i=this.get_assignments()[Symbol.iterator]();!(e=(s=i.next()).done);e=!0){var o=g(s.value,2)[1];o.get("deleted")||t.push(o)}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}var c=function(t){return[t.get("due_date",0),t.get("path","")]};return t.sort((function(t,e){return(0,a.cmp_array)(c(t),c(e))})),t},y.get_assignment=function(t){return this.getIn(["assignments",t])},y.get_assignment_ids=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=!0,r=!1,s=void 0;try{for(var a,i=this.get_assignments()[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var o=g(a.value,2),c=o[0],u=o[1];!!u.get("deleted")==t.deleted&&e.push(c)}}catch(t){r=!0,s=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw s}}return e},y.num_nondeleted=function(t){var e=0,n=!0,r=!1,s=void 0;try{for(var a,i=t[Symbol.iterator]();!(n=(a=i.next()).done);n=!0)g(a.value,2)[1].get("deleted")||(e+=1)}catch(t){r=!0,s=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw s}}return e},y.num_students=function(){return this.num_nondeleted(this.get_students())},y.num_running_projects=function(t){var e=0,n=!0,r=!1,s=void 0;try{for(var a,i=this.get_students()[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var o=g(a.value,2)[1];o.get("deleted")||"running"==t.getIn([o.get("project_id"),"state","state"])&&(e+=1)}}catch(t){r=!0,s=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw s}}return e},y.num_assignments=function(){return this.num_nondeleted(this.get_assignments())},y.num_handouts=function(){return this.num_nondeleted(this.get_handouts())},y.student_assignment_info=function(t,e){var n=function(e){if(null==r)throw Error("bug");var n=r.getIn([e,t]);if(null!=n)return n.toJS()},r=this.resolve({assignment_id:e}).assignment;if(null==r)return{student_id:t,assignment_id:e,peer_assignment:!1,peer_collect:!1};var s=this.get_assignment_status(e);if(null==s)throw Error("bug");var a=s.not_collect+s.not_assignment==0&&0!=s.collect,i=null!=s.not_peer_assignment&&0==s.not_peer_assignment;return{last_assignment:n("last_assignment"),last_collect:n("last_collect"),last_peer_assignment:n("last_peer_assignment"),last_peer_collect:n("last_peer_collect"),last_return_graded:n("last_return_graded"),student_id:t,assignment_id:e,peer_assignment:a,peer_collect:i}},y.last_copied=function(t,e,n,r){var s=this.getIn(["assignments",e,"last_".concat(t),n]);if(null==s)return!1;var a=s;return!(r&&a.get("error")||null==a.get("time"))},y.has_grade=function(t,e){return!!this.getIn(["assignments",t,"grades",e])},y.get_assignment_status=function(t){var e=this;null==this.assignment_status_cache&&(this.assignment_status_cache={},this.on("change",(function(){e.assignment_status_cache={}})));var n=this.resolve({assignment_id:t}).assignment;if(null!=n){if(null!=this.assignment_status_cache[t])return this.assignment_status_cache[t];var r=this.get_student_ids({deleted:!1}),s=n.getIn(["peer_grade","enabled"],!1),a=n.get("skip_grading",!1),o={},c=!0,u=!1,l=void 0;try{for(var _,d=(0,i.Ss)(s)[Symbol.iterator]();!(c=(_=d.next()).done);c=!0){var f=_.value;o[f]=0,o["not_".concat(f)]=0}}catch(t){u=!0,l=t}finally{try{c||null==d.return||d.return()}finally{if(u)throw l}}var g=o,h=!0,p=!1,v=void 0;try{for(var y,m=r[Symbol.iterator]();!(h=(y=m.next()).done);h=!0){var b=y.value,w=!0,j=!0,S=!1,x=void 0;try{for(var k,E=(0,i.Ss)(s)[Symbol.iterator]();!(j=(k=E.next()).done);j=!0){var I=k.value,T=n.getIn(["last_".concat(I),b]);if(null!=T&&!T.get("error")&&!T.get("start")||n.get("skip_".concat(I)))w=!0,g[I]+=1;else{var A=this.has_grade(t,b)||a;(w&&"return_graded"!==I||A)&&(g["not_".concat(I)]+=1),w=!1}}}catch(t){S=!0,x=t}finally{try{j||null==E.return||E.return()}finally{if(S)throw x}}}}catch(t){p=!0,v=t}finally{try{h||null==m.return||m.return()}finally{if(p)throw v}}return this.assignment_status_cache[t]=g,g}},y.get_handouts=function(){return this.get("handouts")},y.get_handout=function(t){return this.getIn(["handouts",t])},y.get_handout_ids=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=!0,r=!1,s=void 0;try{for(var a,i=this.get_handouts()[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var o=g(a.value,2),c=o[0],u=o[1];!!u.get("deleted")==t.deleted&&e.push(c)}}catch(t){r=!0,s=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw s}}return e},y.student_handout_info=function(t,e){var n=this.getIn(["handouts",e,"status",t]);return{status:null!=n?n.toJS():void 0,student_id:t,handout_id:e}},y.handout_last_copied=function(t,e){var n=this.getIn(["handouts",t,"status",e]);return null!=n&&!n.get("error")&&null!=n.get("time")},y.get_handout_status=function(t){var e=this;null==this.handout_status_cache&&(this.handout_status_cache={},this.on("change",(function(){e.handout_status_cache={}})));var n=this.resolve({handout_id:t}).handout;if(null!=n){if(null!=this.handout_status_cache[t])return this.handout_status_cache[t];var r=this.get_student_ids({deleted:!1}),s={handout:0,not_handout:0},a=n.get("status"),i=!0,o=!1,c=void 0;try{for(var u,l=r[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var _=u.value;if(null==a)s.not_handout+=1;else{var d=a.get(_);null==d||d.get("error")?s.not_handout+=1:s.handout+=1}}}catch(t){o=!0,c=t}finally{try{i||null==l.return||l.return()}finally{if(o)throw c}}return this.handout_status_cache[t]=s,s}},y.get_upgrade_plan=function(t){var e=this.redux.getStore("account"),n=this.redux.getStore("projects").get("project_map");if(null==n)throw Error("not fully loaded");return function(t){var e=function(t){var e={};for(var n in t.student_project_ids){var r=t.project_map.getIn([n,"users"]);if(null!=r){var s=void 0;r.forEach((function(e,n){if(n!==t.account_id){var r=e.get("upgrades");null!=r&&(s=(0,a.map_sum)(r.toJS(),null!=s?s:{}))}})),null!=s&&(e[n]=s)}}return e}({account_id:t.account_id,project_map:t.project_map,student_project_ids:t.student_project_ids}),n=function(t){var e=(0,a.copy)(t.purchased_upgrades);return t.project_map.forEach((function(n,r){if(!t.student_project_ids[r]){var s=n.getIn(["users",t.account_id,"upgrades"]);null!=s&&(e=(0,a.map_diff)(e,s.toJS()))}})),e}({account_id:t.account_id,purchased_upgrades:t.purchased_upgrades,project_map:t.project_map,student_project_ids:t.student_project_ids}),r=(0,a.keys)(t.student_project_ids);r.sort();var s={},i=!0,o=!1,c=void 0;try{for(var u,l=r[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var _=u.value;if(!t.deleted_project_ids[_]){for(var d in s[_]={},t.upgrade_goal){var f=t.upgrade_goal[d]-(null!=(null!=e[_]?e[_][d]:void 0)?null!=e[_]?e[_][d]:void 0:0);if(f>0){var g=Math.min(f,n[d]);s[_][d]=g,n[d]-=g}}var h=t.project_map.getIn([_,"users",t.account_id,"upgrades"]),p=null!=h?h.toJS():{},v=!1;for(d in t.upgrade_goal)if((null!=p[d]?p[d]:0)!==(null!=s[_][d]?s[_][d]:0)){v=!0;break}v||delete s[_]}}}catch(t){o=!0,c=t}finally{try{i||null==l.return||l.return()}finally{if(o)throw c}}return s}({account_id:e.get_account_id(),purchased_upgrades:e.get_total_upgrades(),project_map:n,student_project_ids:(0,a.set)(this.get_student_project_ids({include_deleted:!0})),deleted_project_ids:(0,a.set)(this.get_student_project_ids({include_deleted:!0,deleted_only:!0})),upgrade_goal:t})},y.resolve=function(t){var e=this.redux.getActions(this.name);if(null==e)return{};var n=e.resolve(t);return delete n.store,n},y.get_assigned_assignment_ids=function(){var t=[],e=!0,n=!1,r=void 0;try{for(var s,a=this.get_assignments()[Symbol.iterator]();!(e=(s=a.next()).done);e=!0){var i=g(s.value,2),o=i[0],c=i[1];if(!c.get("deleted")){var u=c.get("last_assignment");null!=u&&u.size>0&&t.push(o)}}}catch(t){n=!0,r=t}finally{try{e||null==a.return||a.return()}finally{if(n)throw r}}return t},y.get_assigned_handout_ids=function(){var t=[],e=!0,n=!1,r=void 0;try{for(var s,a=this.get_handouts()[Symbol.iterator]();!(e=(s=a.next()).done);e=!0){var i=g(s.value,2),o=i[0],c=i[1];if(!c.get("deleted")){var u=c.get("status");null!=u&&u.size>0&&t.push(o)}}}catch(t){n=!0,r=t}finally{try{e||null==a.return||a.return()}finally{if(n)throw r}}return t},y.get_copy_parallel=function(){var t,e=null!==(t=this.getIn(["settings","copy_parallel"]))&&void 0!==t?t:p;return e<1?1:e>v?v:e},y.get_nbgrader_parallel=function(){var t,e=null!==(t=this.getIn(["settings","nbgrader_parallel"]))&&void 0!==t?t:p;return e<1?1:e>50?50:e},y.getLicenses=function(t){var e,n=this;return(e=function(){var e,r,a,i,o,c,u,l,_,d,f,g,h,p,v,y;return function(t,e){var n,r,s,a,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(s=2&a[0]?r.return:a[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;switch(r=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}}(this,(function(m){switch(m.label){case 0:e={},a=null!==(r=n.getIn(["settings","site_license_id"]))&&void 0!==r?r:"",i=!0,o=!1,c=void 0,m.label=1;case 1:m.trys.push([1,8,9,10]),u=a.split(",")[Symbol.iterator](),m.label=2;case 2:if(i=(l=u.next()).done)return[3,7];if(!(_=l.value))return[3,6];m.label=3;case 3:return m.trys.push([3,5,,6]),[4,(0,s.k)(_,t)];case 4:return null==(d=m.sent())||(f=d.expires,g=d.run_limit,h=!!(f&&f<=new Date),p=g||999999999999999,e[_]={expired:h,runLimit:p}),[3,6];case 5:return v=m.sent(),console.warn("Error getting license info for ".concat(_),v),[3,6];case 6:return i=!0,[3,2];case 7:return[3,10];case 8:return y=m.sent(),o=!0,c=y,[3,10];case 9:try{i||null==u.return||u.return()}finally{if(o)throw c}return[7];case 10:return[2,e]}}))},function(){var t=this,n=arguments;return new Promise((function(r,s){var a=e.apply(t,n);function i(t){u(a,r,s,i,o,"next",t)}function o(t){u(a,r,s,i,o,"throw",t)}i(void 0)}))})()},h}(r.Store));function b(t){var e=0,n=0,r=!1,s=!1;for(var a in t){var i=t[a];if("string"!=typeof i)for(var o in i){var c=i[o];null==c.score&&c.manual&&(s=!0),c.score&&(n+=c.score),e+=c.points}else r=!0}return{score:n,points:e,error:r,manual_needed:s}}},67690:(t,e,n)=>{n.d(e,{j9:()=>x,gG:()=>k,fv:()=>E});var r=n(32295),s=n(1527),a=n(97636),i=n(59087),o=n(24620),c=n(13435),u=n(95788),l=n(98846),_=n(94873);function d(t,e,n,r,s,a,i){try{var o=t[a](i),c=o.value}catch(t){return void n(t)}o.done?e(c):Promise.resolve(c).then(r,s)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var a=t.apply(e,n);function i(t){d(a,r,s,i,o,"next",t)}function o(t){d(a,r,s,i,o,"throw",t)}i(void 0)}))}}var g=function(t,e){var n,r,s,a,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(s=2&a[0]?r.return:a[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;switch(r=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}};function h(t,e,n,r){return p.apply(this,arguments)}function p(){return(p=f((function(t,e,n,r){return g(this,(function(s){switch(s.label){case 0:return[4,(0,_.Wx)(t,60)];case 1:return s.sent(),[4,(0,_.GL)({project_id:t,command:e,args:n,timeout:r,err_on_exit:!1})];case 2:return[2,s.sent()]}}))}))).apply(this,arguments)}function v(t,e,n,r,s){return y.apply(this,arguments)}function y(){return y=f((function(t,e,n,r,s){var a;return g(this,(function(i){switch(i.label){case 0:return o=f((function(t){var a,i;return g(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,h(t,e,n,r)];case 1:return(a=o.sent()).project_id=t,[3,3];case 2:return i=o.sent(),a={project_id:t,stdout:"",stderr:i.toString(),exit_code:-1},[3,3];case 3:return null!=s&&s(a),[2,a]}}))})),a=function(t){return o.apply(this,arguments)},[4,(0,u.map)(t,x,a)];case 1:return[2,i.sent()]}var o}))})),y.apply(this,arguments)}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function b(t,e,n,r,s,a,i){try{var o=t[a](i),c=o.value}catch(t){return void n(t)}o.done?e(c):Promise.resolve(c).then(r,s)}function w(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var a=t.apply(e,n);function i(t){b(a,r,s,i,o,"next",t)}function o(t){b(a,r,s,i,o,"throw",t)}i(void 0)}))}}function j(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}var S=function(t,e){var n,r,s,a,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(s=2&a[0]?r.return:a[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;switch(r=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},x=30,k=(0,o.days_ago)(i.F),E=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.course_actions=e}var e=t.prototype;return e.get_store=function(){var t=this.course_actions.get_store();if(null==t)throw Error("no store");return t},e.create_student_project=function(t){var e=this;return w((function(){var n,s,i,o,c,u,l,_;return S(this,(function(d){switch(d.label){case 0:return n=e.course_actions.resolve({student_id:t,finish:e.course_actions.set_error.bind(e)}),s=n.store,i=n.student,null==s||null==i?[2]:null==s.get("students")||null==s.get("settings")?(e.course_actions.set_error("BUG: attempt to create when stores not yet initialized"),[2]):i.get("project_id")?[2,i.get("project_id")]:(e.course_actions.set({create_project:a.webapp_client.server_time(),table:"students",student_id:t}),o=e.course_actions.set_activity({desc:"Create project for ".concat(s.get_student_name(t),".")}),[4,r.redux.getStore("customize").getDefaultComputeImage()]);case 1:c=d.sent(),d.label=2;case 2:return d.trys.push([2,4,5,6]),[4,r.redux.getActions("projects").create_project({title:s.get("settings").get("title"),description:s.get("settings").get("description"),image:null!==(l=s.get("settings").get("custom_image"))&&void 0!==l?l:c})];case 3:return u=d.sent(),[3,6];case 4:return _=d.sent(),e.course_actions.set_error("error creating student project for ".concat(s.get_student_name(t)," -- ").concat(_)),[2];case 5:return e.course_actions.clear_activity(o),[7];case 6:return e.course_actions.set({create_project:null,project_id:u,table:"students",student_id:t}),[4,e.configure_project({student_id:t,student_project_id:u})];case 7:return d.sent(),[2,u]}}))}))()},e.invite_student_to_project=function(t){var e=this;return w((function(){var n,a,i,o,u,l,_,d,f,g,h,p;return S(this,(function(v){switch(v.label){case 0:return n=t.student_id,a=t.student,null==(i=t.student_project_id)?[2]:a.includes("@")?null==(o=e.get_store())?[2]:(u=r.redux.getStore("account"),l=u.get_fullname(),_=u.get_email_address(),d=o.get("settings").get("title"),g=null!==(f=r.redux.getStore("customize").get("site_name"))&&void 0!==f?f:c.SITE_NAME,h="".concat(g," Invitation to Course ").concat(d),p=(p=o.get_email_invite()).replace(/{title}/g,d).replace(/{name}/g,l),p=(0,s.markdown_to_html)(p),[4,r.redux.getActions("projects").invite_collaborators_by_email(i,a,p,h,!0,_,l)]):[3,2];case 1:return v.sent(),e.course_actions.set({table:"students",student_id:n,last_email_invite:Date.now()}),[3,4];case 2:return[4,r.redux.getActions("projects").invite_collaborator(i,a)];case 3:v.sent(),v.label=4;case 4:return[2]}}))}))()},e.configure_project_users=function(t){var e=this;return w((function(){var n,s,a,i,o,c,u,l,_,d,f,g,h,p,v,y,m,b,w,j,x,k,E;return S(this,(function(S){switch(S.label){case 0:return n=t.student_project_id,s=t.student_id,a=t.force_send_invite_by_email,i=void 0!==a&&a,null==(o=r.redux.getStore("projects").get_users(n))||null==(c=e.get_store())||null==(u=c.get_student(s))?[2]:null!=(l=u.get("account_id"))?[3,3]:(_=u.get("last_email_invite"),!i&&_?[3,2]:[4,e.invite_student_to_project({student_id:s,student:u.get("email_address"),student_project_id:n})]);case 1:S.sent(),e.course_actions.set({table:"students",student_id:s,last_email_invite:Date.now()}),S.label=2;case 2:return[3,5];case 3:return null!=(null!=o?o.get(l):void 0)?[3,5]:[4,e.invite_student_to_project({student_id:s,student:l,student_project_id:n})];case 4:S.sent(),S.label=5;case 5:if(null==(d=r.redux.getStore("projects").get_users(c.get("course_project_id"))))return[2];f=!0,g=!1,h=void 0,S.label=6;case 6:S.trys.push([6,11,12,13]),p=d.keys()[Symbol.iterator](),S.label=7;case 7:return(f=(v=p.next()).done)?[3,10]:(y=v.value,o.has(y)?[3,9]:[4,r.redux.getActions("projects").invite_collaborator(n,y)]);case 8:S.sent(),S.label=9;case 9:return f=!0,[3,7];case 10:return[3,13];case 11:return E=S.sent(),g=!0,h=E,[3,13];case 12:try{f||null==p.return||p.return()}finally{if(g)throw h}return[7];case 13:if(null==c.get("settings")||c.get_allow_collabs()||null==l)return[3,21];m=!0,b=!1,w=void 0,S.label=14;case 14:S.trys.push([14,19,20,21]),j=o.keys()[Symbol.iterator](),S.label=15;case 15:return(m=(x=j.next()).done)?[3,18]:(k=x.value,d.has(k)||k===l?[3,17]:[4,r.redux.getActions("projects").remove_collaborator(n,k)]);case 16:S.sent(),S.label=17;case 17:return m=!0,[3,15];case 18:return[3,21];case 19:return E=S.sent(),b=!0,w=E,[3,21];case 20:try{m||null==j.return||j.return()}finally{if(b)throw w}return[7];case 21:return[2]}}))}))()},e.set_project_site_license=function(t,e){var n=this;return w((function(){var s,a,i,c,u,l,_,d,f,g,h,p,v,y,b,w;return S(this,(function(j){switch(j.label){case 0:if(null==(a=r.redux.getStore("projects").get("project_map"))||null==a.get(t))return[2];if(null==(i=n.get_store()))return[2];u=(0,o.keys)(null!==(c=null===(s=a.getIn([t,"site_license"]))||void 0===s?void 0:s.toJS())&&void 0!==c?c:{}),_=new Set((null!==(l=i.getIn(["settings","site_license_id"]))&&void 0!==l?l:"").split(",")),f=new Set((null!==(d=i.getIn(["settings","site_license_removed"]))&&void 0!==d?d:"").split(",")),g=function(t){if(Array.isArray(t))return m(t)}(S=e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(S)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}(S)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=!0,p=!1,v=void 0;try{for(y=u[Symbol.iterator]();!(h=(b=y.next()).done);h=!0)w=b.value,_.has(w)||f.has(w)||g.push(w)}catch(t){p=!0,v=t}finally{try{h||null==y.return||y.return()}finally{if(p)throw v}}return[4,r.redux.getActions("projects").set_site_license(t,g.join(","))];case 1:return j.sent(),[2]}var S}))}))()},e.configure_project_license=function(t,e){var n=this;return w((function(){var r,s,a;return S(this,(function(i){switch(i.label){case 0:return null==e?[3,2]:[4,n.set_project_site_license(t,e.split(","))];case 1:case 4:return i.sent(),[2];case 2:return null==(r=n.get_store())?[2]:[4,r.getLicenses(!1)];case 3:for(var o in s=i.sent(),a=[],s)s[o].expired||a.push(o);return[4,n.set_project_site_license(t,a)]}}))}))()},e.remove_project_license=function(t){return w((function(){return S(this,(function(e){switch(e.label){case 0:return[4,r.redux.getActions("projects").set_site_license(t,"")];case 1:return e.sent(),[2]}}))}))()},e.remove_all_project_licenses=function(){var t=this;return w((function(){var e,n,r,s,a,i,o,c,u,l;return S(this,(function(_){switch(_.label){case 0:e=t.course_actions.set_activity({desc:"Removing all student project licenses..."}),_.label=1;case 1:if(_.trys.push([1,,10,11]),null==(n=t.get_store()))return[2];r=!0,s=!1,a=void 0,_.label=2;case 2:_.trys.push([2,7,8,9]),i=n.get_students().valueSeq().toArray()[Symbol.iterator](),_.label=3;case 3:return(r=(o=i.next()).done)?[3,6]:(c=o.value,null==(u=c.get("project_id"))?[3,5]:[4,t.remove_project_license(u)]);case 4:_.sent(),_.label=5;case 5:return r=!0,[3,3];case 6:return[3,9];case 7:return l=_.sent(),s=!0,a=l,[3,9];case 8:try{r||null==i.return||i.return()}finally{if(s)throw a}return[7];case 9:return[3,11];case 10:return t.course_actions.set_activity({id:e}),[7];case 11:return[2]}}))}))()},e.configure_project_visibility=function(t){var e=this;return w((function(){var n,s,a,i,o,c,u,l,_,d,f;return S(this,(function(g){switch(g.label){case 0:if(null==(n=r.redux.getStore("projects").get_users(t)))return[2];if(null==(s=e.get_store()))return[2];if(null==(a=r.redux.getStore("projects").get_users(s.get("course_project_id"))))return[2];i=!0,o=!1,c=void 0,g.label=1;case 1:g.trys.push([1,6,7,8]),u=a.keys()[Symbol.iterator](),g.label=2;case 2:return(i=(l=u.next()).done)?[3,5]:(_=l.value,null==(d=n.get(_))||d.get("hide")?[3,4]:[4,r.redux.getActions("projects").set_project_hide(_,t,!0)]);case 3:g.sent(),g.label=4;case 4:return i=!0,[3,2];case 5:return[3,8];case 6:return f=g.sent(),o=!0,c=f,[3,8];case 7:try{i||null==u.return||u.return()}finally{if(o)throw c}return[7];case 8:return[2]}}))}))()},e.configure_project_title=function(t,e){var n=this;return w((function(){var s,a;return S(this,(function(i){switch(i.label){case 0:return null==(s=n.get_store())?[2]:(a="".concat(s.get_student_name(e)," - ").concat(s.get("settings").get("title")),[4,r.redux.getActions("projects").set_project_title(t,a)]);case 1:return i.sent(),[2]}}))}))()},e.action_all_student_projects=function(t){var e=this;return w((function(){var n,s,a,i,o;return S(this,(function(c){switch(c.label){case 0:if(!["start","stop"].includes(t))throw new Error("unknown desired project_action ".concat(t));if(n={start:"starting",stop:"stopping"}[t],e.course_actions.setState({action_all_projects_state:n}),e.course_actions.shared_project.action_shared_project(t),s=e.get_store(),null==(a=r.redux.getActions("projects")))throw Error("projects actions must be defined");return i=function(){switch(t){case"start":return a.start_project.bind(a);case"stop":return a.stop_project.bind(a)}}(),l=w((function(t){return S(this,(function(e){switch(e.label){case 0:return t?s.get("action_all_projects_state")!==n?[2]:[4,i(t)]:[2];case 1:return e.sent(),[2]}}))})),o=function(t){return l.apply(this,arguments)},[4,(0,u.map)(s.get_student_project_ids(),x,o)];case 1:return c.sent(),[2]}var l}))}))()},e.cancel_action_all_student_projects=function(){this.course_actions.setState({action_all_projects_state:"any"})},e.run_in_all_student_projects=function(t,e,n,r){var s=this;return w((function(){var a,i,o,c,u,l,_,d;return S(this,(function(f){switch(f.label){case 0:s.cancel_action_all_student_projects(),a=s.get_store(),i=s.course_actions.set_activity({desc:"Running a command across all student projects…"}),o=s.course_actions.set_activity({desc:"Starting projects …"}),c=0,u=a.get_student_project_ids(),l=u.length,_=function(){null!=o&&s.course_actions.set_activity({id:o})},d=function(t){c+=1,null==r||r(t),_(),o=s.course_actions.set_activity({desc:"Project ".concat(c,"/").concat(l," finished…")})},f.label=1;case 1:return f.trys.push([1,,3,4]),[4,v(u,t,e,n,d)];case 2:return[2,f.sent()];case 3:return s.course_actions.set_activity({id:i}),_(),[7];case 4:return[2]}}))}))()},e.set_all_student_project_titles=function(t){var e=this;return w((function(){var n,s,a,i,o,c,u,l,_,d,f;return S(this,(function(g){switch(g.label){case 0:n=r.redux.getActions("projects"),s=e.get_store(),a=!0,i=!1,o=void 0,g.label=1;case 1:g.trys.push([1,6,7,8]),c=s.get_students().valueSeq().toArray()[Symbol.iterator](),g.label=2;case 2:return(a=(u=c.next()).done)?[3,5]:(l=u.value,_=l.get("project_id"),d="".concat(s.get_student_name(l.get("student_id"))," - ").concat(t),null==_?[3,4]:[4,n.set_project_title(_,d)]);case 3:if(g.sent(),e.course_actions.is_closed())return[2];g.label=4;case 4:return a=!0,[3,2];case 5:return[3,8];case 6:return f=g.sent(),i=!0,o=f,[3,8];case 7:try{a||null==c.return||c.return()}finally{if(i)throw o}return[7];case 8:return[2]}}))}))()},e.configure_project_description=function(t){var e=this;return w((function(){var n;return S(this,(function(s){switch(s.label){case 0:return n=e.get_store(),[4,r.redux.getActions("projects").set_project_description(t,n.getIn(["settings","description"]))];case 1:return s.sent(),[2]}}))}))()},e.set_all_student_project_descriptions=function(t){var e=this;return w((function(){var n,s,a,i,o,c,u,l,_,d;return S(this,(function(f){switch(f.label){case 0:n=e.get_store(),s=r.redux.getActions("projects"),a=!0,i=!1,o=void 0,f.label=1;case 1:f.trys.push([1,6,7,8]),c=n.get_students().valueSeq().toArray()[Symbol.iterator](),f.label=2;case 2:return(a=(u=c.next()).done)?[3,5]:(l=u.value,null==(_=l.get("project_id"))?[3,4]:[4,s.set_project_description(_,t)]);case 3:if(f.sent(),e.course_actions.is_closed())return[2];f.label=4;case 4:return a=!0,[3,2];case 5:return[3,8];case 6:return d=f.sent(),i=!0,o=d,[3,8];case 7:try{a||null==c.return||c.return()}finally{if(i)throw o}return[7];case 8:return[2]}}))}))()},e.set_all_student_project_course_info=function(t){var e=this;return w((function(){var n,s,a,i,o,c,u,l,_,d,f,g,h,p,v,y,m;return S(this,(function(b){switch(b.label){case 0:s=e.get_store(),null==t?null==(t=s.get_pay())&&(t=""):(j(t,Date)&&(t=t.toISOString()),e.course_actions.set({pay:t,table:"settings"})),""==t||j(t,Date)||(t=new Date(t)),a=s.get_datastore(),i=s.get_envvars(),o=null===(n=s.getIn(["settings","student_project_functionality"]))||void 0===n?void 0:n.toJS(),c=r.redux.getActions("projects"),u=e.course_actions.set_activity({desc:"Updating project course info..."}),b.label=1;case 1:b.trys.push([1,,10,11]),l=!0,_=!1,d=void 0,b.label=2;case 2:b.trys.push([2,7,8,9]),f=s.get_students().valueSeq().toArray()[Symbol.iterator](),b.label=3;case 3:return(l=(g=f.next()).done)?[3,6]:(h=g.value,null==(p=h.get("project_id"))?[3,5]:(v=h.get("account_id"),y=h.get("email_address"),[4,c.set_project_course_info(p,s.get("course_project_id"),s.get("course_filename"),t,v,y,a,"student",o,i)]));case 4:b.sent(),b.label=5;case 5:return l=!0,[3,3];case 6:return[3,9];case 7:return m=b.sent(),_=!0,d=m,[3,9];case 8:try{l||null==f.return||f.return()}finally{if(_)throw d}return[7];case 9:return[3,11];case 10:return e.course_actions.set_activity({id:u}),[7];case 11:return[2]}}))}))()},e.configure_project=function(t){var e=this;return w((function(){var n,r,s,a,i;return S(this,(function(o){switch(o.label){case 0:return n=t.student_id,r=t.force_send_invite_by_email,s=t.license_id,a=t.student_project_id,i=e.get_store(),null==a&&(a=i.getIn(["students",n,"project_id"])),null!=a?[3,2]:[4,e.create_student_project(n)];case 1:return o.sent(),[3,4];case 2:return[4,Promise.all([e.configure_project_users({student_project_id:a,student_id:n,force_send_invite_by_email:r}),e.configure_project_visibility(a),e.configure_project_title(a,n),e.configure_project_description(a),e.configure_project_compute_image(a),e.configure_project_license(a,s)])];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))()},e.configure_project_compute_image=function(t){var e=this;return w((function(){var n,s,a,i;return S(this,(function(o){switch(o.label){case 0:return null==(n=e.get_store())?[2]:[4,r.redux.getStore("customize").getDefaultComputeImage()];case 1:return s=o.sent(),i=null!==(a=n.get("settings").get("custom_image"))&&void 0!==a?a:s,[4,r.redux.getProjectActions(t).set_compute_image(i)];case 2:return o.sent(),[2]}}))}))()},e.delete_student_project=function(t){var e=this;return w((function(){var n,s,a;return S(this,(function(i){switch(i.label){case 0:return n=e.get_store(),null==(s=n.getIn(["students",t,"project_id"]))?[2]:(null!=(a=n.getIn(["students",t,"account_id"]))&&r.redux.getActions("projects").remove_collaborator(s,a),[4,r.redux.getActions("projects").delete_project(s)]);case 1:return i.sent(),e.course_actions.set({create_project:null,project_id:null,table:"students",student_id:t}),[2]}}))}))()},e.reinvite_oustanding_students=function(){var t=this;return w((function(){var e,n,r,s,a,i,o,c,l,_,d,f,g,h,p;return S(this,(function(v){switch(v.label){case 0:if(null==(e=t.get_store()))return[2];n=t.course_actions.set_activity({desc:"Reinviting students..."}),v.label=1;case 1:if(v.trys.push([1,12,13,14]),t.course_actions.setState({reinviting_students:!0}),null==(r=e.get_student_ids({deleted:!1})))return[2];s=0,a=!0,i=!1,o=void 0,v.label=2;case 2:v.trys.push([2,9,10,11]),c=r[Symbol.iterator](),v.label=3;case 3:return(a=(l=c.next()).done)?[3,8]:(_=l.value,t.course_actions.is_closed()?[2]:(s+=1,null==(d=e.get_student(_))||null!=d.get("account_id")?[3,7]:(f=t.course_actions.set_activity({desc:"Progress ".concat(Math.round(100*s/r.length),"%...")}),!(g=d.get("last_email_invite"))||new Date(g)<k?[4,t.invite_student_to_project({student_id:_,student:d.get("email_address"),student_project_id:e.get_student_project_id(_)})]:[3,5])));case 4:v.sent(),v.label=5;case 5:return t.course_actions.set_activity({id:f}),[4,(0,u.delay)(0)];case 6:v.sent(),v.label=7;case 7:return a=!0,[3,3];case 8:return[3,11];case 9:return h=v.sent(),i=!0,o=h,[3,11];case 10:try{a||null==c.return||c.return()}finally{if(i)throw o}return[7];case 11:return[3,14];case 12:return p=v.sent(),t.course_actions.set_error("Error reinviting students - ".concat(p)),[3,14];case 13:return t.course_actions.is_closed()?[2]:(t.course_actions.setState({reinviting_students:!1}),t.course_actions.set_activity({id:n}),[7]);case 14:return[2]}}))}))()},e.configure_all_projects=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this;return w((function(){var n,s,i,c,_,d,f,g,h,p,v,y,m,b,w,j,x,k,E,I,T,A,O,N,D,C,P,q,G,U,R,B,L,J,M,z,H,W,$;return S(this,(function(S){switch(S.label){case 0:return null==(n=e.get_store())||n.get("configuring_projects")?[2]:[4,n.getLicenses(t)];case 1:if(s=S.sent(),i=void 0,"serial"==n.getIn(["settings","site_license_strategy"],"serial")&&(0,o.len)(s)>1)for(var F in c=!!n.getIn(["settings","shared_project_id"]),d=null!==(_=n.getIn(["settings","license_upgrade_host_project"]))&&void 0!==_?_:l.fB,i={},s)s[F].expired?i[F]=0:i[F]=s[F].runLimit-(d?1:0)-(c?1:0);f=-1,S.label=2;case 2:return S.trys.push([2,34,35,36]),e.course_actions.setState({configuring_projects:!0}),f=e.course_actions.set_activity({desc:"Ensuring all projects are configured..."}),null==(g=n.get_student_ids({deleted:!1}))?[2]:(h=0,[4,r.redux.getActions("projects").load_all_projects()]);case 3:if(S.sent(),null==(p=r.redux.getStore("projects").get("project_map"))||null==a.webapp_client.account_id)throw Error("BUG -- project_map must be initialized and you must be signed in; try again later.");v=!1,y=!0,m=!1,b=void 0,S.label=4;case 4:S.trys.push([4,9,10,11]),w=g[Symbol.iterator](),S.label=5;case 5:return(y=(j=w.next()).done)?[3,8]:(x=j.value,e.course_actions.is_closed()?[2]:!(k=n.getIn(["students",x,"project_id"]))||p.get(k)?[3,7]:[4,a.webapp_client.project_collaborators.add_collaborator({account_id:a.webapp_client.account_id,project_id:k})]);case 6:S.sent(),v=!0,S.label=7;case 7:return y=!0,[3,5];case 8:return[3,11];case 9:return W=S.sent(),m=!0,b=W,[3,11];case 10:try{y||null==w.return||w.return()}finally{if(m)throw b}return[7];case 11:return v?[4,(0,u.delay)(3e3)]:[3,13];case 12:S.sent(),p=r.redux.getStore("projects").get("project_map"),S.label=13;case 13:E=n.get_student_ids({deleted:!0}),I=!0,T=!1,A=void 0,S.label=14;case 14:S.trys.push([14,20,21,22]),O=E[Symbol.iterator](),S.label=15;case 15:return(I=(N=O.next()).done)?[3,19]:(D=N.value,h+=1,C=e.course_actions.set_activity({desc:"Configuring deleted student project ".concat(h," of ").concat(E.length)}),[4,e.configure_project({student_id:D,student_project_id:void 0,force_send_invite_by_email:!1,license_id:""})]);case 16:return S.sent(),e.course_actions.set_activity({id:C}),[4,(0,u.delay)(0)];case 17:S.sent(),S.label=18;case 18:return I=!0,[3,15];case 19:return[3,22];case 20:return W=S.sent(),T=!0,A=W,[3,22];case 21:try{I||null==O.return||O.return()}finally{if(T)throw A}return[7];case 22:h=0,P=!0,q=!1,G=void 0,S.label=23;case 23:S.trys.push([23,29,30,31]),U=g[Symbol.iterator](),S.label=24;case 24:if(P=(R=U.next()).done)return[3,28];if(B=R.value,e.course_actions.is_closed())return[2];if(h+=1,L=e.course_actions.set_activity({desc:"Configuring student project ".concat(h," of ").concat(g.length)}),J=void 0,null!=i){for(var K in M=n.getIn(["students",B,"project_id"]),z=null==p?void 0:p.getIn([M,"site_license"]),H=!1,z)if(null!=i[K]&&(i[K]-=1,i[K]>=0)){H=!0,J=K;break}if(!H)for(var Y in J="",i)if(i[Y]>0){J=Y,i[Y]-=1;break}}return[4,e.configure_project({student_id:B,student_project_id:void 0,force_send_invite_by_email:t,license_id:J})];case 25:return S.sent(),e.course_actions.set_activity({id:L}),[4,(0,u.delay)(0)];case 26:S.sent(),S.label=27;case 27:return P=!0,[3,24];case 28:return[3,31];case 29:return W=S.sent(),q=!0,G=W,[3,31];case 30:try{P||null==U.return||U.return()}finally{if(q)throw G}return[7];case 31:return[4,e.course_actions.shared_project.configure()];case 32:return S.sent(),[4,e.set_all_student_project_course_info()];case 33:return S.sent(),[3,36];case 34:return $=S.sent(),e.course_actions.set_error("Error configuring student projects - ".concat($)),[3,36];case 35:return e.course_actions.is_closed()?[2]:(e.course_actions.setState({configuring_projects:!1}),e.course_actions.set_activity({id:f}),[7]);case 36:return[2]}}))}))()},e.delete_all_student_projects=function(){var t=this;return w((function(){var e,n,r,s,a,i,o,c,u,l,_;return S(this,(function(d){switch(d.label){case 0:e=t.get_store(),n=t.course_actions.set_activity({desc:"Deleting all student projects..."}),d.label=1;case 1:if(d.trys.push([1,10,11,12]),null==(r=e.get_student_ids({deleted:!1})))return[2];s=!0,a=!1,i=void 0,d.label=2;case 2:d.trys.push([2,7,8,9]),o=r[Symbol.iterator](),d.label=3;case 3:return(s=(c=o.next()).done)?[3,6]:(u=c.value,[4,t.delete_student_project(u)]);case 4:d.sent(),d.label=5;case 5:return s=!0,[3,3];case 6:return[3,9];case 7:return l=d.sent(),a=!0,i=l,[3,9];case 8:try{s||null==o.return||o.return()}finally{if(a)throw i}return[7];case 9:return[3,12];case 10:return _=d.sent(),t.course_actions.set_error("error deleting a student project... ".concat(_)),[3,12];case 11:return t.course_actions.set_activity({id:n}),[7];case 12:return[2]}}))}))()},e.upgrade_all_student_projects=function(t){var e=this;return w((function(){var n,s,a,i,c,u,l,_,d,f;return S(this,(function(g){switch(g.label){case 0:if(n=e.get_store(),s=n.get_upgrade_plan(t),0===(0,o.len)(s))return[2];for(l in a=e.course_actions.set_activity({desc:"Adjusting upgrades on ".concat((0,o.len)(s)," student projects...")}),i=r.redux.getActions("projects"),c=r.redux.getStore("projects"),u=[],s)u.push(l);_=0,g.label=1;case 1:return _<u.length?null==(d=u[_])||null==(f=s[d])?[3,3]:c.has_project(d)?[4,i.apply_upgrades_to_project(d,f,!1)]:[3,3]:[3,4];case 2:g.sent(),g.label=3;case 3:return _++,[3,1];case 4:return e.course_actions.set_activity({id:a}),[2]}}))}))()},e.admin_upgrade_all_student_projects=function(t){var e=this;return w((function(){var n,s,i,c,u,l,_,d,f,g,h,p;return S(this,(function(v){switch(v.label){case 0:if(n=r.redux.getStore("account"),(s=n.get("groups"))&&s.includes("admin"))throw Error("must be an admin to upgrade");i=e.get_store(),c=i.get_student_project_ids(),u=!0,l=!1,_=void 0,v.label=1;case 1:v.trys.push([1,6,7,8]),d=c[Symbol.iterator](),v.label=2;case 2:return(u=(f=d.next()).done)?[3,5]:(g=f.value,(h=(0,o.copy)(t)).project_id=g,[4,a.webapp_client.project_client.set_quotas(h)]);case 3:v.sent(),v.label=4;case 4:return u=!0,[3,2];case 5:return[3,8];case 6:return p=v.sent(),l=!0,_=p,[3,8];case 7:try{u||null==d.return||d.return()}finally{if(l)throw _}return[7];case 8:return[2]}}))}))()},t}()},30126:(t,e,n)=>{n.d(e,{A:()=>m,Ek:()=>f,JU:()=>j,OG:()=>c,Ss:()=>o,X$:()=>y,_L:()=>h,c8:()=>g,eh:()=>w,k1:()=>d,q_:()=>u,qw:()=>l,sX:()=>_,wA:()=>b});var r=n(32295),s=n(24620),a=n(35730);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t){return t?["assignment","collect","peer_assignment","peer_collect","return_graded"]:["assignment","collect","return_graded"]}function c(t,e){var n,r=!0,s=!1,a=void 0;try{for(var i,c=o(e)[Symbol.iterator]();!(r=(i=c.next()).done);r=!0){var u=i.value;if(t===u){if(void 0===n)break;return n}n=u}}catch(t){s=!0,a=t}finally{try{r||null==c.return||c.return()}finally{if(s)throw a}}throw Error("BUG! previous_step('".concat(t,", ").concat(e,"')"))}function u(t){switch(t){case"assignment":case"return_graded":case"peer_assignment":return"to";case"collect":case"peer_collect":return"from";default:throw Error("BUG! step_direction('".concat(t,"')"))}}function l(t){switch(t){case"assignment":case"peer_assignment":return"assign";case"collect":case"peer_collect":return"collect";case"return_graded":return"return";default:throw Error("BUG! step_verb('".concat(t,"')"))}}function _(t,e){switch(t){case"assignment":return"";case"collect":return e>1?" who have already received it":" who has already received it";case"return_graded":return" whose work you have graded";case"peer_assignment":return" for peer grading";case"peer_collect":return" who should have peer graded it"}}function d(t,e,n){var r=f(t,"student_id"),s=!0,a=!1,i=void 0;try{for(var o,c=r[Symbol.iterator]();!(s=(o=c.next()).done);s=!0){var u=o.value;if(null!=u.account_id){var l=e.get(u.account_id);if(null==u.first_name&&(u.first_name=null==l?"":l.get("first_name","")),null==u.last_name&&(u.last_name=null==l?"":l.get("last_name","")),null!=u.project_id){var _=n.getStore("projects");if(null!=_){var d=_.get_last_active(u.project_id);null!=d&&(u.last_