diff --git a/docs/index.b234d1d2.js b/docs/index.53aa10b5.js similarity index 97% rename from docs/index.b234d1d2.js rename to docs/index.53aa10b5.js index dcb45ef..bf82210 100644 --- a/docs/index.b234d1d2.js +++ b/docs/index.53aa10b5.js @@ -117,7 +117,7 @@ isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:nu * This should only be called on non-detached scopes * @internal */key:"off",value:function(){u=this.parent}},{key:"stop",value:function(e){if(this._active){var t,n;for(t=0,n=this.effects.length;t1&&void 0!==arguments[1]?arguments[1]:u;t&&t.active&&t.effects.push(e)}function w(){return u}function x(e){u&&u.cleanups.push(e)}var C=function(e){var t=new Set(e);return t.w=0,t.n=0,t},S=function(e){return(e.w&A)>0},k=function(e){return(e.n&A)>0},E=function(e){var t=e.deps;if(t.length)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;(0,c._)(this,e),this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,b(this,r)}return(0,d._)(e,[{key:"run",value:function(){if(!this.active)return this.fn();for(var e=s,t=M;e;){if(e===this)return;e=e.parent}try{return this.parent=s,s=this,M=!0,A=1<<++T,T<=30?E(this):I(this),this.fn()}finally{T<=30&&V(this),A=1<<--T,s=this.parent,M=t,this.parent=void 0,this.deferStop&&this.stop()}}},{key:"stop",value:function(){s===this?this.deferStop=!0:this.active&&(I(this),this.onStop&&this.onStop(),this.active=!1)}}]),e}();function I(e){var t=e.deps;if(t.length){for(var n=0;n=u)&&l.push(e)})}else switch(void 0!==n&&l.push(a.get(n)),t){case"add":(0,g.isArray)(e)?(0,g.isIntegerKey)(n)&&l.push(a.get("length")):(l.push(a.get(R)),(0,g.isMap)(e)&&l.push(a.get(O)));break;case"delete":!(0,g.isArray)(e)&&(l.push(a.get(R)),(0,g.isMap)(e)&&l.push(a.get(O)));break;case"set":(0,g.isMap)(e)&&l.push(a.get(R))}if(1===l.length)l[0]&&H(l[0]);else{var s=[],c=!0,d=!1,f=void 0;try{for(var p,h=l[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var y=p.value;y&&s.push.apply(s,(0,m._)(y))}}catch(e){d=!0,f=e}finally{try{c||null==h.return||h.return()}finally{if(d)throw f}}H(C(s))}}}function H(e,t){var n=(0,g.isArray)(e)?e:(0,m._)(e),r=!0,i=!1,o=void 0;try{for(var a,l=n[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;u.computed&&q(u,t)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}var s=!0,c=!1,d=void 0;try{for(var f,p=n[Symbol.iterator]();!(s=(f=p.next()).done);s=!0){var h=f.value;h.computed||q(h,t)}}catch(e){c=!0,d=e}finally{try{s||null==p.return||p.return()}finally{if(c)throw d}}}function q(e,t){(e!==s||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}var W=/* @__PURE__ */(0,g.makeMap)("__proto__,__v_isRef,__isVue"),K=new Set(/* @__PURE__ */Object.getOwnPropertyNames(Symbol).filter(function(e){return"arguments"!==e&&"caller"!==e}).map(function(e){return Symbol[e]}).filter(g.isSymbol)),X=/* @__PURE__ */ee(),G=/* @__PURE__ */ee(!1,!0),$=/* @__PURE__ */ee(!0),J=/* @__PURE__ */ee(!0,!0),Z=(r={},["includes","indexOf","lastIndexOf"].forEach(function(e){r[e]=function(){for(var t=arguments.length,n=Array(t),r=0;r0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n,r,i){if("__v_isReactive"===r)return!e;if("__v_isReadonly"===r)return e;if("__v_isShallow"===r)return t;if("__v_raw"===r&&i===(e?t?eD:eO:t?eR:eA).get(n))return n;var o=(0,g.isArray)(n);if(!e){if(o&&(0,g.hasOwn)(Z,r))return Reflect.get(Z,r,i);if("hasOwnProperty"===r)return Q}var a=Reflect.get(n,r,i);return((0,g.isSymbol)(r)?K.has(r):W(r))?a:(e||z(n,"get",r),t)?a:eG(a)?o&&(0,g.isIntegerKey)(r)?a:a.value:(0,g.isObject)(a)?e?eP(a):eI(a):a}}var et=/* @__PURE__ */er(),en=/* @__PURE__ */er(!0);function er(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t,n,r,i){var o=t[n];if(eF(o)&&eG(o)&&!eG(r))return!1;if(!e&&(ez(r)||eF(r)||(o=eY(o),r=eY(r)),!(0,g.isArray)(t)&&eG(o)&&!eG(r)))return o.value=r,!0;var a=(0,g.isArray)(t)&&(0,g.isIntegerKey)(n)?Number(n)2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=eY(e=e.__v_raw),o=eY(t);n||(t!==o&&z(i,"get",t),z(i,"get",o));var a=es(i).has,l=r?eu:n?eW:eq;return a.call(i,t)?l(e.get(t)):a.call(i,o)?l(e.get(o)):void(e!==i&&e.get(t))}function ed(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.__v_raw,r=eY(n),i=eY(e);return t||(e!==i&&z(r,"has",e),z(r,"has",i)),e===i?n.has(e):n.has(e)||n.has(i)}function ef(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e=e.__v_raw,t||z(eY(e),"iterate",R),Reflect.get(e,"size",e)}function ev(e){e=eY(e);var t=eY(this);return es(t).has.call(t,e)||(t.add(e),Y(t,"add",e,e)),this}function ep(e,t){t=eY(t);var n=eY(this),r=es(n),i=r.has,o=r.get,a=i.call(n,e);a||(e=eY(e),a=i.call(n,e));var l=o.call(n,e);return n.set(e,t),a?(0,g.hasChanged)(t,l)&&Y(n,"set",e,t,l):Y(n,"add",e,t),this}function eh(e){var t=eY(this),n=es(t),r=n.has,i=n.get,o=r.call(t,e);o||(e=eY(e),o=r.call(t,e));var a=i?i.call(t,e):void 0,l=t.delete(e);return o&&Y(t,"delete",e,void 0,a),l}function em(){var e=eY(this),t=0!==e.size,n=e.clear();return t&&Y(e,"clear",void 0,void 0,void 0),n}function eg(e,t){return function(n,r){var i=this,o=i.__v_raw,a=eY(o),l=t?eu:e?eW:eq;return e||z(a,"iterate",R),o.forEach(function(e,t){return n.call(r,l(e),l(t),i)})}}function ey(e,t,n){return function(){for(var r=arguments.length,i=Array(r),o=0;o1?tt(e,t,n):e$(e)}function tt(e,t,n){var r=e[t];return eG(r)?r:new e7(e,t,n)}var tn=/*#__PURE__*/function(){function e(t,n,r,i){var o=this;(0,c._)(this,e),this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new D(t,function(){o._dirty||(o._dirty=!0,eX(o))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}return(0,d._)(e,[{key:"value",get:function(){var e=eY(this);return eK(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value},set:function(e){this._setter(e)}}]),e}();function tr(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=(0,g.isFunction)(e);return o?(n=e,r=g.NOOP):(n=e.get,r=e.set),new tn(n,r,o||!r,i)}}),f.register("9Nw75",function(e,n){t(e.exports,"makeMap",function(){return d}),t(e.exports,"EMPTY_OBJ",function(){return p}),t(e.exports,"EMPTY_ARR",function(){return h}),t(e.exports,"NOOP",function(){return m}),t(e.exports,"NO",function(){return g}),t(e.exports,"isOn",function(){return _}),t(e.exports,"isModelListener",function(){return b}),t(e.exports,"extend",function(){return w}),t(e.exports,"remove",function(){return x}),t(e.exports,"hasOwn",function(){return S}),t(e.exports,"isArray",function(){return k}),t(e.exports,"isMap",function(){return E}),t(e.exports,"isSet",function(){return V}),t(e.exports,"isRegExp",function(){return T}),t(e.exports,"isFunction",function(){return A}),t(e.exports,"isString",function(){return R}),t(e.exports,"isSymbol",function(){return O}),t(e.exports,"isObject",function(){return D}),t(e.exports,"isPromise",function(){return I}),t(e.exports,"toRawType",function(){return M}),t(e.exports,"isPlainObject",function(){return L}),t(e.exports,"isIntegerKey",function(){return j}),t(e.exports,"isReservedProp",function(){return F}),t(e.exports,"isBuiltInDirective",function(){return z}),t(e.exports,"camelize",function(){return H}),t(e.exports,"hyphenate",function(){return W}),t(e.exports,"capitalize",function(){return K}),t(e.exports,"toHandlerKey",function(){return X}),t(e.exports,"hasChanged",function(){return G}),t(e.exports,"invokeArrayFns",function(){return $}),t(e.exports,"def",function(){return J}),t(e.exports,"looseToNumber",function(){return Z}),t(e.exports,"toNumber",function(){return Q}),t(e.exports,"getGlobalThis",function(){return ee}),t(e.exports,"isGloballyWhitelisted",function(){return et}),t(e.exports,"normalizeStyle",function(){return en}),t(e.exports,"normalizeClass",function(){return ea}),t(e.exports,"normalizeProps",function(){return el}),t(e.exports,"isHTMLTag",function(){return eu}),t(e.exports,"isSVGTag",function(){return es}),t(e.exports,"isSpecialBooleanAttr",function(){return ec}),t(e.exports,"includeBooleanAttr",function(){return ed}),t(e.exports,"looseEqual",function(){return ef}),t(e.exports,"looseIndexOf",function(){return ev}),t(e.exports,"toDisplayString",function(){return ep});var r,i,o,a=f("h8xva"),u=f("6wEIk"),s=f("2Yjkq"),c=f("jZ8XT");function d(e,t){for(var n=/* @__PURE__ */Object.create(null),r=e.split(","),i=0;i-1&&e.splice(n,1)},C=Object.prototype.hasOwnProperty,S=function(e,t){return C.call(e,t)},k=Array.isArray,E=function(e){return"[object Map]"===P(e)},V=function(e){return"[object Set]"===P(e)},N=function(e){return"[object Date]"===P(e)},T=function(e){return"[object RegExp]"===P(e)},A=function(e){return"function"==typeof e},R=function(e){return"string"==typeof e},O=function(e){return(void 0===e?"undefined":(0,c._)(e))==="symbol"},D=function(e){return null!==e&&"object"==typeof e},I=function(e){return D(e)&&A(e.then)&&A(e.catch)},B=Object.prototype.toString,P=function(e){return B.call(e)},M=function(e){return P(e).slice(8,-1)},L=function(e){return"[object Object]"===P(e)},j=function(e){return R(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e},F=/* @__PURE__ */d(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),z=/* @__PURE__ */d("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),U=function(e){var t=/* @__PURE__ */Object.create(null);return function(n){return t[n]||(t[n]=e(n))}},Y=/-(\w)/g,H=U(function(e){return e.replace(Y,function(e,t){return t?t.toUpperCase():""})}),q=/\B([A-Z])/g,W=U(function(e){return e.replace(q,"-$1").toLowerCase()}),K=U(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),X=U(function(e){return e?"on".concat(K(e)):""}),G=function(e,t){return!Object.is(e,t)},$=function(e,t){for(var n=0;n1&&(t[n[0].trim()]=n[1].trim())}}),t}(r):en(r);if(i)for(var o in i)t[o]=i[o]}return t}if(R(e)||D(e))return e}var er=/;(?![^(]*\))/g,ei=/:([^]+)/,eo=/\/\*[^]*?\*\//g;function ea(e){var t="";if(R(e))t=e;else if(k(e))for(var n=0;n")]=i,e},{})):V(t)?(0,a._)({},"Set(".concat(t.size,")"),(0,s._)(t.values())):!D(t)||k(t)||L(t)?t:String(t)}}),f.register("aayhd",function(e,n){u(e.exports),t(e.exports,"default",function(){return l});var r=f("xJRWs"),i=f("3XT9C"),o=f("d6xbH"),a=f("9BzA6"),l={data:function(){var e=this,t=new o.Database;return t.setObservable("*",function(t){e.classrooms=t}),{database:t,classrooms:[],peerID:(0,a.getPeerID)()}},methods:{deleteClass:function(e){this.database.drop(e)},forkClass:function(e){e=(0,a.clone)(e);var t=(0,a.infoHash)(),n=(0,a.getPeerID)();e.data.createdBy!==n&&((0,a.removeKeysStartingWithSecret)(e),e.data.members.teacher=[],e.data.members.student=[]),e.data.createdBy=n,e.id=t,this.database.put({id:t,data:e.data,timestamp:Date.now()}),window.location.search="?/classroom/".concat(t)},createClass:function(){return(0,r._)(function(){var e,t;return(0,i.__generator)(this,function(n){return t={id:e=(0,a.infoHash)(),createdBy:(0,a.getPeerID)(),dateCreated:new Date().getTime(),name:"My New Class",meta:{logo:"",description:"",selfAssign:!1,defaultNumberOfRooms:0},members:{teacher:[],student:[]},modules:[{url:"https://edrys-org.github.io/module-reference/",config:"",studentConfig:"",teacherConfig:"",stationConfig:"",width:"full",height:"tall"}]},this.database.put({id:e,data:t,timestamp:Date.now()}),window.location.search="?/classroom/".concat(e),[2]})}).apply(this)}}}}),f.register("xJRWs",function(e,n){function r(e,t,n,r,i,o,a){try{var l=e[o](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var a=e.apply(t,n);function l(e){r(a,i,o,l,u,"next",e)}function u(e){r(a,i,o,l,u,"throw",e)}l(void 0)})}}t(e.exports,"_",function(){return i})}),f.register("3XT9C",function(e,n){function r(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(u){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}t(e.exports,"__generator",function(){return r}),t(e.exports,"__values",function(){return i}),f("jZ8XT"),"function"==typeof SuppressedError&&SuppressedError}),f.register("d6xbH",function(e,n){t(e.exports,"Database",function(){return u});var r=f("xJRWs"),i=f("disEZ"),o=f("fJNo6"),a=f("3XT9C"),l=f("3Zw54"),u=/*#__PURE__*/function(){function e(){(0,i._)(this,e),this.observables={},this.db=new l.Dexie("EdrysLite"),this.db.version(1).stores({data:"\n &id,\n timestamp,\n data"}),this.db.open().then(function(e){// Database opened successfully +next:function(){var e=d.next(),t=e.value,n=e.done;return n?{value:t,done:n}:{value:s?[f(t[0]),f(t[1])]:f(t),done:n}}},Symbol.iterator,function(){return this})}}function e_(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r1?tt(e,t,n):e$(e)}function tt(e,t,n){var r=e[t];return eG(r)?r:new e7(e,t,n)}var tn=/*#__PURE__*/function(){function e(t,n,r,i){var o=this;(0,c._)(this,e),this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new D(t,function(){o._dirty||(o._dirty=!0,eX(o))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}return(0,d._)(e,[{key:"value",get:function(){var e=eY(this);return eK(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value},set:function(e){this._setter(e)}}]),e}();function tr(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=(0,g.isFunction)(e);return o?(n=e,r=g.NOOP):(n=e.get,r=e.set),new tn(n,r,o||!r,i)}}),f.register("9Nw75",function(e,n){t(e.exports,"makeMap",function(){return d}),t(e.exports,"EMPTY_OBJ",function(){return p}),t(e.exports,"EMPTY_ARR",function(){return h}),t(e.exports,"NOOP",function(){return m}),t(e.exports,"NO",function(){return g}),t(e.exports,"isOn",function(){return _}),t(e.exports,"isModelListener",function(){return b}),t(e.exports,"extend",function(){return w}),t(e.exports,"remove",function(){return x}),t(e.exports,"hasOwn",function(){return S}),t(e.exports,"isArray",function(){return k}),t(e.exports,"isMap",function(){return E}),t(e.exports,"isSet",function(){return V}),t(e.exports,"isRegExp",function(){return T}),t(e.exports,"isFunction",function(){return A}),t(e.exports,"isString",function(){return R}),t(e.exports,"isSymbol",function(){return O}),t(e.exports,"isObject",function(){return D}),t(e.exports,"isPromise",function(){return I}),t(e.exports,"toRawType",function(){return M}),t(e.exports,"isPlainObject",function(){return L}),t(e.exports,"isIntegerKey",function(){return j}),t(e.exports,"isReservedProp",function(){return F}),t(e.exports,"isBuiltInDirective",function(){return z}),t(e.exports,"camelize",function(){return H}),t(e.exports,"hyphenate",function(){return W}),t(e.exports,"capitalize",function(){return K}),t(e.exports,"toHandlerKey",function(){return X}),t(e.exports,"hasChanged",function(){return G}),t(e.exports,"invokeArrayFns",function(){return $}),t(e.exports,"def",function(){return J}),t(e.exports,"looseToNumber",function(){return Z}),t(e.exports,"toNumber",function(){return Q}),t(e.exports,"getGlobalThis",function(){return ee}),t(e.exports,"isGloballyWhitelisted",function(){return et}),t(e.exports,"normalizeStyle",function(){return en}),t(e.exports,"normalizeClass",function(){return ea}),t(e.exports,"normalizeProps",function(){return el}),t(e.exports,"isHTMLTag",function(){return eu}),t(e.exports,"isSVGTag",function(){return es}),t(e.exports,"isSpecialBooleanAttr",function(){return ec}),t(e.exports,"includeBooleanAttr",function(){return ed}),t(e.exports,"looseEqual",function(){return ef}),t(e.exports,"looseIndexOf",function(){return ev}),t(e.exports,"toDisplayString",function(){return ep});var r,i,o,a=f("h8xva"),u=f("6wEIk"),s=f("2Yjkq"),c=f("jZ8XT");function d(e,t){for(var n=/* @__PURE__ */Object.create(null),r=e.split(","),i=0;i-1&&e.splice(n,1)},C=Object.prototype.hasOwnProperty,S=function(e,t){return C.call(e,t)},k=Array.isArray,E=function(e){return"[object Map]"===P(e)},V=function(e){return"[object Set]"===P(e)},N=function(e){return"[object Date]"===P(e)},T=function(e){return"[object RegExp]"===P(e)},A=function(e){return"function"==typeof e},R=function(e){return"string"==typeof e},O=function(e){return(void 0===e?"undefined":(0,c._)(e))==="symbol"},D=function(e){return null!==e&&"object"==typeof e},I=function(e){return D(e)&&A(e.then)&&A(e.catch)},B=Object.prototype.toString,P=function(e){return B.call(e)},M=function(e){return P(e).slice(8,-1)},L=function(e){return"[object Object]"===P(e)},j=function(e){return R(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e},F=/* @__PURE__ */d(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),z=/* @__PURE__ */d("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),U=function(e){var t=/* @__PURE__ */Object.create(null);return function(n){return t[n]||(t[n]=e(n))}},Y=/-(\w)/g,H=U(function(e){return e.replace(Y,function(e,t){return t?t.toUpperCase():""})}),q=/\B([A-Z])/g,W=U(function(e){return e.replace(q,"-$1").toLowerCase()}),K=U(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),X=U(function(e){return e?"on".concat(K(e)):""}),G=function(e,t){return!Object.is(e,t)},$=function(e,t){for(var n=0;n1&&(t[n[0].trim()]=n[1].trim())}}),t}(r):en(r);if(i)for(var o in i)t[o]=i[o]}return t}if(R(e)||D(e))return e}var er=/;(?![^(]*\))/g,ei=/:([^]+)/,eo=/\/\*[^]*?\*\//g;function ea(e){var t="";if(R(e))t=e;else if(k(e))for(var n=0;n")]=i,e},{})):V(t)?(0,a._)({},"Set(".concat(t.size,")"),(0,s._)(t.values())):!D(t)||k(t)||L(t)?t:String(t)}}),f.register("aayhd",function(e,n){u(e.exports),t(e.exports,"default",function(){return l});var r=f("xJRWs"),i=f("3XT9C"),o=f("d6xbH"),a=f("9BzA6"),l={data:function(){var e=this,t=new o.Database;return t.setObservable("*",function(t){e.classrooms=t}),{database:t,classrooms:[],peerID:(0,a.getPeerID)(!1)}},methods:{deleteClass:function(e){this.database.drop(e)},forkClass:function(e){e=(0,a.clone)(e);var t=(0,a.infoHash)(),n=(0,a.getPeerID)();e.data.createdBy!==n&&((0,a.removeKeysStartingWithSecret)(e),e.data.members.teacher=[],e.data.members.student=[]),e.data.createdBy=n,e.id=t,this.database.put({id:t,data:e.data,timestamp:Date.now()}),window.location.search="?/classroom/".concat(t)},createClass:function(){return(0,r._)(function(){var e,t;return(0,i.__generator)(this,function(n){return t={id:e=(0,a.infoHash)(),createdBy:(0,a.getPeerID)(),dateCreated:new Date().getTime(),name:"My New Class",meta:{logo:"",description:"",selfAssign:!1,defaultNumberOfRooms:0},members:{teacher:[],student:[]},modules:[{url:"https://edrys-org.github.io/module-reference/",config:"",studentConfig:"",teacherConfig:"",stationConfig:"",width:"full",height:"tall"}]},this.database.put({id:e,data:t,timestamp:Date.now()}),window.location.search="?/classroom/".concat(e),[2]})}).apply(this)}}}}),f.register("xJRWs",function(e,n){function r(e,t,n,r,i,o,a){try{var l=e[o](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var a=e.apply(t,n);function l(e){r(a,i,o,l,u,"next",e)}function u(e){r(a,i,o,l,u,"throw",e)}l(void 0)})}}t(e.exports,"_",function(){return i})}),f.register("3XT9C",function(e,n){function r(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(u){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}t(e.exports,"__generator",function(){return r}),t(e.exports,"__values",function(){return i}),f("jZ8XT"),"function"==typeof SuppressedError&&SuppressedError}),f.register("d6xbH",function(e,n){t(e.exports,"Database",function(){return u});var r=f("xJRWs"),i=f("disEZ"),o=f("fJNo6"),a=f("3XT9C"),l=f("3Zw54"),u=/*#__PURE__*/function(){function e(){(0,i._)(this,e),this.observables={},this.db=new l.Dexie("EdrysLite"),this.db.version(1).stores({data:"\n &id,\n timestamp,\n data"}),this.db.open().then(function(e){// Database opened successfully console.log("Database opened successfully")}).catch(function(e){console.warn("Database error: "+e.message)})}return(0,o._)(e,[{key:"getAll",value:function(){return this.db.data.orderBy("timestamp").desc().toArray()}},{key:"exists",value:function(e){var t=this;return(0,r._)(function(){return(0,a.__generator)(this,function(n){switch(n.label){case 0:return[4,t.get(e)];case 1:return[2,!!n.sent()]}})})()}},{key:"get",value:function(e){var t=this;return(0,r._)(function(){return(0,a.__generator)(this,function(n){switch(n.label){case 0:return[4,t.db.data.get(e)];case 1:return[2,n.sent()]}})})()}},{key:"put",value:function(e){return this.db.data.put(e)}},{key:"update",value:function(e){return e.timestamp=Date.now(),this.put(e)}},{key:"drop",value:function(e){this.db.data.delete(e)}},{key:"setObservable",value:function(e,t){this.observables[e]&&(this.observables[e].unsubscribe(),delete this.observables[e]);var n=this.db.data,r="*"===e?(0,l.liveQuery)(function(){return n.orderBy("timestamp").desc().toArray()}):(0,l.liveQuery)(function(){return n.where("id").equals(e).first()});this.observables[e]=r.subscribe({next:function(e){return t(e)},error:function(e){return console.warn(e)}})}},{key:"deleteObservable",value:function(e){this.observables[e]&&(this.observables[e].unsubscribe(),delete this.observables[e])}}]),e}()}),f.register("3Zw54",function(e,n){t(e.exports,"Dexie",function(){return nk}),t(e.exports,"liveQuery",function(){return nT});/* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -140,8 +140,9 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var r,i,o=f("jZ8XT"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0)n=t;else{var o=h(t);for(var a in n=o===Object.prototype?{}:Object.create(o),M&&M.set(t,n),t)g(t,a)&&(n[a]=e(t[a]))}return n}(e);return M=null,t}var j={}.toString;function F(e){return j.call(e).slice(8,-1)}var z="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",U=(void 0===z?"undefined":(0,o._)(z))==="symbol"?function(e){var t;return null!=e&&(t=e[z])&&t.apply(e)}:function(){return null},Y={};function H(e){var t,n,r,i;if(1==arguments.length){if(d(e))return e.slice();if(this===Y&&"string"==typeof e)return[e];if(i=U(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}var q="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},W="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),K=function(){return!0},X=!Error("").stack;function G(){if(X)try{throw G.arguments,Error()}catch(e){return e}return Error()}function $(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(K).map(function(e){return"\n"+e}).join("")):""}var J=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Z=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(J),Q={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ee(e,t){this._e=G(),this.name=e,this.message=t}function et(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function en(e,t,n,r){this._e=G(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=et(e,t)}function er(e,t){this._e=G(),this.name="BulkError",this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=et(e,t)}w(ee).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+$(this._e,2))}},toString:function(){return this.name+": "+this.message}}),w(en).from(ee),w(er).from(ee);var ei=Z.reduce(function(e,t){return e[t]=t+"Error",e},{}),eo=Z.reduce(function(e,t){var n=t+"Error";function r(e,r){this._e=G(),this.name=n,e?"string"==typeof e?(this.message=""+e+(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=Q[t]||n,this.inner=null)}return w(r).from(ee),e[t]=r,e},{});eo.Syntax=SyntaxError,eo.Type=TypeError,eo.Range=RangeError;var ea=J.reduce(function(e,t){return e[t+"Error"]=eo[t],e},{}),el=Z.reduce(function(e,t){return -1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=eo[t]),e},{});function eu(){}function es(e){return e}function ec(e,t){return null==e||e===es?t:function(n){return t(e(n))}}function ed(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function ef(e,t){return e===eu?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?ed(r,this.onsuccess):r),i&&(this.onerror=this.onerror?ed(i,this.onerror):i),void 0!==o?o:n}}function ev(e,t){return e===eu?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?ed(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ed(r,this.onerror):r)}}function ep(e,t){return e===eu?t:function(n){var r=e.apply(this,arguments);p(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?ed(i,this.onsuccess):i),o&&(this.onerror=this.onerror?ed(o,this.onerror):o),void 0===r?void 0===a?void 0:a:p(r,a)}}function eh(e,t){return e===eu?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function em(e,t){return e===eu?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}el.ModifyError=en,el.DexieError=ee,el.BulkError=er;var eg={},ey="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,h(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,h(t),e]}(),e_=ey[0],eb=ey[1],ew=ey[2],ex=eb&&eb.then,eC=e_&&e_.constructor,eS=!!ew,ek=!1,eE=ew?function(){ew.then(eK)}:s.setImmediate?setImmediate.bind(null,eK):s.MutationObserver?function(){var e=document.createElement("div");new MutationObserver(function(){eK(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(eK,0)},eV=function(e,t){eP.push([e,t]),eT&&(eE(),eT=!1)},eN=!0,eT=!0,eA=[],eR=[],eO=null,eD=es,eI={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:tl,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(function(e){try{tl(e[0],e[1])}catch(e){}})}},eB=eI,eP=[],eM=0,eL=[];function ej(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=eu,this._lib=!1;var t=this._PSD=eB;if(W&&(this._stackHolder=G(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==eg)throw TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],!1===this._state&&eU(this,this._value);return}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var r=t._lib&&eX();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof ej?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,eY(t)),r&&eG()}},eU.bind(null,t))}catch(e){eU(t,e)}}(this,e)}var eF={get:function(){var e=eB,t=e3;function n(n,r){var i=this,o=!e.global&&(e!==eB||t!==e3),a=o&&!e8(),l=new ej(function(t,l){eH(i,new ez(ti(n,e,o,a),ti(r,e,o,a),t,l,e))});return W&&eW(l,this),l}return n.prototype=eg,n},set:function(e){b(this,"then",e&&e.prototype===eg?eF:{get:function(){return e},set:eF.set})}};function ez(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function eU(e,t){if(eR.push(t),null===e._state){var n=e._lib&&eX();t=eD(t),e._state=!1,e._value=t,W&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){t&&t(e)}}(function(){var n=C(t,"stack");t._promise=e,b(t,"stack",{get:function(){return ek?n&&(n.get?n.get.apply(t):n.value):e.stack}})}),eA.some(function(t){return t._value===e._value})||eA.push(e),eY(e),n&&eG()}}function eY(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n0;)for(t=0,e=eP,eP=[],n=e.length;t0)eN=!0,eT=!0}function e$(){var e=eA;eA=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=eL.slice(0),n=t.length;n;)t[--n]()}function eJ(e){return new ej(eg,!1,e)}function eZ(e,t){var n=eB;return function(){var r=eX(),i=eB;try{return tt(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{tt(i,!1),r&&eG()}}}y(ej.prototype,{then:eF,_then:function(e,t){eH(this,new ez(null,null,e,t,eB))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,function(e){return e instanceof t?n(e):eJ(e)}):this.then(null,function(e){return e&&e.name===t?n(e):eJ(e)})},finally:function(e){return this.then(function(t){return e(),t},function(t){return e(),eJ(t)})},stack:{get:function(){if(this._stack)return this._stack;try{ek=!0;var e=(function e(t,n,r){if(n.length===r)return n;var i="";if(!1===t._state){var o,a,l=t._value;null!=l?(o=l.name||"Error",a=l.message||l,i=$(l,0)):(o=l,a=""),n.push(o+(a?": "+a:"")+i)}return W&&((i=$(t._stackHolder,2))&&-1===n.indexOf(i)&&n.push(i),t._prev&&e(t._prev,n,r)),n})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{ek=!1}}},timeout:function(e,t){var n=this;return e<1/0?new ej(function(r,i){var o=setTimeout(function(){return i(new eo.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&b(ej.prototype,Symbol.toStringTag,"Dexie.Promise"),eI.env=tn(),y(ej,{all:function(){var e=H.apply(null,arguments).map(e7);return new ej(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(i,o){return ej.resolve(i).then(function(n){e[o]=n,--r||t(e)},n)})})},resolve:function(e){if(e instanceof ej)return e;if(e&&"function"==typeof e.then)return new ej(function(t,n){e.then(t,n)});var t=new ej(eg,!0,e);return eW(t,eO),t},reject:eJ,race:function(){var e=H.apply(null,arguments).map(e7);return new ej(function(t,n){e.map(function(e){return ej.resolve(e).then(t,n)})})},PSD:{get:function(){return eB},set:function(e){return eB=e}},totalEchoes:{get:function(){return e3}},newPSD:e4,usePSD:tr,scheduler:{get:function(){return eV},set:function(e){eV=e}},rejectionMapper:{get:function(){return eD},set:function(e){eD=e}},follow:function(e,t){return new ej(function(n,r){return e4(function(t,n){var r=eB;r.unhandleds=[],r.onunhandled=n,r.finalize=ed(function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},eL.push(function t(){e(),eL.splice(eL.indexOf(t),1)}),++eM,eV(function(){0==--eM&&e$()},[])},r.finalize),e()},t,n,r)})}}),eC&&(eC.allSettled&&b(ej,"allSettled",function(){var e=H.apply(null,arguments).map(e7);return new ej(function(t){0===e.length&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,i){return ej.resolve(e).then(function(e){return r[i]={status:"fulfilled",value:e}},function(e){return r[i]={status:"rejected",reason:e}}).then(function(){return--n||t(r)})})})}),eC.any&&"undefined"!=typeof AggregateError&&b(ej,"any",function(){var e=H.apply(null,arguments).map(e7);return new ej(function(t,n){0===e.length&&n(AggregateError([]));var r=e.length,i=Array(r);e.forEach(function(e,o){return ej.resolve(e).then(function(e){return t(e)},function(e){i[o]=e,--r||n(AggregateError(i))})})})}));var eQ={awaits:0,echoes:0,id:0},e0=0,e1=[],e2=0,e3=0,e5=0;function e4(e,t,n,r){var i=eB,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++e5;var a=eI.env;o.env=eS?{Promise:ej,PromiseProp:{value:ej,configurable:!0,writable:!0},all:ej.all,race:ej.race,allSettled:ej.allSettled,any:ej.any,resolve:ej.resolve,reject:ej.reject,nthen:to(a.nthen,o),gthen:to(a.gthen,o)}:{},t&&p(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var l=tr(o,e,n,r);return 0===o.ref&&o.finalize(),l}function e6(){return eQ.id||(eQ.id=++e0),++eQ.awaits,eQ.echoes+=100,eQ.id}function e8(){return!!eQ.awaits&&(0==--eQ.awaits&&(eQ.id=0),eQ.echoes=100*eQ.awaits,!0)}function e7(e){return eQ.echoes&&e&&e.constructor===eC?(e6(),e.then(function(e){return e8(),e},function(e){return e8(),tu(e)})):e}function e9(e){++e3,eQ.echoes&&0!=--eQ.echoes||(eQ.echoes=eQ.id=0),e1.push(eB),tt(e,!0)}function te(){var e=e1[e1.length-1];e1.pop(),tt(e,!1)}function tt(e,t){var n,r=eB;if((t?!eQ.echoes||e2++&&e===eB:!e2||--e2&&e===eB)||(n=t?e9.bind(null,e):te,ex.call(e_,n)),e!==eB&&(eB=e,r===eI&&(eI.env=tn()),eS)){var i=eI.env.Promise,o=e.env;eb.then=o.nthen,i.prototype.then=o.gthen,(r.global||e.global)&&(Object.defineProperty(s,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject,o.allSettled&&(i.allSettled=o.allSettled),o.any&&(i.any=o.any))}}function tn(){var e=s.Promise;return eS?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:eb.then,gthen:e.prototype.then}:{}}function tr(e,t,n,r,i){var o=eB;try{return tt(e,!0),t(n,r,i)}finally{tt(o,!1)}}function ti(e,t,n,r){return"function"!=typeof e?e:function(){var i,o=eB;n&&e6(),tt(t,!0);try{return e.apply(this,arguments)}finally{tt(o,!1),r&&(i=e8,ex.call(e_,i))}}}function to(e,t){return function(n,r){return e.call(this,ti(n,t),ti(r,t))}}-1===(""+ex).indexOf("[native code]")&&(e6=e8=eu);var ta="unhandledrejection";function tl(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(s.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(ta,!0,!0),p(r,i)):s.CustomEvent&&(r=new CustomEvent(ta,{detail:i}),p(r,i)),r&&s.dispatchEvent&&(dispatchEvent(r),!s.PromiseRejectionEvent&&s.onunhandledrejection))try{s.onunhandledrejection(r)}catch(e){}W&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var tu=ej.reject,ts="3.2.4",tc=String.fromCharCode(65535),td=-1/0,tf="Invalid key provided. Keys must be of type string, number, Date or Array.",tv="String expected.",tp=[],th="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),tm=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},tg="__dbnames",ty="readonly",t_="readwrite";function tb(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var tw={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function tx(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&(t=L(t),delete t[e]),t}}var tC=function(){function e(){}return e.prototype._trans=function(e,t,n){var r=this._tx||eB.trans,i=this.name;function o(e,n,r){if(!r.schema[i])throw new eo.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var a=eX();try{return r&&r.db===this.db?r===eB.trans?r._promise(e,o,n):e4(function(){return r._promise(e,o,n)},{trans:r,transless:eB.transless||eB}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||eB.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){if(o.name===ei.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0)return console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(function(){return e(t,n,r,i)});return tu(o)}return o._promise(n,function(e,t){return e4(function(){return eB.trans=o,i(e,t,o)})}).then(function(e){return o._completion.then(function(){return e})})}if(t._state.openComplete)return tu(new eo.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return tu(new eo.DatabaseClosed);t.open().catch(eu)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],o)}finally{a&&eG()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(d(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=c(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){return e.compound&&t.every(function(t){return e.keyPath.indexOf(t)>=0})&&e.keyPath.every(function(e){return t.indexOf(e)>=0})})[0];if(n&&this.db._maxKey!==tc)return this.where(n.name).equals(n.keyPath.map(function(t){return e[t]}));!n&&W&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var r=this.schema.idxByName,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}var a=t.reduce(function(t,n){var i=t[0],a=t[1],l=r[n],u=e[n];return[i||l,i||!l?tb(a,l&&l.multi?function(e){var t=A(e,n);return d(t)&&t.some(function(e){return o(u,e)})}:function(e){return o(u,A(e,n))}):a]},[null,null]),l=a[0],u=a[1];return l?this.where(l.name).equals(e[l.keyPath]).filter(u):n?this.filter(u):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,d(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(g(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass(function(e){p(this,e)})},e.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=tx(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})}).then(function(e){return e.numFailures?ej.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{R(e,o,t)}catch(e){}return t})},e.prototype.update=function(e,t){if("object"!=typeof e||d(e))return this.where(":id").equals(e).modify(t);var n=A(e,this.schema.primKey.keyPath);if(void 0===n)return tu(new eo.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?c(t).forEach(function(n){R(e,n,t[n])}):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)},e.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=tx(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?ej.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{R(e,o,t)}catch(e){}return t})},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(e){return e.numFailures?ej.reject(e.failures[0]):void 0})},e.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:tw})}).then(function(e){return e.numFailures?ej.reject(e.failures[0]):void 0})},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},e.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,a=n.auto,l=n.keyPath;if(l&&i)throw new eo.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new eo.InvalidArgument("Arguments objects and keys must have the same length");var u=e.length,s=l&&a?e.map(tx(l)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:s,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?n:i;throw new er(r.name+".bulkAdd(): "+t+" of "+u+" operations failed",a)})})},e.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,a=n.auto,l=n.keyPath;if(l&&i)throw new eo.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new eo.InvalidArgument("Arguments objects and keys must have the same length");var u=e.length,s=l&&a?e.map(tx(l)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:s,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?n:i;throw new er(r.name+".bulkPut(): "+t+" of "+u+" operations failed",a)})})},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e})}).then(function(e){var r=e.numFailures,i=e.lastResult,o=e.failures;if(0===r)return i;throw new er(t.name+".bulkDelete(): "+r+" of "+n+" operations failed",o)})},e}();function tS(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;rt?1:er?a:0}return this.toArray(function(e){return e.sort(l)}).then(t)},e.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&&tE(n,!0)&&n.limit>0){var r=n.valueMapper,i=tT(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then(function(e){var t=e.result;return r?t.map(r):t})}var o=[];return tR(n,function(e){return o.push(e)},e,n.table.core).then(function(){return o})},e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,tE(t)?tN(t,function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n(function(){e.advance(t),t=0}),!1)}}):tN(t,function(){var t=e;return function(){return--t<0}})),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tN(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}},!0),this},e.prototype.until=function(e,t){return tV(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},e.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){var t;return tV(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=tb(t.isMatch,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&tE(t,!0)&&t.limit>0)return this._read(function(e){var n=tT(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return tV(this._ctx,function(e){var t=e.primaryKey.toString(),r=g(n,t);return n[t]=!0,!r}),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){if("function"==typeof e)i=e;else{var i,o=c(e),a=o.length;i=function(t){for(var n=!1,r=0;r0&&l.mutate({trans:r,type:"add",values:p}).then(function(e){for(var t in e.failures)y.splice(parseInt(t),1);g(p.length,e)})).then(function(){return(h.length>0||x&&"object"==typeof e)&&l.mutate({trans:r,type:"put",keys:m,values:h,criteria:x,changeSpec:"function"!=typeof e&&e}).then(function(e){return g(h.length,e)})}).then(function(){return(y.length>0||x&&e===tM)&&l.mutate({trans:r,type:"delete",keys:y,criteria:x}).then(function(e){return g(y.length,e)})}).then(function(){return t.length>a+u&&o(a+f)})})};return o(0).then(function(){if(p.length>0)throw new en("Error modifying one or more objects",p,h,m);return t.length})})})},e.prototype.delete=function(){var e=this._ctx,t=e.range;return tE(e)&&(e.isPrimKey&&!th||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey;return e.table.core.count({trans:n,query:{index:r,range:t}}).then(function(r){return e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(function(e){var t=e.failures;e.lastResult,e.results;var n=e.numFailures;if(n)throw new en("Could not delete some values",Object.keys(t).map(function(e){return t[e]}),r-n);return r-n})})}):this.modify(tM)},e}(),tM=function(e,t){return t.value=null};function tL(e,t){return et?-1:e===t?0:1}function tF(e,t,n){var r=e instanceof tq?new e.Collection(e):e;return r._ctx.error=n?new n(t):TypeError(t),r}function tz(e){return new e.Collection(e,function(){return tH("")}).limit(0)}function tU(e,t,n,r){var i,o,a,l,u,s,c,d=n.length;if(!n.every(function(e){return"string"==typeof e}))return tF(e,tv);function f(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},a="next"===e?tL:tj;var t=n.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return a(e.lower,t.lower)});l=t.map(function(e){return e.upper}),u=t.map(function(e){return e.lower}),s=e,c="next"===e?"":r}f("next");var p=new e.Collection(e,function(){return tY(l[0],u[d-1]+r)});p._ondirectionchange=function(e){f(e)};var h=0;return p._addAlgorithm(function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,u,h))return!0;for(var p=null,m=h;mi(e[u],n[u]))return e.substr(0,u)+n[u]+n.substr(u+1);if(0>i(e[u],r[u]))return e.substr(0,u)+r[u]+n.substr(u+1);if(l>=0)return e.substr(0,l)+t[l]+n.substr(l+1);return null}0>i(e[u],s)&&(l=u)}return a0)&&(p=g)}return n(null!==p?function(){e.continue(p+c)}:r),!1}),p}function tY(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function tH(e){return{type:1,lower:e,upper:e}}var tq=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{if(this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&!(n&&r))return tz(this);return new this.Collection(this,function(){return tY(e,t,!n,!r)})}catch(e){return tF(this,tf)}},e.prototype.equals=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tH(e)})},e.prototype.above=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tY(e,void 0,!0)})},e.prototype.aboveOrEqual=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tY(e,void 0,!1)})},e.prototype.below=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tY(void 0,e,!1,!0)})},e.prototype.belowOrEqual=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tY(void 0,e)})},e.prototype.startsWith=function(e){return"string"!=typeof e?tF(this,tv):this.between(e,e+tc,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):tU(this,function(e,t){return 0===e.indexOf(t[0])},[e],tc)},e.prototype.equalsIgnoreCase=function(e){return tU(this,function(e,t){return e===t[0]},[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=H.apply(Y,arguments);return 0===e.length?tz(this):tU(this,function(e,t){return -1!==t.indexOf(e)},e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=H.apply(Y,arguments);return 0===e.length?tz(this):tU(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,tc)},e.prototype.anyOf=function(){var e=this,t=H.apply(Y,arguments),n=this._cmp;try{t.sort(n)}catch(e){return tF(this,tf)}if(0===t.length)return tz(this);var r=new this.Collection(this,function(){return tY(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,o){for(var a=e.key;n(a,t[i])>0;)if(++i===t.length)return r(o),!1;return 0===n(a,t[i])||(r(function(){e.continue(t[i])}),!1)}),r},e.prototype.notEqual=function(e){return this.inAnyRange([[td,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=H.apply(Y,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return tF(this,tf)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[td,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var n,r=this,i=this._cmp,o=this._ascending,a=this._descending,l=this._min,u=this._max;if(0===e.length)return tz(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&0>=o(e[0],e[1])}))return tF(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",eo.InvalidArgument);var s=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers,d=o;function f(e,t){return d(e[0],t[0])}try{(n=e.reduce(function(e,t){for(var n=0,r=e.length;ni(t[0],o[1])&&i(t[1],o[0])>0){o[0]=l(o[0],t[0]),o[1]=u(o[1],t[1]);break}}return n===r&&e.push(t),e},[])).sort(f)}catch(e){return tF(this,tf)}var p=0,h=c?function(e){return o(e,n[p][1])>0}:function(e){return o(e,n[p][1])>=0},m=s?function(e){return a(e,n[p][0])>0}:function(e){return a(e,n[p][0])>=0},g=h,y=new this.Collection(this,function(){return tY(n[0][0],n[n.length-1][1],!s,!c)});return y._ondirectionchange=function(e){"next"===e?(g=h,d=o):(g=m,d=a),n.sort(f)},y._addAlgorithm(function(e,t,i){for(var a=e.key;g(a);)if(++p===n.length)return t(i),!1;return!(h(a)||m(a))||0!==r._cmp(a,n[p][1])&&0!==r._cmp(a,n[p][0])&&(t(function(){d===o?e.continue(n[p][0]):e.continue(n[p][1])}),!1)}),y},e.prototype.startsWithAnyOf=function(){var e=H.apply(Y,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?tz(this):this.inAnyRange(e.map(function(e){return[e,e+tc]})):tF(this,"startsWithAnyOf() only works with strings")},e}();function tW(e){return eZ(function(t){return tK(t),e(t.target.error),!1})}function tK(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var tX="storagemutated",tG="x-storagemutated-1",t$=tS(null,tX),tJ=function(){function e(){}return e.prototype._lock=function(){return V(!eB.global),++this._reculock,1!==this._reculock||eB.global||(eB.lockOwnerFor=this),this},e.prototype._unlock=function(){if(V(!eB.global),0==--this._reculock)for(eB.global||(eB.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{tr(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&eB.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(V(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new eo.DatabaseClosed(r);case"MissingAPIError":throw new eo.MissingAPI(r.message,r);default:throw new eo.OpenFailed(r)}if(!this.active)throw new eo.TransactionInactive;return V(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=eZ(function(n){tK(n),t._reject(e.error)}),e.onabort=eZ(function(n){tK(n),t.active&&t._reject(new eo.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=eZ(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&t$.storagemutated.fire(e.mutatedParts)}),this},e.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return tu(new eo.ReadOnly("Transaction is readonly"));if(!this.active)return tu(new eo.TransactionInactive);if(this._locked())return new ej(function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},eB])});if(n)return e4(function(){var e=new ej(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new ej(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=ej.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(function(){return n});else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new ej(function(e,r){n.then(function(n){return t._waitingQueue.push(eZ(e.bind(null,n)))},function(e){return t._waitingQueue.push(eZ(r.bind(null,e)))}).finally(function(){t._waitingFor===i&&(t._waitingFor=null)})})},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new eo.Abort))},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(g(t,e))return t[e];var n=this.schema[e];if(!n)throw new eo.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}();function tZ(e,t,n,r,i,o,a){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!a?"&":"")+(r?"*":"")+(i?"++":"")+tQ(t)}}function tQ(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function t0(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:T(n,function(e){return[e.name,e]})}}var t1=function(e){try{return e.only([[]]),t1=function(){return[[]]},[[]]}catch(e){return t1=function(){return tc},tc}};function t2(e){return null==e?function(){}:"string"==typeof e?1===e.split(".").length?function(t){return t[e]}:function(t){return A(t,e)}:function(t){return A(t,e)}}function t3(e){return[].slice.call(e)}var t5=0;function t4(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function t6(e,t){var n,r,i,o,l=e._novip,u=t.db,s=(n=l._middlewares,i=(r=l._deps).IDBKeyRange,r.indexedDB,{dbcore:(o=function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen,o=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!o):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!o)}var i,o=(i=t3(e.objectStoreNames),{schema:{name:e.name,tables:i.map(function(e){return n.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=d(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:t2(t)},indexes:t3(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,i=e.keyPath,a={name:t,compound:d(i),keyPath:i,unique:n,multiEntry:r,extractKey:t2(i)};return o[t4(i)]=a,a}),getIndexByKeyPath:function(e){return o[t4(e)]}};return o[":id"]=a.primaryKey,null!=t&&(o[t4(t)]=a.primaryKey),a})},hasGetAll:i.length>0&&"getAll"in n.objectStore(i[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),a=o.schema,l=o.hasGetAll,u=a.tables.map(function(e){var t;return{name:t=e.name,schema:e,mutate:function(e){var n=e.trans,i=e.type,o=e.keys,a=e.values,l=e.range;return new Promise(function(e,u){e=eZ(e);var s,c=n.objectStore(t),d=null==c.keyPath,f="put"===i||"add"===i;if(!f&&"delete"!==i&&"deleteRange"!==i)throw Error("Invalid operation type: "+i);var p=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var h=[],m=[],g=0,y=function(e){++g,tK(e)};if("deleteRange"===i){if(4===l.type)return e({numFailures:g,failures:m,results:[],lastResult:void 0});3===l.type?h.push(s=c.clear()):h.push(s=c.delete(r(l)))}else{var _=f?d?[a,o]:[a,null]:[o,null],b=_[0],w=_[1];if(f)for(var x=0;x0||a.add.length>0||a.change.length>0)&&r.change.push(a)}else a.recreate=!0,r.change.push(a)}else r.add.push([n,o])}return r}function nt(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return nn(i,e)}),i}function nn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function nr(e,t,n){var r={};return k(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=t.keyPath,o=tZ(tQ(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[],l=0;l0,d=a(a({},n),{isVirtual:c,keyTail:t,keyLength:s,extractKey:t2(e),unique:!c&&n.unique});return u.push(d),d.isPrimaryKey||o.push(d),s>1&&l(2===s?e[0]:e.slice(0,s-1),t+1,n),u.sort(function(e,t){return e.keyTail-t.keyTail}),d}var u=l(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[u];for(var s=0,c=r.indexes;s0?Promise.reject(n.failures[0]):r.length1?t:e}:{d:0});else{var n=new ny;return e&&"d"in e&&p(n,e),n}};function n_(e,t,n){var r=tD(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(ng(e))return p(e,{from:t,to:n,d:1});var i=e.l,o=e.r;if(0>tD(n,e.from))return i?n_(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},nx(e);if(tD(t,e.to)>0)return o?n_(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},nx(e);0>tD(t,e.from)&&(e.from=t,e.l=null,e.d=o?o.d+1:1),tD(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;i&&!e.l&&nb(e,i),o&&a&&nb(e,o)}}function nb(e,t){ng(t)||function e(t,n){var r=n.from,i=n.to,o=n.l,a=n.r;n_(t,r,i),o&&e(t,o),a&&e(t,a)}(e,t)}function nw(e){var t=ng(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>tD(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=tD(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function nx(e){var t,n,r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){var o="r"===i?"l":"r",l=a({},e),u=e[i];e.from=u.from,e.to=u.to,e[i]=u[i],l[i]=u[o],e[o]=l,l.d=nC(l)}e.d=nC(e)}function nC(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}y(ny.prototype,((r={add:function(e){return nb(this,e),this},addKey:function(e){return n_(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return n_(t,e,e)}),this}})[z]=function(){return nw(this)},r));var nS={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new ny(e.MIN_KEY,e.MAX_KEY);return a(a({},e),{table:function(r){var i=e.table(r),o=i.schema,l=o.primaryKey,u=l.extractKey,s=l.outbound,f=a(a({},i),{mutate:function(e){var a=e.trans,l=a.mutatedParts||(a.mutatedParts={}),u=function(e){var n="idb://"+t+"/"+r+"/"+e;return l[n]||(l[n]=new ny)},s=u(""),c=u(":dels"),f=e.type,p="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=p[0],m=p[1],g=e.trans._cache;return i.mutate(e).then(function(e){if(d(h)){"delete"!==f&&(h=e.results),s.addKeys(h);var t=nh(h,g);t||"add"===f||c.addKeys(h),(t||m)&&function(e,t,n,r){t.indexes.forEach(function(t){var i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}var a=function(e){return t.multiEntry&&d(e)?e.forEach(function(e){return i.addKey(e)}):i.addKey(e)};(n||r).forEach(function(e,t){var i=n&&o(n[t]),l=r&&o(r[t]);0!==tD(i,l)&&(null!=i&&a(i),null!=l&&a(l))})})}(u,o,t,m)}else if(h){var r={from:h.lower,to:h.upper};c.add(r),s.add(r)}else s.add(n),c.add(n),o.indexes.forEach(function(e){return u(e.name).add(n)});return e})}}),p=function(t){var n,r,i=t.query,o=i.index,a=i.range;return[o,new ny(null!==(n=a.lower)&&void 0!==n?n:e.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:e.MAX_KEY)]},h={get:function(e){return[l,new ny(e.key)]},getMany:function(e){return[l,new ny().addKeys(e.keys)]},count:p,query:p,openCursor:p};return c(h).forEach(function(e){f[e]=function(o){var l=eB.subscr;if(l){var c=function(e){var n="idb://"+t+"/"+r+"/"+e;return l[n]||(l[n]=new ny)},d=c(""),f=c(":dels"),p=h[e](o),m=p[0],g=p[1];if(c(m.name||"").add(g),!m.isPrimaryKey){if("count"===e)f.add(n);else{var y="query"===e&&s&&o.values&&i.query(a(a({},o),{values:!1}));return i[e].apply(this,arguments).then(function(t){if("query"===e){if(s&&o.values)return y.then(function(e){var n=e.result;return d.addKeys(n),t});var n=o.values?t.result.map(u):t.result;o.values?d.addKeys(n):f.addKeys(n)}else if("openCursor"===e){var r=o.values;return t&&Object.create(t,{key:{get:function(){return f.addKey(t.primaryKey),t.key}},primaryKey:{get:function(){var e=t.primaryKey;return f.addKey(e),e}},value:{get:function(){return r&&d.addKey(t.primaryKey),t.value}}})}return t})}}}return i[e].apply(this,arguments)}}),f}})}},nk=function(){function e(t,n){var r,i,o,l,u,s=this;this._middlewares={},this.verno=0;var c=e.dependencies;this._options=n=a({addons:e.addons,autoOpen:!0,indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var d=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var f={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:eu,dbReadyPromise:null,cancelOpen:eu,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};f.dbReadyPromise=new ej(function(e){f.dbReadyResolve=e}),f.openCanceller=new ej(function(e,t){f.cancelOpen=t}),this._state=f,this.name=t,this.on=tS(this,"populate","blocked","versionchange","close",{ready:[em,eu]}),this.on.ready.subscribe=E(this.on.ready.subscribe,function(t){return function(n,r){e.vip(function(){var e=s._state;e.openComplete?(e.dbOpenError||ej.resolve().then(n),r&&t(n)):e.onReadyBeingFired?(e.onReadyBeingFired.push(n),r&&t(n)):(t(n),r||t(function e(){s.on.ready.unsubscribe(n),s.on.ready.unsubscribe(e)}))})}}),this.Collection=(r=this,tk(tP.prototype,function(e,t){this.db=r;var n=tw,i=null;if(t)try{n=t()}catch(e){i=e}var o=e._ctx,a=o.table,l=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:l!==es?l:null}})),this.Table=(i=this,tk(tC.prototype,function(e,t,n){this.db=i,this._tx=n,this.name=e,this.schema=t,this.hook=i._allTables[e]?i._allTables[e].hook:tS(null,{creating:[ef,eu],reading:[ec,es],updating:[ep,eu],deleting:[ev,eu]})})),this.Transaction=(o=this,tk(tJ.prototype,function(e,t,n,r,i){var a=this;this.db=o,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=tS(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ej(function(e,t){a._resolve=e,a._reject=t}),this._completion.then(function(){a.active=!1,a.on.complete.fire()},function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),tu(e)})})),this.Version=(l=this,tk(no.prototype,function(e){this.db=l,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(u=this,tk(tq.prototype,function(e,t,n){this.db=u,this._ctx={table:e,index:":id"===t?null:t,or:n};var r=u._deps.indexedDB;if(!r)throw new eo.MissingAPI;this._cmp=this._ascending=r.cmp.bind(r),this._descending=function(e,t){return r.cmp(t,e)},this._max=function(e,t){return r.cmp(e,t)>0?e:t},this._min=function(e,t){return 0>r.cmp(e,t)?e:t},this._IDBKeyRange=u._deps.IDBKeyRange})),this.on("versionchange",function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+s.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+s.name+"'. Closing db now to resume the delete request."),s.close()}),this.on("blocked",function(e){!e.newVersion||e.newVersion0x4000000000000000?0:t.oldVersion;u=y<1,e._novip.idbdb=s.result,d=y/10,f=l,p=e._dbSchema,(h=e._createTransaction("readwrite",e._storeNames,p)).create(f),h._completion.catch(i),m=h._reject.bind(h),g=eB.transless||eB,e4(function(){var t,n,r,i,o;eB.trans=h,eB.transless=g,0===d?(c(p).forEach(function(e){nt(f,e,p[e].primKey,p[e].indexes)}),t6(e,f),ej.follow(function(){return e.on.populate.fire(h)}).catch(m)):(t=e._novip,n=[],r=t._versions,i=t._dbSchema=nr(t,t.idbdb,f),o=!1,r.filter(function(e){return e._cfg.version>=d}).forEach(function(e){n.push(function(){var n=i,r=e._cfg.dbschema;ni(t,n,f),ni(t,r,f),i=t._dbSchema=r;var a=ne(n,r);a.add.forEach(function(e){nt(f,e[0],e[1].primKey,e[1].indexes)}),a.change.forEach(function(e){if(e.recreate)throw new eo.Upgrade("Not yet support for changing primary key");var t=f.objectStore(e.name);e.add.forEach(function(e){return nn(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),nn(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>d){t6(t,f),h._memoizedTables={},o=!0;var u,s=O(r);a.del.forEach(function(e){s[e]=n[e]}),t7(t,[t.Transaction.prototype]),t8(t,[t.Transaction.prototype],c(s),s),h.schema=s;var p=q(l);p&&e6();var m=ej.follow(function(){if((u=l(h))&&p){var e=e8.bind(null,null);u.then(e,e)}});return u&&"function"==typeof u.then?ej.resolve(u):m.then(function(){return u})}}),n.push(function(n){o&&th||function(e,t){[].slice.call(t.db.objectStoreNames).forEach(function(n){return null==e[n]&&t.db.deleteObjectStore(n)})}(e._cfg.dbschema,n),t7(t,[t.Transaction.prototype]),t8(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),h.schema=t._dbSchema})}),(function e(){return n.length?ej.resolve(n.shift()(h.idbtrans)).then(e):ej.resolve()})().then(function(){(function(e,t){c(e).forEach(function(n){t.db.objectStoreNames.contains(n)||nt(t,n,e[n].primKey,e[n].indexes)})})(i,f)})).catch(m)})}},i),s.onsuccess=eZ(function(){l=null;var r,i,o,d=e._novip.idbdb=s.result,f=k(d.objectStoreNames);if(f.length>0)try{var p,h,m,g=d.transaction(1===f.length?f[0]:f,"readonly");n.autoSchema?((p=e._novip).verno=d.version/10,h=p._dbSchema=nr(p,d,g),p._storeNames=k(d.objectStoreNames,0),t8(p,[p._allTables],c(h),h)):(ni(e,e._dbSchema,g),((m=ne(nr(e,e.idbdb,g),e._dbSchema)).add.length||m.change.some(function(e){return e.add.length||e.change.length}))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),t6(e,g)}catch(e){}tp.push(e),d.onversionchange=eZ(function(t){n.vcFired=!0,e.on("versionchange").fire(t)}),d.onclose=eZ(function(t){e.on("close").fire(t)}),u&&(i=(r=e._deps).indexedDB,o=r.IDBKeyRange,nl(i)||a===tg||na(i,o).put({name:a}).catch(eu)),t()},i)})})]).then(function(){return o(),n.onReadyBeingFired=[],ej.resolve(nu(function(){return e.on.ready.fire(e.vip)})).then(function t(){if(n.onReadyBeingFired.length>0){var r=n.onReadyBeingFired.reduce(em,eu);return n.onReadyBeingFired=[],ej.resolve(nu(function(){return r(e.vip)})).then(t)}})}).finally(function(){n.onReadyBeingFired=null,n.isBeingOpened=!1}).then(function(){return e}).catch(function(t){n.dbOpenError=t;try{l&&l.abort()}catch(e){}return i===n.openCanceller&&e._close(),tu(t)}).finally(function(){n.openComplete=!0,a()})}(this)},e.prototype._close=function(){var e=this._state,t=tp.indexOf(this);if(t>=0&&tp.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new ej(function(t){e.dbReadyResolve=t}),e.openCanceller=new ej(function(t,n){e.cancelOpen=n})},e.prototype.close=function(){this._close();var e=this._state;this._options.autoOpen=!1,e.dbOpenError=new eo.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)},e.prototype.delete=function(){var e=this,t=arguments.length>0,n=this._state;return new ej(function(r,i){var o=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=eZ(function(){var t,n,i,o;t=e._deps,n=e.name,i=t.indexedDB,o=t.IDBKeyRange,nl(i)||n===tg||na(i,o).delete(n).catch(eu),r()}),t.onerror=tW(i),t.onblocked=e._fireOnBlocked};if(t)throw new eo.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(o):o()})},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return c(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var e=nc.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r,i,o=this,a=eB.trans;a&&a.db===this&&-1===e.indexOf("!")||(a=null);var l=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(i=t.map(function(e){var t=e instanceof o.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||e===ty)r=ty;else if("rw"==e||e==t_)r=t_;else throw new eo.InvalidArgument("Invalid transaction mode: "+e);if(a){if(a.mode===ty&&r===t_){if(l)a=null;else throw new eo.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY")}a&&i.forEach(function(e){if(a&&-1===a.storeNames.indexOf(e)){if(l)a=null;else throw new eo.SubTransaction("Table "+e+" not included in parent transaction.")}}),l&&a&&!a.active&&(a=null)}}catch(e){return a?a._promise(null,function(t,n){n(e)}):tu(e)}var u=(function e(t,n,r,i,o){return ej.resolve().then(function(){var a,l=eB.transless||eB,u=t._createTransaction(n,r,t._dbSchema,i);if(i)u.idbtrans=i.idbtrans;else try{u.create(),t._state.PR1398_maxLoop=3}catch(i){if(i.name===ei.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0)return console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(function(){return e(t,n,r,null,o)});return tu(i)}var s=q(o);s&&e6();var c=ej.follow(function(){if(a=o.call(u,u)){if(s){var e=e8.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=ns(a))}},{trans:u,transless:l});return(a&&"function"==typeof a.then?ej.resolve(a).then(function(e){return u.active?e:tu(new eo.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):c.then(function(){return a})).then(function(e){return i&&u._resolve(),u._completion.then(function(){return e})}).catch(function(e){return u._reject(e),tu(e)})})}).bind(null,this,r,i,a,n);return a?a._promise(r,u,"lock"):eB.trans?tr(eB.transless,function(){return o._whenReady(u)}):this._whenReady(u)},e.prototype.table=function(e){if(!g(this._allTables,e))throw new eo.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),nE="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",nV=function(){function e(e){this._subscribe=e}return e.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},e.prototype[nE]=function(){return this},e}();function nN(e,t){return c(t).forEach(function(n){nb(e[n]||(e[n]=new ny),t[n])}),e}function nT(e){var t=!1,n=void 0,r=new nV(function(r){var i=q(e),o=!1,a={},l={},u={get closed(){return o},unsubscribe:function(){o=!0,t$.storagemutated.unsubscribe(p)}};r.start&&r.start(u);var s=!1,d=!1;function f(){return c(l).some(function(e){return a[e]&&function(e,t){var n=nw(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=nw(e),a=o.next(i.from),l=a.value;!r.done&&!a.done;){if(0>=tD(l.from,i.to)&&tD(l.to,i.from)>=0)return!0;0>tD(i.from,l.from)?i=(r=n.next(l.from)).value:l=(a=o.next(i.from)).value}return!1}(a[e],l[e])})}var p=function(e){nN(a,e),f()&&h()},h=function(){if(!s&&!o){a={};var c,m,g={},y=(i&&e6(),c=function(){return e4(e,{subscr:g,trans:null})},m=eB.trans?tr(eB.transless,c):c(),i&&m.then(e8,e8),m);d||(t$(tX,p),d=!0),s=!0,Promise.resolve(y).then(function(e){t=!0,n=e,s=!1,!o&&(f()?h():(a={},l=g,r.next&&r.next(e)))},function(e){s=!1,t=!1,r.error&&r.error(e),u.unsubscribe()})}};return h(),u});return r.hasValue=function(){return t},r.getValue=function(){return n},r}try{i={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch(e){i={indexedDB:null,IDBKeyRange:null}}function nA(e){var t=nR;try{nR=!0,t$.storagemutated.fire(e)}finally{nR=t}}y(nk,a(a({},el),{delete:function(e){return new nk(e,{addons:[]}).delete()},exists:function(e){return new nk(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{var t,n,r;return(n=(t=nk.dependencies).indexedDB,r=t.IDBKeyRange,nl(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==tg})}):na(n,r).toCollection().primaryKeys()).then(e)}catch(e){return tu(new eo.MissingAPI)}},defineClass:function(){return function(e){p(this,e)}},ignoreTransaction:function(e){return eB.trans?tr(eB.transless,e):e()},vip:nu,async:function(e){return function(){try{var t=ns(e.apply(this,arguments));if(!t||"function"!=typeof t.then)return ej.resolve(t);return t}catch(e){return tu(e)}}},spawn:function(e,t,n){try{var r=ns(e.apply(n,t||[]));if(!r||"function"!=typeof r.then)return ej.resolve(r);return r}catch(e){return tu(e)}},currentTransaction:{get:function(){return eB.trans||null}},waitFor:function(e,t){var n=ej.resolve("function"==typeof e?nk.ignoreTransaction(e):e).timeout(t||6e4);return eB.trans?eB.trans.waitFor(n):n},Promise:ej,debug:{get:function(){return W},set:function(e){W=e,K="dexie"===e?function(){return!0}:tm}},derive:w,extend:p,props:y,override:E,Events:tS,on:t$,liveQuery:nT,extendObservabilitySet:nN,getByKeyPath:A,setByKeyPath:R,delByKeyPath:function(e,t){"string"==typeof t?R(e,t,void 0):"length"in t&&[].map.call(t,function(t){R(e,t,void 0)})},shallowClone:O,deepClone:L,getObjectDiff:nv,cmp:tD,asap:N,minKey:td,addons:[],connections:tp,errnames:ei,dependencies:i,semVer:ts,version:ts.split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),nk.maxKey=t1(nk.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(t$(tX,function(e){if(!nR){var t;th?(t=document.createEvent("CustomEvent")).initCustomEvent(tG,!0,!0,e):t=new CustomEvent(tG,{detail:e}),nR=!0,dispatchEvent(t),nR=!1}}),addEventListener(tG,function(e){var t=e.detail;nR||nA(t)}));var nR=!1;if("undefined"!=typeof BroadcastChannel){var nO=new BroadcastChannel(tG);"function"==typeof nO.unref&&nO.unref(),t$(tX,function(e){nR||nO.postMessage(e)}),nO.onmessage=function(e){e.data&&nA(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){t$(tX,function(e){try{nR||("undefined"!=typeof localStorage&&localStorage.setItem(tG,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&u([],self.clients.matchAll({includeUncontrolled:!0}),!0).forEach(function(t){return t.postMessage({type:tG,changedParts:e})}))}catch(e){}}),"undefined"!=typeof addEventListener&&addEventListener("storage",function(e){if(e.key===tG){var t=JSON.parse(e.newValue);t&&nA(t.changedParts)}});var nD=self.document&&navigator.serviceWorker;nD&&nD.addEventListener("message",function(e){var t=e.data;t&&t.type===tG&&nA(t.changedParts)})}ej.rejectionMapper=function(e,t){if(!e||e instanceof ee||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ea[e.name])return e;var n=new ea[e.name](t||e.message,e);return"stack"in e&&b(n,"stack",{get:function(){return this.inner.stack}}),n},K=tm}),f.register("9BzA6",function(e,n){t(e.exports,"copyToClipboard",function(){return s}),t(e.exports,"parseClassroom",function(){return c}),t(e.exports,"parse",function(){return d}),t(e.exports,"stringify",function(){return p}),t(e.exports,"scrapeModule",function(){return h}),t(e.exports,"validateUrl",function(){return g}),t(e.exports,"infoHash",function(){return y}),t(e.exports,"getPeerID",function(){return _}),t(e.exports,"clone",function(){return b}),t(e.exports,"removeKeysStartingWithSecret",function(){return function e(t){for(var n in t)"object"==typeof t[n]&&(// Recursively call the function if the value is an object or an array -e(t[n]),"{}"===JSON.stringify(t[n])&&delete t[n]),n.toLocaleLowerCase().startsWith("secret")&&delete t[n]}}),t(e.exports,"deepEqual",function(){return function e(t,n){var r=Object.keys(t),i=Object.keys(n);if(r.length!==i.length)return!1;var o=!0,a=!1,l=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,d=t[c],f=n[c],p=w(d)&&w(f);if(p&&!e(d,f)||!p&&d!==f)return!1}}catch(e){a=!0,l=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw l}}return!0}});var r=f("xJRWs"),i=f("a42Vg"),o=f("9zFRg"),a=f("3XT9C"),l=f("i1Uxe");function u(e,t,n){if(t.match(/(https?)?:\/\//i))return"script"===e?''):'');var r=new URL(t,n).toString();return'\n ')}function s(e){navigator.clipboard.writeText(e)}function c(e){var t;console.warn("parse Classroom",e);try{if(t=d(e))for(var n=0;n').concat(s.style||"","\n \n \n \n ").concat(s.body||"","\n \n \n "),[2,(0,o._)((0,i._)({},e),{name:s.name,description:s.description,icon:s.icon||"mdi-package",shownIn:s["show-in"]||["*"],srcdoc:"data:text/html,"+escape(f),origin:"*"})]}catch(e){throw console.warn("loading yaml:",e),Error("Could not load the YAML-declaration: "+e.message)}else{if((p=document.createElement("html")).innerHTML=t,(h=Object.fromEntries(Object.values(p.getElementsByTagName("meta")).map(function(e){return[e.name,e.content]}))).fetch&&"false"!==h.fetch)return[2,(0,o._)((0,i._)({},e),{name:p.getElementsByTagName("title")[0].innerText||h.name,description:h.description,icon:h.icon||"mdi-package",shownIn:(h["show-in"]||"*").replace(/\s+/g,"").split(","),srcdoc:"data:text/html,"+escape(function(e,t){try{var n=e.match(RegExp(".*?<\\/head>","is"))[0];return n=(n=n.replace(RegExp(".*?<\\/script>","gims"),function(e){var n=e.match(RegExp("src=(?:'|\")([^\"']+)(?:'|\")","is"));return n&&!((n=n[1]).startsWith("https://")||n.startsWith("http://"))?u("script",n,t):e})).replace(RegExp("","gims"),function(e){var n=e.match(RegExp("href=(?:'|\")([^\"']+)(?:'|\")","is"));return n&&!((n=n[1]).startsWith("https://")||n.startsWith("http://"))?u("css",n,t):e}),e.replace(RegExp(".*?<\\/head>","is"),n)}catch(e){console.warn("problems parsing html:",e)}}(t,e.url)),origin:"*"})];try{return[2,(0,o._)((0,i._)({},e),{name:p.getElementsByTagName("title")[0].innerText||h.name,description:h.description,icon:h.icon||"mdi-package",shownIn:(h["show-in"]||"*").replace(/\s+/g,"").split(",")})]}catch(e){throw Error("This does not seem to be a valid module declaration, check the URL manually.")}}return[3,4];case 3:return m=a.sent(),[2,(0,o._)((0,i._)({},e),{name:"",description:m,icon:"mdi-alert",shownIn:""})];case 4:return[2]}})})).apply(this,arguments)}function g(e){try{var t=new URL(e);if(["http:","https:","file:","ipfs:","ipns:","blob:","dat:","hyper:"].includes(t.protocol))return!0}catch(e){}return!1}function y(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r=0)n=t;else{var o=h(t);for(var a in n=o===Object.prototype?{}:Object.create(o),M&&M.set(t,n),t)g(t,a)&&(n[a]=e(t[a]))}return n}(e);return M=null,t}var j={}.toString;function F(e){return j.call(e).slice(8,-1)}var z="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",U=(void 0===z?"undefined":(0,o._)(z))==="symbol"?function(e){var t;return null!=e&&(t=e[z])&&t.apply(e)}:function(){return null},Y={};function H(e){var t,n,r,i;if(1==arguments.length){if(d(e))return e.slice();if(this===Y&&"string"==typeof e)return[e];if(i=U(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}var q="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},W="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),K=function(){return!0},X=!Error("").stack;function G(){if(X)try{throw G.arguments,Error()}catch(e){return e}return Error()}function $(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(K).map(function(e){return"\n"+e}).join("")):""}var J=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Z=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(J),Q={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ee(e,t){this._e=G(),this.name=e,this.message=t}function et(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function en(e,t,n,r){this._e=G(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=et(e,t)}function er(e,t){this._e=G(),this.name="BulkError",this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=et(e,t)}w(ee).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+$(this._e,2))}},toString:function(){return this.name+": "+this.message}}),w(en).from(ee),w(er).from(ee);var ei=Z.reduce(function(e,t){return e[t]=t+"Error",e},{}),eo=Z.reduce(function(e,t){var n=t+"Error";function r(e,r){this._e=G(),this.name=n,e?"string"==typeof e?(this.message=""+e+(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=Q[t]||n,this.inner=null)}return w(r).from(ee),e[t]=r,e},{});eo.Syntax=SyntaxError,eo.Type=TypeError,eo.Range=RangeError;var ea=J.reduce(function(e,t){return e[t+"Error"]=eo[t],e},{}),el=Z.reduce(function(e,t){return -1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=eo[t]),e},{});function eu(){}function es(e){return e}function ec(e,t){return null==e||e===es?t:function(n){return t(e(n))}}function ed(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function ef(e,t){return e===eu?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?ed(r,this.onsuccess):r),i&&(this.onerror=this.onerror?ed(i,this.onerror):i),void 0!==o?o:n}}function ev(e,t){return e===eu?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?ed(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ed(r,this.onerror):r)}}function ep(e,t){return e===eu?t:function(n){var r=e.apply(this,arguments);p(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?ed(i,this.onsuccess):i),o&&(this.onerror=this.onerror?ed(o,this.onerror):o),void 0===r?void 0===a?void 0:a:p(r,a)}}function eh(e,t){return e===eu?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function em(e,t){return e===eu?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}el.ModifyError=en,el.DexieError=ee,el.BulkError=er;var eg={},ey="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,h(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,h(t),e]}(),e_=ey[0],eb=ey[1],ew=ey[2],ex=eb&&eb.then,eC=e_&&e_.constructor,eS=!!ew,ek=!1,eE=ew?function(){ew.then(eK)}:s.setImmediate?setImmediate.bind(null,eK):s.MutationObserver?function(){var e=document.createElement("div");new MutationObserver(function(){eK(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(eK,0)},eV=function(e,t){eP.push([e,t]),eT&&(eE(),eT=!1)},eN=!0,eT=!0,eA=[],eR=[],eO=null,eD=es,eI={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:tl,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(function(e){try{tl(e[0],e[1])}catch(e){}})}},eB=eI,eP=[],eM=0,eL=[];function ej(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=eu,this._lib=!1;var t=this._PSD=eB;if(W&&(this._stackHolder=G(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==eg)throw TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],!1===this._state&&eU(this,this._value);return}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var r=t._lib&&eX();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof ej?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,eY(t)),r&&eG()}},eU.bind(null,t))}catch(e){eU(t,e)}}(this,e)}var eF={get:function(){var e=eB,t=e3;function n(n,r){var i=this,o=!e.global&&(e!==eB||t!==e3),a=o&&!e8(),l=new ej(function(t,l){eH(i,new ez(ti(n,e,o,a),ti(r,e,o,a),t,l,e))});return W&&eW(l,this),l}return n.prototype=eg,n},set:function(e){b(this,"then",e&&e.prototype===eg?eF:{get:function(){return e},set:eF.set})}};function ez(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function eU(e,t){if(eR.push(t),null===e._state){var n=e._lib&&eX();t=eD(t),e._state=!1,e._value=t,W&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){t&&t(e)}}(function(){var n=C(t,"stack");t._promise=e,b(t,"stack",{get:function(){return ek?n&&(n.get?n.get.apply(t):n.value):e.stack}})}),eA.some(function(t){return t._value===e._value})||eA.push(e),eY(e),n&&eG()}}function eY(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n0;)for(t=0,e=eP,eP=[],n=e.length;t0)eN=!0,eT=!0}function e$(){var e=eA;eA=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=eL.slice(0),n=t.length;n;)t[--n]()}function eJ(e){return new ej(eg,!1,e)}function eZ(e,t){var n=eB;return function(){var r=eX(),i=eB;try{return tt(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{tt(i,!1),r&&eG()}}}y(ej.prototype,{then:eF,_then:function(e,t){eH(this,new ez(null,null,e,t,eB))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,function(e){return e instanceof t?n(e):eJ(e)}):this.then(null,function(e){return e&&e.name===t?n(e):eJ(e)})},finally:function(e){return this.then(function(t){return e(),t},function(t){return e(),eJ(t)})},stack:{get:function(){if(this._stack)return this._stack;try{ek=!0;var e=(function e(t,n,r){if(n.length===r)return n;var i="";if(!1===t._state){var o,a,l=t._value;null!=l?(o=l.name||"Error",a=l.message||l,i=$(l,0)):(o=l,a=""),n.push(o+(a?": "+a:"")+i)}return W&&((i=$(t._stackHolder,2))&&-1===n.indexOf(i)&&n.push(i),t._prev&&e(t._prev,n,r)),n})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{ek=!1}}},timeout:function(e,t){var n=this;return e<1/0?new ej(function(r,i){var o=setTimeout(function(){return i(new eo.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&b(ej.prototype,Symbol.toStringTag,"Dexie.Promise"),eI.env=tn(),y(ej,{all:function(){var e=H.apply(null,arguments).map(e7);return new ej(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(i,o){return ej.resolve(i).then(function(n){e[o]=n,--r||t(e)},n)})})},resolve:function(e){if(e instanceof ej)return e;if(e&&"function"==typeof e.then)return new ej(function(t,n){e.then(t,n)});var t=new ej(eg,!0,e);return eW(t,eO),t},reject:eJ,race:function(){var e=H.apply(null,arguments).map(e7);return new ej(function(t,n){e.map(function(e){return ej.resolve(e).then(t,n)})})},PSD:{get:function(){return eB},set:function(e){return eB=e}},totalEchoes:{get:function(){return e3}},newPSD:e4,usePSD:tr,scheduler:{get:function(){return eV},set:function(e){eV=e}},rejectionMapper:{get:function(){return eD},set:function(e){eD=e}},follow:function(e,t){return new ej(function(n,r){return e4(function(t,n){var r=eB;r.unhandleds=[],r.onunhandled=n,r.finalize=ed(function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},eL.push(function t(){e(),eL.splice(eL.indexOf(t),1)}),++eM,eV(function(){0==--eM&&e$()},[])},r.finalize),e()},t,n,r)})}}),eC&&(eC.allSettled&&b(ej,"allSettled",function(){var e=H.apply(null,arguments).map(e7);return new ej(function(t){0===e.length&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,i){return ej.resolve(e).then(function(e){return r[i]={status:"fulfilled",value:e}},function(e){return r[i]={status:"rejected",reason:e}}).then(function(){return--n||t(r)})})})}),eC.any&&"undefined"!=typeof AggregateError&&b(ej,"any",function(){var e=H.apply(null,arguments).map(e7);return new ej(function(t,n){0===e.length&&n(AggregateError([]));var r=e.length,i=Array(r);e.forEach(function(e,o){return ej.resolve(e).then(function(e){return t(e)},function(e){i[o]=e,--r||n(AggregateError(i))})})})}));var eQ={awaits:0,echoes:0,id:0},e0=0,e1=[],e2=0,e3=0,e5=0;function e4(e,t,n,r){var i=eB,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++e5;var a=eI.env;o.env=eS?{Promise:ej,PromiseProp:{value:ej,configurable:!0,writable:!0},all:ej.all,race:ej.race,allSettled:ej.allSettled,any:ej.any,resolve:ej.resolve,reject:ej.reject,nthen:to(a.nthen,o),gthen:to(a.gthen,o)}:{},t&&p(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var l=tr(o,e,n,r);return 0===o.ref&&o.finalize(),l}function e6(){return eQ.id||(eQ.id=++e0),++eQ.awaits,eQ.echoes+=100,eQ.id}function e8(){return!!eQ.awaits&&(0==--eQ.awaits&&(eQ.id=0),eQ.echoes=100*eQ.awaits,!0)}function e7(e){return eQ.echoes&&e&&e.constructor===eC?(e6(),e.then(function(e){return e8(),e},function(e){return e8(),tu(e)})):e}function e9(e){++e3,eQ.echoes&&0!=--eQ.echoes||(eQ.echoes=eQ.id=0),e1.push(eB),tt(e,!0)}function te(){var e=e1[e1.length-1];e1.pop(),tt(e,!1)}function tt(e,t){var n,r=eB;if((t?!eQ.echoes||e2++&&e===eB:!e2||--e2&&e===eB)||(n=t?e9.bind(null,e):te,ex.call(e_,n)),e!==eB&&(eB=e,r===eI&&(eI.env=tn()),eS)){var i=eI.env.Promise,o=e.env;eb.then=o.nthen,i.prototype.then=o.gthen,(r.global||e.global)&&(Object.defineProperty(s,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject,o.allSettled&&(i.allSettled=o.allSettled),o.any&&(i.any=o.any))}}function tn(){var e=s.Promise;return eS?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:eb.then,gthen:e.prototype.then}:{}}function tr(e,t,n,r,i){var o=eB;try{return tt(e,!0),t(n,r,i)}finally{tt(o,!1)}}function ti(e,t,n,r){return"function"!=typeof e?e:function(){var i,o=eB;n&&e6(),tt(t,!0);try{return e.apply(this,arguments)}finally{tt(o,!1),r&&(i=e8,ex.call(e_,i))}}}function to(e,t){return function(n,r){return e.call(this,ti(n,t),ti(r,t))}}-1===(""+ex).indexOf("[native code]")&&(e6=e8=eu);var ta="unhandledrejection";function tl(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(s.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(ta,!0,!0),p(r,i)):s.CustomEvent&&(r=new CustomEvent(ta,{detail:i}),p(r,i)),r&&s.dispatchEvent&&(dispatchEvent(r),!s.PromiseRejectionEvent&&s.onunhandledrejection))try{s.onunhandledrejection(r)}catch(e){}W&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var tu=ej.reject,ts="3.2.4",tc=String.fromCharCode(65535),td=-1/0,tf="Invalid key provided. Keys must be of type string, number, Date or Array.",tv="String expected.",tp=[],th="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),tm=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},tg="__dbnames",ty="readonly",t_="readwrite";function tb(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var tw={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function tx(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&(t=L(t),delete t[e]),t}}var tC=function(){function e(){}return e.prototype._trans=function(e,t,n){var r=this._tx||eB.trans,i=this.name;function o(e,n,r){if(!r.schema[i])throw new eo.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var a=eX();try{return r&&r.db===this.db?r===eB.trans?r._promise(e,o,n):e4(function(){return r._promise(e,o,n)},{trans:r,transless:eB.transless||eB}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||eB.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){if(o.name===ei.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0)return console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(function(){return e(t,n,r,i)});return tu(o)}return o._promise(n,function(e,t){return e4(function(){return eB.trans=o,i(e,t,o)})}).then(function(e){return o._completion.then(function(){return e})})}if(t._state.openComplete)return tu(new eo.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return tu(new eo.DatabaseClosed);t.open().catch(eu)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],o)}finally{a&&eG()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(d(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=c(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){return e.compound&&t.every(function(t){return e.keyPath.indexOf(t)>=0})&&e.keyPath.every(function(e){return t.indexOf(e)>=0})})[0];if(n&&this.db._maxKey!==tc)return this.where(n.name).equals(n.keyPath.map(function(t){return e[t]}));!n&&W&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var r=this.schema.idxByName,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}var a=t.reduce(function(t,n){var i=t[0],a=t[1],l=r[n],u=e[n];return[i||l,i||!l?tb(a,l&&l.multi?function(e){var t=A(e,n);return d(t)&&t.some(function(e){return o(u,e)})}:function(e){return o(u,A(e,n))}):a]},[null,null]),l=a[0],u=a[1];return l?this.where(l.name).equals(e[l.keyPath]).filter(u):n?this.filter(u):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,d(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(g(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass(function(e){p(this,e)})},e.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=tx(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})}).then(function(e){return e.numFailures?ej.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{R(e,o,t)}catch(e){}return t})},e.prototype.update=function(e,t){if("object"!=typeof e||d(e))return this.where(":id").equals(e).modify(t);var n=A(e,this.schema.primKey.keyPath);if(void 0===n)return tu(new eo.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?c(t).forEach(function(n){R(e,n,t[n])}):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)},e.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=tx(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?ej.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{R(e,o,t)}catch(e){}return t})},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(e){return e.numFailures?ej.reject(e.failures[0]):void 0})},e.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:tw})}).then(function(e){return e.numFailures?ej.reject(e.failures[0]):void 0})},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},e.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,a=n.auto,l=n.keyPath;if(l&&i)throw new eo.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new eo.InvalidArgument("Arguments objects and keys must have the same length");var u=e.length,s=l&&a?e.map(tx(l)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:s,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?n:i;throw new er(r.name+".bulkAdd(): "+t+" of "+u+" operations failed",a)})})},e.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,a=n.auto,l=n.keyPath;if(l&&i)throw new eo.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new eo.InvalidArgument("Arguments objects and keys must have the same length");var u=e.length,s=l&&a?e.map(tx(l)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:s,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?n:i;throw new er(r.name+".bulkPut(): "+t+" of "+u+" operations failed",a)})})},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e})}).then(function(e){var r=e.numFailures,i=e.lastResult,o=e.failures;if(0===r)return i;throw new er(t.name+".bulkDelete(): "+r+" of "+n+" operations failed",o)})},e}();function tS(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;rt?1:er?a:0}return this.toArray(function(e){return e.sort(l)}).then(t)},e.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&&tE(n,!0)&&n.limit>0){var r=n.valueMapper,i=tT(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then(function(e){var t=e.result;return r?t.map(r):t})}var o=[];return tR(n,function(e){return o.push(e)},e,n.table.core).then(function(){return o})},e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,tE(t)?tN(t,function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n(function(){e.advance(t),t=0}),!1)}}):tN(t,function(){var t=e;return function(){return--t<0}})),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tN(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}},!0),this},e.prototype.until=function(e,t){return tV(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},e.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){var t;return tV(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=tb(t.isMatch,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&tE(t,!0)&&t.limit>0)return this._read(function(e){var n=tT(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return tV(this._ctx,function(e){var t=e.primaryKey.toString(),r=g(n,t);return n[t]=!0,!r}),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){if("function"==typeof e)i=e;else{var i,o=c(e),a=o.length;i=function(t){for(var n=!1,r=0;r0&&l.mutate({trans:r,type:"add",values:p}).then(function(e){for(var t in e.failures)y.splice(parseInt(t),1);g(p.length,e)})).then(function(){return(h.length>0||x&&"object"==typeof e)&&l.mutate({trans:r,type:"put",keys:m,values:h,criteria:x,changeSpec:"function"!=typeof e&&e}).then(function(e){return g(h.length,e)})}).then(function(){return(y.length>0||x&&e===tM)&&l.mutate({trans:r,type:"delete",keys:y,criteria:x}).then(function(e){return g(y.length,e)})}).then(function(){return t.length>a+u&&o(a+f)})})};return o(0).then(function(){if(p.length>0)throw new en("Error modifying one or more objects",p,h,m);return t.length})})})},e.prototype.delete=function(){var e=this._ctx,t=e.range;return tE(e)&&(e.isPrimKey&&!th||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey;return e.table.core.count({trans:n,query:{index:r,range:t}}).then(function(r){return e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(function(e){var t=e.failures;e.lastResult,e.results;var n=e.numFailures;if(n)throw new en("Could not delete some values",Object.keys(t).map(function(e){return t[e]}),r-n);return r-n})})}):this.modify(tM)},e}(),tM=function(e,t){return t.value=null};function tL(e,t){return et?-1:e===t?0:1}function tF(e,t,n){var r=e instanceof tq?new e.Collection(e):e;return r._ctx.error=n?new n(t):TypeError(t),r}function tz(e){return new e.Collection(e,function(){return tH("")}).limit(0)}function tU(e,t,n,r){var i,o,a,l,u,s,c,d=n.length;if(!n.every(function(e){return"string"==typeof e}))return tF(e,tv);function f(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},a="next"===e?tL:tj;var t=n.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return a(e.lower,t.lower)});l=t.map(function(e){return e.upper}),u=t.map(function(e){return e.lower}),s=e,c="next"===e?"":r}f("next");var p=new e.Collection(e,function(){return tY(l[0],u[d-1]+r)});p._ondirectionchange=function(e){f(e)};var h=0;return p._addAlgorithm(function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,u,h))return!0;for(var p=null,m=h;mi(e[u],n[u]))return e.substr(0,u)+n[u]+n.substr(u+1);if(0>i(e[u],r[u]))return e.substr(0,u)+r[u]+n.substr(u+1);if(l>=0)return e.substr(0,l)+t[l]+n.substr(l+1);return null}0>i(e[u],s)&&(l=u)}return a0)&&(p=g)}return n(null!==p?function(){e.continue(p+c)}:r),!1}),p}function tY(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function tH(e){return{type:1,lower:e,upper:e}}var tq=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{if(this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&!(n&&r))return tz(this);return new this.Collection(this,function(){return tY(e,t,!n,!r)})}catch(e){return tF(this,tf)}},e.prototype.equals=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tH(e)})},e.prototype.above=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tY(e,void 0,!0)})},e.prototype.aboveOrEqual=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tY(e,void 0,!1)})},e.prototype.below=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tY(void 0,e,!1,!0)})},e.prototype.belowOrEqual=function(e){return null==e?tF(this,tf):new this.Collection(this,function(){return tY(void 0,e)})},e.prototype.startsWith=function(e){return"string"!=typeof e?tF(this,tv):this.between(e,e+tc,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):tU(this,function(e,t){return 0===e.indexOf(t[0])},[e],tc)},e.prototype.equalsIgnoreCase=function(e){return tU(this,function(e,t){return e===t[0]},[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=H.apply(Y,arguments);return 0===e.length?tz(this):tU(this,function(e,t){return -1!==t.indexOf(e)},e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=H.apply(Y,arguments);return 0===e.length?tz(this):tU(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,tc)},e.prototype.anyOf=function(){var e=this,t=H.apply(Y,arguments),n=this._cmp;try{t.sort(n)}catch(e){return tF(this,tf)}if(0===t.length)return tz(this);var r=new this.Collection(this,function(){return tY(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,o){for(var a=e.key;n(a,t[i])>0;)if(++i===t.length)return r(o),!1;return 0===n(a,t[i])||(r(function(){e.continue(t[i])}),!1)}),r},e.prototype.notEqual=function(e){return this.inAnyRange([[td,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=H.apply(Y,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return tF(this,tf)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[td,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var n,r=this,i=this._cmp,o=this._ascending,a=this._descending,l=this._min,u=this._max;if(0===e.length)return tz(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&0>=o(e[0],e[1])}))return tF(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",eo.InvalidArgument);var s=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers,d=o;function f(e,t){return d(e[0],t[0])}try{(n=e.reduce(function(e,t){for(var n=0,r=e.length;ni(t[0],o[1])&&i(t[1],o[0])>0){o[0]=l(o[0],t[0]),o[1]=u(o[1],t[1]);break}}return n===r&&e.push(t),e},[])).sort(f)}catch(e){return tF(this,tf)}var p=0,h=c?function(e){return o(e,n[p][1])>0}:function(e){return o(e,n[p][1])>=0},m=s?function(e){return a(e,n[p][0])>0}:function(e){return a(e,n[p][0])>=0},g=h,y=new this.Collection(this,function(){return tY(n[0][0],n[n.length-1][1],!s,!c)});return y._ondirectionchange=function(e){"next"===e?(g=h,d=o):(g=m,d=a),n.sort(f)},y._addAlgorithm(function(e,t,i){for(var a=e.key;g(a);)if(++p===n.length)return t(i),!1;return!(h(a)||m(a))||0!==r._cmp(a,n[p][1])&&0!==r._cmp(a,n[p][0])&&(t(function(){d===o?e.continue(n[p][0]):e.continue(n[p][1])}),!1)}),y},e.prototype.startsWithAnyOf=function(){var e=H.apply(Y,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?tz(this):this.inAnyRange(e.map(function(e){return[e,e+tc]})):tF(this,"startsWithAnyOf() only works with strings")},e}();function tW(e){return eZ(function(t){return tK(t),e(t.target.error),!1})}function tK(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var tX="storagemutated",tG="x-storagemutated-1",t$=tS(null,tX),tJ=function(){function e(){}return e.prototype._lock=function(){return V(!eB.global),++this._reculock,1!==this._reculock||eB.global||(eB.lockOwnerFor=this),this},e.prototype._unlock=function(){if(V(!eB.global),0==--this._reculock)for(eB.global||(eB.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{tr(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&eB.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(V(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new eo.DatabaseClosed(r);case"MissingAPIError":throw new eo.MissingAPI(r.message,r);default:throw new eo.OpenFailed(r)}if(!this.active)throw new eo.TransactionInactive;return V(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=eZ(function(n){tK(n),t._reject(e.error)}),e.onabort=eZ(function(n){tK(n),t.active&&t._reject(new eo.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=eZ(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&t$.storagemutated.fire(e.mutatedParts)}),this},e.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return tu(new eo.ReadOnly("Transaction is readonly"));if(!this.active)return tu(new eo.TransactionInactive);if(this._locked())return new ej(function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},eB])});if(n)return e4(function(){var e=new ej(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new ej(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=ej.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(function(){return n});else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new ej(function(e,r){n.then(function(n){return t._waitingQueue.push(eZ(e.bind(null,n)))},function(e){return t._waitingQueue.push(eZ(r.bind(null,e)))}).finally(function(){t._waitingFor===i&&(t._waitingFor=null)})})},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new eo.Abort))},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(g(t,e))return t[e];var n=this.schema[e];if(!n)throw new eo.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}();function tZ(e,t,n,r,i,o,a){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!a?"&":"")+(r?"*":"")+(i?"++":"")+tQ(t)}}function tQ(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function t0(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:T(n,function(e){return[e.name,e]})}}var t1=function(e){try{return e.only([[]]),t1=function(){return[[]]},[[]]}catch(e){return t1=function(){return tc},tc}};function t2(e){return null==e?function(){}:"string"==typeof e?1===e.split(".").length?function(t){return t[e]}:function(t){return A(t,e)}:function(t){return A(t,e)}}function t3(e){return[].slice.call(e)}var t5=0;function t4(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function t6(e,t){var n,r,i,o,l=e._novip,u=t.db,s=(n=l._middlewares,i=(r=l._deps).IDBKeyRange,r.indexedDB,{dbcore:(o=function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen,o=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!o):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!o)}var i,o=(i=t3(e.objectStoreNames),{schema:{name:e.name,tables:i.map(function(e){return n.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=d(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:t2(t)},indexes:t3(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,i=e.keyPath,a={name:t,compound:d(i),keyPath:i,unique:n,multiEntry:r,extractKey:t2(i)};return o[t4(i)]=a,a}),getIndexByKeyPath:function(e){return o[t4(e)]}};return o[":id"]=a.primaryKey,null!=t&&(o[t4(t)]=a.primaryKey),a})},hasGetAll:i.length>0&&"getAll"in n.objectStore(i[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),a=o.schema,l=o.hasGetAll,u=a.tables.map(function(e){var t;return{name:t=e.name,schema:e,mutate:function(e){var n=e.trans,i=e.type,o=e.keys,a=e.values,l=e.range;return new Promise(function(e,u){e=eZ(e);var s,c=n.objectStore(t),d=null==c.keyPath,f="put"===i||"add"===i;if(!f&&"delete"!==i&&"deleteRange"!==i)throw Error("Invalid operation type: "+i);var p=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var h=[],m=[],g=0,y=function(e){++g,tK(e)};if("deleteRange"===i){if(4===l.type)return e({numFailures:g,failures:m,results:[],lastResult:void 0});3===l.type?h.push(s=c.clear()):h.push(s=c.delete(r(l)))}else{var _=f?d?[a,o]:[a,null]:[o,null],b=_[0],w=_[1];if(f)for(var x=0;x0||a.add.length>0||a.change.length>0)&&r.change.push(a)}else a.recreate=!0,r.change.push(a)}else r.add.push([n,o])}return r}function nt(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return nn(i,e)}),i}function nn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function nr(e,t,n){var r={};return k(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=t.keyPath,o=tZ(tQ(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[],l=0;l0,d=a(a({},n),{isVirtual:c,keyTail:t,keyLength:s,extractKey:t2(e),unique:!c&&n.unique});return u.push(d),d.isPrimaryKey||o.push(d),s>1&&l(2===s?e[0]:e.slice(0,s-1),t+1,n),u.sort(function(e,t){return e.keyTail-t.keyTail}),d}var u=l(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[u];for(var s=0,c=r.indexes;s0?Promise.reject(n.failures[0]):r.length1?t:e}:{d:0});else{var n=new ny;return e&&"d"in e&&p(n,e),n}};function n_(e,t,n){var r=tD(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(ng(e))return p(e,{from:t,to:n,d:1});var i=e.l,o=e.r;if(0>tD(n,e.from))return i?n_(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},nx(e);if(tD(t,e.to)>0)return o?n_(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},nx(e);0>tD(t,e.from)&&(e.from=t,e.l=null,e.d=o?o.d+1:1),tD(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;i&&!e.l&&nb(e,i),o&&a&&nb(e,o)}}function nb(e,t){ng(t)||function e(t,n){var r=n.from,i=n.to,o=n.l,a=n.r;n_(t,r,i),o&&e(t,o),a&&e(t,a)}(e,t)}function nw(e){var t=ng(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>tD(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=tD(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function nx(e){var t,n,r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){var o="r"===i?"l":"r",l=a({},e),u=e[i];e.from=u.from,e.to=u.to,e[i]=u[i],l[i]=u[o],e[o]=l,l.d=nC(l)}e.d=nC(e)}function nC(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}y(ny.prototype,((r={add:function(e){return nb(this,e),this},addKey:function(e){return n_(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return n_(t,e,e)}),this}})[z]=function(){return nw(this)},r));var nS={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new ny(e.MIN_KEY,e.MAX_KEY);return a(a({},e),{table:function(r){var i=e.table(r),o=i.schema,l=o.primaryKey,u=l.extractKey,s=l.outbound,f=a(a({},i),{mutate:function(e){var a=e.trans,l=a.mutatedParts||(a.mutatedParts={}),u=function(e){var n="idb://"+t+"/"+r+"/"+e;return l[n]||(l[n]=new ny)},s=u(""),c=u(":dels"),f=e.type,p="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=p[0],m=p[1],g=e.trans._cache;return i.mutate(e).then(function(e){if(d(h)){"delete"!==f&&(h=e.results),s.addKeys(h);var t=nh(h,g);t||"add"===f||c.addKeys(h),(t||m)&&function(e,t,n,r){t.indexes.forEach(function(t){var i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}var a=function(e){return t.multiEntry&&d(e)?e.forEach(function(e){return i.addKey(e)}):i.addKey(e)};(n||r).forEach(function(e,t){var i=n&&o(n[t]),l=r&&o(r[t]);0!==tD(i,l)&&(null!=i&&a(i),null!=l&&a(l))})})}(u,o,t,m)}else if(h){var r={from:h.lower,to:h.upper};c.add(r),s.add(r)}else s.add(n),c.add(n),o.indexes.forEach(function(e){return u(e.name).add(n)});return e})}}),p=function(t){var n,r,i=t.query,o=i.index,a=i.range;return[o,new ny(null!==(n=a.lower)&&void 0!==n?n:e.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:e.MAX_KEY)]},h={get:function(e){return[l,new ny(e.key)]},getMany:function(e){return[l,new ny().addKeys(e.keys)]},count:p,query:p,openCursor:p};return c(h).forEach(function(e){f[e]=function(o){var l=eB.subscr;if(l){var c=function(e){var n="idb://"+t+"/"+r+"/"+e;return l[n]||(l[n]=new ny)},d=c(""),f=c(":dels"),p=h[e](o),m=p[0],g=p[1];if(c(m.name||"").add(g),!m.isPrimaryKey){if("count"===e)f.add(n);else{var y="query"===e&&s&&o.values&&i.query(a(a({},o),{values:!1}));return i[e].apply(this,arguments).then(function(t){if("query"===e){if(s&&o.values)return y.then(function(e){var n=e.result;return d.addKeys(n),t});var n=o.values?t.result.map(u):t.result;o.values?d.addKeys(n):f.addKeys(n)}else if("openCursor"===e){var r=o.values;return t&&Object.create(t,{key:{get:function(){return f.addKey(t.primaryKey),t.key}},primaryKey:{get:function(){var e=t.primaryKey;return f.addKey(e),e}},value:{get:function(){return r&&d.addKey(t.primaryKey),t.value}}})}return t})}}}return i[e].apply(this,arguments)}}),f}})}},nk=function(){function e(t,n){var r,i,o,l,u,s=this;this._middlewares={},this.verno=0;var c=e.dependencies;this._options=n=a({addons:e.addons,autoOpen:!0,indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var d=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var f={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:eu,dbReadyPromise:null,cancelOpen:eu,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};f.dbReadyPromise=new ej(function(e){f.dbReadyResolve=e}),f.openCanceller=new ej(function(e,t){f.cancelOpen=t}),this._state=f,this.name=t,this.on=tS(this,"populate","blocked","versionchange","close",{ready:[em,eu]}),this.on.ready.subscribe=E(this.on.ready.subscribe,function(t){return function(n,r){e.vip(function(){var e=s._state;e.openComplete?(e.dbOpenError||ej.resolve().then(n),r&&t(n)):e.onReadyBeingFired?(e.onReadyBeingFired.push(n),r&&t(n)):(t(n),r||t(function e(){s.on.ready.unsubscribe(n),s.on.ready.unsubscribe(e)}))})}}),this.Collection=(r=this,tk(tP.prototype,function(e,t){this.db=r;var n=tw,i=null;if(t)try{n=t()}catch(e){i=e}var o=e._ctx,a=o.table,l=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:l!==es?l:null}})),this.Table=(i=this,tk(tC.prototype,function(e,t,n){this.db=i,this._tx=n,this.name=e,this.schema=t,this.hook=i._allTables[e]?i._allTables[e].hook:tS(null,{creating:[ef,eu],reading:[ec,es],updating:[ep,eu],deleting:[ev,eu]})})),this.Transaction=(o=this,tk(tJ.prototype,function(e,t,n,r,i){var a=this;this.db=o,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=tS(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ej(function(e,t){a._resolve=e,a._reject=t}),this._completion.then(function(){a.active=!1,a.on.complete.fire()},function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),tu(e)})})),this.Version=(l=this,tk(no.prototype,function(e){this.db=l,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(u=this,tk(tq.prototype,function(e,t,n){this.db=u,this._ctx={table:e,index:":id"===t?null:t,or:n};var r=u._deps.indexedDB;if(!r)throw new eo.MissingAPI;this._cmp=this._ascending=r.cmp.bind(r),this._descending=function(e,t){return r.cmp(t,e)},this._max=function(e,t){return r.cmp(e,t)>0?e:t},this._min=function(e,t){return 0>r.cmp(e,t)?e:t},this._IDBKeyRange=u._deps.IDBKeyRange})),this.on("versionchange",function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+s.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+s.name+"'. Closing db now to resume the delete request."),s.close()}),this.on("blocked",function(e){!e.newVersion||e.newVersion0x4000000000000000?0:t.oldVersion;u=y<1,e._novip.idbdb=s.result,d=y/10,f=l,p=e._dbSchema,(h=e._createTransaction("readwrite",e._storeNames,p)).create(f),h._completion.catch(i),m=h._reject.bind(h),g=eB.transless||eB,e4(function(){var t,n,r,i,o;eB.trans=h,eB.transless=g,0===d?(c(p).forEach(function(e){nt(f,e,p[e].primKey,p[e].indexes)}),t6(e,f),ej.follow(function(){return e.on.populate.fire(h)}).catch(m)):(t=e._novip,n=[],r=t._versions,i=t._dbSchema=nr(t,t.idbdb,f),o=!1,r.filter(function(e){return e._cfg.version>=d}).forEach(function(e){n.push(function(){var n=i,r=e._cfg.dbschema;ni(t,n,f),ni(t,r,f),i=t._dbSchema=r;var a=ne(n,r);a.add.forEach(function(e){nt(f,e[0],e[1].primKey,e[1].indexes)}),a.change.forEach(function(e){if(e.recreate)throw new eo.Upgrade("Not yet support for changing primary key");var t=f.objectStore(e.name);e.add.forEach(function(e){return nn(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),nn(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>d){t6(t,f),h._memoizedTables={},o=!0;var u,s=O(r);a.del.forEach(function(e){s[e]=n[e]}),t7(t,[t.Transaction.prototype]),t8(t,[t.Transaction.prototype],c(s),s),h.schema=s;var p=q(l);p&&e6();var m=ej.follow(function(){if((u=l(h))&&p){var e=e8.bind(null,null);u.then(e,e)}});return u&&"function"==typeof u.then?ej.resolve(u):m.then(function(){return u})}}),n.push(function(n){o&&th||function(e,t){[].slice.call(t.db.objectStoreNames).forEach(function(n){return null==e[n]&&t.db.deleteObjectStore(n)})}(e._cfg.dbschema,n),t7(t,[t.Transaction.prototype]),t8(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),h.schema=t._dbSchema})}),(function e(){return n.length?ej.resolve(n.shift()(h.idbtrans)).then(e):ej.resolve()})().then(function(){(function(e,t){c(e).forEach(function(n){t.db.objectStoreNames.contains(n)||nt(t,n,e[n].primKey,e[n].indexes)})})(i,f)})).catch(m)})}},i),s.onsuccess=eZ(function(){l=null;var r,i,o,d=e._novip.idbdb=s.result,f=k(d.objectStoreNames);if(f.length>0)try{var p,h,m,g=d.transaction(1===f.length?f[0]:f,"readonly");n.autoSchema?((p=e._novip).verno=d.version/10,h=p._dbSchema=nr(p,d,g),p._storeNames=k(d.objectStoreNames,0),t8(p,[p._allTables],c(h),h)):(ni(e,e._dbSchema,g),((m=ne(nr(e,e.idbdb,g),e._dbSchema)).add.length||m.change.some(function(e){return e.add.length||e.change.length}))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),t6(e,g)}catch(e){}tp.push(e),d.onversionchange=eZ(function(t){n.vcFired=!0,e.on("versionchange").fire(t)}),d.onclose=eZ(function(t){e.on("close").fire(t)}),u&&(i=(r=e._deps).indexedDB,o=r.IDBKeyRange,nl(i)||a===tg||na(i,o).put({name:a}).catch(eu)),t()},i)})})]).then(function(){return o(),n.onReadyBeingFired=[],ej.resolve(nu(function(){return e.on.ready.fire(e.vip)})).then(function t(){if(n.onReadyBeingFired.length>0){var r=n.onReadyBeingFired.reduce(em,eu);return n.onReadyBeingFired=[],ej.resolve(nu(function(){return r(e.vip)})).then(t)}})}).finally(function(){n.onReadyBeingFired=null,n.isBeingOpened=!1}).then(function(){return e}).catch(function(t){n.dbOpenError=t;try{l&&l.abort()}catch(e){}return i===n.openCanceller&&e._close(),tu(t)}).finally(function(){n.openComplete=!0,a()})}(this)},e.prototype._close=function(){var e=this._state,t=tp.indexOf(this);if(t>=0&&tp.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new ej(function(t){e.dbReadyResolve=t}),e.openCanceller=new ej(function(t,n){e.cancelOpen=n})},e.prototype.close=function(){this._close();var e=this._state;this._options.autoOpen=!1,e.dbOpenError=new eo.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)},e.prototype.delete=function(){var e=this,t=arguments.length>0,n=this._state;return new ej(function(r,i){var o=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=eZ(function(){var t,n,i,o;t=e._deps,n=e.name,i=t.indexedDB,o=t.IDBKeyRange,nl(i)||n===tg||na(i,o).delete(n).catch(eu),r()}),t.onerror=tW(i),t.onblocked=e._fireOnBlocked};if(t)throw new eo.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(o):o()})},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return c(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var e=nc.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r,i,o=this,a=eB.trans;a&&a.db===this&&-1===e.indexOf("!")||(a=null);var l=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(i=t.map(function(e){var t=e instanceof o.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||e===ty)r=ty;else if("rw"==e||e==t_)r=t_;else throw new eo.InvalidArgument("Invalid transaction mode: "+e);if(a){if(a.mode===ty&&r===t_){if(l)a=null;else throw new eo.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY")}a&&i.forEach(function(e){if(a&&-1===a.storeNames.indexOf(e)){if(l)a=null;else throw new eo.SubTransaction("Table "+e+" not included in parent transaction.")}}),l&&a&&!a.active&&(a=null)}}catch(e){return a?a._promise(null,function(t,n){n(e)}):tu(e)}var u=(function e(t,n,r,i,o){return ej.resolve().then(function(){var a,l=eB.transless||eB,u=t._createTransaction(n,r,t._dbSchema,i);if(i)u.idbtrans=i.idbtrans;else try{u.create(),t._state.PR1398_maxLoop=3}catch(i){if(i.name===ei.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0)return console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(function(){return e(t,n,r,null,o)});return tu(i)}var s=q(o);s&&e6();var c=ej.follow(function(){if(a=o.call(u,u)){if(s){var e=e8.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=ns(a))}},{trans:u,transless:l});return(a&&"function"==typeof a.then?ej.resolve(a).then(function(e){return u.active?e:tu(new eo.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):c.then(function(){return a})).then(function(e){return i&&u._resolve(),u._completion.then(function(){return e})}).catch(function(e){return u._reject(e),tu(e)})})}).bind(null,this,r,i,a,n);return a?a._promise(r,u,"lock"):eB.trans?tr(eB.transless,function(){return o._whenReady(u)}):this._whenReady(u)},e.prototype.table=function(e){if(!g(this._allTables,e))throw new eo.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),nE="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",nV=function(){function e(e){this._subscribe=e}return e.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},e.prototype[nE]=function(){return this},e}();function nN(e,t){return c(t).forEach(function(n){nb(e[n]||(e[n]=new ny),t[n])}),e}function nT(e){var t=!1,n=void 0,r=new nV(function(r){var i=q(e),o=!1,a={},l={},u={get closed(){return o},unsubscribe:function(){o=!0,t$.storagemutated.unsubscribe(p)}};r.start&&r.start(u);var s=!1,d=!1;function f(){return c(l).some(function(e){return a[e]&&function(e,t){var n=nw(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=nw(e),a=o.next(i.from),l=a.value;!r.done&&!a.done;){if(0>=tD(l.from,i.to)&&tD(l.to,i.from)>=0)return!0;0>tD(i.from,l.from)?i=(r=n.next(l.from)).value:l=(a=o.next(i.from)).value}return!1}(a[e],l[e])})}var p=function(e){nN(a,e),f()&&h()},h=function(){if(!s&&!o){a={};var c,m,g={},y=(i&&e6(),c=function(){return e4(e,{subscr:g,trans:null})},m=eB.trans?tr(eB.transless,c):c(),i&&m.then(e8,e8),m);d||(t$(tX,p),d=!0),s=!0,Promise.resolve(y).then(function(e){t=!0,n=e,s=!1,!o&&(f()?h():(a={},l=g,r.next&&r.next(e)))},function(e){s=!1,t=!1,r.error&&r.error(e),u.unsubscribe()})}};return h(),u});return r.hasValue=function(){return t},r.getValue=function(){return n},r}try{i={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch(e){i={indexedDB:null,IDBKeyRange:null}}function nA(e){var t=nR;try{nR=!0,t$.storagemutated.fire(e)}finally{nR=t}}y(nk,a(a({},el),{delete:function(e){return new nk(e,{addons:[]}).delete()},exists:function(e){return new nk(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{var t,n,r;return(n=(t=nk.dependencies).indexedDB,r=t.IDBKeyRange,nl(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==tg})}):na(n,r).toCollection().primaryKeys()).then(e)}catch(e){return tu(new eo.MissingAPI)}},defineClass:function(){return function(e){p(this,e)}},ignoreTransaction:function(e){return eB.trans?tr(eB.transless,e):e()},vip:nu,async:function(e){return function(){try{var t=ns(e.apply(this,arguments));if(!t||"function"!=typeof t.then)return ej.resolve(t);return t}catch(e){return tu(e)}}},spawn:function(e,t,n){try{var r=ns(e.apply(n,t||[]));if(!r||"function"!=typeof r.then)return ej.resolve(r);return r}catch(e){return tu(e)}},currentTransaction:{get:function(){return eB.trans||null}},waitFor:function(e,t){var n=ej.resolve("function"==typeof e?nk.ignoreTransaction(e):e).timeout(t||6e4);return eB.trans?eB.trans.waitFor(n):n},Promise:ej,debug:{get:function(){return W},set:function(e){W=e,K="dexie"===e?function(){return!0}:tm}},derive:w,extend:p,props:y,override:E,Events:tS,on:t$,liveQuery:nT,extendObservabilitySet:nN,getByKeyPath:A,setByKeyPath:R,delByKeyPath:function(e,t){"string"==typeof t?R(e,t,void 0):"length"in t&&[].map.call(t,function(t){R(e,t,void 0)})},shallowClone:O,deepClone:L,getObjectDiff:nv,cmp:tD,asap:N,minKey:td,addons:[],connections:tp,errnames:ei,dependencies:i,semVer:ts,version:ts.split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),nk.maxKey=t1(nk.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(t$(tX,function(e){if(!nR){var t;th?(t=document.createEvent("CustomEvent")).initCustomEvent(tG,!0,!0,e):t=new CustomEvent(tG,{detail:e}),nR=!0,dispatchEvent(t),nR=!1}}),addEventListener(tG,function(e){var t=e.detail;nR||nA(t)}));var nR=!1;if("undefined"!=typeof BroadcastChannel){var nO=new BroadcastChannel(tG);"function"==typeof nO.unref&&nO.unref(),t$(tX,function(e){nR||nO.postMessage(e)}),nO.onmessage=function(e){e.data&&nA(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){t$(tX,function(e){try{nR||("undefined"!=typeof localStorage&&localStorage.setItem(tG,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&u([],self.clients.matchAll({includeUncontrolled:!0}),!0).forEach(function(t){return t.postMessage({type:tG,changedParts:e})}))}catch(e){}}),"undefined"!=typeof addEventListener&&addEventListener("storage",function(e){if(e.key===tG){var t=JSON.parse(e.newValue);t&&nA(t.changedParts)}});var nD=self.document&&navigator.serviceWorker;nD&&nD.addEventListener("message",function(e){var t=e.data;t&&t.type===tG&&nA(t.changedParts)})}ej.rejectionMapper=function(e,t){if(!e||e instanceof ee||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ea[e.name])return e;var n=new ea[e.name](t||e.message,e);return"stack"in e&&b(n,"stack",{get:function(){return this.inner.stack}}),n},K=tm}),f.register("9BzA6",function(e,n){t(e.exports,"copyToClipboard",function(){return s}),t(e.exports,"parseClassroom",function(){return c}),t(e.exports,"parse",function(){return d}),t(e.exports,"stringify",function(){return p}),t(e.exports,"scrapeModule",function(){return h}),t(e.exports,"validateUrl",function(){return g}),t(e.exports,"infoHash",function(){return y}),t(e.exports,"getPeerID",function(){return b}),t(e.exports,"getShortPeerID",function(){return w}),t(e.exports,"clone",function(){return x}),t(e.exports,"removeKeysStartingWithSecret",function(){return function e(t){for(var n in t)"object"==typeof t[n]&&(// Recursively call the function if the value is an object or an array +e(t[n]),"{}"===JSON.stringify(t[n])&&delete t[n]),n.toLocaleLowerCase().startsWith("secret")&&delete t[n]}}),t(e.exports,"deepEqual",function(){return function e(t,n){var r=Object.keys(t),i=Object.keys(n);if(r.length!==i.length)return!1;var o=!0,a=!1,l=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,d=t[c],f=n[c],p=C(d)&&C(f);if(p&&!e(d,f)||!p&&d!==f)return!1}}catch(e){a=!0,l=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw l}}return!0}});var r=f("xJRWs"),i=f("a42Vg"),o=f("9zFRg"),a=f("3XT9C"),l=f("i1Uxe");function u(e,t,n){if(t.match(/(https?)?:\/\//i))return"script"===e?''):'');var r=new URL(t,n).toString();return'\n ')}function s(e){navigator.clipboard.writeText(e)}function c(e){var t;console.warn("parse Classroom",e);try{if(t=d(e))for(var n=0;n').concat(s.style||"","\n \n \n \n ").concat(s.body||"","\n \n \n "),[2,(0,o._)((0,i._)({},e),{name:s.name,description:s.description,icon:s.icon||"mdi-package",shownIn:s["show-in"]||["*"],srcdoc:"data:text/html,"+escape(f),origin:"*"})]}catch(e){throw console.warn("loading yaml:",e),Error("Could not load the YAML-declaration: "+e.message)}else{if((p=document.createElement("html")).innerHTML=t,(h=Object.fromEntries(Object.values(p.getElementsByTagName("meta")).map(function(e){return[e.name,e.content]}))).fetch&&"false"!==h.fetch)return[2,(0,o._)((0,i._)({},e),{name:p.getElementsByTagName("title")[0].innerText||h.name,description:h.description,icon:h.icon||"mdi-package",shownIn:(h["show-in"]||"*").replace(/\s+/g,"").split(","),srcdoc:"data:text/html,"+escape(function(e,t){try{var n=e.match(RegExp(".*?<\\/head>","is"))[0];return n=(n=n.replace(RegExp(".*?<\\/script>","gims"),function(e){var n=e.match(RegExp("src=(?:'|\")([^\"']+)(?:'|\")","is"));return n&&!((n=n[1]).startsWith("https://")||n.startsWith("http://"))?u("script",n,t):e})).replace(RegExp("","gims"),function(e){var n=e.match(RegExp("href=(?:'|\")([^\"']+)(?:'|\")","is"));return n&&!((n=n[1]).startsWith("https://")||n.startsWith("http://"))?u("css",n,t):e}),e.replace(RegExp(".*?<\\/head>","is"),n)}catch(e){console.warn("problems parsing html:",e)}}(t,e.url)),origin:"*"})];try{return[2,(0,o._)((0,i._)({},e),{name:p.getElementsByTagName("title")[0].innerText||h.name,description:h.description,icon:h.icon||"mdi-package",shownIn:(h["show-in"]||"*").replace(/\s+/g,"").split(",")})]}catch(e){throw Error("This does not seem to be a valid module declaration, check the URL manually.")}}return[3,4];case 3:return m=a.sent(),[2,(0,o._)((0,i._)({},e),{name:"",description:m,icon:"mdi-alert",shownIn:""})];case 4:return[2]}})})).apply(this,arguments)}function g(e){try{var t=new URL(e);if(["http:","https:","file:","ipfs:","ipns:","blob:","dat:","hyper:"].includes(t.protocol))return!0}catch(e){}return!1}function y(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r0)||void 0===arguments[0]||arguments[0],t=localStorage.getItem("peerID");return t||(t=y(12),localStorage.setItem("peerID",t)),_||(_=y(6)),e?t+"_"+_:t}function w(e){var t=e.split("_");return(// peerID_sessionID +2==t.length?t[0].slice(6):e)}function x(e){if(void 0!==e)return JSON.parse(JSON.stringify(e))}function C(e){return null!=e&&"object"==typeof e}}),f.register("a42Vg",function(e,n){t(e.exports,"_",function(){return i});var r=f("h8xva");function i(e){for(var t=1;tl&&(t=r-l+(o=" ... ").length),n-r>l&&(n=r+l-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:r-t+o.length// relative position @@ -285,7 +286,7 @@ function(e){for(var t,n="",r=0,o=0;o=65536?o+=2:o++)!(t=eb[r=eA(e,o) // // Also need to encode '!' because it has special meaning (end of tag prefix). // -f=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),f="!"===e.tag[0]?"!"+f:"tag:yaml.org,2002:"===f.slice(0,18)?"!!"+f.slice(18):"!<"+f+">",e.dump=f+" "+e.dump)}return!0}function eL(e,t){return function(){throw Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var ej=eg.load;eg.loadAll;var eF=function(e,t){t=t||{};var n=new eC(t);n.noRefs||function(e,t){var n,r,i=[],o=[];for(function e(t,n,r){var i,o,a;if(null!==t&&"object"==typeof t){if(-1!==(o=n.indexOf(t)))-1===r.indexOf(o)&&r.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;o",e.dump=f+" "+e.dump)}return!0}function eL(e,t){return function(){throw Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var ej=eg.load;eg.loadAll;var eF=function(e,t){t=t||{};var n=new eC(t);n.noRefs||function(e,t){var n,r,i=[],o=[];for(function e(t,n,r){var i,o,a;if(null!==t&&"object"==typeof t){if(-1!==(o=n.indexOf(t)))-1===r.indexOf(o)&&r.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;o { self.communication = new Comm2( this.id, @@ -302,7 +303,7 @@ f=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),f="!"===e.t self.componentKey++; }, Math.random() * 1000 + 1000); - */}).apply(this)},saveClass:function(e){this.$refs.Settings.close=!0,this.configuration.data=(0,s.clone)(e),this.data=(0,s.clone)(e),this.database.update((0,s.clone)(this.configuration)),this.scrapeModules()},usersInRoom:function(e){var t=[];for(var n in this.liveClassProxy.users)if(this.liveClassProxy.users[n].room===e){var r=this.liveClassProxy.users[n].displayName;t.push([r.startsWith("Station ")?r:r.slice(6),this.peerID===n?"black":"grey"])}return t},gotoRoom:function(e){var t;null===(t=this.communication)||void 0===t||t.gotoRoom(e)},addRoom:function(){var e;null===(e=this.communication)||void 0===e||e.addRoom()},deleteClass:function(){this.database.drop(this.configuration.id),window.location.search=""},updateClass:function(e){this.data=(0,s.clone)(e.data)}},components:{Settings:o.default,Modules:a.default}}}),f.register("f5dpm",function(e,n){t(e.exports,"default",function(){return i}),(r=f("8esOQ")).__esModule&&(r=r.default),r.render=f("gQjAn").render,f("4jdFA").default(r),r.__scopeId="data-v-2a4b91",r.__file="Settings.vue";var r,i=r}),f.register("8esOQ",function(e,n){u(e.exports),t(e.exports,"default",function(){return s});var r=f("8Aud4"),i=f("3RwXY"),o=f("79hdG"),a=f("aj2m5"),l=f("54yBi"),s={name:"Settings",props:{config:{type:Object,required:!0},scrapedModules:{type:Object,required:!0}},emits:["close","saveClass","deleteClass","updateClass"],data:function(){return{tab:0,configClone:JSON.parse(JSON.stringify(this.config)),configChanged:!1}},methods:{updateModules:function(){console.warn("updateModules",this.scrapedModules)},saveClass:function(){this.$emit("saveClass",this.config),this.configClone=JSON.parse(JSON.stringify(this.config)),this.configChanged=!1},deleteClass:function(){this.$emit("deleteClass")},updateClass:function(){this.$emit("updateClass",this.config)},updateMembers:function(e){this.config.members=e}},watch:{config:{handler:function(){JSON.stringify(this.config)!==JSON.stringify(this.configClone)?this.configChanged=!0:this.configChanged=!1},deep:!0}},components:{Main:r.default,Members:i.default,Modules:o.default,Stations:a.default,Share:l.default}}}),f.register("8Aud4",function(e,n){t(e.exports,"default",function(){return i}),(r=f("5hBFb")).__esModule&&(r=r.default),r.render=f("51n5s").render,f("krOPZ").default(r),r.__scopeId="data-v-36e2dd",r.__file="Main.vue";var r,i=r}),f.register("5hBFb",function(e,n){u(e.exports),t(e.exports,"default",function(){return r});var r={name:"Settings-Main",props:{config:{type:Object,required:!0}},data:function(){return{}}}}),f.register("51n5s",function(e,n){t(e.exports,"render",function(){return i}),f("7DTtY");var r=f("5BxzC");function i(e,t,n,i,o,a){var l=(0,r.resolveComponent)("v-text-field"),u=(0,r.resolveComponent)("v-textarea"),s=(0,r.resolveComponent)("v-checkbox");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(l,{modelValue:n.config.name,"onUpdate:modelValue":t[0]||(t[0]=function(e){return n.config.name=e}),counter:20,label:"Class Name",outlined:"",required:""},null,8,["modelValue"]),(0,r.createVNode)(l,{modelValue:n.config.meta.logo,"onUpdate:modelValue":t[1]||(t[1]=function(e){return n.config.meta.logo=e}),label:"Logo URL",outlined:"",required:""},null,8,["modelValue"]),(0,r.createVNode)(u,{modelValue:n.config.meta.description,"onUpdate:modelValue":t[2]||(t[2]=function(e){return n.config.meta.description=e}),filled:"",label:"Description","auto-grow":""},null,8,["modelValue"]),(0,r.createVNode)(l,{modelValue:n.config.meta.defaultNumberOfRooms,"onUpdate:modelValue":t[3]||(t[3]=function(e){return n.config.meta.defaultNumberOfRooms=e}),label:"Default number of rooms (optional)",type:"number",outlined:""},null,8,["modelValue"]),(0,r.createVNode)(s,{modelValue:n.config.meta.selfAssign,"onUpdate:modelValue":t[4]||(t[4]=function(e){return n.config.meta.selfAssign=e}),label:"Enable self-assignment",outlined:""},null,8,["modelValue"])],64)}}),f.register("krOPZ",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("3RwXY",function(e,n){t(e.exports,"default",function(){return i}),(r=f("9lzoE")).__esModule&&(r=r.default),r.render=f("7iCgJ").render,f("1w6IK").default(r),r.__scopeId="data-v-e3fc8a",r.__file="Members.vue";var r,i=r}),f.register("9lzoE",function(e,n){u(e.exports),t(e.exports,"default",function(){return i});var r=f("9BzA6"),i={name:"Settings-Members",emits:["updateMembers"],props:{members:{type:Object,required:!0}},data:function(){var e=this.members.teacher.join(", ");return{url:window.location.toString(),teacher:e}},methods:{copyUrl:function(){(0,r.copyToClipboard)(this.url)}},watch:{teacher:function(){this.$emit("updateMembers",{teacher:this.teacher.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0}),student:this.members.student})}}}}),f.register("7iCgJ",function(e,n){t(e.exports,"render",function(){return a}),f("7DTtY");var r=f("5BxzC"),i=f("9Nw75"),o=["href"];function a(e,t,n,a,l,u){var s=(0,r.resolveComponent)("v-container"),c=(0,r.resolveComponent)("v-btn"),d=(0,r.resolveComponent)("v-alert"),f=(0,r.resolveComponent)("v-divider"),p=(0,r.resolveComponent)("v-textarea");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(d,{outlined:"",dense:"",type:"info",text:"Invite your users in by sharing this link: "},{append:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,{icon:"mdi-content-copy",onClick:u.copyUrl,variant:"text"},null,8,["onClick"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createElementVNode)("a",{href:l.url},(0,i.toDisplayString)(l.url),9,o)]}),_:1})]}),_:1}),(0,r.createVNode)(f),(0,r.createVNode)(p,{label:"List of teacher ids","auto-grow":"",variant:"outlined",rows:"3","row-height":"25",shaped:"",style:{"margin-top":"2rem"},modelValue:l.teacher,"onUpdate:modelValue":t[0]||(t[0]=function(e){return l.teacher=e})},null,8,["modelValue"])],64)}}),f.register("1w6IK",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("79hdG",function(e,n){t(e.exports,"default",function(){return i}),(r=f("caBYS")).__esModule&&(r=r.default),r.render=f("b2vdk").render,f("3XaP9").default(r),r.__scopeId="data-v-08025a",r.__file="Modules.vue";var r,i=r}),f.register("caBYS",function(e,n){u(e.exports),t(e.exports,"default",function(){return l});var r=f("xJRWs"),i=f("3XT9C"),o=f("9BzA6"),a=f("d80n2"),l={name:"Settings-Modules",props:{config:{type:Object,required:!0},scrapedModules:{type:Object,required:!0}},data:function(){for(var e=[],t=0;t0}),student:this.members.student})}}}}),f.register("7iCgJ",function(e,n){t(e.exports,"render",function(){return a}),f("7DTtY");var r=f("5BxzC"),i=f("9Nw75"),o=["href"];function a(e,t,n,a,l,u){var s=(0,r.resolveComponent)("v-container"),c=(0,r.resolveComponent)("v-btn"),d=(0,r.resolveComponent)("v-alert"),f=(0,r.resolveComponent)("v-divider"),p=(0,r.resolveComponent)("v-textarea");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(d,{outlined:"",dense:"",type:"info",text:"Invite your users in by sharing this link: "},{append:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,{icon:"mdi-content-copy",onClick:u.copyUrl,variant:"text"},null,8,["onClick"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createElementVNode)("a",{href:l.url},(0,i.toDisplayString)(l.url),9,o)]}),_:1})]}),_:1}),(0,r.createVNode)(f),(0,r.createVNode)(p,{label:"List of teacher ids","auto-grow":"",variant:"outlined",rows:"3","row-height":"25",shaped:"",style:{"margin-top":"2rem"},modelValue:l.teacher,"onUpdate:modelValue":t[0]||(t[0]=function(e){return l.teacher=e})},null,8,["modelValue"])],64)}}),f.register("1w6IK",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("79hdG",function(e,n){t(e.exports,"default",function(){return i}),(r=f("caBYS")).__esModule&&(r=r.default),r.render=f("b2vdk").render,f("3XaP9").default(r),r.__scopeId="data-v-08025a",r.__file="Modules.vue";var r,i=r}),f.register("caBYS",function(e,n){u(e.exports),t(e.exports,"default",function(){return l});var r=f("xJRWs"),i=f("3XT9C"),o=f("9BzA6"),a=f("d80n2"),l={name:"Settings-Modules",props:{config:{type:Object,required:!0},scrapedModules:{type:Object,required:!0}},data:function(){for(var e=[],t=0;t|(?:[a-zA-Z\d-]*! * @param {string} value * @param {string} [flags] * @returns {RegExp} - */function a(e,t){return t=(t||"").replace(/m/g,"")+"m",RegExp(/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return r}).replace(/<>/g,function(){return e}),t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return r}).replace(/<>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:a(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:a(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:a(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:a(o),lookbehind:!0,greedy:!0},number:{pattern:a(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)}),f.register("8ussG",function(e,n){t(e.exports,"render",function(){return o}),f("7DTtY");var r=f("5BxzC"),i=f("9Nw75");function o(e,t,n,o,a,l){var u=(0,r.resolveComponent)("v-icon"),s=(0,r.resolveComponent)("v-expansion-panel-title"),c=(0,r.resolveComponent)("v-divider"),d=(0,r.resolveComponent)("prism-editor"),f=(0,r.resolveComponent)("v-expansion-panel-text"),p=(0,r.resolveComponent)("v-expansion-panel");return(0,r.openBlock)(),(0,r.createBlock)(p,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{actions:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{style:(0,i.normalizeStyle)(a.errorMessage?"color: red;":"")},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)((0,i.toDisplayString)(n.icon),1)]}),_:1},8,["style"])]}),default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)((0,i.toDisplayString)(n.title)+" ",1)]}),_:1}),(0,r.createVNode)(f,{style:{"max-height":"60vh"}},{default:(0,r.withCtx)(function(){return[(0,r.createElementVNode)("div",{style:(0,i.normalizeStyle)([{"font-size":"small","margin-bottom":"0.25rem"},a.errorMessage?"color: red;":"color: gray;"])},(0,i.toDisplayString)(a.errorMessage||"Valid YAML or JSON configuration"),5),(0,r.createVNode)(c,{style:{"margin-bottom":"0.5rem"}}),(0,r.createVNode)(d,{modelValue:a.code,"onUpdate:modelValue":t[0]||(t[0]=function(e){return a.code=e}),highlight:l.highlighter,"line-numbers":""},null,8,["modelValue","highlight"])]}),_:1})]}),_:1})}}),f.register("6INDR",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("atDkO",function(e,n){t(e.exports,"render",function(){return a}),f("7DTtY");var r=f("5BxzC"),i=/*#__PURE__*/(0,r.createElementVNode)("p",null,"Width",-1),o=/*#__PURE__*/(0,r.createElementVNode)("p",null,"Height",-1);function a(e,t,n,a,l,u){var s=(0,r.resolveComponent)("v-icon"),c=(0,r.resolveComponent)("v-expansion-panel-title"),d=(0,r.resolveComponent)("v-text-field"),f=(0,r.resolveComponent)("v-expansion-panel-text"),p=(0,r.resolveComponent)("v-expansion-panel"),h=(0,r.resolveComponent)("v-radio"),m=(0,r.resolveComponent)("v-radio-group"),g=(0,r.resolveComponent)("v-container"),y=(0,r.resolveComponent)("v-col"),_=(0,r.resolveComponent)("v-row"),b=(0,r.resolveComponent)("Editor"),w=(0,r.resolveComponent)("v-expansion-panels");return(0,r.openBlock)(),(0,r.createBlock)(w,{variant:"accordion",style:{"min-width":"400px"}},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(p,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{actions:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-link ")]}),_:1})]}),default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" URL ")]}),_:1}),(0,r.createVNode)(f,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(d,{variant:"underlined",label:"Module URL",modelValue:n.module.url,"onUpdate:modelValue":t[0]||(t[0]=function(e){return n.module.url=e})},null,8,["modelValue"])]}),_:1})]}),_:1}),(0,r.createVNode)(p,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{actions:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-pencil-ruler ")]}),_:1})]}),default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Design ")]}),_:1}),(0,r.createVNode)(f,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(_,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(y,{cols:"6"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(g,{fluid:""},{default:(0,r.withCtx)(function(){return[i,(0,r.createVNode)(m,{modelValue:n.module.width,"onUpdate:modelValue":t[1]||(t[1]=function(e){return n.module.width=e})},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(h,{label:"Full (1000px)",value:"full"}),(0,r.createVNode)(h,{label:"Half (500px)",value:"half"}),(0,r.createVNode)(h,{label:"Quarter (250px)",value:"third"})]}),_:1},8,["modelValue"])]}),_:1})]}),_:1}),(0,r.createVNode)(y,{cols:"6"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(g,{fluid:""},{default:(0,r.withCtx)(function(){return[o,(0,r.createVNode)(m,{modelValue:n.module.height,"onUpdate:modelValue":t[2]||(t[2]=function(e){return n.module.height=e})},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(h,{label:"HUGE (830px)",value:"huge"}),(0,r.createVNode)(h,{label:"Tall (720x)",value:"tall"}),(0,r.createVNode)(h,{label:"Medium (410px)",value:"medium"}),(0,r.createVNode)(h,{label:"Short (200px)",value:"short"})]}),_:1},8,["modelValue"])]}),_:1})]}),_:1})]}),_:1})]}),_:1})]}),_:1}),(0,r.createVNode)(b,{title:"General settings",icon:"mdi-script-text",config:n.module.config,"onUpdate:config":t[3]||(t[3]=function(e){return n.module.config=e}),error:n.error.config,"onUpdate:error":t[4]||(t[4]=function(e){return n.error.config=e})},null,8,["config","error"]),(0,r.createVNode)(b,{title:"Student settings",icon:"mdi-account-circle-outline",config:n.module.studentConfig,"onUpdate:config":t[5]||(t[5]=function(e){return n.module.studentConfig=e}),error:n.error.studentConfig,"onUpdate:error":t[6]||(t[6]=function(e){return n.error.studentConfig=e})},null,8,["config","error"]),(0,r.createVNode)(b,{title:"Teacher settings",icon:"mdi-clipboard-account-outline",config:n.module.teacherConfig,"onUpdate:config":t[7]||(t[7]=function(e){return n.module.teacherConfig=e}),error:n.error.teacherConfig,"onUpdate:error":t[8]||(t[8]=function(e){return n.error.teacherConfig=e})},null,8,["config","error"]),(0,r.createVNode)(b,{title:"Station settings",icon:"mdi-router-wireless",config:n.module.stationConfig,"onUpdate:config":t[9]||(t[9]=function(e){return n.module.stationConfig=e}),error:n.error.stationConfig,"onUpdate:error":t[10]||(t[10]=function(e){return n.error.stationConfig=e})},null,8,["config","error"]),(0,r.createVNode)(p,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{actions:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-eye ")]}),_:1})]}),default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Show in ")]}),_:1}),(0,r.createVNode)(f,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(d,{variant:"underlined",label:"Comma separated list of rooms, or: lobby, * for all, teacher-only, station",modelValue:n.module.showInCustom,"onUpdate:modelValue":t[11]||(t[11]=function(e){return n.module.showInCustom=e})},null,8,["modelValue"])]}),_:1})]}),_:1})]}),_:1})}}),f.register("czxFg",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("b2vdk",function(e,n){t(e.exports,"render",function(){return o}),f("7DTtY");var r=f("5BxzC"),i=f("9Nw75");function o(e,t,n,o,a,l){var u=(0,r.resolveComponent)("v-icon"),s=(0,r.resolveComponent)("v-chip"),c=(0,r.resolveComponent)("v-list-item-title"),d=(0,r.resolveComponent)("v-list-item-subtitle"),f=(0,r.resolveComponent)("v-btn"),p=(0,r.resolveComponent)("Module"),h=(0,r.resolveComponent)("v-menu"),m=(0,r.resolveComponent)("v-list-item"),g=(0,r.resolveComponent)("v-list"),y=(0,r.resolveComponent)("draggable"),_=(0,r.resolveComponent)("v-text-field"),b=(0,r.resolveComponent)("v-divider");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(g,{lines:"three"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(y,{list:n.config.modules,"item-key":"id",onEnd:l.move,class:"list-group"},{item:(0,r.withCtx)(function(e){var t=e.element,o=e.index;return[((0,r.openBlock)(),(0,r.createBlock)(m,{key:o,class:"list-group-item"},{prepend:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{icon:n.scrapedModules[o].icon||"mdi-package"},null,8,["icon"])]}),append:(0,r.withCtx)(function(){return[(0,r.createVNode)(h,{"close-on-content-click":!1},{activator:(0,r.withCtx)(function(e){var t=e.props;return[(0,r.createVNode)(f,(0,r.mergeProps)({icon:"mdi-cog",variant:"text"},t,{style:l.validate_config(o)?"":"color: red"}),null,16,["style"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(p,{module:n.config.modules[o],"onUpdate:module":function(e){return n.config.modules[o]=e},error:a.errors[o],"onUpdate:error":function(e){return a.errors[o]=e}},null,8,["module","onUpdate:module","error","onUpdate:error"])]}),_:2},1024),(0,r.createVNode)(h,null,{activator:(0,r.withCtx)(function(e){var t=e.props;return[(0,r.createVNode)(f,(0,r.mergeProps)(t,{icon:"mdi-delete",variant:"text"}),null,16)]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(g,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(m,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Delete the module and its configuration? ")]}),_:1}),(0,r.createVNode)(f,{color:"red",depressed:"",onClick:function(e){return l.deleteModule(o)},class:"float-right",style:{"margin-top":"10px"}},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Yes ")]}),_:2},1032,["onClick"])]}),_:2},1024)]}),_:2},1024)]}),_:2},1024)]}),default:(0,r.withCtx)(function(){var e;return[(0,r.createVNode)(c,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)((0,i.toDisplayString)(n.scrapedModules[o].name)+" ",1),(0,r.createVNode)(s,{size:"x-small"},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)((0,i.toDisplayString)(t.showInCustom||"*"),1)]}),_:2},1024)]}),_:2},1024),(0,r.createVNode)(d,{innerHTML:(null===(e=n.scrapedModules[o])||void 0===e?void 0:e.description)||"No description",style:{"white-space":"break-spaces"}},null,8,["innerHTML"])]}),_:2},1024))]}),_:1},8,["list","onEnd"]),(0,r.createVNode)(m,null,{prepend:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{icon:"mdi-link"})]}),append:(0,r.withCtx)(function(){return[(0,r.createVNode)(f,{onClick:l.loadURL,disabled:!l.validate_url(a.moduleImportUrl)},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-view-grid-plus ")]}),_:1}),(0,r.createTextVNode)(" Add ")]}),_:1},8,["onClick","disabled"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(_,{modelValue:a.moduleImportUrl,"onUpdate:modelValue":t[0]||(t[0]=function(e){return a.moduleImportUrl=e}),label:"Module URL",variant:"underlined",required:"",style:{width:"calc(100% - 40px)"}},null,8,["modelValue"])]}),_:1})]}),_:1}),(0,r.createVNode)(b,{class:"pb-2"}),(0,r.createVNode)(f,{href:"https://github.com/topics/edrys-module",target:"_blank"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-github ")]}),_:1}),(0,r.createTextVNode)(" Explore on GitHub ")]}),_:1})],64)}}),f.register("3XaP9",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("aj2m5",function(e,n){t(e.exports,"default",function(){return i}),(r=f("ge8Ut")).__esModule&&(r=r.default),r.render=f("ch5tX").render,f("3nSv6").default(r),r.__scopeId="data-v-af4199",r.__file="Stations.vue";var r,i=r}),f.register("ge8Ut",function(e,n){u(e.exports),t(e.exports,"default",function(){return i});var r=f("9BzA6"),i={name:"Settings-Stations",props:{config:{type:Object,required:!0}},data:function(){return{url:window.location.toString().replace("classroom","station")}},methods:{copyUrl:function(){(0,r.copyToClipboard)(this.url)}}}}),f.register("ch5tX",function(e,n){t(e.exports,"render",function(){return a}),f("7DTtY");var r=f("5BxzC"),i=f("9Nw75"),o=["href"];function a(e,t,n,a,l,u){var s=(0,r.resolveComponent)("v-container"),c=(0,r.resolveComponent)("v-btn"),d=(0,r.resolveComponent)("v-alert");return(0,r.openBlock)(),(0,r.createBlock)(d,{outlined:"",dense:"",type:"info",text:"To add a new station, simply open this link on the client device: "},{append:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,{icon:"mdi-content-copy",onClick:u.copyUrl,variant:"text"},null,8,["onClick"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createElementVNode)("a",{href:l.url,target:"_blank"},(0,i.toDisplayString)(l.url),9,o)]}),_:1})]}),_:1})}}),f.register("3nSv6",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("54yBi",function(e,n){t(e.exports,"default",function(){return i}),(r=f("bmM2m")).__esModule&&(r=r.default),r.render=f("bS67F").render,f("3CRKo").default(r),r.__scopeId="data-v-8b8f43",r.__file="Share.vue";var r,i=r}),f.register("bmM2m",function(e,n){u(e.exports),t(e.exports,"default",function(){return l});var r=f("xJRWs"),i=f("3XT9C"),o=f("i1Uxe"),a=f("9BzA6"),l={name:"Settings-Share",props:{config:{type:Object,required:!0}},data:function(){return console.log("Classroom config",JSON.stringify(this.config,null,2)),{url:window.location.toString(),selectedURL:"",selectedFile:[],showTemplate:!1,restoreSuccess:!1,saveError:!1,errorMessage:"",restoreFileRules:[function(e){return!e||e.size<2e6||"File should be less than 2 MB!"}]}},methods:{updateConfig:function(e){e.meta||(e.meta={logo:"",description:"",selfAssign:!1,defaultNumberOfRooms:0}),this.config.name=e.name,this.config.meta=e.meta,this.config.createdBy=(0,a.getPeerID)(),this.config.dateCreated=e.dateCreated,this.config.members=e.members,this.config.modules=e.modules},updateModules:function(){console.warn("updateModules",this.scrapedModules)},downloadClass:function(e){var t="yaml"===e?o.dump(this.config):JSON.stringify(this.config,null,2),n="class-"+this.config.id+("yaml"===e?".yml":".json"),r=new Blob([t],{type:"text/"+e}),i=URL.createObjectURL(r),a=document.createElement("a");a.href=i,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},restoreURL:function(){return(0,r._)(function(){var e,t,n;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return this.restoreSuccess=!1,this.saveError=!1,[4,fetch(this.selectedURL)];case 1:if(!(e=r.sent()).ok)return[3,3];return[4,e.text()];case 2:if(t=r.sent(),n=(0,a.parseClassroom)(t))return this.updateConfig(n),this.restoreSuccess=!0,[2];r.label=3;case 3:return this.saveError=!0,this.errorMessage="Could not parse the content within the URL: ".concat(this.selectedURL),console.warn("Could not parse the content within the URL:",this.selectedURL),[2]}})}).apply(this)},restoreFile:function(){var e=this;this.restoreSuccess=!1,this.saveError=!1;var t=new FileReader;t.readAsText(this.selectedFile[0]),t.onload=function(n){// will load yaml and json as well + */function a(e,t){return t=(t||"").replace(/m/g,"")+"m",RegExp(/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return r}).replace(/<>/g,function(){return e}),t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return r}).replace(/<>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:a(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:a(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:a(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:a(o),lookbehind:!0,greedy:!0},number:{pattern:a(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)}),f.register("8ussG",function(e,n){t(e.exports,"render",function(){return o}),f("7DTtY");var r=f("5BxzC"),i=f("9Nw75");function o(e,t,n,o,a,l){var u=(0,r.resolveComponent)("v-icon"),s=(0,r.resolveComponent)("v-expansion-panel-title"),c=(0,r.resolveComponent)("v-divider"),d=(0,r.resolveComponent)("prism-editor"),f=(0,r.resolveComponent)("v-expansion-panel-text"),p=(0,r.resolveComponent)("v-expansion-panel");return(0,r.openBlock)(),(0,r.createBlock)(p,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{actions:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{style:(0,i.normalizeStyle)(a.errorMessage?"color: red;":"")},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)((0,i.toDisplayString)(n.icon),1)]}),_:1},8,["style"])]}),default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)((0,i.toDisplayString)(n.title)+" ",1)]}),_:1}),(0,r.createVNode)(f,{style:{"max-height":"60vh"}},{default:(0,r.withCtx)(function(){return[(0,r.createElementVNode)("div",{style:(0,i.normalizeStyle)([{"font-size":"small","margin-bottom":"0.25rem"},a.errorMessage?"color: red;":"color: gray;"])},(0,i.toDisplayString)(a.errorMessage||"Valid YAML or JSON configuration"),5),(0,r.createVNode)(c,{style:{"margin-bottom":"0.5rem"}}),(0,r.createVNode)(d,{modelValue:a.code,"onUpdate:modelValue":t[0]||(t[0]=function(e){return a.code=e}),highlight:l.highlighter,"line-numbers":""},null,8,["modelValue","highlight"])]}),_:1})]}),_:1})}}),f.register("6INDR",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("atDkO",function(e,n){t(e.exports,"render",function(){return a}),f("7DTtY");var r=f("5BxzC"),i=/*#__PURE__*/(0,r.createElementVNode)("p",null,"Width",-1),o=/*#__PURE__*/(0,r.createElementVNode)("p",null,"Height",-1);function a(e,t,n,a,l,u){var s=(0,r.resolveComponent)("v-icon"),c=(0,r.resolveComponent)("v-expansion-panel-title"),d=(0,r.resolveComponent)("v-text-field"),f=(0,r.resolveComponent)("v-expansion-panel-text"),p=(0,r.resolveComponent)("v-expansion-panel"),h=(0,r.resolveComponent)("v-radio"),m=(0,r.resolveComponent)("v-radio-group"),g=(0,r.resolveComponent)("v-container"),y=(0,r.resolveComponent)("v-col"),_=(0,r.resolveComponent)("v-row"),b=(0,r.resolveComponent)("Editor"),w=(0,r.resolveComponent)("v-expansion-panels");return(0,r.openBlock)(),(0,r.createBlock)(w,{variant:"accordion",style:{"min-width":"400px"}},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(p,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{actions:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-link ")]}),_:1})]}),default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" URL ")]}),_:1}),(0,r.createVNode)(f,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(d,{variant:"underlined",label:"Module URL",modelValue:n.module.url,"onUpdate:modelValue":t[0]||(t[0]=function(e){return n.module.url=e})},null,8,["modelValue"])]}),_:1})]}),_:1}),(0,r.createVNode)(p,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{actions:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-pencil-ruler ")]}),_:1})]}),default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Design ")]}),_:1}),(0,r.createVNode)(f,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(_,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(y,{cols:"6"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(g,{fluid:""},{default:(0,r.withCtx)(function(){return[i,(0,r.createVNode)(m,{modelValue:n.module.width,"onUpdate:modelValue":t[1]||(t[1]=function(e){return n.module.width=e})},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(h,{label:"Full (1000px)",value:"full"}),(0,r.createVNode)(h,{label:"Half (500px)",value:"half"}),(0,r.createVNode)(h,{label:"Quarter (250px)",value:"third"})]}),_:1},8,["modelValue"])]}),_:1})]}),_:1}),(0,r.createVNode)(y,{cols:"6"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(g,{fluid:""},{default:(0,r.withCtx)(function(){return[o,(0,r.createVNode)(m,{modelValue:n.module.height,"onUpdate:modelValue":t[2]||(t[2]=function(e){return n.module.height=e})},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(h,{label:"HUGE (830px)",value:"huge"}),(0,r.createVNode)(h,{label:"Tall (720x)",value:"tall"}),(0,r.createVNode)(h,{label:"Medium (410px)",value:"medium"}),(0,r.createVNode)(h,{label:"Short (200px)",value:"short"})]}),_:1},8,["modelValue"])]}),_:1})]}),_:1})]}),_:1})]}),_:1})]}),_:1}),(0,r.createVNode)(b,{title:"General settings",icon:"mdi-script-text",config:n.module.config,"onUpdate:config":t[3]||(t[3]=function(e){return n.module.config=e}),error:n.error.config,"onUpdate:error":t[4]||(t[4]=function(e){return n.error.config=e})},null,8,["config","error"]),(0,r.createVNode)(b,{title:"Student settings",icon:"mdi-account-circle-outline",config:n.module.studentConfig,"onUpdate:config":t[5]||(t[5]=function(e){return n.module.studentConfig=e}),error:n.error.studentConfig,"onUpdate:error":t[6]||(t[6]=function(e){return n.error.studentConfig=e})},null,8,["config","error"]),(0,r.createVNode)(b,{title:"Teacher settings",icon:"mdi-clipboard-account-outline",config:n.module.teacherConfig,"onUpdate:config":t[7]||(t[7]=function(e){return n.module.teacherConfig=e}),error:n.error.teacherConfig,"onUpdate:error":t[8]||(t[8]=function(e){return n.error.teacherConfig=e})},null,8,["config","error"]),(0,r.createVNode)(b,{title:"Station settings",icon:"mdi-router-wireless",config:n.module.stationConfig,"onUpdate:config":t[9]||(t[9]=function(e){return n.module.stationConfig=e}),error:n.error.stationConfig,"onUpdate:error":t[10]||(t[10]=function(e){return n.error.stationConfig=e})},null,8,["config","error"]),(0,r.createVNode)(p,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{actions:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-eye ")]}),_:1})]}),default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Show in ")]}),_:1}),(0,r.createVNode)(f,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(d,{variant:"underlined",label:"Comma separated list of rooms, or: lobby, * for all, teacher-only, station",modelValue:n.module.showInCustom,"onUpdate:modelValue":t[11]||(t[11]=function(e){return n.module.showInCustom=e})},null,8,["modelValue"])]}),_:1})]}),_:1})]}),_:1})}}),f.register("czxFg",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("b2vdk",function(e,n){t(e.exports,"render",function(){return o}),f("7DTtY");var r=f("5BxzC"),i=f("9Nw75");function o(e,t,n,o,a,l){var u=(0,r.resolveComponent)("v-icon"),s=(0,r.resolveComponent)("v-chip"),c=(0,r.resolveComponent)("v-list-item-title"),d=(0,r.resolveComponent)("v-list-item-subtitle"),f=(0,r.resolveComponent)("v-btn"),p=(0,r.resolveComponent)("Module"),h=(0,r.resolveComponent)("v-menu"),m=(0,r.resolveComponent)("v-list-item"),g=(0,r.resolveComponent)("v-list"),y=(0,r.resolveComponent)("draggable"),_=(0,r.resolveComponent)("v-text-field"),b=(0,r.resolveComponent)("v-divider");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(g,{lines:"three"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(y,{list:n.config.modules,"item-key":"id",onEnd:l.move,class:"list-group"},{item:(0,r.withCtx)(function(e){var t=e.element,o=e.index;return[((0,r.openBlock)(),(0,r.createBlock)(m,{key:o,class:"list-group-item"},{prepend:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{icon:n.scrapedModules[o].icon||"mdi-package"},null,8,["icon"])]}),append:(0,r.withCtx)(function(){return[(0,r.createVNode)(h,{"close-on-content-click":!1},{activator:(0,r.withCtx)(function(e){var t=e.props;return[(0,r.createVNode)(f,(0,r.mergeProps)({icon:"mdi-cog",variant:"text"},t,{style:l.validate_config(o)?"":"color: red"}),null,16,["style"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(p,{module:n.config.modules[o],"onUpdate:module":function(e){return n.config.modules[o]=e},error:a.errors[o],"onUpdate:error":function(e){return a.errors[o]=e}},null,8,["module","onUpdate:module","error","onUpdate:error"])]}),_:2},1024),(0,r.createVNode)(h,null,{activator:(0,r.withCtx)(function(e){var t=e.props;return[(0,r.createVNode)(f,(0,r.mergeProps)(t,{icon:"mdi-delete",variant:"text"}),null,16)]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(g,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(m,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Delete the module and its configuration? ")]}),_:1}),(0,r.createVNode)(f,{color:"red",depressed:"",onClick:function(e){return l.deleteModule(o)},class:"float-right",style:{"margin-top":"10px"}},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Yes ")]}),_:2},1032,["onClick"])]}),_:2},1024)]}),_:2},1024)]}),_:2},1024)]}),default:(0,r.withCtx)(function(){var e;return[(0,r.createVNode)(c,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)((0,i.toDisplayString)(n.scrapedModules[o].name)+" ",1),(0,r.createVNode)(s,{size:"x-small"},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)((0,i.toDisplayString)(t.showInCustom||"*"),1)]}),_:2},1024)]}),_:2},1024),(0,r.createVNode)(d,{innerHTML:(null===(e=n.scrapedModules[o])||void 0===e?void 0:e.description)||"No description",style:{"white-space":"break-spaces"}},null,8,["innerHTML"])]}),_:2},1024))]}),_:1},8,["list","onEnd"]),(0,r.createVNode)(m,null,{prepend:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{icon:"mdi-link"})]}),append:(0,r.withCtx)(function(){return[(0,r.createVNode)(f,{onClick:l.loadURL,disabled:!l.validate_url(a.moduleImportUrl)},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-view-grid-plus ")]}),_:1}),(0,r.createTextVNode)(" Add ")]}),_:1},8,["onClick","disabled"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(_,{modelValue:a.moduleImportUrl,"onUpdate:modelValue":t[0]||(t[0]=function(e){return a.moduleImportUrl=e}),label:"Module URL",variant:"underlined",required:"",style:{width:"calc(100% - 40px)"}},null,8,["modelValue"])]}),_:1})]}),_:1}),(0,r.createVNode)(b,{class:"pb-2"}),(0,r.createVNode)(f,{href:"https://github.com/topics/edrys-module",target:"_blank"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-github ")]}),_:1}),(0,r.createTextVNode)(" Explore on GitHub ")]}),_:1})],64)}}),f.register("3XaP9",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("aj2m5",function(e,n){t(e.exports,"default",function(){return i}),(r=f("ge8Ut")).__esModule&&(r=r.default),r.render=f("ch5tX").render,f("3nSv6").default(r),r.__scopeId="data-v-af4199",r.__file="Stations.vue";var r,i=r}),f.register("ge8Ut",function(e,n){u(e.exports),t(e.exports,"default",function(){return i});var r=f("9BzA6"),i={name:"Settings-Stations",props:{config:{type:Object,required:!0}},data:function(){return{url:window.location.toString().replace("classroom","station")}},methods:{copyUrl:function(){(0,r.copyToClipboard)(this.url)}}}}),f.register("ch5tX",function(e,n){t(e.exports,"render",function(){return a}),f("7DTtY");var r=f("5BxzC"),i=f("9Nw75"),o=["href"];function a(e,t,n,a,l,u){var s=(0,r.resolveComponent)("v-container"),c=(0,r.resolveComponent)("v-btn"),d=(0,r.resolveComponent)("v-alert");return(0,r.openBlock)(),(0,r.createBlock)(d,{outlined:"",dense:"",type:"info",text:"To add a new station, simply open this link on the client device: "},{append:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,{icon:"mdi-content-copy",onClick:u.copyUrl,variant:"text"},null,8,["onClick"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createElementVNode)("a",{href:l.url,target:"_blank"},(0,i.toDisplayString)(l.url),9,o)]}),_:1})]}),_:1})}}),f.register("3nSv6",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("54yBi",function(e,n){t(e.exports,"default",function(){return i}),(r=f("bmM2m")).__esModule&&(r=r.default),r.render=f("bS67F").render,f("3CRKo").default(r),r.__scopeId="data-v-7baf37",r.__file="Share.vue";var r,i=r}),f.register("bmM2m",function(e,n){u(e.exports),t(e.exports,"default",function(){return l});var r=f("xJRWs"),i=f("3XT9C"),o=f("i1Uxe"),a=f("9BzA6"),l={name:"Settings-Share",props:{config:{type:Object,required:!0}},data:function(){return console.log("Classroom config",JSON.stringify(this.config,null,2)),{url:window.location.toString(),selectedURL:"",selectedFile:[],showTemplate:!1,restoreSuccess:!1,saveError:!1,errorMessage:"",restoreFileRules:[function(e){return!e||e.size<2e6||"File should be less than 2 MB!"}]}},methods:{updateConfig:function(e){e.meta||(e.meta={logo:"",description:"",selfAssign:!1,defaultNumberOfRooms:0}),this.config.name=e.name,this.config.meta=e.meta,this.config.createdBy=(0,a.getPeerID)(!1),this.config.dateCreated=e.dateCreated,this.config.members=e.members,this.config.modules=e.modules},updateModules:function(){console.warn("updateModules",this.scrapedModules)},downloadClass:function(e){var t="yaml"===e?o.dump(this.config):JSON.stringify(this.config,null,2),n="class-"+this.config.id+("yaml"===e?".yml":".json"),r=new Blob([t],{type:"text/"+e}),i=URL.createObjectURL(r),a=document.createElement("a");a.href=i,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},restoreURL:function(){return(0,r._)(function(){var e,t,n;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return this.restoreSuccess=!1,this.saveError=!1,[4,fetch(this.selectedURL)];case 1:if(!(e=r.sent()).ok)return[3,3];return[4,e.text()];case 2:if(t=r.sent(),n=(0,a.parseClassroom)(t))return this.updateConfig(n),this.restoreSuccess=!0,[2];r.label=3;case 3:return this.saveError=!0,this.errorMessage="Could not parse the content within the URL: ".concat(this.selectedURL),console.warn("Could not parse the content within the URL:",this.selectedURL),[2]}})}).apply(this)},restoreFile:function(){var e=this;this.restoreSuccess=!1,this.saveError=!1;var t=new FileReader;t.readAsText(this.selectedFile[0]),t.onload=function(n){// will load yaml and json as well var r,i=(0,a.parseClassroom)((null===(r=t.result)||void 0===r?void 0:r.toString())||"");i?(//this.updateState(newClass); e.updateConfig(i),e.restoreSuccess=!0,console.log("restoreFile: loaded class",i)):(e.restoreSuccess=!1,e.saveError=!0,e.errorMessage="Failed to restore classroom configuration from file.",console.warn("restoreFile: failed to load class",i))},t.onerror=function(t){e.restoreSuccess=!1,e.saveError=!0,console.warn("restoreFile",t)}}},computed:{selectedURLIcon:function(){return this.selectedURL?"mdi-upload":""},selectedFileIcon:function(){return void 0!==this.selectedFile[0]?"mdi-upload":""}}}}),f.register("bS67F",function(e,n){t(e.exports,"render",function(){return o}),f("7DTtY");var r=f("5BxzC"),i=f("jo4gN");function o(e,t,n,o,a,l){var u=(0,r.resolveComponent)("v-icon"),s=(0,r.resolveComponent)("v-btn"),c=(0,r.resolveComponent)("v-col"),d=(0,r.resolveComponent)("v-row"),f=(0,r.resolveComponent)("v-file-input"),p=(0,r.resolveComponent)("v-text-field"),h=(0,r.resolveComponent)("v-divider");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(d,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,{depressed:"",block:"",onClick:t[0]||(t[0]=function(e){return l.downloadClass("yaml")})},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-download ")]}),_:1}),(0,r.createTextVNode)(" Download class file (.yml) ")]}),_:1})]}),_:1}),(0,r.createVNode)(c,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,{depressed:"",block:"",onClick:t[1]||(t[1]=function(e){return l.downloadClass("json")})},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-download ")]}),_:1}),(0,r.createTextVNode)(" Download class file (.json) ")]}),_:1})]}),_:1})]}),_:1}),(0,r.createVNode)(d,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(f,{dense:"",accept:".yml,.yaml,.json,application/yaml,application/json",label:"Restore class from file (yaml, json)",modelValue:a.selectedFile,"onUpdate:modelValue":t[2]||(t[2]=function(e){return a.selectedFile=e}),"append-icon":l.selectedFileIcon,"onClick:append":(0,i.withModifiers)(l.restoreFile,["self"])},null,8,["modelValue","append-icon","onClick:append"])]}),_:1}),(0,r.createVNode)(c,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(p,{dense:"",label:"Restore class from URL (http, https)",modelValue:a.selectedURL,"onUpdate:modelValue":t[6]||(t[6]=function(e){return a.selectedURL=e}),"prepend-icon":"mdi-link","append-icon":l.selectedURLIcon,"onClick:append":(0,i.withModifiers)(l.restoreURL,["self"]),onMouseover:t[7]||(t[7]=function(e){return a.showTemplate=!0}),onMouseleave:t[8]||(t[8]=function(e){return a.showTemplate=!1})},{"append-inner":(0,r.withCtx)(function(){return[a.selectedURL.length>0&&a.showTemplate?((0,r.openBlock)(),(0,r.createBlock)(u,{key:0,onMouseover:t[3]||(t[3]=function(e){return a.showTemplate=!0}),onMouseleave:t[4]||(t[4]=function(e){return a.showTemplate=!1}),onClick:t[5]||(t[5]=function(e){return a.selectedURL=""})},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)("mdi-close-circle")]}),_:1})):(0,r.createCommentVNode)("",!0)]}),_:1},8,["modelValue","append-icon","onClick:append"])]}),_:1})]}),_:1}),(0,r.createVNode)(h,{class:"pb-2"}),(0,r.createVNode)(s,{href:"https://github.com/topics/edrys-classroom",target:"_blank"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(u,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-github ")]}),_:1}),(0,r.createTextVNode)(" Explore on GitHub ")]}),_:1})],64)}}),f.register("3CRKo",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("gQjAn",function(e,n){t(e.exports,"render",function(){return i}),f("7DTtY");var r=f("5BxzC");function i(e,t,n,i,o,a){var l=(0,r.resolveComponent)("v-toolbar-title"),u=(0,r.resolveComponent)("v-spacer"),s=(0,r.resolveComponent)("v-icon"),c=(0,r.resolveComponent)("v-btn"),d=(0,r.resolveComponent)("v-tab"),f=(0,r.resolveComponent)("v-tabs"),p=(0,r.resolveComponent)("v-toolbar"),h=(0,r.resolveComponent)("Main"),m=(0,r.resolveComponent)("v-window-item"),g=(0,r.resolveComponent)("Members"),y=(0,r.resolveComponent)("Modules"),_=(0,r.resolveComponent)("Stations"),b=(0,r.resolveComponent)("Share"),w=(0,r.resolveComponent)("v-window"),x=(0,r.resolveComponent)("v-card-text"),C=(0,r.resolveComponent)("v-badge"),S=(0,r.resolveComponent)("v-list-item-title"),k=(0,r.resolveComponent)("v-list-item"),E=(0,r.resolveComponent)("v-list"),V=(0,r.resolveComponent)("v-menu"),N=(0,r.resolveComponent)("v-card-actions"),T=(0,r.resolveComponent)("v-card");return(0,r.openBlock)(),(0,r.createBlock)(T,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(p,{dark:"",flat:""},{extension:(0,r.withCtx)(function(){return[(0,r.createVNode)(f,{modelValue:o.tab,"onUpdate:modelValue":t[1]||(t[1]=function(e){return o.tab=e}),"fixed-tabs":"","center-active":"","show-arrows":""},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(d,{active:""},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-book-open-outline ")]}),_:1}),(0,r.createTextVNode)(" Settings ")]}),_:1}),(0,r.createVNode)(d,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-account-group ")]}),_:1}),(0,r.createTextVNode)(" Members ")]}),_:1}),(0,r.createVNode)(d,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-view-dashboard ")]}),_:1}),(0,r.createTextVNode)(" Modules ")]}),_:1}),(0,r.createVNode)(d,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-router-wireless ")]}),_:1}),(0,r.createTextVNode)(" Stations ")]}),_:1}),(0,r.createVNode)(d,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-share-variant ")]}),_:1}),(0,r.createTextVNode)(" Share ")]}),_:1})]}),_:1},8,["modelValue"])]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(l,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)("Class Settings")]}),_:1}),(0,r.createVNode)(u),(0,r.createVNode)(c,{icon:"",onClick:t[0]||(t[0]=function(t){return e.$emit("close")})},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)("mdi-close")]}),_:1})]}),_:1})]}),_:1}),(0,r.createVNode)(x,{style:{height:"565px"}},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(w,{modelValue:o.tab,"onUpdate:modelValue":t[2]||(t[2]=function(e){return o.tab=e}),class:"pt-5"},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(m,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(h,{config:n.config},null,8,["config"])]}),_:1}),(0,r.createVNode)(m,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(g,{members:n.config.members,onUpdateMembers:a.updateMembers},null,8,["members","onUpdateMembers"])]}),_:1}),(0,r.createVNode)(m,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(y,{config:n.config,"scraped-modules":n.scrapedModules},null,8,["config","scraped-modules"])]}),_:1}),(0,r.createVNode)(m,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(_,{config:n.config},null,8,["config"])]}),_:1}),(0,r.createVNode)(m,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(b,{config:n.config},null,8,["config"])]}),_:1})]}),_:1},8,["modelValue"])]}),_:1}),(0,r.createVNode)(N,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(c,{onClick:a.saveClass,color:"primary",style:{"margin-top":"30px"}},{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(s,{left:""},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" mdi-upload ")]}),_:1}),(0,r.createTextVNode)(" Save "),o.configChanged?((0,r.openBlock)(),(0,r.createBlock)(C,{key:0,overlap:"",dot:"",color:"red",style:{position:"relative",bottom:"12px",left:"6px"}})):(0,r.createCommentVNode)("",!0)]}),_:1},8,["onClick"]),(0,r.createVNode)(V,null,{activator:(0,r.withCtx)(function(e){var t=e.props;return[(0,r.createVNode)(c,(0,r.mergeProps)({color:""},t,{style:{"margin-top":"30px","margin-right":"10px","margin-left":"30px"},class:"float-right"}),{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Delete Class ")]}),_:2},1040)]}),default:(0,r.withCtx)(function(){return[(0,r.createVNode)(E,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(k,null,{default:(0,r.withCtx)(function(){return[(0,r.createVNode)(S,null,{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Are you sure? ")]}),_:1}),(0,r.createVNode)(c,{color:"red",depressed:"",onClick:a.deleteClass,class:"float-right",style:{"margin-top":"10px"}},{default:(0,r.withCtx)(function(){return[(0,r.createTextVNode)(" Yes, delete forever")]}),_:1},8,["onClick"])]}),_:1})]}),_:1})]}),_:1})]}),_:1})]}),_:1})}}),f.register("4jdFA",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}}),f.register("gUtJX",function(e,n){t(e.exports,"default",function(){return i}),(r=f("giAxm")).__esModule&&(r=r.default),r.render=f("8fSY0").render,r.__cssModules={},f("2F8S7").default(r),r.__scopeId="data-v-0961a5",r.__file="Modules.vue";var r,i=r}),f.register("giAxm",function(e,n){u(e.exports),t(e.exports,"default",function(){return s});var r=f("xJRWs"),i=f("a42Vg"),o=f("3XT9C"),a=f("cDaaW"),l=f("4qftf"),s={components:{Module:a.default},name:"Modules",props:["role","username_","liveClassProxy","scrapedModules_","communication","class_id"],data:function(){return{username:this.username_,grid:null,//scrapedModules: JSON.parse(JSON.stringify(this.scrapedModules_)), count:0}},computed:{roomName:function(){var e,t=this;return setTimeout(function(){t.gridUpdate()},1e3),(null===(e=this.liveClassProxy.users[this.username])||void 0===e?void 0:e.room)||"Station "+this.username},modulesType:function(){return this.roomName.startsWith("Station ")?"station":"chat"},scrapedModulesFilter:function(){var e=this;return this.scrapedModules_.filter(function(t){var n=t.showInCustom?t.showInCustom.split(",").map(function(e){return e.trim()}):t.shownIn;return(n.includes(e.modulesType)||n.map(function(e){return e.toLowerCase().replace(/\*/g,".*")}).map(function(e){return new RegExp(e)}).map(function(t){return null!==e.roomName.toLowerCase().match(t)}).includes(!0)||"*"==n)&&!n.includes("teacher-only")})}},created:function(){window.addEventListener("message",this.messageHandler);var e=document.getElementsByTagName("iframe");this.communication.on("message",function(t){for(var n=0;nc.timestamp.config&&(c.timestamp.config=i,c.data=r,c.update("setup"));break;case"setup-update":var o=t.data,a=o.data,l=o.timestamp;l>c.timestamp.config&&(c.timestamp.config=l,c.data=a,c.update("setup"));break;case"room":c.update("message",t.data.msg);break;case"room-update":if(t.id===c.peerID)break;c.peers[e.id]?c.peers[e.id].id=t.id:c.peers[e.id]={peer:e,id:t.id},c.state.merge(t.data);break;default:console.warn("unknown command",t.topic)}}),this.p2pt.start()}return(0,i._)(e,[{key:"newSetup",value:function(e){this.id=e.id,this.data=e.data,this.timestamp.config=e.timestamp,this.publishSetup()}},{key:"getPeerID",value:function(){return this.peerID}},{key:"update",value:function(e,t){var n=this.callback[e];switch(e){case"message":n&&n(t);break;case"setup":n?(n({id:this.id,data:this.data,timestamp:this.timestamp.config}),this.callbackUpdate[e]=!1):this.callbackUpdate[e]=!0;break;case"room":n?(n(this.state.toJSON()),this.callbackUpdate[e]=!1):this.callbackUpdate[e]=!0;break;case"connected":n?(n(this.connected),this.callbackUpdate[e]=!1):this.callbackUpdate[e]=!0}}},{key:"on",value:function(e,t){t?(this.callback[e]=t,this.callbackUpdate[e]&&this.update(e)):this.callback[e]&&delete this.callback[e]}},{key:"updateSetup",value:function(e,t){this.data=e,this.timestamp.config=t,this.broadcast({topic:"update-setup",data:{data:e,timestamp:t}})}},{key:"broadcast",value:function(e){if(this.p2pt){if(e.id=this.peerID,"room"===e.topic){var t,n=this.state.getUsers();for(var r in e.data.msg.date=Date.now(),this.peers)if(this.peers[r].id&&(null===(t=n[this.peers[r].id])||void 0===t?void 0:t.room)===e.data.room)try{this.p2pt.send(this.peers[r].peer,e)}catch(e){//console.warn(e.message) +switch(t.topic){case"setup":var n=t.data,r=n.data,i=n.timestamp;ic.timestamp.config&&(c.timestamp.config=i,c.data=r,c.update("setup"));break;case"setup-update":var o=t.data,a=o.data,l=o.timestamp;l>c.timestamp.config&&(c.timestamp.config=l,c.data=a,c.update("setup"));break;case"room":c.update("message",t.data.msg);break;case"room-update":if(t.id===c.peerID)break;c.peers[e.id]?c.peers[e.id].id=t.id:c.peers[e.id]={peer:e,id:t.id},c.state.merge(t.data);break;default:console.warn("unknown command",t.topic)}}),this.p2pt.start()}return(0,i._)(e,[{key:"newSetup",value:function(e){this.id=e.id,this.data=e.data,this.timestamp.config=e.timestamp,this.publishSetup()}},{key:"update",value:function(e,t){var n=this.callback[e];switch(e){case"message":n&&n(t);break;case"setup":n?(n({id:this.id,data:this.data,timestamp:this.timestamp.config}),this.callbackUpdate[e]=!1):this.callbackUpdate[e]=!0;break;case"room":n?(n(this.state.toJSON()),this.callbackUpdate[e]=!1):this.callbackUpdate[e]=!0;break;case"connected":n?(n(this.connected),this.callbackUpdate[e]=!1):this.callbackUpdate[e]=!0}}},{key:"on",value:function(e,t){t?(this.callback[e]=t,this.callbackUpdate[e]&&this.update(e)):this.callback[e]&&delete this.callback[e]}},{key:"updateSetup",value:function(e,t){this.data=e,this.timestamp.config=t,this.broadcast({topic:"update-setup",data:{data:e,timestamp:t}})}},{key:"broadcast",value:function(e){if(this.p2pt){if(e.id=this.peerID,"room"===e.topic){var t,n=this.state.getUsers();for(var r in e.data.msg.date=Date.now(),this.peers)if(this.peers[r].id&&(null===(t=n[this.peers[r].id])||void 0===t?void 0:t.room)===e.data.room)try{this.p2pt.send(this.peers[r].peer,e)}catch(e){//console.warn(e.message) //delete this.peers[id] }// as in the original Edrys ... messages are send back to the sender this.update("message",e.data.msg)}else for(var i in this.peers)try{this.p2pt.send(this.peers[i].peer,e)}catch(e){console.warn(e.message),delete this.peers[i]}}}},{key:"setIdentification",value:function(e){this.id=e.id,this.data=e.data,this.timestamp.config=e.timestamp,this.p2pt.setIdentifier(this.id),this.peers={}}},{key:"stop",value:function(){var e;null===(e=this.p2pt)||void 0===e||e.destroy(),this.callback={},this.callbackUpdate={},this.peers={}}},{key:"publishSetup",value:function(e){var t={topic:"setup",data:{data:this.data,timestamp:this.timestamp.config}};e&&this.peers[e]?this.p2pt.send(this.peers[e].peer,t):this.broadcast(t)}},{key:"addRoom",value:function(){this.state.addRoom(!0)}},{key:"gotoRoom",value:function(e){this.state.gotoRoom(e)}},{key:"join",value:function(){var e=this;this.timestamp.join=Date.now(),this.state.init("student",this.data.meta.defaultNumberOfRooms);var t=this;return this.state.on("update",function(t){t&&e.updateClassroom(),e.update("room")}),setTimeout(function(){t.updateClassroom()},1e3),this.state.toJSON()}},{key:"updateClassroom",value:function(){this.broadcast({topic:"room-update",data:this.state.encode()})}}]),e}()}),f.register("9U0AO",function(e,t){/** @@ -4646,7 +4647,7 @@ key:"initRooms",value:function(e){for(var t=1;t<=e;t++)this.addRoom(!1,"Room "+t } } } - */this.update(!0)}},{key:"on",value:function(e,t){this.callback=t}}]),e}()}),f.register("jzTLe",function(e,n){t(e.exports,"render",function(){return u});var r=f("6wEIk");f("7DTtY");var i=f("5BxzC"),o=f("9Nw75"),a=/*#__PURE__*/(0,i.createElementVNode)("a",{href:"./",style:{color:"white","text-decoration":"none"}},"edrys-lite",-1),l={class:"pa-2"};function u(e,t,n,u,s,c){var d=(0,i.resolveComponent)("v-progress-circular"),f=(0,i.resolveComponent)("v-btn"),p=(0,i.resolveComponent)("v-col"),h=(0,i.resolveComponent)("v-row"),m=(0,i.resolveComponent)("v-container"),g=(0,i.resolveComponent)("v-overlay"),y=(0,i.resolveComponent)("v-app-bar-nav-icon"),_=(0,i.resolveComponent)("v-app-bar-title"),b=(0,i.resolveComponent)("v-list-item-title"),w=(0,i.resolveComponent)("v-list-item-subtitle"),x=(0,i.resolveComponent)("v-list-item"),C=(0,i.resolveComponent)("v-list"),S=(0,i.resolveComponent)("v-menu"),k=(0,i.resolveComponent)("v-app-bar"),E=(0,i.resolveComponent)("v-card-text"),V=(0,i.resolveComponent)("v-divider"),N=(0,i.resolveComponent)("v-text-field"),T=(0,i.resolveComponent)("v-icon"),A=(0,i.resolveComponent)("v-card"),R=(0,i.resolveComponent)("v-navigation-drawer"),O=(0,i.resolveComponent)("Modules"),D=(0,i.resolveComponent)("v-main"),I=(0,i.resolveComponent)("v-layout"),B=(0,i.resolveComponent)("Settings"),P=(0,i.resolveComponent)("v-dialog"),M=(0,i.resolveComponent)("v-app");return(0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[null===s.states.connectedToNetwork||null===s.states.webRTCSupport||null===s.states.receivedConfiguration?((0,i.openBlock)(),(0,i.createBlock)(g,{key:0,modelValue:s.state,"onUpdate:modelValue":t[0]||(t[0]=function(e){return s.state=e}),style:{"background-color":"rgba(0, 0, 0, 0.6)","z-index":"1000"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(m,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(h,{justify:"center",align:"center",style:{color:"white",width:"100vw",height:"70vh"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(p,{cols:"12",sm:"12",md:"4",justify:"center",align:"center"},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(d,{indeterminate:"",size:88,width:7,justify:"center",align:"center"}),(0,i.createElementVNode)("div",null,[(0,i.createTextVNode)(" WebRTC-support "),!0===s.states.webRTCSupport?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,class:"ma-5",size:"x-small",color:"success",icon:"mdi-check"})):(0,i.createCommentVNode)("",!0),!1===s.states.webRTCSupport?((0,i.openBlock)(),(0,i.createBlock)(f,{key:1,class:"ma-5",size:"x-small",color:"error",icon:"mdi-close"})):(0,i.createCommentVNode)("",!0)]),(0,i.createElementVNode)("div",null,[(0,i.createTextVNode)(" Configuration loaded "),!0===s.states.receivedConfiguration?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,class:"ma-5",size:"x-small",color:"success",icon:"mdi-check"})):(0,i.createCommentVNode)("",!0),!1===s.states.receivedConfiguration?((0,i.openBlock)(),(0,i.createBlock)(f,{key:1,class:"ma-5",size:"x-small",color:"error",icon:"mdi-close"})):(0,i.createCommentVNode)("",!0)]),(0,i.createElementVNode)("div",null,[(0,i.createTextVNode)(" Connected to peer 2 peer network "),!0===s.states.connectedToNetwork?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,class:"ma-5",size:"x-small",color:"success",icon:"mdi-check"})):(0,i.createCommentVNode)("",!0),!1===s.states.connectedToNetwork?((0,i.openBlock)(),(0,i.createBlock)(f,{key:1,class:"ma-5",size:"x-small",color:"error",icon:"mdi-close"})):(0,i.createCommentVNode)("",!0)])]}),_:1})]}),_:1})]}),_:1})]}),_:1},8,["modelValue"])):(0,i.createCommentVNode)("",!0),(0,i.createVNode)(M,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(I,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(k,{color:"surface-variant"},{prepend:(0,i.withCtx)(function(){return[(0,i.createVNode)(y,{onClick:t[1]||(t[1]=function(e){return s.showSideMenu=!s.showSideMenu})}),(0,i.createVNode)(_,{tag:"a",style:{color:"white","text-decoration":"none"},title:"Back to index-page"},{default:(0,i.withCtx)(function(){return[a]}),_:1})]}),append:(0,i.withCtx)(function(){return[(0,i.createVNode)(S,null,{activator:(0,i.withCtx)(function(e){var t=e.props;return[(0,i.createVNode)(f,(0,i.mergeProps)(t,{icon:"mdi-dots-vertical"}),null,16)]}),default:(0,i.withCtx)(function(){return[(0,i.createVNode)(C,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(x,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(b,null,{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)(" User ID: ")]}),_:1}),(0,i.createVNode)(w,null,{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)((0,o.toDisplayString)(s.peerID)+" ",1),(0,i.createVNode)(f,{icon:"mdi-content-copy",size:"small",variant:"flat",onClick:t[2]||(t[2]=function(e){return c.copyPeerID()})})]}),_:1})]}),_:1}),(0,i.createVNode)(x,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(b,null,{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)(" User Role: ")]}),_:1}),(0,i.createVNode)(w,null,{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)((0,o.toDisplayString)(c.getRole()),1)]}),_:1})]}),_:1})]}),_:1})]}),_:1})]}),_:1}),(0,i.createVNode)(R,{temporary:"",modelValue:s.showSideMenu,"onUpdate:modelValue":t[6]||(t[6]=function(e){return s.showSideMenu=e})},{append:(0,i.withCtx)(function(){return[(0,i.createElementVNode)("div",l,[!s.isStation&&s.isOwner?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,depressed:"",block:"",class:"mb-2",onClick:c.addRoom},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(T,{left:""},{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)("mdi-forum")]}),_:1}),(0,i.createTextVNode)(" New room ")]}),_:1},8,["onClick"])):(0,i.createCommentVNode)("",!0)])]}),default:(0,i.withCtx)(function(){return[s.isStation?((0,i.openBlock)(),(0,i.createBlock)(g,{key:0,modelValue:s.showSideMenu,"onUpdate:modelValue":t[4]||(t[4]=function(e){return s.showSideMenu=e}),style:{width:"275px"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(A,{tile:"",width:"100%",class:"text-center",style:{"margin-top":"calc(50vh - 100px)"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(E,{class:"white--text"},{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)(" Station Mode Active ")]}),_:1}),(0,i.createVNode)(V),(0,i.createVNode)(E,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(N,{outlined:"",modelValue:s.stationName,"onUpdate:modelValue":t[3]||(t[3]=function(e){return s.stationName=e}),active:"false",label:"Station Name",required:"",disabled:"true"},null,8,["modelValue"]),(0,i.createTextVNode)(" This browser is now running as a station and ready to serve students ")]}),_:1}),(0,i.createVNode)(V),(0,i.createVNode)(E,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(f,{href:"/?/classroom/"+n.id},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(T,{left:""},{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)("mdi-export-variant")]}),_:1}),(0,i.createTextVNode)(" Exit Station mode ")]}),_:1},8,["href"])]}),_:1})]}),_:1})]}),_:1},8,["modelValue"])):(0,i.createCommentVNode)("",!0),(0,i.createVNode)(C,{density:"compact",nav:""},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(x,null,{append:(0,i.withCtx)(function(){return[!s.isStation&&s.isOwner?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,color:"grey",icon:"mdi-cog",onClick:t[5]||(t[5]=function(e){return s.showSettings=!s.showSettings}),variant:"text"})):(0,i.createCommentVNode)("",!0)]}),default:(0,i.withCtx)(function(){return[(0,i.createVNode)(b,null,{default:(0,i.withCtx)(function(){var e,t;return[(0,i.createTextVNode)((0,o.toDisplayString)((null===(e=s.configuration)||void 0===e?void 0:null===(t=e.data)||void 0===t?void 0:t.name)||""),1)]}),_:1}),(0,i.createVNode)(w,null,{default:(0,i.withCtx)(function(){var e;return[(0,i.createTextVNode)(" online users "+(0,o.toDisplayString)(Object.keys((null===(e=s.liveClassProxy)||void 0===e?void 0:e.users)||{}).length),1)]}),_:1})]}),_:1})]}),_:1}),(0,i.createVNode)(V),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(c.getRooms(),function(e,t,n){return(0,i.openBlock)(),(0,i.createBlock)(C,{nav:"",key:n,density:"compact"},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(x,{"prepend-icon":"Lobby"===t?"mdi-account-group":"mdi-forum",title:t,style:{"background-color":"lightgray","padding-top":"0px","padding-bottom":"0px","min-height":"2rem"}},{append:(0,i.withCtx)(function(){return[(0,i.createVNode)(f,{icon:"mdi-arrow-right-circle",variant:"text",onClick:function(e){return c.gotoRoom(t)}},null,8,["onClick"])]}),_:2},1032,["prepend-icon","title"]),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(c.usersInRoom(t),function(e,t){var n=(0,r._)(e,2),a=n[0],l=n[1];return(0,i.openBlock)(),(0,i.createBlock)(x,{key:t,title:a,style:(0,o.normalizeStyle)("min-height: 1.25rem; color: "+l)},null,8,["title","style"])}),128))]}),_:2},1024)}),128))]}),_:1},8,["modelValue"]),(0,i.createVNode)(D,{style:{"overflow-y":"scroll"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(p,null,{default:(0,i.withCtx)(function(){return[null!==s.liveClassProxy?((0,i.openBlock)(),(0,i.createBlock)(O,{role:c.getRole(),username_:s.peerID,liveClassProxy:s.liveClassProxy,scrapedModules_:s.scrapedModules,communication:s.communication,key:s.componentKey,class_id:n.id},null,8,["role","username_","liveClassProxy","scrapedModules_","communication","class_id"])):(0,i.createCommentVNode)("",!0)]}),_:1})]}),_:1})]}),_:1}),(0,i.createVNode)(P,{modelValue:s.showSettings,"onUpdate:modelValue":t[8]||(t[8]=function(e){return s.showSettings=e}),"max-width":"1200px",width:"90%",scrollable:"",persistent:"",id:"settings"+s.componentKey},{default:(0,i.withCtx)(function(){return[s.data?((0,i.openBlock)(),(0,i.createBlock)(B,{key:0,ref:"Settings",onClose:t[7]||(t[7]=function(e){return s.showSettings=!1}),config:s.data,scrapedModules:s.scrapedModules,onSaveClass:c.saveClass,onDeleteClass:c.deleteClass,onUpdateClass:c.updateClass},null,8,["config","scrapedModules","onSaveClass","onDeleteClass","onUpdateClass"])):(0,i.createCommentVNode)("",!0)]}),_:1},8,["modelValue","id"])]}),_:1})],64)}}),f.register("60HDL",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}});var p=f("xJRWs"),h=f("a42Vg"),m=f("3XT9C");f("7DTtY");var g=f("jo4gN");(r=f("aayhd")).__esModule&&(r=r.default),r.render=f("avAUU").render,f("gXrRD").default(r),r.__scopeId="data-v-710926",r.__file="Index.vue";var y=r;(i=f("9T9U7")).__esModule&&(i=i.default),i.render=f("jzTLe").render,f("60HDL").default(i),i.__scopeId="data-v-7f314c",i.__file="Classroom.vue";var _=i,h=f("a42Vg"),b=f("9zFRg");function w(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}// Utilities + */this.update(!0)}},{key:"on",value:function(e,t){this.callback=t}}]),e}()}),f.register("jzTLe",function(e,n){t(e.exports,"render",function(){return u});var r=f("6wEIk");f("7DTtY");var i=f("5BxzC"),o=f("9Nw75"),a=/*#__PURE__*/(0,i.createElementVNode)("a",{href:"./",style:{color:"white","text-decoration":"none"}},"edrys-lite",-1),l={class:"pa-2"};function u(e,t,n,u,s,c){var d=(0,i.resolveComponent)("v-progress-circular"),f=(0,i.resolveComponent)("v-btn"),p=(0,i.resolveComponent)("v-col"),h=(0,i.resolveComponent)("v-row"),m=(0,i.resolveComponent)("v-container"),g=(0,i.resolveComponent)("v-overlay"),y=(0,i.resolveComponent)("v-app-bar-nav-icon"),_=(0,i.resolveComponent)("v-app-bar-title"),b=(0,i.resolveComponent)("v-list-item-title"),w=(0,i.resolveComponent)("v-list-item-subtitle"),x=(0,i.resolveComponent)("v-list-item"),C=(0,i.resolveComponent)("v-list"),S=(0,i.resolveComponent)("v-menu"),k=(0,i.resolveComponent)("v-app-bar"),E=(0,i.resolveComponent)("v-card-text"),V=(0,i.resolveComponent)("v-divider"),N=(0,i.resolveComponent)("v-text-field"),T=(0,i.resolveComponent)("v-icon"),A=(0,i.resolveComponent)("v-card"),R=(0,i.resolveComponent)("v-navigation-drawer"),O=(0,i.resolveComponent)("Modules"),D=(0,i.resolveComponent)("v-main"),I=(0,i.resolveComponent)("v-layout"),B=(0,i.resolveComponent)("Settings"),P=(0,i.resolveComponent)("v-dialog"),M=(0,i.resolveComponent)("v-app");return(0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[null===s.states.connectedToNetwork||null===s.states.webRTCSupport||null===s.states.receivedConfiguration?((0,i.openBlock)(),(0,i.createBlock)(g,{key:0,modelValue:s.state,"onUpdate:modelValue":t[0]||(t[0]=function(e){return s.state=e}),style:{"background-color":"rgba(0, 0, 0, 0.6)","z-index":"1000"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(m,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(h,{justify:"center",align:"center",style:{color:"white",width:"100vw",height:"70vh"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(p,{cols:"12",sm:"12",md:"4",justify:"center",align:"center"},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(d,{indeterminate:"",size:88,width:7,justify:"center",align:"center"}),(0,i.createElementVNode)("div",null,[(0,i.createTextVNode)(" WebRTC-support "),!0===s.states.webRTCSupport?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,class:"ma-5",size:"x-small",color:"success",icon:"mdi-check"})):(0,i.createCommentVNode)("",!0),!1===s.states.webRTCSupport?((0,i.openBlock)(),(0,i.createBlock)(f,{key:1,class:"ma-5",size:"x-small",color:"error",icon:"mdi-close"})):(0,i.createCommentVNode)("",!0)]),(0,i.createElementVNode)("div",null,[(0,i.createTextVNode)(" Configuration loaded "),!0===s.states.receivedConfiguration?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,class:"ma-5",size:"x-small",color:"success",icon:"mdi-check"})):(0,i.createCommentVNode)("",!0),!1===s.states.receivedConfiguration?((0,i.openBlock)(),(0,i.createBlock)(f,{key:1,class:"ma-5",size:"x-small",color:"error",icon:"mdi-close"})):(0,i.createCommentVNode)("",!0)]),(0,i.createElementVNode)("div",null,[(0,i.createTextVNode)(" Connected to peer 2 peer network "),!0===s.states.connectedToNetwork?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,class:"ma-5",size:"x-small",color:"success",icon:"mdi-check"})):(0,i.createCommentVNode)("",!0),!1===s.states.connectedToNetwork?((0,i.openBlock)(),(0,i.createBlock)(f,{key:1,class:"ma-5",size:"x-small",color:"error",icon:"mdi-close"})):(0,i.createCommentVNode)("",!0)])]}),_:1})]}),_:1})]}),_:1})]}),_:1},8,["modelValue"])):(0,i.createCommentVNode)("",!0),(0,i.createVNode)(M,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(I,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(k,{color:"surface-variant"},{prepend:(0,i.withCtx)(function(){return[(0,i.createVNode)(y,{onClick:t[1]||(t[1]=function(e){return s.showSideMenu=!s.showSideMenu})}),(0,i.createVNode)(_,{tag:"a",style:{color:"white","text-decoration":"none"},title:"Back to index-page"},{default:(0,i.withCtx)(function(){return[a]}),_:1})]}),append:(0,i.withCtx)(function(){return[(0,i.createVNode)(S,null,{activator:(0,i.withCtx)(function(e){var t=e.props;return[(0,i.createVNode)(f,(0,i.mergeProps)(t,{icon:"mdi-dots-vertical"}),null,16)]}),default:(0,i.withCtx)(function(){return[(0,i.createVNode)(C,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(x,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(b,null,{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)(" User ID: ")]}),_:1}),(0,i.createVNode)(w,null,{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)((0,o.toDisplayString)(c.getPeerID())+" ",1),(0,i.createVNode)(f,{icon:"mdi-content-copy",size:"small",variant:"flat",onClick:t[2]||(t[2]=function(e){return c.copyPeerID()})})]}),_:1})]}),_:1}),(0,i.createVNode)(x,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(b,null,{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)(" User Role: ")]}),_:1}),(0,i.createVNode)(w,null,{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)((0,o.toDisplayString)(c.getRole()),1)]}),_:1})]}),_:1})]}),_:1})]}),_:1})]}),_:1}),(0,i.createVNode)(R,{temporary:"",modelValue:s.showSideMenu,"onUpdate:modelValue":t[6]||(t[6]=function(e){return s.showSideMenu=e})},{append:(0,i.withCtx)(function(){return[(0,i.createElementVNode)("div",l,[!s.isStation&&s.isOwner?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,depressed:"",block:"",class:"mb-2",onClick:c.addRoom},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(T,{left:""},{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)("mdi-forum")]}),_:1}),(0,i.createTextVNode)(" New room ")]}),_:1},8,["onClick"])):(0,i.createCommentVNode)("",!0)])]}),default:(0,i.withCtx)(function(){return[s.isStation?((0,i.openBlock)(),(0,i.createBlock)(g,{key:0,modelValue:s.showSideMenu,"onUpdate:modelValue":t[4]||(t[4]=function(e){return s.showSideMenu=e}),style:{width:"275px"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(A,{tile:"",width:"100%",class:"text-center",style:{"margin-top":"calc(50vh - 100px)"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(E,{class:"white--text"},{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)(" Station Mode Active ")]}),_:1}),(0,i.createVNode)(V),(0,i.createVNode)(E,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(N,{outlined:"",modelValue:s.stationName,"onUpdate:modelValue":t[3]||(t[3]=function(e){return s.stationName=e}),active:"false",label:"Station Name",required:"",disabled:"true"},null,8,["modelValue"]),(0,i.createTextVNode)(" This browser is now running as a station and ready to serve students ")]}),_:1}),(0,i.createVNode)(V),(0,i.createVNode)(E,null,{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(f,{href:"/?/classroom/"+n.id},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(T,{left:""},{default:(0,i.withCtx)(function(){return[(0,i.createTextVNode)("mdi-export-variant")]}),_:1}),(0,i.createTextVNode)(" Exit Station mode ")]}),_:1},8,["href"])]}),_:1})]}),_:1})]}),_:1},8,["modelValue"])):(0,i.createCommentVNode)("",!0),(0,i.createVNode)(C,{density:"compact",nav:""},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(x,null,{append:(0,i.withCtx)(function(){return[!s.isStation&&s.isOwner?((0,i.openBlock)(),(0,i.createBlock)(f,{key:0,color:"grey",icon:"mdi-cog",onClick:t[5]||(t[5]=function(e){return s.showSettings=!s.showSettings}),variant:"text"})):(0,i.createCommentVNode)("",!0)]}),default:(0,i.withCtx)(function(){return[(0,i.createVNode)(b,null,{default:(0,i.withCtx)(function(){var e,t;return[(0,i.createTextVNode)((0,o.toDisplayString)((null===(e=s.configuration)||void 0===e?void 0:null===(t=e.data)||void 0===t?void 0:t.name)||""),1)]}),_:1}),(0,i.createVNode)(w,null,{default:(0,i.withCtx)(function(){var e;return[(0,i.createTextVNode)(" online users "+(0,o.toDisplayString)(Object.keys((null===(e=s.liveClassProxy)||void 0===e?void 0:e.users)||{}).length),1)]}),_:1})]}),_:1})]}),_:1}),(0,i.createVNode)(V),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(c.getRooms(),function(e,t,n){return(0,i.openBlock)(),(0,i.createBlock)(C,{nav:"",key:n,density:"compact"},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(x,{"prepend-icon":"Lobby"===t?"mdi-account-group":"mdi-forum",title:t,style:{"background-color":"lightgray","padding-top":"0px","padding-bottom":"0px","min-height":"2rem"}},{append:(0,i.withCtx)(function(){return[(0,i.createVNode)(f,{icon:"mdi-arrow-right-circle",variant:"text",onClick:function(e){return c.gotoRoom(t)}},null,8,["onClick"])]}),_:2},1032,["prepend-icon","title"]),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(c.usersInRoom(t),function(e,t){var n=(0,r._)(e,2),a=n[0],l=n[1];return(0,i.openBlock)(),(0,i.createBlock)(x,{key:t,title:a,style:(0,o.normalizeStyle)("min-height: 1.25rem; color: "+l)},null,8,["title","style"])}),128))]}),_:2},1024)}),128))]}),_:1},8,["modelValue"]),(0,i.createVNode)(D,{style:{"overflow-y":"scroll"}},{default:(0,i.withCtx)(function(){return[(0,i.createVNode)(p,null,{default:(0,i.withCtx)(function(){return[null!==s.liveClassProxy?((0,i.openBlock)(),(0,i.createBlock)(O,{role:c.getRole(),username_:s.peerID,liveClassProxy:s.liveClassProxy,scrapedModules_:s.scrapedModules,communication:s.communication,key:s.componentKey,class_id:n.id},null,8,["role","username_","liveClassProxy","scrapedModules_","communication","class_id"])):(0,i.createCommentVNode)("",!0)]}),_:1})]}),_:1})]}),_:1}),(0,i.createVNode)(P,{modelValue:s.showSettings,"onUpdate:modelValue":t[8]||(t[8]=function(e){return s.showSettings=e}),"max-width":"1200px",width:"90%",scrollable:"",persistent:"",id:"settings"+s.componentKey},{default:(0,i.withCtx)(function(){return[s.data?((0,i.openBlock)(),(0,i.createBlock)(B,{key:0,ref:"Settings",onClose:t[7]||(t[7]=function(e){return s.showSettings=!1}),config:s.data,scrapedModules:s.scrapedModules,onSaveClass:c.saveClass,onDeleteClass:c.deleteClass,onUpdateClass:c.updateClass},null,8,["config","scrapedModules","onSaveClass","onDeleteClass","onUpdateClass"])):(0,i.createCommentVNode)("",!0)]}),_:1},8,["modelValue","id"])]}),_:1})],64)}}),f.register("60HDL",function(e,n){t(e.exports,"default",function(){return r});var r=function(e){}});var p=f("xJRWs"),h=f("a42Vg"),m=f("3XT9C");f("7DTtY");var g=f("jo4gN");(r=f("aayhd")).__esModule&&(r=r.default),r.render=f("avAUU").render,f("gXrRD").default(r),r.__scopeId="data-v-c3a986",r.__file="Index.vue";var y=r;(i=f("9T9U7")).__esModule&&(i=i.default),i.render=f("jzTLe").render,f("60HDL").default(i),i.__scopeId="data-v-c2ef85",i.__file="Classroom.vue";var _=i,h=f("a42Vg"),b=f("9zFRg");function w(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}// Utilities var x=f("6wEIk");f("7DTtY");var C=f("bNhjt"),S=f("5BxzC");// Utilities f("7DTtY");var S=f("5BxzC"),k=f("disEZ"),E=f("fJNo6"),h=f("a42Vg"),x=f("6wEIk"),V=f("2Yjkq");f("7DTtY");var N=f("9Nw75"),S=f("5BxzC"),C=f("bNhjt"),T="undefined"!=typeof window,A=T&&"IntersectionObserver"in window,R=T&&("ontouchstart"in window||window.navigator.maxTouchPoints>0);function O(e,t,n){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function D(e,t){var n=I(e,t,"get");return n.get?n.get.call(e):n.value}function I(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function B(e,t,n){var r=t.length-1;if(r<0)return void 0===e?n:e;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return Array.from({length:e},function(e,n){return t+n})}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px";if(null!=e&&""!==e){if(isNaN(+e))return String(e);if(!isFinite(+e))return;return"".concat(Number(e)).concat(t)}}function z(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function U(e){return e&&"$el"in e?e.$el:e}var Y=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34,shift:16}),H=Object.freeze({enter:"Enter",tab:"Tab",delete:"Delete",esc:"Escape",space:"Space",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",end:"End",home:"Home",del:"Delete",backspace:"Backspace",insert:"Insert",pageup:"PageUp",pagedown:"PageDown",shift:"Shift"});function q(e){return Object.keys(e)}function W(e,t){return t.every(function(t){return e.hasOwnProperty(t)})}function K(e,t,n){var r=function(r){!t.some(function(e){return e instanceof RegExp?e.test(r):e===r})||(null==n?void 0:n.some(function(e){return e===r}))?o[r]=e[r]:i[r]=e[r]},i=Object.create(null),o=Object.create(null);for(var a in e)r(a);return[i,o]}function X(e,t){var n=(0,h._)({},e);return t.forEach(function(e){return delete n[e]}),n}var G=/^on[^a-z]/,$=function(e){return G.test(e)},J=["onAfterscriptexecute","onAnimationcancel","onAnimationend","onAnimationiteration","onAnimationstart","onAuxclick","onBeforeinput","onBeforescriptexecute","onChange","onClick","onCompositionend","onCompositionstart","onCompositionupdate","onContextmenu","onCopy","onCut","onDblclick","onFocusin","onFocusout","onFullscreenchange","onFullscreenerror","onGesturechange","onGestureend","onGesturestart","onGotpointercapture","onInput","onKeydown","onKeypress","onKeyup","onLostpointercapture","onMousedown","onMousemove","onMouseout","onMouseover","onMouseup","onMousewheel","onPaste","onPointercancel","onPointerdown","onPointerenter","onPointerleave","onPointermove","onPointerout","onPointerover","onPointerup","onReset","onSelect","onSubmit","onTouchcancel","onTouchend","onTouchmove","onTouchstart","onTransitioncancel","onTransitionend","onTransitionrun","onTransitionstart","onWheel"];function Z(e){var t=(0,x._)(K(e,[G]),2),n=t[0],r=t[1],i=X(n,J),o=(0,x._)(K(r,["class","style","id",/^data-/]),2),a=o[0],l=o[1];return Object.assign(a,n),Object.assign(l,i),[a,l]}function Q(e){return null==e?[]:Array.isArray(e)?e:[e]}function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.max(t,Math.min(n,e))}function et(e){var t=e.toString().trim();return t.includes(".")?t.length-t.indexOf(".")-1:0}function en(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return e+n.repeat(Math.max(0,t-e.length))}function er(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(e=t&&r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r={};for(var i in e)r[i]=e[i];for(var o in t){var a=e[o],l=t[o];// Only continue deep merging if diff --git a/docs/index.65a81918.js b/docs/index.f4e14b11.js similarity index 98% rename from docs/index.65a81918.js rename to docs/index.f4e14b11.js index 671cdb8..907be80 100644 --- a/docs/index.65a81918.js +++ b/docs/index.f4e14b11.js @@ -117,7 +117,7 @@ isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:nu * @internal */this.cleanups=[],this.parent=n,!e&&n&&(this.index=(n.scopes||(n.scopes=[])).push(this)-1)}}function l(e){return new a(e)}function s(e,t=n){t&&t.active&&t.effects.push(e)}function u(){return n}function c(e){n&&n.cleanups.push(e)}let f=e=>{let t=new Set(e);return t.w=0,t.n=0,t},p=e=>(e.w&_)>0,h=e=>(e.n&_)>0,m=({deps:e})=>{if(e.length)for(let t=0;t{let{deps:t}=e;if(t.length){let n=0;for(let r=0;r{("length"===n||n>=e)&&s.push(t)})}else switch(void 0!==n&&s.push(l.get(n)),t){case"add":(0,o.isArray)(e)?(0,o.isIntegerKey)(n)&&s.push(l.get("length")):(s.push(l.get(w)),(0,o.isMap)(e)&&s.push(l.get(x)));break;case"delete":!(0,o.isArray)(e)&&(s.push(l.get(w)),(0,o.isMap)(e)&&s.push(l.get(x)));break;case"set":(0,o.isMap)(e)&&s.push(l.get(w))}if(1===s.length)s[0]&&L(s[0]);else{let e=[];for(let t of s)t&&e.push(...t);L(f(e))}}function L(e,t){let n=(0,o.isArray)(e)?e:[...e];for(let e of n)e.computed&&D(e,t);for(let e of n)e.computed||D(e,t)}function D(e,t){(e!==i||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}let P=/* @__PURE__ */(0,o.makeMap)("__proto__,__v_isRef,__isVue"),M=new Set(/* @__PURE__ */Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(o.isSymbol)),B=/* @__PURE__ */$(),F=/* @__PURE__ */$(!1,!0),j=/* @__PURE__ */$(!0),z=/* @__PURE__ */$(!0,!0),U=/* @__PURE__ */function(){let e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...e){let n=eO(this);for(let e=0,t=this.length;e{e[t]=function(...e){A();let n=eO(this)[t].apply(this,e);return T(),n}}),e}();function H(e){let t=eO(this);return R(t,"has",e),t.hasOwnProperty(e)}function $(e=!1,t=!1){return function(n,r,i){if("__v_isReactive"===r)return!e;if("__v_isReadonly"===r)return e;if("__v_isShallow"===r)return t;if("__v_raw"===r&&i===(e?t?ex:ew:t?e_:eb).get(n))return n;let a=(0,o.isArray)(n);if(!e){if(a&&(0,o.hasOwn)(U,r))return Reflect.get(U,r,i);if("hasOwnProperty"===r)return H}let l=Reflect.get(n,r,i);return((0,o.isSymbol)(r)?M.has(r):P(r))?l:(e||R(n,"get",r),t)?l:eB(l)?a&&(0,o.isIntegerKey)(r)?l:l.value:(0,o.isObject)(l)?e?ek(l):eS(l):l}}let G=/* @__PURE__ */q(),X=/* @__PURE__ */q(!0);function q(e=!1){return function(t,n,r,i){let a=t[n];if(eA(a)&&eB(a)&&!eB(r))return!1;if(!e&&(eT(r)||eA(r)||(a=eO(a),r=eO(r)),!(0,o.isArray)(t)&&eB(a)&&!eB(r)))return a.value=r,!0;let l=(0,o.isArray)(t)&&(0,o.isIntegerKey)(n)?Number(n)!0,deleteProperty:(e,t)=>!0},K=/* @__PURE__ */(0,o.extend)({},Y,{get:F,set:X}),J=/* @__PURE__ */(0,o.extend)({},W,{get:z}),Z=e=>e,Q=e=>Reflect.getPrototypeOf(e);function ee(e,t,n=!1,r=!1){e=e.__v_raw;let i=eO(e),o=eO(t);n||(t!==o&&R(i,"get",t),R(i,"get",o));let{has:a}=Q(i),l=r?Z:n?eD:eL;return a.call(i,t)?l(e.get(t)):a.call(i,o)?l(e.get(o)):void(e!==i&&e.get(t))}function et(e,t=!1){let n=this.__v_raw,r=eO(n),i=eO(e);return t||(e!==i&&R(r,"has",e),R(r,"has",i)),e===i?n.has(e):n.has(e)||n.has(i)}function en(e,t=!1){return e=e.__v_raw,t||R(eO(e),"iterate",w),Reflect.get(e,"size",e)}function er(e){e=eO(e);let t=eO(this),n=Q(t),r=n.has.call(t,e);return r||(t.add(e),I(t,"add",e,e)),this}function ei(e,t){t=eO(t);let n=eO(this),{has:r,get:i}=Q(n),a=r.call(n,e);a||(e=eO(e),a=r.call(n,e));let l=i.call(n,e);return n.set(e,t),a?(0,o.hasChanged)(t,l)&&I(n,"set",e,t,l):I(n,"add",e,t),this}function eo(e){let t=eO(this),{has:n,get:r}=Q(t),i=n.call(t,e);i||(e=eO(e),i=n.call(t,e));let o=r?r.call(t,e):void 0,a=t.delete(e);return i&&I(t,"delete",e,void 0,o),a}function ea(){let e=eO(this),t=0!==e.size,n=e.clear();return t&&I(e,"clear",void 0,void 0,void 0),n}function el(e,t){return function(n,r){let i=this,o=i.__v_raw,a=eO(o),l=t?Z:e?eD:eL;return e||R(a,"iterate",w),o.forEach((e,t)=>n.call(r,l(e),l(t),i))}}function es(e,t,n){return function(...r){let i=this.__v_raw,a=eO(i),l=(0,o.isMap)(a),s="entries"===e||e===Symbol.iterator&&l,u="keys"===e&&l,c=i[e](...r),d=n?Z:t?eD:eL;return t||R(a,"iterate",u?x:w),{// iterator protocol next(){let{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}},// iterable protocol -[Symbol.iterator](){return this}}}}function eu(e){return function(...t){return"delete"!==e&&this}}let[ec,ed,ef,ep]=/* @__PURE__ */function(){let e={get(e){return ee(this,e)},get size(){return en(this)},has:et,add:er,set:ei,delete:eo,clear:ea,forEach:el(!1,!1)},t={get(e){return ee(this,e,!1,!0)},get size(){return en(this)},has:et,add:er,set:ei,delete:eo,clear:ea,forEach:el(!1,!0)},n={get(e){return ee(this,e,!0)},get size(){return en(this,!0)},has(e){return et.call(this,e,!0)},add:eu("add"),set:eu("set"),delete:eu("delete"),clear:eu("clear"),forEach:el(!0,!1)},r={get(e){return ee(this,e,!0,!0)},get size(){return en(this,!0)},has(e){return et.call(this,e,!0)},add:eu("add"),set:eu("set"),delete:eu("delete"),clear:eu("clear"),forEach:el(!0,!0)},i=["keys","values","entries",Symbol.iterator];return i.forEach(i=>{e[i]=es(i,!1,!1),n[i]=es(i,!0,!1),t[i]=es(i,!1,!0),r[i]=es(i,!0,!0)}),[e,n,t,r]}();function eh(e,t){let n=t?e?ep:ef:e?ed:ec;return(t,r,i)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get((0,o.hasOwn)(n,r)&&r in t?n:t,r,i)}let ev={get:/* @__PURE__ */eh(!1,!1)},em={get:/* @__PURE__ */eh(!1,!0)},eg={get:/* @__PURE__ */eh(!0,!1)},ey={get:/* @__PURE__ */eh(!0,!0)},eb=/* @__PURE__ */new WeakMap,e_=/* @__PURE__ */new WeakMap,ew=/* @__PURE__ */new WeakMap,ex=/* @__PURE__ */new WeakMap;function eS(e){return eA(e)?e:eV(e,!1,Y,ev,eb)}function eC(e){return eV(e,!1,K,em,e_)}function ek(e){return eV(e,!0,W,eg,ew)}function eE(e){return eV(e,!0,J,ey,ex)}function eV(e,t,n,r,i){if(!(0,o.isObject)(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=i.get(e);if(a)return a;let l=e.__v_skip||!Object.isExtensible(e)?0/* INVALID */:function(e){switch(e){case"Object":case"Array":return 1/* COMMON */;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2/* COLLECTION */;default:return 0/* INVALID */}}((0,o.toRawType)(e));if(0/* INVALID */===l)return e;let s=new Proxy(e,2/* COLLECTION */===l?r:n);return i.set(e,s),s}function eN(e){return eA(e)?eN(e.__v_raw):!!(e&&e.__v_isReactive)}function eA(e){return!!(e&&e.__v_isReadonly)}function eT(e){return!!(e&&e.__v_isShallow)}function eR(e){return eN(e)||eA(e)}function eO(e){let t=e&&e.__v_raw;return t?eO(t):e}function eI(e){return(0,o.def)(e,"__v_skip",!0),e}let eL=e=>(0,o.isObject)(e)?eS(e):e,eD=e=>(0,o.isObject)(e)?ek(e):e;function eP(e){V&&i&&O((e=eO(e)).dep||(e.dep=f()))}function eM(e,t){e=eO(e);let n=e.dep;n&&L(n)}function eB(e){return!!(e&&!0===e.__v_isRef)}function eF(e){return ez(e,!1)}function ej(e){return ez(e,!0)}function ez(e,t){return eB(e)?e:new eU(e,t)}class eU{get value(){return eP(this),this._value}set value(e){let t=this.__v_isShallow||eT(e)||eA(e);e=t?e:eO(e),(0,o.hasChanged)(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:eL(e),eM(this,e))}constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:eO(e),this._value=t?e:eL(e)}}function eH(e){eM(e,void 0)}function e$(e){return eB(e)?e.value:e}function eG(e){return(0,o.isFunction)(e)?e():e$(e)}let eX={get:(e,t,n)=>e$(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return eB(i)&&!eB(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function eq(e){return eN(e)?e:new Proxy(e,eX)}class eY{get value(){return this._get()}set value(e){this._set(e)}constructor(e){this.dep=void 0,this.__v_isRef=!0;let{get:t,set:n}=e(()=>eP(this),()=>eM(this));this._get=t,this._set=n}}function eW(e){return new eY(e)}function eK(e){let t=(0,o.isArray)(e)?Array(e.length):{};for(let n in e)t[n]=e0(e,n);return t}class eJ{get value(){let e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){var e,t,n;return e=eO(this._object),t=this._key,null==(n=y.get(e))?void 0:n.get(t)}constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}}class eZ{get value(){return this._getter()}constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}}function eQ(e,t,n){return eB(e)?e:(0,o.isFunction)(e)?new eZ(e):(0,o.isObject)(e)&&arguments.length>1?e0(e,t,n):eF(e)}function e0(e,t,n){let r=e[t];return eB(r)?r:new eJ(e,t,n)}class e1{get value(){let e=eO(this);return eP(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}constructor(e,t,n,r){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new S(e,()=>{this._dirty||(this._dirty=!0,eM(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=n}}function e2(e,t,n=!1){let r,i;let a=(0,o.isFunction)(e);a?(r=e,i=o.NOOP):(r=e.get,i=e.set);let l=new e1(r,i,a||!i,n);return l}}),d.register("1bZPG",function(e,t){let n;function i(e,t){let n=/* @__PURE__ */Object.create(null),r=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}r(e.exports,"makeMap",function(){return i}),r(e.exports,"EMPTY_OBJ",function(){return o}),r(e.exports,"EMPTY_ARR",function(){return l}),r(e.exports,"NOOP",function(){return s}),r(e.exports,"NO",function(){return u}),r(e.exports,"isOn",function(){return d}),r(e.exports,"isModelListener",function(){return f}),r(e.exports,"extend",function(){return p}),r(e.exports,"remove",function(){return h}),r(e.exports,"hasOwn",function(){return g}),r(e.exports,"isArray",function(){return y}),r(e.exports,"isMap",function(){return b}),r(e.exports,"isSet",function(){return _}),r(e.exports,"isRegExp",function(){return x}),r(e.exports,"isFunction",function(){return S}),r(e.exports,"isString",function(){return C}),r(e.exports,"isSymbol",function(){return k}),r(e.exports,"isObject",function(){return E}),r(e.exports,"isPromise",function(){return V}),r(e.exports,"toRawType",function(){return T}),r(e.exports,"isPlainObject",function(){return R}),r(e.exports,"isIntegerKey",function(){return O}),r(e.exports,"isReservedProp",function(){return I}),r(e.exports,"isBuiltInDirective",function(){return L}),r(e.exports,"camelize",function(){return M}),r(e.exports,"hyphenate",function(){return F}),r(e.exports,"capitalize",function(){return j}),r(e.exports,"toHandlerKey",function(){return z}),r(e.exports,"hasChanged",function(){return U}),r(e.exports,"invokeArrayFns",function(){return H}),r(e.exports,"def",function(){return $}),r(e.exports,"looseToNumber",function(){return G}),r(e.exports,"toNumber",function(){return X}),r(e.exports,"getGlobalThis",function(){return q}),r(e.exports,"isGloballyWhitelisted",function(){return Y}),r(e.exports,"normalizeStyle",function(){return W}),r(e.exports,"normalizeClass",function(){return Q}),r(e.exports,"normalizeProps",function(){return ee}),r(e.exports,"isHTMLTag",function(){return et}),r(e.exports,"isSVGTag",function(){return en}),r(e.exports,"isSpecialBooleanAttr",function(){return er}),r(e.exports,"includeBooleanAttr",function(){return ei}),r(e.exports,"looseEqual",function(){return eo}),r(e.exports,"looseIndexOf",function(){return ea}),r(e.exports,"toDisplayString",function(){return el});let o={},l=[],s=()=>{},u=()=>!1,c=/^on[^a-z]/,d=e=>c.test(e),f=e=>e.startsWith("onUpdate:"),p=Object.assign,h=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},m=Object.prototype.hasOwnProperty,g=(e,t)=>m.call(e,t),y=Array.isArray,b=e=>"[object Map]"===A(e),_=e=>"[object Set]"===A(e),w=e=>"[object Date]"===A(e),x=e=>"[object RegExp]"===A(e),S=e=>"function"==typeof e,C=e=>"string"==typeof e,k=e=>"symbol"==typeof e,E=e=>null!==e&&"object"==typeof e,V=e=>E(e)&&S(e.then)&&S(e.catch),N=Object.prototype.toString,A=e=>N.call(e),T=e=>A(e).slice(8,-1),R=e=>"[object Object]"===A(e),O=e=>C(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,I=/* @__PURE__ */i(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),L=/* @__PURE__ */i("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),D=e=>{let t=/* @__PURE__ */Object.create(null);return n=>{let r=t[n];return r||(t[n]=e(n))}},P=/-(\w)/g,M=D(e=>e.replace(P,(e,t)=>t?t.toUpperCase():"")),B=/\B([A-Z])/g,F=D(e=>e.replace(B,"-$1").toLowerCase()),j=D(e=>e.charAt(0).toUpperCase()+e.slice(1)),z=D(e=>e?`on${j(e)}`:""),U=(e,t)=>!Object.is(e,t),H=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},G=e=>{let t=parseFloat(e);return isNaN(t)?e:t},X=e=>{let t=C(e)?Number(e):NaN;return isNaN(t)?e:t},q=()=>n||(n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==a?a:{}),Y=/* @__PURE__ */i("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console");function W(e){if(y(e)){let t={};for(let n=0;n{if(e){let n=e.split(J);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(r):W(r);if(i)for(let e in i)t[e]=i[e]}return t}if(C(e)||E(e))return e}let K=/;(?![^(]*\))/g,J=/:([^]+)/,Z=/\/\*[^]*?\*\//g;function Q(e){let t="";if(C(e))t=e;else if(y(e))for(let n=0;neo(e,t))}let el=e=>C(e)?e:null==e?"":y(e)||E(e)&&(e.toString===N||!S(e.toString))?JSON.stringify(e,es,2):String(e),es=(e,t)=>t&&t.__v_isRef?es(e,t.value):b(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n])=>(e[`${t} =>`]=n,e),{})}:_(t)?{[`Set(${t.size})`]:[...t.values()]}:!E(t)||y(t)||R(t)?t:String(t)}),d.register("5amXH",function(e,t){l(e.exports),r(e.exports,"default",function(){return o});var n=d("2itWq"),i=d("74PtA"),o={data(){let e=new n.Database;return e.setObservable("*",e=>{this.classrooms=e}),{database:e,classrooms:[],peerID:(0,i.getPeerID)()}},methods:{deleteClass(e){this.database.drop(e)},forkClass(e){e=(0,i.clone)(e);let t=(0,i.infoHash)(),n=(0,i.getPeerID)();e.data.createdBy!==n&&((0,i.removeKeysStartingWithSecret)(e),e.data.members.teacher=[],e.data.members.student=[]),e.data.createdBy=n,e.id=t,this.database.put({id:t,data:e.data,timestamp:Date.now()}),window.location.search=`?/classroom/${t}`},async createClass(){let e=(0,i.infoHash)(),t={id:e,createdBy:(0,i.getPeerID)(),dateCreated:new Date().getTime(),name:"My New Class",meta:{logo:"",description:"",selfAssign:!1,defaultNumberOfRooms:0},members:{teacher:[],student:[]},modules:[{url:"https://edrys-org.github.io/module-reference/",config:"",studentConfig:"",teacherConfig:"",stationConfig:"",width:"full",height:"tall"}]};this.database.put({id:e,data:t,timestamp:Date.now()}),window.location.search=`?/classroom/${e}`}}}}),d.register("2itWq",function(e,t){r(e.exports,"Database",function(){return i});var n=d("kxHmC");class i{getAll(){return this.db.data.orderBy("timestamp").desc().toArray()}async exists(e){let t=await this.get(e);return!!t}async get(e){return await this.db.data.get(e)}put(e){return this.db.data.put(e)}update(e){return e.timestamp=Date.now(),this.put(e)}drop(e){this.db.data.delete(e)}setObservable(e,t){this.observables[e]&&(this.observables[e].unsubscribe(),delete this.observables[e]);let r=this.db.data,i="*"===e?(0,n.liveQuery)(()=>r.orderBy("timestamp").desc().toArray()):(0,n.liveQuery)(()=>r.where("id").equals(e).first());this.observables[e]=i.subscribe({next:e=>t(e),error:e=>console.warn(e)})}deleteObservable(e){this.observables[e]&&(this.observables[e].unsubscribe(),delete this.observables[e])}constructor(){this.observables={},this.db=new n.Dexie("EdrysLite"),this.db.version(1).stores({data:` +[Symbol.iterator](){return this}}}}function eu(e){return function(...t){return"delete"!==e&&this}}let[ec,ed,ef,ep]=/* @__PURE__ */function(){let e={get(e){return ee(this,e)},get size(){return en(this)},has:et,add:er,set:ei,delete:eo,clear:ea,forEach:el(!1,!1)},t={get(e){return ee(this,e,!1,!0)},get size(){return en(this)},has:et,add:er,set:ei,delete:eo,clear:ea,forEach:el(!1,!0)},n={get(e){return ee(this,e,!0)},get size(){return en(this,!0)},has(e){return et.call(this,e,!0)},add:eu("add"),set:eu("set"),delete:eu("delete"),clear:eu("clear"),forEach:el(!0,!1)},r={get(e){return ee(this,e,!0,!0)},get size(){return en(this,!0)},has(e){return et.call(this,e,!0)},add:eu("add"),set:eu("set"),delete:eu("delete"),clear:eu("clear"),forEach:el(!0,!0)},i=["keys","values","entries",Symbol.iterator];return i.forEach(i=>{e[i]=es(i,!1,!1),n[i]=es(i,!0,!1),t[i]=es(i,!1,!0),r[i]=es(i,!0,!0)}),[e,n,t,r]}();function eh(e,t){let n=t?e?ep:ef:e?ed:ec;return(t,r,i)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get((0,o.hasOwn)(n,r)&&r in t?n:t,r,i)}let ev={get:/* @__PURE__ */eh(!1,!1)},em={get:/* @__PURE__ */eh(!1,!0)},eg={get:/* @__PURE__ */eh(!0,!1)},ey={get:/* @__PURE__ */eh(!0,!0)},eb=/* @__PURE__ */new WeakMap,e_=/* @__PURE__ */new WeakMap,ew=/* @__PURE__ */new WeakMap,ex=/* @__PURE__ */new WeakMap;function eS(e){return eA(e)?e:eV(e,!1,Y,ev,eb)}function eC(e){return eV(e,!1,K,em,e_)}function ek(e){return eV(e,!0,W,eg,ew)}function eE(e){return eV(e,!0,J,ey,ex)}function eV(e,t,n,r,i){if(!(0,o.isObject)(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=i.get(e);if(a)return a;let l=e.__v_skip||!Object.isExtensible(e)?0/* INVALID */:function(e){switch(e){case"Object":case"Array":return 1/* COMMON */;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2/* COLLECTION */;default:return 0/* INVALID */}}((0,o.toRawType)(e));if(0/* INVALID */===l)return e;let s=new Proxy(e,2/* COLLECTION */===l?r:n);return i.set(e,s),s}function eN(e){return eA(e)?eN(e.__v_raw):!!(e&&e.__v_isReactive)}function eA(e){return!!(e&&e.__v_isReadonly)}function eT(e){return!!(e&&e.__v_isShallow)}function eR(e){return eN(e)||eA(e)}function eO(e){let t=e&&e.__v_raw;return t?eO(t):e}function eI(e){return(0,o.def)(e,"__v_skip",!0),e}let eL=e=>(0,o.isObject)(e)?eS(e):e,eD=e=>(0,o.isObject)(e)?ek(e):e;function eP(e){V&&i&&O((e=eO(e)).dep||(e.dep=f()))}function eM(e,t){e=eO(e);let n=e.dep;n&&L(n)}function eB(e){return!!(e&&!0===e.__v_isRef)}function eF(e){return ez(e,!1)}function ej(e){return ez(e,!0)}function ez(e,t){return eB(e)?e:new eU(e,t)}class eU{get value(){return eP(this),this._value}set value(e){let t=this.__v_isShallow||eT(e)||eA(e);e=t?e:eO(e),(0,o.hasChanged)(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:eL(e),eM(this,e))}constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:eO(e),this._value=t?e:eL(e)}}function eH(e){eM(e,void 0)}function e$(e){return eB(e)?e.value:e}function eG(e){return(0,o.isFunction)(e)?e():e$(e)}let eX={get:(e,t,n)=>e$(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return eB(i)&&!eB(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function eq(e){return eN(e)?e:new Proxy(e,eX)}class eY{get value(){return this._get()}set value(e){this._set(e)}constructor(e){this.dep=void 0,this.__v_isRef=!0;let{get:t,set:n}=e(()=>eP(this),()=>eM(this));this._get=t,this._set=n}}function eW(e){return new eY(e)}function eK(e){let t=(0,o.isArray)(e)?Array(e.length):{};for(let n in e)t[n]=e0(e,n);return t}class eJ{get value(){let e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){var e,t,n;return e=eO(this._object),t=this._key,null==(n=y.get(e))?void 0:n.get(t)}constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}}class eZ{get value(){return this._getter()}constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}}function eQ(e,t,n){return eB(e)?e:(0,o.isFunction)(e)?new eZ(e):(0,o.isObject)(e)&&arguments.length>1?e0(e,t,n):eF(e)}function e0(e,t,n){let r=e[t];return eB(r)?r:new eJ(e,t,n)}class e1{get value(){let e=eO(this);return eP(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}constructor(e,t,n,r){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new S(e,()=>{this._dirty||(this._dirty=!0,eM(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=n}}function e2(e,t,n=!1){let r,i;let a=(0,o.isFunction)(e);a?(r=e,i=o.NOOP):(r=e.get,i=e.set);let l=new e1(r,i,a||!i,n);return l}}),d.register("1bZPG",function(e,t){let n;function i(e,t){let n=/* @__PURE__ */Object.create(null),r=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}r(e.exports,"makeMap",function(){return i}),r(e.exports,"EMPTY_OBJ",function(){return o}),r(e.exports,"EMPTY_ARR",function(){return l}),r(e.exports,"NOOP",function(){return s}),r(e.exports,"NO",function(){return u}),r(e.exports,"isOn",function(){return d}),r(e.exports,"isModelListener",function(){return f}),r(e.exports,"extend",function(){return p}),r(e.exports,"remove",function(){return h}),r(e.exports,"hasOwn",function(){return g}),r(e.exports,"isArray",function(){return y}),r(e.exports,"isMap",function(){return b}),r(e.exports,"isSet",function(){return _}),r(e.exports,"isRegExp",function(){return x}),r(e.exports,"isFunction",function(){return S}),r(e.exports,"isString",function(){return C}),r(e.exports,"isSymbol",function(){return k}),r(e.exports,"isObject",function(){return E}),r(e.exports,"isPromise",function(){return V}),r(e.exports,"toRawType",function(){return T}),r(e.exports,"isPlainObject",function(){return R}),r(e.exports,"isIntegerKey",function(){return O}),r(e.exports,"isReservedProp",function(){return I}),r(e.exports,"isBuiltInDirective",function(){return L}),r(e.exports,"camelize",function(){return M}),r(e.exports,"hyphenate",function(){return F}),r(e.exports,"capitalize",function(){return j}),r(e.exports,"toHandlerKey",function(){return z}),r(e.exports,"hasChanged",function(){return U}),r(e.exports,"invokeArrayFns",function(){return H}),r(e.exports,"def",function(){return $}),r(e.exports,"looseToNumber",function(){return G}),r(e.exports,"toNumber",function(){return X}),r(e.exports,"getGlobalThis",function(){return q}),r(e.exports,"isGloballyWhitelisted",function(){return Y}),r(e.exports,"normalizeStyle",function(){return W}),r(e.exports,"normalizeClass",function(){return Q}),r(e.exports,"normalizeProps",function(){return ee}),r(e.exports,"isHTMLTag",function(){return et}),r(e.exports,"isSVGTag",function(){return en}),r(e.exports,"isSpecialBooleanAttr",function(){return er}),r(e.exports,"includeBooleanAttr",function(){return ei}),r(e.exports,"looseEqual",function(){return eo}),r(e.exports,"looseIndexOf",function(){return ea}),r(e.exports,"toDisplayString",function(){return el});let o={},l=[],s=()=>{},u=()=>!1,c=/^on[^a-z]/,d=e=>c.test(e),f=e=>e.startsWith("onUpdate:"),p=Object.assign,h=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},m=Object.prototype.hasOwnProperty,g=(e,t)=>m.call(e,t),y=Array.isArray,b=e=>"[object Map]"===A(e),_=e=>"[object Set]"===A(e),w=e=>"[object Date]"===A(e),x=e=>"[object RegExp]"===A(e),S=e=>"function"==typeof e,C=e=>"string"==typeof e,k=e=>"symbol"==typeof e,E=e=>null!==e&&"object"==typeof e,V=e=>E(e)&&S(e.then)&&S(e.catch),N=Object.prototype.toString,A=e=>N.call(e),T=e=>A(e).slice(8,-1),R=e=>"[object Object]"===A(e),O=e=>C(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,I=/* @__PURE__ */i(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),L=/* @__PURE__ */i("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),D=e=>{let t=/* @__PURE__ */Object.create(null);return n=>{let r=t[n];return r||(t[n]=e(n))}},P=/-(\w)/g,M=D(e=>e.replace(P,(e,t)=>t?t.toUpperCase():"")),B=/\B([A-Z])/g,F=D(e=>e.replace(B,"-$1").toLowerCase()),j=D(e=>e.charAt(0).toUpperCase()+e.slice(1)),z=D(e=>e?`on${j(e)}`:""),U=(e,t)=>!Object.is(e,t),H=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},G=e=>{let t=parseFloat(e);return isNaN(t)?e:t},X=e=>{let t=C(e)?Number(e):NaN;return isNaN(t)?e:t},q=()=>n||(n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==a?a:{}),Y=/* @__PURE__ */i("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console");function W(e){if(y(e)){let t={};for(let n=0;n{if(e){let n=e.split(J);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(r):W(r);if(i)for(let e in i)t[e]=i[e]}return t}if(C(e)||E(e))return e}let K=/;(?![^(]*\))/g,J=/:([^]+)/,Z=/\/\*[^]*?\*\//g;function Q(e){let t="";if(C(e))t=e;else if(y(e))for(let n=0;neo(e,t))}let el=e=>C(e)?e:null==e?"":y(e)||E(e)&&(e.toString===N||!S(e.toString))?JSON.stringify(e,es,2):String(e),es=(e,t)=>t&&t.__v_isRef?es(e,t.value):b(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n])=>(e[`${t} =>`]=n,e),{})}:_(t)?{[`Set(${t.size})`]:[...t.values()]}:!E(t)||y(t)||R(t)?t:String(t)}),d.register("5amXH",function(e,t){l(e.exports),r(e.exports,"default",function(){return o});var n=d("2itWq"),i=d("74PtA"),o={data(){let e=new n.Database;return e.setObservable("*",e=>{this.classrooms=e}),{database:e,classrooms:[],peerID:(0,i.getPeerID)(!1)}},methods:{deleteClass(e){this.database.drop(e)},forkClass(e){e=(0,i.clone)(e);let t=(0,i.infoHash)(),n=(0,i.getPeerID)();e.data.createdBy!==n&&((0,i.removeKeysStartingWithSecret)(e),e.data.members.teacher=[],e.data.members.student=[]),e.data.createdBy=n,e.id=t,this.database.put({id:t,data:e.data,timestamp:Date.now()}),window.location.search=`?/classroom/${t}`},async createClass(){let e=(0,i.infoHash)(),t={id:e,createdBy:(0,i.getPeerID)(),dateCreated:new Date().getTime(),name:"My New Class",meta:{logo:"",description:"",selfAssign:!1,defaultNumberOfRooms:0},members:{teacher:[],student:[]},modules:[{url:"https://edrys-org.github.io/module-reference/",config:"",studentConfig:"",teacherConfig:"",stationConfig:"",width:"full",height:"tall"}]};this.database.put({id:e,data:t,timestamp:Date.now()}),window.location.search=`?/classroom/${e}`}}}}),d.register("2itWq",function(e,t){r(e.exports,"Database",function(){return i});var n=d("kxHmC");class i{getAll(){return this.db.data.orderBy("timestamp").desc().toArray()}async exists(e){let t=await this.get(e);return!!t}async get(e){return await this.db.data.get(e)}put(e){return this.db.data.put(e)}update(e){return e.timestamp=Date.now(),this.put(e)}drop(e){this.db.data.delete(e)}setObservable(e,t){this.observables[e]&&(this.observables[e].unsubscribe(),delete this.observables[e]);let r=this.db.data,i="*"===e?(0,n.liveQuery)(()=>r.orderBy("timestamp").desc().toArray()):(0,n.liveQuery)(()=>r.where("id").equals(e).first());this.observables[e]=i.subscribe({next:e=>t(e),error:e=>console.warn(e)})}deleteObservable(e){this.observables[e]&&(this.observables[e].unsubscribe(),delete this.observables[e])}constructor(){this.observables={},this.db=new n.Dexie("EdrysLite"),this.db.version(1).stores({data:` &id, timestamp, data`}),this.db.open().then(function(e){// Database opened successfully @@ -143,8 +143,8 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var n,i,o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0)n=t;else{var o=f(t);for(var a in n=o===Object.prototype?{}:Object.create(o),D&&D.set(t,n),t)h(t,a)&&(n[a]=e(t[a]))}return n}(e);return D=null,t}var M={}.toString;function B(e){return M.call(e).slice(8,-1)}var F="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",j="symbol"==typeof F?function(e){var t;return null!=e&&(t=e[F])&&t.apply(e)}:function(){return null},z={};function U(e){var t,n,r,i;if(1==arguments.length){if(c(e))return e.slice();if(this===z&&"string"==typeof e)return[e];if(i=j(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}var H="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},$="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),G=function(){return!0},X=!Error("").stack;function q(){if(X)try{throw q.arguments,Error()}catch(e){return e}return Error()}function Y(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(G).map(function(e){return"\n"+e}).join("")):""}var W=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],K=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(W),J={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Z(e,t){this._e=q(),this.name=e,this.message=t}function Q(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function ee(e,t,n,r){this._e=q(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Q(e,t)}function et(e,t){this._e=q(),this.name="BulkError",this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=Q(e,t)}b(Z).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Y(this._e,2))}},toString:function(){return this.name+": "+this.message}}),b(ee).from(Z),b(et).from(Z);var en=K.reduce(function(e,t){return e[t]=t+"Error",e},{}),er=K.reduce(function(e,t){var n=t+"Error";function r(e,r){this._e=q(),this.name=n,e?"string"==typeof e?(this.message=""+e+(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=J[t]||n,this.inner=null)}return b(r).from(Z),e[t]=r,e},{});er.Syntax=SyntaxError,er.Type=TypeError,er.Range=RangeError;var ei=W.reduce(function(e,t){return e[t+"Error"]=er[t],e},{}),eo=K.reduce(function(e,t){return -1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=er[t]),e},{});function ea(){}function el(e){return e}function es(e,t){return null==e||e===el?t:function(n){return t(e(n))}}function eu(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function ec(e,t){return e===ea?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?eu(r,this.onsuccess):r),i&&(this.onerror=this.onerror?eu(i,this.onerror):i),void 0!==o?o:n}}function ed(e,t){return e===ea?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?eu(n,this.onsuccess):n),r&&(this.onerror=this.onerror?eu(r,this.onerror):r)}}function ef(e,t){return e===ea?t:function(n){var r=e.apply(this,arguments);d(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?eu(i,this.onsuccess):i),o&&(this.onerror=this.onerror?eu(o,this.onerror):o),void 0===r?void 0===a?void 0:a:d(r,a)}}function ep(e,t){return e===ea?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function eh(e,t){return e===ea?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}eo.ModifyError=ee,eo.DexieError=Z,eo.BulkError=et;var ev={},em="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,f(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,f(t),e]}(),eg=em[0],ey=em[1],eb=em[2],e_=ey&&ey.then,ew=eg&&eg.constructor,ex=!!eb,eS=!1,eC=eb?function(){eb.then(eG)}:s.setImmediate?setImmediate.bind(null,eG):s.MutationObserver?function(){var e=document.createElement("div");new MutationObserver(function(){eG(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(eG,0)},ek=function(e,t){eL.push([e,t]),eV&&(eC(),eV=!1)},eE=!0,eV=!0,eN=[],eA=[],eT=null,eR=el,eO={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:to,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(function(e){try{to(e[0],e[1])}catch(e){}})}},eI=eO,eL=[],eD=0,eP=[];function eM(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=ea,this._lib=!1;var t=this._PSD=eI;if($&&(this._stackHolder=q(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==ev)throw TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],!1===this._state&&ej(this,this._value);return}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var r=t._lib&&eX();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof eM?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,ez(t)),r&&eq()}},ej.bind(null,t))}catch(e){ej(t,e)}}(this,e)}var eB={get:function(){var e=eI,t=e1;function n(n,r){var i=this,o=!e.global&&(e!==eI||t!==e1),a=o&&!e5(),l=new eM(function(t,l){eU(i,new eF(tn(n,e,o,a),tn(r,e,o,a),t,l,e))});return $&&e$(l,this),l}return n.prototype=ev,n},set:function(e){y(this,"then",e&&e.prototype===ev?eB:{get:function(){return e},set:eB.set})}};function eF(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function ej(e,t){if(eA.push(t),null===e._state){var n=e._lib&&eX();t=eR(t),e._state=!1,e._value=t,$&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){t&&t(e)}}(function(){var n=w(t,"stack");t._promise=e,y(t,"stack",{get:function(){return eS?n&&(n.get?n.get.apply(t):n.value):e.stack}})}),eN.some(function(t){return t._value===e._value})||eN.push(e),ez(e),n&&eq()}}function ez(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n0;)for(t=0,e=eL,eL=[],n=e.length;t0)eE=!0,eV=!0}function eY(){var e=eN;eN=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=eP.slice(0),n=t.length;n;)t[--n]()}function eW(e){return new eM(ev,!1,e)}function eK(e,t){var n=eI;return function(){var r=eX(),i=eI;try{return e9(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{e9(i,!1),r&&eq()}}}m(eM.prototype,{then:eB,_then:function(e,t){eU(this,new eF(null,null,e,t,eI))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,function(e){return e instanceof t?n(e):eW(e)}):this.then(null,function(e){return e&&e.name===t?n(e):eW(e)})},finally:function(e){return this.then(function(t){return e(),t},function(t){return e(),eW(t)})},stack:{get:function(){if(this._stack)return this._stack;try{eS=!0;var e=(function e(t,n,r){if(n.length===r)return n;var i="";if(!1===t._state){var o,a,l=t._value;null!=l?(o=l.name||"Error",a=l.message||l,i=Y(l,0)):(o=l,a=""),n.push(o+(a?": "+a:"")+i)}return $&&((i=Y(t._stackHolder,2))&&-1===n.indexOf(i)&&n.push(i),t._prev&&e(t._prev,n,r)),n})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{eS=!1}}},timeout:function(e,t){var n=this;return e<1/0?new eM(function(r,i){var o=setTimeout(function(){return i(new er.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&y(eM.prototype,Symbol.toStringTag,"Dexie.Promise"),eO.env=te(),m(eM,{all:function(){var e=U.apply(null,arguments).map(e4);return new eM(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(i,o){return eM.resolve(i).then(function(n){e[o]=n,--r||t(e)},n)})})},resolve:function(e){if(e instanceof eM)return e;if(e&&"function"==typeof e.then)return new eM(function(t,n){e.then(t,n)});var t=new eM(ev,!0,e);return e$(t,eT),t},reject:eW,race:function(){var e=U.apply(null,arguments).map(e4);return new eM(function(t,n){e.map(function(e){return eM.resolve(e).then(t,n)})})},PSD:{get:function(){return eI},set:function(e){return eI=e}},totalEchoes:{get:function(){return e1}},newPSD:e3,usePSD:tt,scheduler:{get:function(){return ek},set:function(e){ek=e}},rejectionMapper:{get:function(){return eR},set:function(e){eR=e}},follow:function(e,t){return new eM(function(n,r){return e3(function(t,n){var r=eI;r.unhandleds=[],r.onunhandled=n,r.finalize=eu(function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},eP.push(function t(){e(),eP.splice(eP.indexOf(t),1)}),++eD,ek(function(){0==--eD&&eY()},[])},r.finalize),e()},t,n,r)})}}),ew&&(ew.allSettled&&y(eM,"allSettled",function(){var e=U.apply(null,arguments).map(e4);return new eM(function(t){0===e.length&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,i){return eM.resolve(e).then(function(e){return r[i]={status:"fulfilled",value:e}},function(e){return r[i]={status:"rejected",reason:e}}).then(function(){return--n||t(r)})})})}),ew.any&&"undefined"!=typeof AggregateError&&y(eM,"any",function(){var e=U.apply(null,arguments).map(e4);return new eM(function(t,n){0===e.length&&n(AggregateError([]));var r=e.length,i=Array(r);e.forEach(function(e,o){return eM.resolve(e).then(function(e){return t(e)},function(e){i[o]=e,--r||n(AggregateError(i))})})})}));var eJ={awaits:0,echoes:0,id:0},eZ=0,eQ=[],e0=0,e1=0,e2=0;function e3(e,t,n,r){var i=eI,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++e2;var a=eO.env;o.env=ex?{Promise:eM,PromiseProp:{value:eM,configurable:!0,writable:!0},all:eM.all,race:eM.race,allSettled:eM.allSettled,any:eM.any,resolve:eM.resolve,reject:eM.reject,nthen:tr(a.nthen,o),gthen:tr(a.gthen,o)}:{},t&&d(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var l=tt(o,e,n,r);return 0===o.ref&&o.finalize(),l}function e6(){return eJ.id||(eJ.id=++eZ),++eJ.awaits,eJ.echoes+=100,eJ.id}function e5(){return!!eJ.awaits&&(0==--eJ.awaits&&(eJ.id=0),eJ.echoes=100*eJ.awaits,!0)}function e4(e){return eJ.echoes&&e&&e.constructor===ew?(e6(),e.then(function(e){return e5(),e},function(e){return e5(),ta(e)})):e}function e8(e){++e1,eJ.echoes&&0!=--eJ.echoes||(eJ.echoes=eJ.id=0),eQ.push(eI),e9(e,!0)}function e7(){var e=eQ[eQ.length-1];eQ.pop(),e9(e,!1)}function e9(e,t){var n,r=eI;if((t?!eJ.echoes||e0++&&e===eI:!e0||--e0&&e===eI)||(n=t?e8.bind(null,e):e7,e_.call(eg,n)),e!==eI&&(eI=e,r===eO&&(eO.env=te()),ex)){var i=eO.env.Promise,o=e.env;ey.then=o.nthen,i.prototype.then=o.gthen,(r.global||e.global)&&(Object.defineProperty(s,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject,o.allSettled&&(i.allSettled=o.allSettled),o.any&&(i.any=o.any))}}function te(){var e=s.Promise;return ex?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:ey.then,gthen:e.prototype.then}:{}}function tt(e,t,n,r,i){var o=eI;try{return e9(e,!0),t(n,r,i)}finally{e9(o,!1)}}function tn(e,t,n,r){return"function"!=typeof e?e:function(){var i,o=eI;n&&e6(),e9(t,!0);try{return e.apply(this,arguments)}finally{e9(o,!1),r&&(i=e5,e_.call(eg,i))}}}function tr(e,t){return function(n,r){return e.call(this,tn(n,t),tn(r,t))}}-1===(""+e_).indexOf("[native code]")&&(e6=e5=ea);var ti="unhandledrejection";function to(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(s.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(ti,!0,!0),d(r,i)):s.CustomEvent&&(r=new CustomEvent(ti,{detail:i}),d(r,i)),r&&s.dispatchEvent&&(dispatchEvent(r),!s.PromiseRejectionEvent&&s.onunhandledrejection))try{s.onunhandledrejection(r)}catch(e){}$&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var ta=eM.reject,tl="3.2.4",ts=String.fromCharCode(65535),tu=-1/0,tc="Invalid key provided. Keys must be of type string, number, Date or Array.",td="String expected.",tf=[],tp="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),th=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},tv="__dbnames",tm="readonly",tg="readwrite";function ty(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var tb={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function t_(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&(t=P(t),delete t[e]),t}}var tw=function(){function e(){}return e.prototype._trans=function(e,t,n){var r=this._tx||eI.trans,i=this.name;function o(e,n,r){if(!r.schema[i])throw new er.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var a=eX();try{return r&&r.db===this.db?r===eI.trans?r._promise(e,o,n):e3(function(){return r._promise(e,o,n)},{trans:r,transless:eI.transless||eI}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||eI.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){if(o.name===en.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0)return console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(function(){return e(t,n,r,i)});return ta(o)}return o._promise(n,function(e,t){return e3(function(){return eI.trans=o,i(e,t,o)})}).then(function(e){return o._completion.then(function(){return e})})}if(t._state.openComplete)return ta(new er.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return ta(new er.DatabaseClosed);t.open().catch(ea)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],o)}finally{a&&eq()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(c(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=u(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){return e.compound&&t.every(function(t){return e.keyPath.indexOf(t)>=0})&&e.keyPath.every(function(e){return t.indexOf(e)>=0})})[0];if(n&&this.db._maxKey!==ts)return this.where(n.name).equals(n.keyPath.map(function(t){return e[t]}));!n&&$&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var r=this.schema.idxByName,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}var a=t.reduce(function(t,n){var i=t[0],a=t[1],l=r[n],s=e[n];return[i||l,i||!l?ty(a,l&&l.multi?function(e){var t=N(e,n);return c(t)&&t.some(function(e){return o(s,e)})}:function(e){return o(s,N(e,n))}):a]},[null,null]),l=a[0],s=a[1];return l?this.where(l.name).equals(e[l.keyPath]).filter(s):n?this.filter(s):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,c(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(h(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass(function(e){d(this,e)})},e.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=t_(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})}).then(function(e){return e.numFailures?eM.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{A(e,o,t)}catch(e){}return t})},e.prototype.update=function(e,t){if("object"!=typeof e||c(e))return this.where(":id").equals(e).modify(t);var n=N(e,this.schema.primKey.keyPath);if(void 0===n)return ta(new er.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?u(t).forEach(function(n){A(e,n,t[n])}):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)},e.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=t_(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?eM.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{A(e,o,t)}catch(e){}return t})},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(e){return e.numFailures?eM.reject(e.failures[0]):void 0})},e.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:tb})}).then(function(e){return e.numFailures?eM.reject(e.failures[0]):void 0})},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},e.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,a=n.auto,l=n.keyPath;if(l&&i)throw new er.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new er.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,u=l&&a?e.map(t_(l)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:u,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?n:i;throw new et(r.name+".bulkAdd(): "+t+" of "+s+" operations failed",a)})})},e.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,a=n.auto,l=n.keyPath;if(l&&i)throw new er.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new er.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,u=l&&a?e.map(t_(l)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:u,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?n:i;throw new et(r.name+".bulkPut(): "+t+" of "+s+" operations failed",a)})})},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e})}).then(function(e){var r=e.numFailures,i=e.lastResult,o=e.failures;if(0===r)return i;throw new et(t.name+".bulkDelete(): "+r+" of "+n+" operations failed",o)})},e}();function tx(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;rt?1:er?a:0}return this.toArray(function(e){return e.sort(l)}).then(t)},e.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&&tC(n,!0)&&n.limit>0){var r=n.valueMapper,i=tV(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then(function(e){var t=e.result;return r?t.map(r):t})}var o=[];return tA(n,function(e){return o.push(e)},e,n.table.core).then(function(){return o})},e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,tC(t)?tE(t,function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n(function(){e.advance(t),t=0}),!1)}}):tE(t,function(){var t=e;return function(){return--t<0}})),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tE(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}},!0),this},e.prototype.until=function(e,t){return tk(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},e.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){var t;return tk(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=ty(t.isMatch,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&tC(t,!0)&&t.limit>0)return this._read(function(e){var n=tV(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return tk(this._ctx,function(e){var t=e.primaryKey.toString(),r=h(n,t);return n[t]=!0,!r}),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){if("function"==typeof e)i=e;else{var i,o=u(e),a=o.length;i=function(t){for(var n=!1,r=0;r0&&l.mutate({trans:r,type:"add",values:p}).then(function(e){for(var t in e.failures)y.splice(parseInt(t),1);g(p.length,e)})).then(function(){return(h.length>0||x&&"object"==typeof e)&&l.mutate({trans:r,type:"put",keys:m,values:h,criteria:x,changeSpec:"function"!=typeof e&&e}).then(function(e){return g(h.length,e)})}).then(function(){return(y.length>0||x&&e===tD)&&l.mutate({trans:r,type:"delete",keys:y,criteria:x}).then(function(e){return g(y.length,e)})}).then(function(){return t.length>a+s&&o(a+f)})})};return o(0).then(function(){if(p.length>0)throw new ee("Error modifying one or more objects",p,h,m);return t.length})})})},e.prototype.delete=function(){var e=this._ctx,t=e.range;return tC(e)&&(e.isPrimKey&&!tp||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey;return e.table.core.count({trans:n,query:{index:r,range:t}}).then(function(r){return e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(function(e){var t=e.failures;e.lastResult,e.results;var n=e.numFailures;if(n)throw new ee("Could not delete some values",Object.keys(t).map(function(e){return t[e]}),r-n);return r-n})})}):this.modify(tD)},e}(),tD=function(e,t){return t.value=null};function tP(e,t){return et?-1:e===t?0:1}function tB(e,t,n){var r=e instanceof tH?new e.Collection(e):e;return r._ctx.error=n?new n(t):TypeError(t),r}function tF(e){return new e.Collection(e,function(){return tU("")}).limit(0)}function tj(e,t,n,r){var i,o,a,l,s,u,c,d=n.length;if(!n.every(function(e){return"string"==typeof e}))return tB(e,td);function f(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},a="next"===e?tP:tM;var t=n.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return a(e.lower,t.lower)});l=t.map(function(e){return e.upper}),s=t.map(function(e){return e.lower}),u=e,c="next"===e?"":r}f("next");var p=new e.Collection(e,function(){return tz(l[0],s[d-1]+r)});p._ondirectionchange=function(e){f(e)};var h=0;return p._addAlgorithm(function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,s,h))return!0;for(var p=null,m=h;mi(e[s],n[s]))return e.substr(0,s)+n[s]+n.substr(s+1);if(0>i(e[s],r[s]))return e.substr(0,s)+r[s]+n.substr(s+1);if(l>=0)return e.substr(0,l)+t[l]+n.substr(l+1);return null}0>i(e[s],u)&&(l=s)}return a0)&&(p=g)}return n(null!==p?function(){e.continue(p+c)}:r),!1}),p}function tz(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function tU(e){return{type:1,lower:e,upper:e}}var tH=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{if(this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&!(n&&r))return tF(this);return new this.Collection(this,function(){return tz(e,t,!n,!r)})}catch(e){return tB(this,tc)}},e.prototype.equals=function(e){return null==e?tB(this,tc):new this.Collection(this,function(){return tU(e)})},e.prototype.above=function(e){return null==e?tB(this,tc):new this.Collection(this,function(){return tz(e,void 0,!0)})},e.prototype.aboveOrEqual=function(e){return null==e?tB(this,tc):new this.Collection(this,function(){return tz(e,void 0,!1)})},e.prototype.below=function(e){return null==e?tB(this,tc):new this.Collection(this,function(){return tz(void 0,e,!1,!0)})},e.prototype.belowOrEqual=function(e){return null==e?tB(this,tc):new this.Collection(this,function(){return tz(void 0,e)})},e.prototype.startsWith=function(e){return"string"!=typeof e?tB(this,td):this.between(e,e+ts,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):tj(this,function(e,t){return 0===e.indexOf(t[0])},[e],ts)},e.prototype.equalsIgnoreCase=function(e){return tj(this,function(e,t){return e===t[0]},[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=U.apply(z,arguments);return 0===e.length?tF(this):tj(this,function(e,t){return -1!==t.indexOf(e)},e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=U.apply(z,arguments);return 0===e.length?tF(this):tj(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,ts)},e.prototype.anyOf=function(){var e=this,t=U.apply(z,arguments),n=this._cmp;try{t.sort(n)}catch(e){return tB(this,tc)}if(0===t.length)return tF(this);var r=new this.Collection(this,function(){return tz(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,o){for(var a=e.key;n(a,t[i])>0;)if(++i===t.length)return r(o),!1;return 0===n(a,t[i])||(r(function(){e.continue(t[i])}),!1)}),r},e.prototype.notEqual=function(e){return this.inAnyRange([[tu,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=U.apply(z,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return tB(this,tc)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[tu,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var n,r=this,i=this._cmp,o=this._ascending,a=this._descending,l=this._min,s=this._max;if(0===e.length)return tF(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&0>=o(e[0],e[1])}))return tB(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",er.InvalidArgument);var u=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers,d=o;function f(e,t){return d(e[0],t[0])}try{(n=e.reduce(function(e,t){for(var n=0,r=e.length;ni(t[0],o[1])&&i(t[1],o[0])>0){o[0]=l(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return n===r&&e.push(t),e},[])).sort(f)}catch(e){return tB(this,tc)}var p=0,h=c?function(e){return o(e,n[p][1])>0}:function(e){return o(e,n[p][1])>=0},m=u?function(e){return a(e,n[p][0])>0}:function(e){return a(e,n[p][0])>=0},g=h,y=new this.Collection(this,function(){return tz(n[0][0],n[n.length-1][1],!u,!c)});return y._ondirectionchange=function(e){"next"===e?(g=h,d=o):(g=m,d=a),n.sort(f)},y._addAlgorithm(function(e,t,i){for(var a=e.key;g(a);)if(++p===n.length)return t(i),!1;return!(h(a)||m(a))||0!==r._cmp(a,n[p][1])&&0!==r._cmp(a,n[p][0])&&(t(function(){d===o?e.continue(n[p][0]):e.continue(n[p][1])}),!1)}),y},e.prototype.startsWithAnyOf=function(){var e=U.apply(z,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?tF(this):this.inAnyRange(e.map(function(e){return[e,e+ts]})):tB(this,"startsWithAnyOf() only works with strings")},e}();function t$(e){return eK(function(t){return tG(t),e(t.target.error),!1})}function tG(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var tX="storagemutated",tq="x-storagemutated-1",tY=tx(null,tX),tW=function(){function e(){}return e.prototype._lock=function(){return k(!eI.global),++this._reculock,1!==this._reculock||eI.global||(eI.lockOwnerFor=this),this},e.prototype._unlock=function(){if(k(!eI.global),0==--this._reculock)for(eI.global||(eI.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{tt(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&eI.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(k(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new er.DatabaseClosed(r);case"MissingAPIError":throw new er.MissingAPI(r.message,r);default:throw new er.OpenFailed(r)}if(!this.active)throw new er.TransactionInactive;return k(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=eK(function(n){tG(n),t._reject(e.error)}),e.onabort=eK(function(n){tG(n),t.active&&t._reject(new er.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=eK(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&tY.storagemutated.fire(e.mutatedParts)}),this},e.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return ta(new er.ReadOnly("Transaction is readonly"));if(!this.active)return ta(new er.TransactionInactive);if(this._locked())return new eM(function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},eI])});if(n)return e3(function(){var e=new eM(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new eM(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=eM.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(function(){return n});else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new eM(function(e,r){n.then(function(n){return t._waitingQueue.push(eK(e.bind(null,n)))},function(e){return t._waitingQueue.push(eK(r.bind(null,e)))}).finally(function(){t._waitingFor===i&&(t._waitingFor=null)})})},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new er.Abort))},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(h(t,e))return t[e];var n=this.schema[e];if(!n)throw new er.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}();function tK(e,t,n,r,i,o,a){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!a?"&":"")+(r?"*":"")+(i?"++":"")+tJ(t)}}function tJ(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function tZ(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:V(n,function(e){return[e.name,e]})}}var tQ=function(e){try{return e.only([[]]),tQ=function(){return[[]]},[[]]}catch(e){return tQ=function(){return ts},ts}};function t0(e){return null==e?function(){}:"string"==typeof e?1===e.split(".").length?function(t){return t[e]}:function(t){return N(t,e)}:function(t){return N(t,e)}}function t1(e){return[].slice.call(e)}var t2=0;function t3(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function t6(e,t){var n,r,i,a,l=e._novip,s=t.db,u=(n=l._middlewares,i=(r=l._deps).IDBKeyRange,r.indexedDB,{dbcore:(a=function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen,o=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!o):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!o)}var i,o=(i=t1(e.objectStoreNames),{schema:{name:e.name,tables:i.map(function(e){return n.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=c(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:t0(t)},indexes:t1(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,i=e.keyPath,a={name:t,compound:c(i),keyPath:i,unique:n,multiEntry:r,extractKey:t0(i)};return o[t3(i)]=a,a}),getIndexByKeyPath:function(e){return o[t3(e)]}};return o[":id"]=a.primaryKey,null!=t&&(o[t3(t)]=a.primaryKey),a})},hasGetAll:i.length>0&&"getAll"in n.objectStore(i[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),a=o.schema,l=o.hasGetAll,s=a.tables.map(function(e){var t;return{name:t=e.name,schema:e,mutate:function(e){var n=e.trans,i=e.type,o=e.keys,a=e.values,l=e.range;return new Promise(function(e,s){e=eK(e);var u,c=n.objectStore(t),d=null==c.keyPath,f="put"===i||"add"===i;if(!f&&"delete"!==i&&"deleteRange"!==i)throw Error("Invalid operation type: "+i);var p=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var h=[],m=[],g=0,y=function(e){++g,tG(e)};if("deleteRange"===i){if(4===l.type)return e({numFailures:g,failures:m,results:[],lastResult:void 0});3===l.type?h.push(u=c.clear()):h.push(u=c.delete(r(l)))}else{var b=f?d?[a,o]:[a,null]:[o,null],_=b[0],w=b[1];if(f)for(var x=0;x0||a.add.length>0||a.change.length>0)&&r.change.push(a)}else a.recreate=!0,r.change.push(a)}else r.add.push([n,o])}return r}function t9(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return ne(i,e)}),i}function ne(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function nt(e,t,n){var r={};return S(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=t.keyPath,o=tK(tJ(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[],l=0;l0,d=o(o({},n),{isVirtual:c,keyTail:t,keyLength:u,extractKey:t0(e),unique:!c&&n.unique});return s.push(d),d.isPrimaryKey||a.push(d),u>1&&l(2===u?e[0]:e.slice(0,u-1),t+1,n),s.sort(function(e,t){return e.keyTail-t.keyTail}),d}var s=l(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[s];for(var u=0,c=r.indexes;u0?Promise.reject(n.failures[0]):r.length1?t:e}:{d:0});else{var n=new nm;return e&&"d"in e&&d(n,e),n}};function ng(e,t,n){var r=tR(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(nv(e))return d(e,{from:t,to:n,d:1});var i=e.l,o=e.r;if(0>tR(n,e.from))return i?ng(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},n_(e);if(tR(t,e.to)>0)return o?ng(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},n_(e);0>tR(t,e.from)&&(e.from=t,e.l=null,e.d=o?o.d+1:1),tR(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;i&&!e.l&&ny(e,i),o&&a&&ny(e,o)}}function ny(e,t){nv(t)||function e(t,n){var r=n.from,i=n.to,o=n.l,a=n.r;ng(t,r,i),o&&e(t,o),a&&e(t,a)}(e,t)}function nb(e){var t=nv(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>tR(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=tR(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function n_(e){var t,n,r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){var a="r"===i?"l":"r",l=o({},e),s=e[i];e.from=s.from,e.to=s.to,e[i]=s[i],l[i]=s[a],e[a]=l,l.d=nw(l)}e.d=nw(e)}function nw(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}m(nm.prototype,((n={add:function(e){return ny(this,e),this},addKey:function(e){return ng(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return ng(t,e,e)}),this}})[F]=function(){return nb(this)},n));var nx={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new nm(e.MIN_KEY,e.MAX_KEY);return o(o({},e),{table:function(r){var i=e.table(r),a=i.schema,l=a.primaryKey,s=l.extractKey,d=l.outbound,f=o(o({},i),{mutate:function(e){var o=e.trans,l=o.mutatedParts||(o.mutatedParts={}),s=function(e){var n="idb://"+t+"/"+r+"/"+e;return l[n]||(l[n]=new nm)},u=s(""),d=s(":dels"),f=e.type,p="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=p[0],m=p[1],g=e.trans._cache;return i.mutate(e).then(function(e){if(c(h)){"delete"!==f&&(h=e.results),u.addKeys(h);var t=np(h,g);t||"add"===f||d.addKeys(h),(t||m)&&function(e,t,n,r){t.indexes.forEach(function(t){var i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}var a=function(e){return t.multiEntry&&c(e)?e.forEach(function(e){return i.addKey(e)}):i.addKey(e)};(n||r).forEach(function(e,t){var i=n&&o(n[t]),l=r&&o(r[t]);0!==tR(i,l)&&(null!=i&&a(i),null!=l&&a(l))})})}(s,a,t,m)}else if(h){var r={from:h.lower,to:h.upper};d.add(r),u.add(r)}else u.add(n),d.add(n),a.indexes.forEach(function(e){return s(e.name).add(n)});return e})}}),p=function(t){var n,r,i=t.query,o=i.index,a=i.range;return[o,new nm(null!==(n=a.lower)&&void 0!==n?n:e.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:e.MAX_KEY)]},h={get:function(e){return[l,new nm(e.key)]},getMany:function(e){return[l,new nm().addKeys(e.keys)]},count:p,query:p,openCursor:p};return u(h).forEach(function(e){f[e]=function(a){var l=eI.subscr;if(l){var u=function(e){var n="idb://"+t+"/"+r+"/"+e;return l[n]||(l[n]=new nm)},c=u(""),f=u(":dels"),p=h[e](a),m=p[0],g=p[1];if(u(m.name||"").add(g),!m.isPrimaryKey){if("count"===e)f.add(n);else{var y="query"===e&&d&&a.values&&i.query(o(o({},a),{values:!1}));return i[e].apply(this,arguments).then(function(t){if("query"===e){if(d&&a.values)return y.then(function(e){var n=e.result;return c.addKeys(n),t});var n=a.values?t.result.map(s):t.result;a.values?c.addKeys(n):f.addKeys(n)}else if("openCursor"===e){var r=a.values;return t&&Object.create(t,{key:{get:function(){return f.addKey(t.primaryKey),t.key}},primaryKey:{get:function(){var e=t.primaryKey;return f.addKey(e),e}},value:{get:function(){return r&&c.addKey(t.primaryKey),t.value}}})}return t})}}}return i[e].apply(this,arguments)}}),f}})}},nS=function(){function e(t,n){var r,i,a,l,s,u=this;this._middlewares={},this.verno=0;var c=e.dependencies;this._options=n=o({addons:e.addons,autoOpen:!0,indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var d=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var f={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ea,dbReadyPromise:null,cancelOpen:ea,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};f.dbReadyPromise=new eM(function(e){f.dbReadyResolve=e}),f.openCanceller=new eM(function(e,t){f.cancelOpen=t}),this._state=f,this.name=t,this.on=tx(this,"populate","blocked","versionchange","close",{ready:[eh,ea]}),this.on.ready.subscribe=C(this.on.ready.subscribe,function(t){return function(n,r){e.vip(function(){var e=u._state;e.openComplete?(e.dbOpenError||eM.resolve().then(n),r&&t(n)):e.onReadyBeingFired?(e.onReadyBeingFired.push(n),r&&t(n)):(t(n),r||t(function e(){u.on.ready.unsubscribe(n),u.on.ready.unsubscribe(e)}))})}}),this.Collection=(r=this,tS(tL.prototype,function(e,t){this.db=r;var n=tb,i=null;if(t)try{n=t()}catch(e){i=e}var o=e._ctx,a=o.table,l=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:l!==el?l:null}})),this.Table=(i=this,tS(tw.prototype,function(e,t,n){this.db=i,this._tx=n,this.name=e,this.schema=t,this.hook=i._allTables[e]?i._allTables[e].hook:tx(null,{creating:[ec,ea],reading:[es,el],updating:[ef,ea],deleting:[ed,ea]})})),this.Transaction=(a=this,tS(tW.prototype,function(e,t,n,r,i){var o=this;this.db=a,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=tx(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new eM(function(e,t){o._resolve=e,o._reject=t}),this._completion.then(function(){o.active=!1,o.on.complete.fire()},function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),ta(e)})})),this.Version=(l=this,tS(nr.prototype,function(e){this.db=l,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(s=this,tS(tH.prototype,function(e,t,n){this.db=s,this._ctx={table:e,index:":id"===t?null:t,or:n};var r=s._deps.indexedDB;if(!r)throw new er.MissingAPI;this._cmp=this._ascending=r.cmp.bind(r),this._descending=function(e,t){return r.cmp(t,e)},this._max=function(e,t){return r.cmp(e,t)>0?e:t},this._min=function(e,t){return 0>r.cmp(e,t)?e:t},this._IDBKeyRange=s._deps.IDBKeyRange})),this.on("versionchange",function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+u.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+u.name+"'. Closing db now to resume the delete request."),u.close()}),this.on("blocked",function(e){!e.newVersion||e.newVersion0x4000000000000000?0:t.oldVersion;s=y<1,e._novip.idbdb=c.result,d=y/10,f=l,p=e._dbSchema,(h=e._createTransaction("readwrite",e._storeNames,p)).create(f),h._completion.catch(i),m=h._reject.bind(h),g=eI.transless||eI,e3(function(){var t,n,r,i,o;eI.trans=h,eI.transless=g,0===d?(u(p).forEach(function(e){t9(f,e,p[e].primKey,p[e].indexes)}),t6(e,f),eM.follow(function(){return e.on.populate.fire(h)}).catch(m)):(t=e._novip,n=[],r=t._versions,i=t._dbSchema=nt(t,t.idbdb,f),o=!1,r.filter(function(e){return e._cfg.version>=d}).forEach(function(e){n.push(function(){var n=i,r=e._cfg.dbschema;nn(t,n,f),nn(t,r,f),i=t._dbSchema=r;var a=t7(n,r);a.add.forEach(function(e){t9(f,e[0],e[1].primKey,e[1].indexes)}),a.change.forEach(function(e){if(e.recreate)throw new er.Upgrade("Not yet support for changing primary key");var t=f.objectStore(e.name);e.add.forEach(function(e){return ne(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),ne(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>d){t6(t,f),h._memoizedTables={},o=!0;var s,c=T(r);a.del.forEach(function(e){c[e]=n[e]}),t4(t,[t.Transaction.prototype]),t5(t,[t.Transaction.prototype],u(c),c),h.schema=c;var p=H(l);p&&e6();var m=eM.follow(function(){if((s=l(h))&&p){var e=e5.bind(null,null);s.then(e,e)}});return s&&"function"==typeof s.then?eM.resolve(s):m.then(function(){return s})}}),n.push(function(n){o&&tp||function(e,t){[].slice.call(t.db.objectStoreNames).forEach(function(n){return null==e[n]&&t.db.deleteObjectStore(n)})}(e._cfg.dbschema,n),t4(t,[t.Transaction.prototype]),t5(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),h.schema=t._dbSchema})}),(function e(){return n.length?eM.resolve(n.shift()(h.idbtrans)).then(e):eM.resolve()})().then(function(){(function(e,t){u(e).forEach(function(n){t.db.objectStoreNames.contains(n)||t9(t,n,e[n].primKey,e[n].indexes)})})(i,f)})).catch(m)})}},i),c.onsuccess=eK(function(){l=null;var r,i,o,d=e._novip.idbdb=c.result,f=S(d.objectStoreNames);if(f.length>0)try{var p,h,m,g=d.transaction(1===f.length?f[0]:f,"readonly");n.autoSchema?((p=e._novip).verno=d.version/10,h=p._dbSchema=nt(p,d,g),p._storeNames=S(d.objectStoreNames,0),t5(p,[p._allTables],u(h),h)):(nn(e,e._dbSchema,g),((m=t7(nt(e,e.idbdb,g),e._dbSchema)).add.length||m.change.some(function(e){return e.add.length||e.change.length}))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),t6(e,g)}catch(e){}tf.push(e),d.onversionchange=eK(function(t){n.vcFired=!0,e.on("versionchange").fire(t)}),d.onclose=eK(function(t){e.on("close").fire(t)}),s&&(i=(r=e._deps).indexedDB,o=r.IDBKeyRange,no(i)||a===tv||ni(i,o).put({name:a}).catch(ea)),t()},i)})})]).then(function(){return o(),n.onReadyBeingFired=[],eM.resolve(na(function(){return e.on.ready.fire(e.vip)})).then(function t(){if(n.onReadyBeingFired.length>0){var r=n.onReadyBeingFired.reduce(eh,ea);return n.onReadyBeingFired=[],eM.resolve(na(function(){return r(e.vip)})).then(t)}})}).finally(function(){n.onReadyBeingFired=null,n.isBeingOpened=!1}).then(function(){return e}).catch(function(t){n.dbOpenError=t;try{l&&l.abort()}catch(e){}return i===n.openCanceller&&e._close(),ta(t)}).finally(function(){n.openComplete=!0,a()})}(this)},e.prototype._close=function(){var e=this._state,t=tf.indexOf(this);if(t>=0&&tf.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new eM(function(t){e.dbReadyResolve=t}),e.openCanceller=new eM(function(t,n){e.cancelOpen=n})},e.prototype.close=function(){this._close();var e=this._state;this._options.autoOpen=!1,e.dbOpenError=new er.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)},e.prototype.delete=function(){var e=this,t=arguments.length>0,n=this._state;return new eM(function(r,i){var o=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=eK(function(){var t,n,i,o;t=e._deps,n=e.name,i=t.indexedDB,o=t.IDBKeyRange,no(i)||n===tv||ni(i,o).delete(n).catch(ea),r()}),t.onerror=t$(i),t.onblocked=e._fireOnBlocked};if(t)throw new er.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(o):o()})},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return u(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var e=ns.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r,i,o=this,a=eI.trans;a&&a.db===this&&-1===e.indexOf("!")||(a=null);var l=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(i=t.map(function(e){var t=e instanceof o.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||e===tm)r=tm;else if("rw"==e||e==tg)r=tg;else throw new er.InvalidArgument("Invalid transaction mode: "+e);if(a){if(a.mode===tm&&r===tg){if(l)a=null;else throw new er.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY")}a&&i.forEach(function(e){if(a&&-1===a.storeNames.indexOf(e)){if(l)a=null;else throw new er.SubTransaction("Table "+e+" not included in parent transaction.")}}),l&&a&&!a.active&&(a=null)}}catch(e){return a?a._promise(null,function(t,n){n(e)}):ta(e)}var s=(function e(t,n,r,i,o){return eM.resolve().then(function(){var a,l=eI.transless||eI,s=t._createTransaction(n,r,t._dbSchema,i);if(i)s.idbtrans=i.idbtrans;else try{s.create(),t._state.PR1398_maxLoop=3}catch(i){if(i.name===en.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0)return console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(function(){return e(t,n,r,null,o)});return ta(i)}var u=H(o);u&&e6();var c=eM.follow(function(){if(a=o.call(s,s)){if(u){var e=e5.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=nl(a))}},{trans:s,transless:l});return(a&&"function"==typeof a.then?eM.resolve(a).then(function(e){return s.active?e:ta(new er.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):c.then(function(){return a})).then(function(e){return i&&s._resolve(),s._completion.then(function(){return e})}).catch(function(e){return s._reject(e),ta(e)})})}).bind(null,this,r,i,a,n);return a?a._promise(r,s,"lock"):eI.trans?tt(eI.transless,function(){return o._whenReady(s)}):this._whenReady(s)},e.prototype.table=function(e){if(!h(this._allTables,e))throw new er.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),nC="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",nk=function(){function e(e){this._subscribe=e}return e.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},e.prototype[nC]=function(){return this},e}();function nE(e,t){return u(t).forEach(function(n){ny(e[n]||(e[n]=new nm),t[n])}),e}function nV(e){var t=!1,n=void 0,r=new nk(function(r){var i=H(e),o=!1,a={},l={},s={get closed(){return o},unsubscribe:function(){o=!0,tY.storagemutated.unsubscribe(p)}};r.start&&r.start(s);var c=!1,d=!1;function f(){return u(l).some(function(e){return a[e]&&function(e,t){var n=nb(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=nb(e),a=o.next(i.from),l=a.value;!r.done&&!a.done;){if(0>=tR(l.from,i.to)&&tR(l.to,i.from)>=0)return!0;0>tR(i.from,l.from)?i=(r=n.next(l.from)).value:l=(a=o.next(i.from)).value}return!1}(a[e],l[e])})}var p=function(e){nE(a,e),f()&&h()},h=function(){if(!c&&!o){a={};var u,m,g={},y=(i&&e6(),u=function(){return e3(e,{subscr:g,trans:null})},m=eI.trans?tt(eI.transless,u):u(),i&&m.then(e5,e5),m);d||(tY(tX,p),d=!0),c=!0,Promise.resolve(y).then(function(e){t=!0,n=e,c=!1,!o&&(f()?h():(a={},l=g,r.next&&r.next(e)))},function(e){c=!1,t=!1,r.error&&r.error(e),s.unsubscribe()})}};return h(),s});return r.hasValue=function(){return t},r.getValue=function(){return n},r}try{i={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch(e){i={indexedDB:null,IDBKeyRange:null}}function nN(e){var t=nA;try{nA=!0,tY.storagemutated.fire(e)}finally{nA=t}}m(nS,o(o({},eo),{delete:function(e){return new nS(e,{addons:[]}).delete()},exists:function(e){return new nS(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{var t,n,r;return(n=(t=nS.dependencies).indexedDB,r=t.IDBKeyRange,no(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==tv})}):ni(n,r).toCollection().primaryKeys()).then(e)}catch(e){return ta(new er.MissingAPI)}},defineClass:function(){return function(e){d(this,e)}},ignoreTransaction:function(e){return eI.trans?tt(eI.transless,e):e()},vip:na,async:function(e){return function(){try{var t=nl(e.apply(this,arguments));if(!t||"function"!=typeof t.then)return eM.resolve(t);return t}catch(e){return ta(e)}}},spawn:function(e,t,n){try{var r=nl(e.apply(n,t||[]));if(!r||"function"!=typeof r.then)return eM.resolve(r);return r}catch(e){return ta(e)}},currentTransaction:{get:function(){return eI.trans||null}},waitFor:function(e,t){var n=eM.resolve("function"==typeof e?nS.ignoreTransaction(e):e).timeout(t||6e4);return eI.trans?eI.trans.waitFor(n):n},Promise:eM,debug:{get:function(){return $},set:function(e){$=e,G="dexie"===e?function(){return!0}:th}},derive:b,extend:d,props:m,override:C,Events:tx,on:tY,liveQuery:nV,extendObservabilitySet:nE,getByKeyPath:N,setByKeyPath:A,delByKeyPath:function(e,t){"string"==typeof t?A(e,t,void 0):"length"in t&&[].map.call(t,function(t){A(e,t,void 0)})},shallowClone:T,deepClone:P,getObjectDiff:nd,cmp:tR,asap:E,minKey:tu,addons:[],connections:tf,errnames:en,dependencies:i,semVer:tl,version:tl.split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),nS.maxKey=tQ(nS.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(tY(tX,function(e){if(!nA){var t;tp?(t=document.createEvent("CustomEvent")).initCustomEvent(tq,!0,!0,e):t=new CustomEvent(tq,{detail:e}),nA=!0,dispatchEvent(t),nA=!1}}),addEventListener(tq,function(e){var t=e.detail;nA||nN(t)}));var nA=!1;if("undefined"!=typeof BroadcastChannel){var nT=new BroadcastChannel(tq);"function"==typeof nT.unref&&nT.unref(),tY(tX,function(e){nA||nT.postMessage(e)}),nT.onmessage=function(e){e.data&&nN(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){tY(tX,function(e){try{nA||("undefined"!=typeof localStorage&&localStorage.setItem(tq,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&l([],self.clients.matchAll({includeUncontrolled:!0}),!0).forEach(function(t){return t.postMessage({type:tq,changedParts:e})}))}catch(e){}}),"undefined"!=typeof addEventListener&&addEventListener("storage",function(e){if(e.key===tq){var t=JSON.parse(e.newValue);t&&nN(t.changedParts)}});var nR=self.document&&navigator.serviceWorker;nR&&nR.addEventListener("message",function(e){var t=e.data;t&&t.type===tq&&nN(t.changedParts)})}eM.rejectionMapper=function(e,t){if(!e||e instanceof Z||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ei[e.name])return e;var n=new ei[e.name](t||e.message,e);return"stack"in e&&y(n,"stack",{get:function(){return this.inner.stack}}),n},G=th}),d.register("74PtA",function(e,t){r(e.exports,"copyToClipboard",function(){return o}),r(e.exports,"parseClassroom",function(){return a}),r(e.exports,"parse",function(){return l}),r(e.exports,"stringify",function(){return s}),r(e.exports,"scrapeModule",function(){return u}),r(e.exports,"validateUrl",function(){return c}),r(e.exports,"infoHash",function(){return f}),r(e.exports,"getPeerID",function(){return p}),r(e.exports,"clone",function(){return h}),r(e.exports,"removeKeysStartingWithSecret",function(){return function e(t){for(let n in t)"object"==typeof t[n]&&(// Recursively call the function if the value is an object or an array -e(t[n]),"{}"===JSON.stringify(t[n])&&delete t[n]),n.toLocaleLowerCase().startsWith("secret")&&delete t[n]}}),r(e.exports,"deepEqual",function(){return function e(t,n){let r=Object.keys(t),i=Object.keys(n);if(r.length!==i.length)return!1;for(let i of r){let r=t[i],o=n[i],a=m(r)&&m(o);if(a&&!e(r,o)||!a&&r!==o)return!1}return!0}});var n=d("5dn3r");function i(e,t,n){if(t.match(/(https?)?:\/\//i))return"script"===e?``:``;let r=new URL(t,n).toString();return``:``;let r=new URL(t,n).toString();return` \ No newline at end of file +Edrys - Lite \ No newline at end of file