-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.js
1 lines (1 loc) · 224 KB
/
index.js
1
module.exports=function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=79)}([function(e,t){e.exports=require("mongoose")},function(e,t,a){a(4).Server,a(4).Db;t.user=a(108),t.lrs=a(110),t.error=a(126),t.message=a(127),t.payment=a(128),t.count=a(129),t.embedableChart=a(130)},function(e,t){e.exports=require("random-js")},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("mongodb")},function(e,t,a){process.env;const n=a(71);function i(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}t.hashPassword=function(e,t,a){return n.pbkdf2Sync(a,t,1e4,16,"sha256").toString("hex")},t.sumMBox=function(e){const t=n.createHash("sha1");return t.update(e),t.digest("hex")},t.mustBe=function(e,t){return function(a,n,i){return a.user.type==e?t(a,n,i):i()}},t.endInSlash=function(e,t,n){const i=a(14).parse(e.baseUrl+e.url);if(i.pathname.indexOf(".")>-1)return n();"GET"==e.method&&"/"!==i.pathname[i.pathname.length-1]?(i.pathname+="/",t.redirect(i.format())):n()},t.getMongoConnectionString=function(e){let t=process.parsed_env.mongoServer.replace("mongodb://","").split("/")[0];if(process.parsed_env.mongoServer.replace("mongodb://","").split("?")[0].match(/\/.+$/))throw new Error("Please don't include the database name in the mongo connection string");t=t.split("?")[0]+`/${e}`;let a=process.parsed_env.mongoServer.split("?")[1];a&&a.toLowerCase().indexOf("replicaset")>-1&&"lite"==BUILD_TYPE&&(console.log("Lite version does not support multiserver databases."),process.exit()),a?(a=a.split("&")).push("authSource=admin"):a=["authSource=admin"];let n="";return a.length>0&&(n=`?${a.join("&")}`),`mongodb://${t}${n}`},t._userToDefaults=function(e,t,a){e.defaults=e._user,a()},t.renderPage=function(e,t){return function(a,n,i){n.locals.pageTitle=e,n._render(t,{})}},t.ensureLearnerLoggedIn=function(e,t,a){if(!e.learner)return t.redirect(`/ui/lrs/${e.lrs.prettyURL}/learners/home/login?r=${encodeURIComponent(`${e.baseUrl}${e.url}`)}`);a()},t.ensureLearnerLoggedIn.type="permissionMiddleware",t.ensureLoggedIn=function(e,t,a){if(!e.user)return t.redirect(`/ui/users/login?r=${encodeURIComponent(`${e.baseUrl}${e.url}`)}`);a()},t.ensureLoggedIn.type="permissionMiddleware",t.icons=function(e,t,n){const i=a(107);t._render("icons",{icons:i})},t.ensureLearnerNotLoggedIn=function(e,t,a){e.learner?t.redirect("/"):a()},t.ensureLearnerNotLoggedIn.type="permissionMiddleware",t.ensureNotLoggedIn=function(e,t,a){e.user?t.redirect("/"):a()},t.ensureNotLoggedIn.type="permissionMiddleware",t.usertoLocals=function(e,t,a){e.user&&(t.locals.user=e.user),a()},t.testOwner=function(e,t){if(!e)throw"object can't be null";return!!t&&(t.uuid==a(22).owner||e.owner==t.uuid)},t.message=function(e,t,a){t.message=function(e,a){let n=e,i=a;i||(i=n,n=null),t._render("message",{title:n,message:i})},a()},t.checkMustResetPassword=function(e,t,a){e.user&&e.session.mustResetPassword&&"/users/resetPassword/"!==e.url?t.redirect("/ui/users/resetPassword"):a()},t.renderTemplate=function(e){return function(t,a,n){a._render(e)}},t.genPageination=function(e,t,a){let n=e;n-=1;const i=Math.ceil(t/a),r={};n>-1&&(r.prev={page:n}),n<i-2&&(r.next={page:n+2}),n>3&&(r.start={page:0}),i-(n+2)>3&&(r.end={page:i-1}),r.pages=[];let s=0;n>3&&(s=n-2);for(let e=s;e<Math.min(s+7,i);e++)r.pages.push({page:e,display:e+1,current:e==n+1});return r},t.errorRoutes=function(...e){return e.map(e=>t.exceptionsToExpressError(e))},t.exceptionsToExpressError=function(e){return"function"==typeof e?function(t,a,n){try{const i=e(t,a,n);i&&i.catch&&i.catch(n)}catch(e){n(e)}}:e},t.userToDefaults=function(e,t,a){e.defaults=e.user,a()},t.getLRSLite=async function(e,t,n){const i=a(1).lrs,r=await i.findOne({prettyURL:e.params.id}).exec();r&&(e.lrs=r),n()},t.getLRS=async function(e,t,n){const i=a(1).lrs,r=await i.findOne({prettyURL:e.params.id}).exec();if(r){e.lrs=r;const i=a(6);if(!await i.connect(r))return console.log("Attempt to access DB that does not exist"),t.redirect("/");const s=await i.odm(r);if(!s)return console.log("Attempt to access DB that does not exist"),t.redirect("/");const o=await s.key.find({}).exec();e.lrs.keys=o,e.lrs.odm=s,t.locals.lrs=e.lrs,n()}else t.redirect("/")},t.ensureLRSOwner=function(e,t,n){a(74).checkPermission(".",e.lrs,e.user)?n():t.redirect("/")},t.notLearner=function(e,t,a){"learner"==e.user.type?t.redirect(`/ui/lrs/${e.user.lrs}`):a()},t.isLearner=function(e,t,a){return e.user?"learner"!=e.user.type?a("User is not a user of this LRS."):void a():a("Not logged in")},t.mustBeAdmin=function(e,t,n){const i=a(74);i.checkPermission(".",i.permissionRoot,e.user)?n():t.redirect("/")},t.confirm=function(e,t,a,n){return function(i,r){r._render("confirm",{prompt:e,subprompt:t,yesUrl:a,doneUrl:n})}},t.errorHandler=function(e,t,n,i){const r=new(a(1).error);r.uuid=a(3).v4(),r.createdOn=new Date,r.name=e.name,r.message=e.message,r.stack=e.stack,r.url=t.url,r.user=t.user?t.user.uuid:"",r.body=t.body,console.log(e),r.save(e=>{console.log("err in save error",e)}),n.status(500),"application/x-www-form-urlencoded"==t.get("content-type")||"multipart/form-data"==t.get("content-type")?n.send({text:`Shoot! An error occured! ${r.uuid}`}):n._render("message",{title:"Error!",message:`Shoot! An error occured! ${r.uuid}`})},t.final404=function(e,t,a){t.status(404),"application/x-www-form-urlencoded"==e.get("content-type")||"multipart/form-data"==e.get("content-type")?t.send({text:`Sorry, we can't find the page at ${e.baseUrl}${e.url}`}):t._render("message",{title:"404",message:`Sorry, we can't find the page at ${e.baseUrl}${e.url}`})},t.createSampleLRS=async function(e){const t=a(1).lrs,n=a(133),i=(await t.find({}).count(),`Sample LRS ${a(15)().word({length:7})}`),r=new t;r.lrsName=i,r.prettyURL=n(i),r.owner=e.uuid,r.createdOn=new Date,r.strict=!0,r.preferRead=!1,r.verboseLogs=!0,r.uuid=a(3).v4(),r.secret=a(3).v4(),await r.save();const s=new((await a(6).odm(r)).key);return s.name="Sample Credentials",s.read=!0,s.write=!0,s.uuid="username",s.password="password",await s.save(),a(134).schedule("generateStatements",{lrs:r,user:e}),{sampleLRS:r,newKey:s}},t.populateLrsStats=async function(e){if(e.stats)return console.log("lrs stats already populated"),e;const t=a(6),n=await t.connect(e);let i;e.stats=await n.stats(),e.stats.dataSize/=1e6,e.stats.dataSize=Math.round(e.stats.dataSize),i=e.parent?Math.round(e.parent.getTier().maxStorage/1e6):0,e.stats.percentUsed=e.stats.dataSize/i*100,e.stats.allowedInMegs=i,e.stats.counts={},e.stats.counts.statements=0,e.stats.counts.attachments=0,e.stats.counts.state=0,e.stats.counts.logs=0;try{e.stats.counts.statements=(await n.command({collStats:"statements"})).count,e.stats.counts.attachments=(await n.command({collStats:"attachments"})).count,e.stats.counts.state=(await n.command({collStats:"state"})).count,e.stats.counts.logs=(await n.command({collStats:"userLogs"})).count}catch(e){}return e},t.preventOverLimit=async function(t,a,n){if("lrs.io"==BUILD_TYPE){if(!t.lrs)return console.log("Cant run preventOverLimit when req.lrs not populated"),n();if(t.lrs.stats||(t.lrs=await e.exports.populateLrsStats(t.lrs)),t.lrs.stats.percentUsed>=100)return a.message("You're over your data limit! You need to free up some space before you can use this feature.")}n()},t.redirectToTOS=function(e,t,a){"/users/accepttos/"!==e.path&&e.user&&null==e.user.acceptsTOS?t.redirect("/ui/users/accepttos/"):a()},t.genSearchForm=function(e){const t=[];t.push({label:"Search All",type:{isText:!0},id:"search"});for(const a in e)t.push({label:e[a],type:{isText:!0},id:e[a]});return{fields:t}},t.mongooseQueryFromQueryString=function(e,t){let a={};for(const t in e.query)e.query[t]&&(a[t]=new RegExp(i(e.query[t].trim()),"ig"));if(e.query.search){a={$or:[]};for(let n=0;n<t.length;n++){const r={};r[t[n]]=new RegExp(i(e.query.search.trim()),"ig"),a.$or.push(r)}}return a},t.generateStatements=async function(e){const t=a(6),n=await t.dal(e,!1,!1),i=new(a(160))(n,{homepage:"https://veracity.it",name:"veracity-generated"}),r=a(161);await r.generateStatements(i,100)}},function(e,t,a){a(4).MongoClient;const n=a(21),i=a(0),r=a(5);global.connectionPoolSingleton&&(e.exports=global.connectionPoolSingleton);global.connectionPoolSingleton=e.exports=new class{constructor(){this.connections={},this.mongoose={},this.systemMongoose=null}connectSystem(){const e=this;return new Promise((t,a)=>{i.connect(r.getMongoConnectionString(process.parsed_env.adminDBName),{useMongoClient:!0},n=>{e.systemMongoose=i.connection,n?a(n):t(e.systemMongoose)})})}async connect(e,t=!0){const a=this,n=await this.odm(e,t);return 1===n.readyState?n.db:new Promise((t,i)=>{n.on("open",i=>{a.wrap(n.db,e),t(n.db)}),n.on("error",e=>{i(e)})})}wrap(e,t){const a=Object.keys(e);for(const n in a){const i=e[a[n]],r=this;if(i instanceof Function){e[a[n]]=function(...a){return r.touch(t),i.apply(e,a)};for(const t in i)e[a[n]][t]=i[t]}}}odm(e,t=!0){let n,s=e;const o=a(1).lrs,l=this;if(s.constructor!==o?(console.log(new Error("You must now get an ODM reference via an LRS model instance")),n=s):n=s.uuid,this.mongoose[n]&&t)this.mongoose[n].when=new Date;else{const e=new Promise(async(e,c)=>{const d=i.createConnection(r.getMongoConnectionString(n),{useMongoClient:!0,poolSize:1});s.constructor!==o&&(s=await o.findOne({uuid:n})),a(111).attachLrsModels(d,s),t?(d.shutdown=function(){d.close(!0);const e=i.connections;for(const t in e)e[t]==d&&e.splice(t,1);for(const e of Object.keys(i.models))delete i.models[e];for(const e of Object.keys(i.connection.collections))delete i.connection.collections[e];for(const e of Object.keys(i.modelSchemas))delete i.modelSchemas[e]},l.wrap(d,n)):d.shutdown=function(){d.close()},e(d)});t&&(this.mongoose[n]={conn:e,when:new Date})}return this.mongoose[n].conn}dal(e,t,a,i=!0){return n.get(e,t,a,i)}touch(e){this.mongoose[e]&&(this.mongoose[e].when=new Date)}touchDal(e){n.touch(e)}async shutdown(){const e=this.mongoose;for(const t in e){const a=await e[t].conn;await a.close(),delete e[t]}}startLoop(){setInterval(()=>{const t=a(73),n=e.exports.mongoose;for(const e in n){const a=n[e].when;new Date-a>t(process.env.closeConnectionsAfter||"2 minutes")&&(n[e].conn.then(e=>{e.shutdown()}),delete n[e])}},2e3)}}},function(e,t,a){var n=a(2)(),i={actor:{},verb:{},object:{},context:{contextActivities:{grouping:[{},{id:"",definition:{type:"http://adlnet.gov/expapi/activities/attempt"}}],category:[{id:"https://w3id.org/xapi/scorm",definition:{type:"http://adlnet.gov/expapi/activities/profile"}}]}}};e.exports.getBase=function(e,t,a,r){var s=JSON.parse(JSON.stringify(i));return s.id=n.uuid4(),s.actor=e,s.object=t.activity,s.context.contextActivities.grouping[0]=t.contextActivity,s.context.contextActivities.grouping[1].id=a,s.timestamp=r.toISOString(),s}},function(e,t){e.exports=require("express")},function(e,t,a){const n=a(26),i=new n({format:"full",jsonPointers:!0}),r=a(27),s=new(a(15)),o=a(82),l=a(28),c=a(30),d=a(31),u=a(32),m=a(33),p=a(34),h=a(35),y=a(36),g=a(37),f=a(16),b=a(38),v=a(39),S=a(40),w=a(41),x=a(17),A=a(42),D=a(43),M=a(44),C=a(45),L=a(46),P=a(12),j=a(13),E=a(47),T=a(48),R=a(49),k=a(50),I=a(51),B=a(52),$=a(53),J=a(54),O=a(55),N=a(56),K=a(57),G=a(58),q=a(59),U=a(60),F=a(61),_=a(62),z=a(63),H=a(64),V=a(65),W=a(66),Z=a(67),Y=a(68);i.addFormat("mbox",/mailto\:[-_a-zA-Z0-9\.]+@[-_a-zA-Z0-9]+\.[a-zA-Z0-9]{2,20}/),i.addFormat("iso8601",e=>{if("P4W1D"==e)return!1;return new RegExp("^P((?=[\\d\\.]+[YMWD])([\\d\\.]+Y)?([\\d\\.]+M)?([\\d\\.]+W)?([\\d\\.]+D)?)?(T(?=[\\d\\.]+[HMS])([\\d\\.]+H)?([\\d\\.]+M)?([\\d\\.]+S)?)?$").test(e)}),i.addSchema(l),i.addSchema(c),i.addSchema(d),i.addSchema(u),i.addSchema(m),i.addSchema(p),i.addSchema(h),i.addSchema(y),i.addSchema(g),i.addSchema(f),i.addSchema(b),i.addSchema(v),i.addSchema(S),i.addSchema(w),i.addSchema(x),i.addSchema(A),i.addSchema(D),i.addSchema(M),i.addSchema(C),i.addSchema(L),i.addSchema(P),i.addSchema(j),i.addSchema(E),i.addSchema(T),i.addSchema(R),i.addSchema(k),i.addSchema(I),i.addSchema(B),i.addSchema($),i.addSchema(J),i.addSchema(O),i.addSchema(N),i.addSchema(K),i.addSchema(G),i.addSchema(q),i.addSchema(U);const Q=new n({coerceTypes:!0,format:"full",jsonPointers:!0});Q.addSchema(l),Q.addSchema(b),Q.addSchema(v),Q.addSchema(S),Q.addSchema(w),Q.addSchema(x),Q.addSchema(g),Q.addSchema(u),Q.addSchema(m),Q.addSchema(p),Q.addSchema(h),Q.addSchema(y),Q.addSchema(K),Q.addSchema(G),Q.addSchema(q),Q.addSchema(U),Q.addFormat("mbox",/mailto\:[-_a-zA-Z0-9\.]+@[-_a-zA-Z0-9]+\.[a-zA-Z0-9]{2,20}/),Q.addSchema(f);const X=i.compile(T),ee=i.compile(F),te=Q.compile(k),ae=Q.compile(_),ne=i.compile(H),ie=i.compile(V),re=i.compile(l),se=i.compile(M),oe=i.compile(z),le=i.compile(W),ce=i.compile(Z),de=i.compile(Y);function ue(e){for(const t in e){if(e[t]&&e[t].trim&&"{"==e[t].trim()[0])try{e[t]=JSON.parse(e[t])}catch(e){}if(e[t]&&e[t].trim&&0==e[t].trim().indexOf('"{'))try{e[t]=JSON.parse(e[t]),e[t]=JSON.parse(e[t]),console.log("This was in fact double json")}catch(e){}}}const me=a(69),pe=a(83);o({schema:T,mode:"return",indent:2});e.exports.validateStatement=function(e){const t=X(e);return{valid:t,error:t?null:pe.validateStatement(e).error}},e.exports.validatePayload=function(e){const t=ee(e);return{valid:t,error:t?null:pe.validatePayload(e).error}},e.exports.validateAdvancedQuery=function(e){!function(e){for(const t in e)if(e[t]&&e[t].trim&&"{"==e[t].trim()[0])try{e[t]=me.parse(e[t])}catch(e){}}(e);const t=de(e);return{valid:t,error:t?null:pe.validateAdvancedQuery(e).error}},e.exports.validateQuery=function(e){ue(e);const t=te(e);return{valid:t,error:t?null:pe.validateQuery(e).error}},e.exports.validateActivityProfile=function(e){ue(e);const t=oe(e);return{valid:t,error:t?null:pe.validateActivityProfile(e).error}},e.exports.validateActivityState=function(e){ue(e);const t=ae(e);return{valid:t,error:t?null:pe.validateActivityState(e).error}},e.exports.validateAgentQuery=function(e){ue(e);const t=le(e);return{valid:t,error:t?null:pe.validateAgentQuery(e).error}},e.exports.validateActivityQuery=function(e){ue(e);const t=ce(e);return{valid:t,error:t?null:pe.validateActivityQuery(e).error}},e.exports.validateAgentProfile=function(e){ue(e);const t=ne(e);return{valid:t,error:t?null:pe.validateAgentProfile(e).error}},e.exports.validatePut=function(e){const t=ie(e);return{valid:t,error:t?null:pe.validatePut(e).error}},e.exports.isLangMap=function(e){return re(e)},e.exports.isActivity=function(e){return se(e)};const he=a(88),ye=[l,c,d,y,g,x,A,D,M,C,L,P,j,E,T,b,v,S,w,f,u,m,p,h,K,G,q,U,R,k,I,B,$,J,O,N];he.format("mbox",()=>`mailto:${s.email()}`),he.extend("chance",()=>s),he.format("uuid",()=>a(3).v4()),he.format("uri",()=>s.url()),he.format("iso8601",()=>{const e=new RegExp("^P(?=[\\d\\.]+[YMWD])([\\d\\.]+Y)?([\\d\\.]+M)?([\\d\\.]+W)?([\\d\\.]+D)?(T(?=[\\d\\.]+[HMS])([\\d\\.]+H)?([\\d\\.]+M)?([\\d\\.]+S)?)?$");return he.random.randexp(e)});const ge={};for(const e in ye)ge[ye[e].id]=ye[e];function fe(e,t){for(const a in t)if(t[a].id==e)return JSON.parse(JSON.stringify(t[a]));console.log("could not deref ",e,t)}function be(e,t,a){return a.indexOf(e)===t}function ve(e,t,a,n){if("string"!=typeof e){for(const t in e)if("oneOf"==t&&e[t][0].$ref){const a=e[t][Math.floor(Math.random()*e[t].length)];e.$ref=a.$ref,delete e[t]}else ve(e[t],e,t,n);return e}}e.exports.randomStatement=function(e){const t=ye.map(e=>ve(JSON.parse(JSON.stringify(e))));return new Promise((e,a)=>{let n=ve(JSON.parse(JSON.stringify(T)));(function e(t){if("string"!=typeof t&&t){for(const a in t)e(t[a]);if(t.properties){let e=Object.keys(t.properties);e=s.pickset(e,Math.floor(Math.random()*e.length+.5)),e=(t.required||[]).concat(e).filter(be),t.required=e}}})(n=function e(t,a,n){let i=t;if(!i)return i;if("string"==typeof i)return i;for(const t in i.properties)i.properties[t].$ref&&(i.properties[t]=e(fe(i.properties[t].$ref,a),a,t)),i.properties[t].oneOf&&(i.properties[t]=i.properties[t].oneOf[0]);for(const t in i)i[t]&&(i[t].$ref&&(i[t]=e(fe(i[t].$ref,a),a,t)),i[t].oneOf&&(i[t]=i[t].oneOf[0]),e(i[t],a,t));return i.$ref&&(i=e(fe(i.$ref,a),a,"$ref")),i}(n,t)),he.resolve(n,t).then(t=>{(r.get(t,"object.definition.correctResponsesPattern")||r.get(t,"object.definition.choices")||r.get(t,"object.definition.source")||r.get(t,"object.definition.target")||r.get(t,"object.definition.steps")||r.get(t,"object.definition.scale"))&&r.set(t,"object.definition.interactionType",s.pickone(["true-false","choice","fill-in","long-fill-in","likert","matching","performance","sequencing","numeric","other"])),e(t)})})},e.exports.parseJSONQuery=ue},function(e,t){e.exports={AccountError:class extends Error{constructor(e){super(e)}},ClientError:class extends Error{constructor(e){super(e),this.err=e}},ConflictError:class extends Error{constructor(e){super(e)}},PreconditionError:class extends Error{constructor(e){super(e)}},ServerError:class extends Error{constructor(e){super(e)}},NotFoundError:class extends Error{constructor(e){super(e)}}}},function(e,t,a){const n=a(4).MongoClient,i=a(4),r=a(3),s=a(99);a(100);const{URL:o}=a(14);function l(e,t,n){let i=t,r=n;i=i||function(){return null},r=r||function(){return null};const s=a(101);return function e(t){return s(t,(t,a,n)=>{!1!==i(t,a,n)&&t instanceof Object&&(e(t),r(t,a,n))}),t}(e)}const c=a(9),d=a(102),u=a(103),m=a(20),{ClientError:p,ConflictError:h,PreconditionError:y,ServerError:g,NotFoundError:f}=a(10),b=a(104),v=function(e,t,a){t.indexOf(".")>-1&&(a[t.replace(/\./g,"*`*")]=e,delete a[t])},S=function(e,t,a){0==t.indexOf("$")&&(a[`_${t}`]=e,delete a[t])},w=function(e,t,a){const n=Object.keys(e);if(1==n.length&&"$parseDate"==n[0]){const n=e.$parseDate.date;if(!n)throw console.log(e),new Error("$parseDate should have one key, 'date'");a[t]=new Date(n)}if(1==n.length&&"$parseNum"==n[0]){const n=e.$parseNum.num;if(!n)throw new Error("$parseNum should have one key, 'num'");a[t]=parseFloat(n)}if(1==n.length&&"$parseRegExp"==n[0]){const n=e.$parseRegExp.regexp;if(!n)throw new Error("$parseRegex should have one key, 'regexp'");a[t]=new RegExp(n)}},x=function(e,t,a){t.indexOf("*`*")>-1&&(a[t.replace(/\*`\*/g,".")]=e,delete a[t])},A=function(e){return e.mbox?e.mbox:e.mbox_sha1sum?e.mbox_sha1sum:e.openid?e.openid:e.account?m(e.account):e.member?m(e):void 0},D=function(e){if(e.id)return e.id},M=function e(t){let a=[];for(const n in t)void 0!==t[n]&&(A(t[n])&&a.push(A(t[n])),t[n].member&&(a=a.concat(e(t[n].member))));return a},C=function(e){const t=[];for(const a in e)if(void 0!==e[a]){if(D(e[a])&&t.push(D(e[a])),e[a].grouping)for(const n in e[a].grouping)t.push(D(e[a].grouping[n]));if(e[a].parent)for(const n in e[a].parent)t.push(D(e[a].parent[n]));if(e[a].category)for(const n in e[a].category)t.push(D(e[a].category[n]));if(e[a].other)for(const n in e[a].other)t.push(D(e[a].other[n]))}return t},L=function(e){if(e.statementId&&e.voidedStatementId)throw new p("The LRS MUST reject with a 400 Bad Request error any requests to this resource which contain both statementId and voidedStatementId parameters");if(e.statementId||e.voidedStatementId){const t=JSON.parse(JSON.stringify(e));if(delete t.statementId,delete t.voidedStatementId,delete t.attachments,delete t.format,0!==Object.keys(t).length)throw new p('The LRS MUST reject with an 400 Bad Request error any requests to this resource which contain statementId or voidedStatementId parameters, and also contain any other parameter besides "attachments" or "format"')}const t={voided:!1,provisional:!1};return this.preferRead||(delete t.voided,delete t.provisional),e.statementId&&(t.id=e.statementId,t.voided=!1),e.voidedStatementId&&(t.id=e.voidedStatementId,t.voided=!0),e.agent&&(e.agent=A(e.agent),t.agent=e.agent),e.verb&&(t.verb=e.verb),e.activity&&(t.activity=e.activity),e.registration&&(t.registration=e.registration),e.related_activities&&(delete t.activity,t.relatedActivities=e.activity),e.related_agents&&(delete t.agent,t.relatedAgents=e.agent),e.authority&&(t["statement.authority"]=e.authority),e.since&&e.until?t.$and=[{"statement.stored":{$gt:new Date(e.since)}},{"statement.stored":{$lt:new Date(e.until)}}]:e.since?t["statement.stored"]={$gt:new Date(e.since)}:e.until&&(t["statement.stored"]={$lt:new Date(e.until)}),t},P=function e(t){try{new o(t.verb.id),t.object.verb&&e(t.object)}catch(e){throw new p(`${e.message}in Verb ID`)}},j=function e(t){if(t.context&&t.context.contextActivities){const e=["grouping","parent","category","other"],a=t.context.contextActivities;for(const t in e)a[e[t]]&&a[e[t]].constructor==Object&&(a[e[t]]=[a[e[t]]])}t.object.context&&e(t.object)},E=function e(t){if(t.context){if(t.context.revision&&t.object.objectType&&"Activity"!==t.object.objectType)throw new p('A Statement cannot contain both a "revision" property in its "context" property and have the value of the "object" property\'s "objectType" be anything but "Activity"');if(t.context.platform&&t.object.objectType&&"Activity"!==t.object.objectType)throw new p('A Statement cannot contain both a "platform" property in its "context" property and have the value of the "object" property\'s "objectType" be anything but "Activity"')}t.object.context&&e(t.object)},T=function e(t){if(t.result&&t.result.score){const e=t.result.score.min,a=t.result.score.max,n=(t.result.score.scaled,t.result.score.raw);if(void 0!==e&&void 0!==n&&n<e)throw new p("raw is less than min");if(void 0!==a&&void 0!==n&&n>a)throw new p("raw is greater than max");if(void 0!==e&&void 0!==a&&a<e)throw new p("max is less than min");if(void 0!==e&&void 0!==a&&a<e)throw new p("max is less than min")}t.object.result&&e(t.object)},R=function e(t){t.authority,t.object.authority&&e(t.object)},k=function(e){return 0==e.indexOf("http://adlnet.gov/expapi/verbs/voided")},I=function(e,t){for(const a in t)"objectType"!=a&&e[a]&&-1==e[a].indexOf(t[a])&&e[a].push(t[a]);return e};function B(e,t,a){return a.indexOf(e)===t}const $=a(70).EventEmitter;e.exports=class extends ${constructor(e,t=!0,a=!0){super(),this.connectionString=e,this.strict=t,this.preferRead=a,this.locked=0,this.locked++,n.connect(e,{poolSize:1,appname:e},(e,t)=>{if(e)return console.log(e),void this.locked--;this.db=t,this.statements=t.collection("statements"),this.userLogs=t.collection("userLogs"),this.accessLogs=t.collection("accessLogs"),this.moreLinks=t.collection("moreLinks"),this.state=t.collection("state"),this.activityProfile=t.collection("activityProfile"),this.agentProfile=t.collection("agentProfile"),this.attachments=t.collection("attachments"),this.userLogs.createIndex({id:1}),this.userLogs.createIndex({when:1}),this.userLogs.createIndex({type:1}),this.statements.createIndex({id:1},{unique:!0}),this.statements.createIndex({agent:1}),this.statements.createIndex({verb:1}),this.statements.createIndex({activity:1}),this.statements.createIndex({registration:1}),this.statements.createIndex({relatedActivities:1}),this.statements.createIndex({relatedAgents:1}),this.statements.createIndex({voided:1}),this.statements.createIndex({voids:1}),this.statements.createIndex({provisional:1}),this.statements.createIndex({"statement.stored":1}),this.statements.createIndex({"statement.stored":-1}),this.statements.createIndex({"statement.timestamp":1}),this.statements.createIndex({"statement.object.id":1}),this.statements.createIndex({"statement.object.objectType":1}),this.statements.createIndex({"statement.actor.id":1}),this.statements.createIndex({"statement.actor.mbox":1}),this.statements.createIndex({"statement.registration":1}),this.activityProfile.createIndex({id:1}),this.activityProfile.createIndex({contextID:1}),this.agentProfile.createIndex({id:1}),this.agentProfile.createIndex({contextID:1}),this.state.createIndex({id:1}),this.state.createIndex({contextID:1}),this.attachments.createIndex({xApiHash:1}),this.moreLinks.createIndex({id:1}),this.moreLinks.createIndex({createdOn:1}),this.ready=!0,this.locked--,this.emit("ready")})}shutdown(){this.db&&this.ready&&0===this.locked?(console.log("Shutdown"),this.db.close()):(console.log("Not ready to shutdown!",this.ready&&this.locked),setTimeout(()=>{this.shutdown()},100))}async userLog(e,t,a,n){if(e.constructor!==String)throw new Error("Error in logger");if(t&&t.constructor!==String)throw new Error("Error in logger");if(n&&n.constructor!==String)throw new Error("Error in logger");this.locked++,a&&(l(a,v),l(a,S)),await this.userLogs.insert({type:e,message:t,context:a,id:n,when:new Date(Date.now())}),this.locked--}async log(e,t,a,n){this.verbose&&this.userLog(e,t,a,n),this.accessLog(e)}async accessLog(e){let t,a=e;if(this.locked++,"string"!=typeof a&&(a=a.constructor.name),["storeStatements","storeAttachment","storeDocument"].indexOf(a)>-1?t="store":["getStatements","getAttachment","getDocument"].indexOf(a)>-1?t="get":["ClientError","ConflictError","NotFoundError","ServerError","AccountError"].indexOf(a)>-1?t="error":console.log("unknown log type",a),t){let e=new Date;e=new Date(b(e,"mm/dd/yyyy hh:01")),await this.accessLogs.update({when:e,type:t},{$inc:{value:1}},{upsert:!0})}this.locked--}async getActivity(e){const t=await this.statements.find({activity:e}).limit(100).toArray();let a={objectType:"Activity",id:e};for(const n in t)t[n].statement.object.id==e&&(a=d(a,t[n].statement.object));return l(a,x),this.log("getActivity",null,null,e),a}async getAgentAsPerson(e){const t={},a=A(e);let n={objectType:"Person",mbox:[],mbox_sha1sum:[],account:[],openid:[],name:[]};t.agent=a;const i=await this.statements.find(t,{"statement.actor":1}).limit(100).toArray();for(const e in i)if(A(i[e].statement.actor)==a&&(n=I(n,i[e].statement.actor)),i[e].statement.actor.members)for(const t in i[e].statement.actor.members){const r=i[e].statement.actor.members[t];A(r)==a&&(n=I(n,r))}return this.log("getAgent",null,null,a),n}async voidTargets(e){const t=e.filter(e=>k(e.verb.id)).map(e=>e.object.id);t.length>0&&await this.statements.update({id:{$in:t}},{$set:{voided:!0}})}async storeAttachment(e){this.locked++;try{const t={};t.xApiHash=e.xApiHash,t.contentType=e.contentType,t.data=new i.Binary(e.data);await this.attachments.replaceOne({xApiHash:t.xApiHash},t,{upsert:!0});this.log("storeAttachment",null,null,t.xApiHash)}catch(e){throw this.locked--,e}this.locked--}async getAttachment(e){this.locked++;const t=await this.attachments.find({xApiHash:e}).toArray();if(t&&t[0])return t[0].data=t[0].data.read(0,t[0].data.length),this.log("getAttachment",null,null,e),this.locked--,t[0];this.locked--}async testForVoidingRequirements(e){for(const t in e){const a=e[t];if(k(a.verb.id)){if("StatementRef"!==a.object.objectType)throw new p('A Voiding Statements "objectType" field has a value of "StatementRef"');const e=a.object.id,t=await this.statements.find({id:e},{id:1,verb:1}).toArray();if(t&&t.length>0){const e=t[0];if(k(e.verb[0]))throw new p("A Voiding Statement cannot Target another Voiding Statement:should not void a voiding statement");if(e.voided)throw new p("A Voiding Statement cannot Target another Voiding Statement:should not void an already voided statement")}}}}async _updateMongoStatementsWhichRef(e){const t={$push:{agent:{$each:e.agent},verb:e.verb[0]}};e.registration[0]&&(t.$push={registration:e.registration[0]}),e.activity[0]&&(t.$push={activity:e.activity[0]}),await this.statements.update({"statement.object.objectType":"StatementRef","statement.id":e.id},t)}async _getMongoStatementById(e){this.locked++;const t=await this.statements.find({id:e}).toArray();return this.locked--,t[0]}async updateReferences(e){for(const n in e){const i=e[n];if(this.strict&&await this._updateMongoStatementsWhichRef(i),"StatementRef"==i.statement.object.objectType){const e=await this._getMongoStatementById(i.statement.object.id);t=i,(a=e)&&(t.agent=t.agent.concat(a.agent),t.activity=t.activity.concat(a.activity),t.registration=t.registration.concat(a.registration),t.relatedAgents=t.relatedAgents.concat(a.relatedAgents),t.relatedActivities=t.relatedActivities.concat(a.relatedActivities))}}var t,a}statementsToMongoForm(e){const t=[];for(const a in e){const n=e[a],i={};i.statement=n,i.id=n.id,i.agent=M([n.actor]),n.object.objectType&&"Agent"==n.object.objectType&&"Group"==n.object.objectType&&(i.agent=i.agent.concat(M([n.object]))),i.statement.actor.id=i.agent[0],i.verb=[n.verb.id],i.activity=[],c.isActivity(n.object)&&(i.activity=C([n.object])),i.registration=[],n.context&&n.context.registration&&i.registration.push(n.context.registration),i.relatedAgents=M([n.actor,n.object]),i.relatedActivities=C([n.object,n.context]),n.object.objectType&&"SubStatement"==n.object.objectType&&(i.relatedAgents=i.relatedAgents.concat(M([n.object.actor])),i.relatedActivities=i.relatedActivities.concat(C([n.object.object])),n.object&&n.object.context&&n.object.context.contextActivities&&(i.relatedActivities=i.relatedActivities.concat(C([n.object.context.contextActivities]))),n.context&&n.context.team&&(i.relatedAgents=i.relatedAgents.concat(M([n.context.team]))),n.object.context&&n.object.context.instructor&&(i.relatedAgents=i.relatedAgents.concat(M([n.object.context.instructor])))),n.context&&n.context.instructor&&(i.relatedAgents=i.relatedAgents.concat(M([n.context.instructor]))),n.context&&n.context.team&&(i.relatedAgents=i.relatedAgents.concat(M([n.context.team]))),i.voided=!1,i.voids=null,k(n.verb.id)&&(i.voids=n.object.id),n.result&&n.result.duration&&(i.duration=s.duration(n.result.duration).valueOf()),t.push(i)}return t}async testIDCollisions(e){const t=e.map(e=>e.id);if(t.length!==t.filter(B).length)throw new p("The statement batch contains duplicate IDs");const a=await this.statements.find({id:{$in:t}},{_id:1}).toArray();if(a.length>0)throw new p(`${a.length} of the statements in the batch have ids that are already in the DB`)}async rollBackProvisional(e){await this.statements.remove({id:{$in:e.map(e=>e.id)},provisional:!0})}async isAlreadyVoidedByPreviousStatement(e){for(const t in e)for(const a in e)if(e[a].voids===e[t].id){if(e[t].voided)throw new Error("Statement is voided twice by another statement in the same batch");e[t].voided=!0}let t=await this.statements.find({voids:{$in:e.map(e=>e.id)}},{id:1}).toArray();t=t.map(e=>e.id);for(const a in e)if(t.indexOf(e[a].id)>-1){if(e[a].voided)throw new Error("Statement is voided twice by another statement in the same batch");e[a].voided=!0}}async store(e,t,a,n){let i=e;this.locked++;try{if(!this.db)throw new p("DB is not ready");if(!i)throw new p("statementArray is null");if(i.constructor!==Array)throw new p("statementArray is not Array");if(0==i.length)throw new p("statementArray is empty");if(!t)throw new p("authority is mandatory");i.forEach(P),i.forEach(T),i.forEach(E),i.forEach(R),i.forEach(e=>(function(e,t){for(const a in e.attachments){const n=e.attachments[a];if("http://adlnet.gov/expapi/attachments/signature"==n.usageType){if("application/octet-stream"!==n.contentType)throw new p("rejects a signed statement with a malformed signature - bad content type. Content-type of signatures should be application/octet-stream");for(const i in t)if(t[i].xApiHash==n.sha2){const n=u.decode(t[i].data.toString("binary"),{complete:!0});if(!n)throw new p("Could not parse signature body");if("RS256"!==n.header.alg&&"RS384"!==n.header.alg&&"RS512"!==n.header.alg)throw new p("signature JWT uses invalid signature algorithm ");const r=JSON.parse(JSON.stringify(e));if(r.attachments.splice(0,a+1),0==r.attachments.length&&delete r.attachments,delete n.payload.iat,n.payload.id||delete r.id,JSON.stringify(r)!==JSON.stringify(n.payload))throw console.log(r),console.log(n.payload),new p("The statement signed by the signature does not match the statement provided")}}}})(e,a)),i.forEach(j),await this.testIDCollisions(i),i=i.map(e=>(function(e,t,a){if(!e)throw new p("statement is null");if(e.constructor!==Object)throw new p("statement is not Object");return e.id||(e.id=r.v4()),e.timestamp?e.timestamp=new Date(e.timestamp):e.timestamp=new Date,e.stored=a||new Date,e.authority=t,l(e,v),e})(e,t,n));const e=this.statementsToMongoForm(i);this.strict&&await this.isAlreadyVoidedByPreviousStatement(e),await this.testForVoidingRequirements(i),this.strict&&(e.forEach(e=>e.provisional=!0),await this.statements.insertMany(e));try{this.preferRead&&await this.updateReferences(e),this.strict&&await this.statements.remove({id:{$in:e.map(e=>e.id)},provisional:!0}),e.forEach(e=>e.provisional=!1);await this.statements.insertMany(e);if(await this.voidTargets(i),a)for(const e in a)await this.storeAttachment(a[e]);this.log("storeStatements",null,i.map(e=>e.id))}catch(e){throw console.log("Something has gone really wrong, and we've thrown in a part of the code that does not use expections for validataion",e),this.strict&&await this.rollBackProvisional(i),e}}catch(e){throw this.strict&&await this.rollBackProvisional(i),this.locked--,e}return this.locked--,!0}async recurseForRefs(e,t){if(!e||0==e.length)return e;const a=e.map(e=>e.statement.id),n={};t["statement.stored"]&&(n["statement.stored"]=t["statement.stored"]),n["statement.object.objectType"]="StatementRef",n["statement.object.id"]={$in:a};const i=await this.statements.find(n,{id:1,statement:1,voided:1}).toArray(),r=await this.recurseForRefs(i,t);return e.concat(r)}async countResults(e){this.locked++;const t=L.call(this,e,{statement:1,id:1}),a=this.statements.find(t),n=await a.count(t);return this.locked--,n}formatAdvancedQuery(e){const t={};if(e.constructor===Array)return e.map(e=>this.formatAdvancedQuery(e));if(e.constructor===String)return e;if(e.constructor===Number)return e;for(const t in e){if(0===t.indexOf("context.extensions."))e[`context.extensions.${t.replace("context.extensions.","").replace(/\./g,"*`*")}`]=e[t],delete e[t]}for(const a in e)e[a]&&e[a].constructor!==String&&"$"===a[0]?t[a]=this.formatAdvancedQuery(e[a]):e[a]&&e[a].constructor===String?"$"==a[0]?t[a]=new RegExp(e[a],"ig"):t[`statement.${a}`]=new RegExp(e[a],"ig"):e[a].constructor!==String&&e[a].constructor!==Boolean&&e[a].constructor!==Number?t[`statement.${a}`]=this.formatAdvancedQuery(e[a]):t[`statement.${a}`]=e[a];return t}async aggregate(e){let t,a=e;this.locked++;try{a=a.map(e=>l(e,w)),console.log(a),t=(t=await this.statements.aggregate(a,{allowDiskUse:!1,maxTimeMS:1e4}).toArray()).map(e=>l(e,x))}catch(e){return this.locked--,e}return this.locked--,t}async findAdvanced(e,t=0,a=300){let n,i=e;this.locked++;try{i=this.formatAdvancedQuery(i),(n=(n=await this.statements.find(i).skip(t).limit(a).toArray()).map(e=>e.statement)).forEach(e=>l(e,x)),n.forEach(e=>delete e.actor.id),n.forEach(e=>{e.timestamp=e.timestamp.toISOString(),e.stored=e.stored.toISOString()})}catch(e){throw this.locked--,e}return this.locked--,n}async find(e,t){let a;this.locked++;try{const n=L.call(this,e,{statement:1,id:1});let i=this.statements.find(n,{id:1,statement:1,voided:1});i=e.ascending?i.sort({"statement.stored":1}):i.sort({"statement.stored":-1});let r=100;e.limit&&(r=Math.min(100,e.limit));const s=r+1;i=i.limit(s),e.page||(e.page=0),i.skip(r*e.page),a=await i.toArray(),this.preferRead||e.voidedStatementId||e.statementId||(a=await this.recurseForRefs(a,n)),this.preferRead||e.voidedStatementId||(a=function(e){const t={};for(let a=0;a<e.length;a++)t[e[a].statement.id]=e[a];const a=[];for(const e in t)a.push(t[e]);return a}(a=a.filter(e=>!e.voided)),e.ascending?a.sort((e,t)=>e.statement.stored-t.statement.stored):a.sort((e,t)=>t.statement.stored-e.statement.stored),a.length>s&&(a=a.slice(0,s))),(a=a.map(e=>e.statement)).forEach(e=>l(e,x)),a.forEach(e=>delete e.actor.id),"exact"!==e.format&&(a=await function(e,t,a){if("ids"==t&&e.forEach(e=>l(e,(e,t,a)=>{"object"==t&&a[t].id?a[t]={id:a[t].id}:"id"!=t&&"mbox_sha1sum"!=t&&"mbox"!=t&&"openid"!=t&&"account"!=t&&"objectType"!=t&&(a[t]&&a[t].constructor!=Boolean&&a[t].constructor!=String&&a[t].constructor!=Number||delete a[t])},(e,t,a)=>{"id"!=t&&"mbox_sha1sum"!=t&&"mbox"!=t&&"openid"!=t&&"account"!=t&&"objectType"!=t&&a[t]&&a[t].constructor==Object&&0==Object.keys(a[t]).length&&delete a[t]})),"canonical"==t){const t=a["accept-language"]||"en-US";e.forEach(e=>l(e,(e,a,n)=>{if("extensions"==a)return!1;c.isLangMap(e)&&(n[a]={},n[a][t]=e[t]||"")}))}return e}(a,e.format,t)),a.forEach(e=>{e.timestamp=e.timestamp.toISOString(),e.stored=e.stored.toISOString()}),a.length>=s&&((a=a.slice(0,r)).more=!0),this.log("getStatements",null,e)}catch(e){throw this.locked--,e}return this.locked--,e.statementId||e.voidedStatementId?a[0]:a}},e.exports.queryToMongo=L,e.exports.prepStatementForDisplay=function(e){let t=e;return t.statement&&(t=t.statement),l(t,x),delete t.actor.id,t},e.exports.getIFI=A},function(e,t){e.exports={id:"#Result",type:"object",minProperties:1,properties:{score:{$ref:"#Score"},success:{type:"boolean"},completion:{type:"boolean"},response:{type:"string",chance:{word:[4]}},duration:{type:"string",format:"iso8601"},extensions:{$ref:"#Extensions"}},additionalProperties:!1}},function(e,t,a){const n={id:"#Context",type:"object",minProperties:1,properties:{registration:{type:"string",format:"uuid"},instructor:{$ref:"#Instructor"},team:{$ref:"#Team"},revision:{type:"string",chance:{word:null}},platform:{type:"string",chance:{company:null}},language:{type:"string",pattern:a(29)},statement:{$ref:"#StatementRef"},extensions:{$ref:"#Extensions"},contextActivities:{type:"object",additionalProperties:!1,properties:{parent:{oneOf:[{type:"array",items:{$ref:"#Activity"},minItems:1,maxItems:10},{$ref:"#Activity"}]},grouping:{oneOf:[{type:"array",items:{$ref:"#Activity"},minItems:1,maxItems:10},{$ref:"#Activity"}]},category:{oneOf:[{type:"array",items:{$ref:"#Activity"},minItems:1,maxItems:10},{$ref:"#Activity"}]},other:{oneOf:[{type:"array",items:{$ref:"#Activity"},minItems:1,maxItems:10},{$ref:"#Activity"}]}}}},additionalProperties:!1};e.exports=n},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("chance")},function(e,t){e.exports={id:"#Object",oneOf:[{$ref:"#SubStatement"},{$ref:"#Activity"},{$ref:"#ObjectAgent"},{$ref:"#ObjectAnonymousGroup"},{$ref:"#ObjectIdentifiedGroup"},{$ref:"#StatementRef"}]}},function(e,t){e.exports={id:"#Agent",oneOf:[{$ref:"#AgentOpenId"},{$ref:"#AgentAccount"},{$ref:"#AgentMboxSum"},{$ref:"#AgentMbox"}]}},function(e,t){e.exports={id:"#Actor",oneOf:[{$ref:"#Agent"},{$ref:"#AnonymousGroup"},{$ref:"#IdentifiedGroup"}]}},function(e,t){e.exports=require("request")},function(e,t){e.exports=require("object-hash")},function(e,t,a){const n={},i=a(11),r=a(5),s=a(76)("dalcache");e.exports={get(e,t,a,r=!0,o=null,l=""){if(void 0==t||void 0==a)throw"Invalid invoke of dalcache get. you must send in the lrs settings";o||s(`No CB${l}`);let c=n[e];if(r&&c&&c.dal.strict==t&&c.dal.preferRead==a){if(s(`Dal in cache ${l}`),c.when=new Date,c.dal.ready){if(s(`CB cached ready DAL${l}`),o)return o(null,c.dal)}else if(s(`Cached DAL not ready, cb when ready${l}`),o)return c.dal.on("ready",()=>{s(`Dal Ready, CB${l}`),o(null,c.dal)})}else{const d=this.getConnectionString(e);if(s(`allocate DAL${l}`),c=new i(d,t,a),r?(this.wrapDal(c),c=n[e]={dal:c,when:new Date}):c={dal:c,when:new Date},o)return s(`New DAL not ready, CB when ready${l}`),c.dal.on("ready",()=>{s(`Dal Ready, CB${l}`),o(null,c.dal)})}return s(`No CB, return promise${l}`),c.dal.ready?(s(`Cached DAL is ready${l}`),c.dal):(s(`Dal not ready, resolve promise when it is${l}`),new Promise(e=>{c.dal.on("ready",()=>{s(`Dal Ready, resolve${l}`),e(c.dal)})}))},wrapDal(e){const t=Object.keys(e);for(const a in t){const n=e[t[a]];n instanceof Function&&(e[t[a]]=function(...t){return this.touch(e),n.apply(e,t)})}},touch(e){if(!n[e])throw new Error("This instance is not loaded");s("reset timer "),n[e].when=new Date},getConnectionString:e=>r.getMongoConnectionString(e),shutdown(){for(const e in n)n[e].dal.shutdown(),delete n[e]},startLoop(){setInterval(()=>{const e=a(73);for(const t in n){const a=n[t].when;if(new Date-a>e(process.env.closeConnectionsAfter||"2 minutes")){const e=n[t].dal;delete n[t],e.shutdown()}}},2e3)}}},function(e,t){e.exports={permissions:{},owner:"185855fc-bc38-4f96-8413-4b40637e23de"}},function(e,t){t.pullGenerator=function(e){return function(t,a){const n={$pull:{}};n.$pull[e]=t,this.collection.update({_id:this._id},n,e=>e&&a?a(e):a?a():void 0)}},t.setGenerator=function(e){return function(t,a){const n={$addToSet:{}};n.$addToSet[e]=t,this.collection.update({_id:this._id},n,e=>e&&a?a(e):a?a():void 0)}},t.incGenerator=function(e){return function(t){const a={$inc:{}};a.$inc[e]=1,this.collection.update({_id:this._id},a,e=>e&&t?t(e):t?t():void 0)}}},function(e,t){e.exports=require("path")},function(e,t,a){const n=a(143).strings,i=process.env,r=a(144),s=a(145),o={};try{o.verifyEmail=a(148),o.forgotPassword=a(149),o.accountConfirmation=a(150),o.accountRequest=a(151),o.contactUs=a(152),o.error=a(153)}catch(e){}for(const e in o)r.parse(o[e]);const l=a(154).createTransport(`smtps://${encodeURIComponent(i.email_user)}:${encodeURIComponent(i.email_pass)}@${i.email_server}`);t.sendForgotPasswordEmail=function(e,t){console.log("The user's password reset key is ",e.passwordResetKey);const a=r.render(o.forgotPassword,{username:e.username,login_url:`${i.protocol}://${i.host}:${i.displayPort}/ui/users/login/`,temp_password:e.passwordResetKey}),c={from:i.system_email_from,to:e.email,subject:n.forgot_password_email_subject,text:a,html:a};s.info(c),l.sendMail(c,(e,a)=>e?(s.error(c),t?t(e):void 0):(s.info(`Message sent: ${a.response}`),t?t():void 0))},t.sendAccountValidateEmail=function(e,t){console.log("The user's verification key is ",e.verifyCode);const a=r.render(o.verifyEmail,{username:e.username,email:e.email,verify_url:`${i.protocol}://${i.host}:${i.displayPort}/ui/users/validateEmail/${e.verifyCode}`,verify_url_base:`${i.protocol}://${i.host}:${i.displayPort}/ui/users/validateEmail/`,verify_code:e.verifyCode}),c={from:"Veracity LRS <[email protected]>",to:e.email,subject:n.validate_email_subject,text:a,html:a};s.info(c),l.sendMail(c,(e,a)=>e?(console.log(e),s.error(e),t?t(e):void 0):(s.info(`Message sent: ${a.response}`),t?t(null):void 0))},t.sendAccountConfirmationEmail=function(e,t){const a=r.render(o.accountConfirmation,{username:e.username,login_url:`${i.protocol}://${i.host}:${i.displayPort}/ui/users/login/`}),c={from:i.system_email_from,to:e.email,subject:n.account_confirmation,text:a,html:a};s.info(c),l.sendMail(c,(e,a)=>e?(s.error(e),t?t(e):void 0):(s.info(`Message sent: ${a.response}`),t?t():void 0))},t.sendContactUsEmail=function(e,t){const a=r.render(o.contactUs,e),n={from:i.email_from,to:i.email_to,subject:"LRS Contact Us Form",text:a,html:a};s.info(n),l.sendMail(n,(e,a)=>e?(s.error(e),t?t(e):void 0):(s.info(`Message sent: ${a.response}`),t?t():void 0))},t.sendErrorEmail=function(e,t){const a=r.render(o.error,e),n={from:i.email_from,to:i.email_to,subject:"LRS.io unhandled exception",text:a,html:a};s.info(n),l.sendMail(n,(e,a)=>e?(s.error(e),t?t(e):void 0):(s.info(`Message sent: ${a.response}`),t?t():void 0))}},function(e,t){e.exports=require("ajv")},function(e,t){e.exports=require("lodash")},function(e,t,a){const n=["bn-BD","bn-IN","zh-CN","zh-TW","zh-HK","en-GB","en-US","en-CA","en-IN","pt-PT","pt-BR","es-ES","es-MX","es-AR","es-CO","es-CL","ta-LK","de","tlh"],i=a(29),r={id:"#LanguageMap",type:"object",properties:{"sr-Latn-RS":{type:"string"}},patternProperties:{},minProperties:1,additionalProperties:!1};r.patternProperties[i]={type:"string",chance:{pickone:n}},r.patternProperties["^[a-z]{2,3}$"]={type:"string",chance:{pickone:n}},e.exports=r},function(e,t){e.exports="^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$"},function(e,t){const a={type:"object",id:"#Extensions",patternProperties:{},additionalProperties:!1};a.patternProperties["([A-Za-z][A-Za-z0-9+\\-.]*):(?:(//)(?:((?:[A-Za-z0-9\\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})*)@)?((?:\\[(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}|::(?:[0-9A-Fa-f]{1,4}:){5}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::)(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)|[Vv][0-9A-Fa-f]+\\.[A-Za-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[A-Za-z0-9\\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*))(?::([0-9]*))?((?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)|/((?:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)?)|((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)|)(?:\\?((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*))?(?:\\#((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*))?"]={},e.exports=a},function(e,t){e.exports={id:"#AnonymousGroup",type:"object",properties:{objectType:{type:"string",enum:["Group"]},name:{type:"string",chance:{name:null}},member:{type:"array",items:{$ref:"#Agent"},minItems:1}},required:["objectType","member"],additionalProperties:!1}},function(e,t){e.exports={id:"#IdentifiedGroupMbox",type:"object",properties:{objectType:{type:"string",enum:["Group"]},name:{type:"string",chance:{name:null}},member:{type:"array",items:{$ref:"#Agent"},minItems:1},mbox:{type:"string",format:"mbox"}},required:["objectType","mbox"],additionalProperties:!1}},function(e,t){e.exports={id:"#IdentifiedGroupMboxSum",type:"object",properties:{objectType:{type:"string",enum:["Group"]},name:{type:"string",chance:{name:null}},member:{type:"array",items:{$ref:"#Agent"},minItems:1},mbox_sha1sum:{type:"string",chance:{hash:[]}}},required:["objectType","mbox_sha1sum"],additionalProperties:!1}},function(e,t){e.exports={id:"#IdentifiedGroupOpenId",type:"object",properties:{objectType:{type:"string",enum:["Group"]},name:{type:"string",chance:{name:null}},member:{type:"array",items:{$ref:"#Agent"},minItems:1},openid:{type:"string",format:"uri"}},required:["objectType","openid"],additionalProperties:!1}},function(e,t){e.exports={id:"#IdentifiedGroupAccount",type:"object",properties:{objectType:{type:"string",enum:["Group"]},name:{type:"string",chance:{name:null}},member:{type:"array",items:{$ref:"#Agent"},minItems:1},account:{$ref:"#Account"}},required:["objectType","account"],additionalProperties:!1}},function(e,t){e.exports={id:"#IdentifiedGroup",oneOf:[{$ref:"#IdentifiedGroupOpenId"},{$ref:"#IdentifiedGroupAccount"},{$ref:"#IdentifiedGroupMboxSum"},{$ref:"#IdentifiedGroupMbox"}]}},function(e,t){e.exports={type:"object",id:"#Account",properties:{homePage:{type:"string",format:"uri"},name:{type:"string",chance:{name:null}}},required:["homePage","name"],additionalProperties:!1}},function(e,t){e.exports={id:"#AgentMbox",type:"object",properties:{objectType:{type:"string",enum:["Agent"]},name:{type:"string",chance:{name:null}},mbox:{type:"string",format:"mbox"}},required:["mbox"],additionalProperties:!1}},function(e,t){e.exports={id:"#AgentMboxSum",type:"object",properties:{objectType:{type:"string",enum:["Agent"]},name:{type:"string",chance:{name:null}},mbox_sha1sum:{type:"string",chance:{hash:null}}},required:["mbox_sha1sum"],additionalProperties:!1}},function(e,t){e.exports={id:"#AgentOpenId",type:"object",properties:{objectType:{type:"string",enum:["Agent"]},name:{type:"string",chance:{name:null}},openid:{type:"string",format:"uri"}},required:["openid"],additionalProperties:!1}},function(e,t){e.exports={id:"#AgentAccount",type:"object",properties:{objectType:{type:"string",enum:["Agent"]},name:{type:"string",chance:{name:null}},account:{$ref:"#Account"}},required:["account"],additionalProperties:!1}},function(e,t){e.exports={id:"#Verb",properties:{id:{type:"string",format:"uri"},display:{$ref:"#LanguageMap"}},required:["id"],additionalProperties:!1}},function(e,t){e.exports={id:"#Definition",type:"object",dependencies:{correctResponsesPattern:["interactionType"],choices:["interactionType"],source:["interactionType"],target:["interactionType"],steps:["interactionType"],scale:["interactionType"]},properties:{name:{$ref:"#LanguageMap"},description:{$ref:"#LanguageMap"},type:{type:"string",format:"uri"},moreInfo:{type:"string",format:"uri"},extensions:{$ref:"#Extensions"},interactionType:{type:"string",enum:["true-false","choice","fill-in","long-fill-in","likert","matching","performance","sequencing","numeric","other"]},correctResponsesPattern:{type:"array",items:{type:"string",chance:{word:null}}},choices:{$ref:"#InteractionData"},steps:{$ref:"#InteractionData"},target:{$ref:"#InteractionData"},source:{$ref:"#InteractionData"},scale:{$ref:"#InteractionData"}},additionalProperties:!1}},function(e,t){e.exports={id:"#Activity",type:"object",properties:{id:{type:"string",format:"uri"},objectType:{type:"string",enum:["Activity"]},definition:{$ref:"#Definition"}},required:["id"],additionalProperties:!1}},function(e,t){e.exports={id:"#StatementRef",type:"object",properties:{objectType:{type:"string",enum:["StatementRef"]},id:{type:"string",format:"uuid"}},required:["objectType","id"],additionalProperties:!1}},function(e,t){e.exports={id:"#Score",type:"object",properties:{scaled:{type:"number",minimum:-1,maximum:1},raw:{type:"number"},min:{type:"number"},max:{type:"number"}},additionalProperties:!1}},function(e,t){e.exports={type:"object",id:"#Attachment",properties:{usageType:{type:"string",format:"uri"},display:{$ref:"#LanguageMap"},description:{$ref:"#LanguageMap"},contentType:{type:"string",faker:{mimeType:null}},length:{type:"number",minimum:0},sha2:{type:"string",chance:{hash:null}},fileUrl:{type:"string",format:"uri"}},required:["usageType","display","contentType","length","sha2"],additionalProperties:!1}},function(e,t,a){const n={id:"#Statement",type:"object",properties:{id:{type:"string",format:"uuid"},actor:a(18),verb:{$ref:"#Verb"},object:{$ref:"#Object"},result:a(12),context:a(13),timestamp:{type:"string",format:"date-time"},stored:{type:"string",format:"date-time"},authority:{$ref:"#Authority"},version:{type:"string",pattern:"1\\.0\\.[0-9]+"},attachments:{type:"array",items:{$ref:"#Attachment"}}},additionalProperties:!1,required:["actor","verb","object"]};e.exports=n},function(e,t,a){const n=a(18),i=a(12),r=a(13),s={id:"#PostedStatement",type:"object",properties:{objectType:{type:"string",enum:["SubStatement"]},id:{type:"string",format:"uuid"},actor:n,verb:{$ref:"#Verb"},stored:{type:"string",format:"date-time"},authority:{$ref:"#Authority"},object:a(16),result:i,context:r,timestamp:{type:"string",format:"date-time"},version:{oneOf:[{type:"string",pattern:"1.0.[0-9]+"},{type:"string",enum:["1.0"]}]},attachments:{type:"array",items:{$ref:"#Attachment"}}},additionalProperties:!1,required:["actor","verb","object"]};e.exports=s},function(e,t){e.exports={id:"#QueryStatements",type:"object",properties:{statementId:{type:"string",format:"uuid"},voidedStatementId:{type:"string",format:"uuid"},agent:{oneOf:[{$ref:"#Agent"},{$ref:"#IdentifiedGroup"}]},verb:{type:"string",format:"uri"},activity:{type:"string",format:"uri"},registration:{type:"string",format:"uuid"},related_activities:{type:"boolean",default:!1},related_agents:{type:"boolean",default:!1},since:{oneOf:[{type:"string",format:"date-time"},{type:"string",format:"date"}]},until:{oneOf:[{type:"string",format:"date-time"},{type:"string",format:"date"}]},limit:{type:"integer",minimum:0,default:0},format:{type:"string",enum:["ids","exact","canonical"],default:"exact"},attachments:{type:"boolean"},ascending:{type:"boolean"},tincan:{type:"boolean"}},additionalProperties:!1}},function(e,t){e.exports={type:"array",id:"#InteractionData",items:{type:"object",properties:{id:{type:"string",chance:{hash:null}},description:{$ref:"#LanguageMap"}},additionalProperties:!1}}},function(e,t,a){const n={id:"#SubStatement",type:"object",properties:{objectType:{type:"string",enum:["SubStatement"]},actor:a(18),verb:{$ref:"#Verb"},object:{$ref:"#SubStatementObject"},result:a(12),context:a(13),timestamp:{type:"string",format:"date-time"},attachments:{type:"array",items:{$ref:"#Attachment"}}},additionalProperties:!1,required:["actor","verb","object","objectType"]};e.exports=n},function(e,t){e.exports={type:"object",id:"#ObjectAgent",allOf:[{$ref:"#Agent"}],properties:{objectType:{type:"string",enum:["Agent"]}},required:["objectType"]}},function(e,t){e.exports={type:"object",id:"#ObjectIdentifiedGroup",allOf:[{$ref:"#IdentifiedGroup"}],properties:{objectType:{type:"string",enum:["Group"]}},required:["objectType"]}},function(e,t){e.exports={type:"object",id:"#ObjectAnonymousGroup",allOf:[{$ref:"#AnonymousGroup"}],properties:{objectType:{type:"string",enum:["Group"]}},required:["objectType"]}},function(e,t){e.exports={id:"#AuthorityGroup",properties:{objectType:{type:"string",enum:["Group"]},name:{type:"string",chance:{name:null}},member:{type:"array",items:[{$ref:"#Agent"},{$ref:"#Agent"}],additionalItems:!1,minItems:2}},required:["objectType","member"],additionalProperties:!1}},function(e,t){e.exports={id:"#Instructor",oneOf:[{$ref:"#Agent"},{$ref:"#AnonymousGroup"},{$ref:"#IdentifiedGroup"}]}},function(e,t){e.exports={id:"#Team",oneOf:[{$ref:"#AnonymousGroup"},{$ref:"#IdentifiedGroup"}]}},function(e,t){e.exports={id:"#Authority",oneOf:[{$ref:"#Agent"},{$ref:"#AuthorityGroup"}]}},function(e,t){e.exports={id:"#SubStatementObject",oneOf:[{$ref:"#Activity"},{$ref:"#ObjectAgent"},{$ref:"#ObjectAnonymousGroup"},{$ref:"#ObjectIdentifiedGroup"},{$ref:"#StatementRef"}]}},function(e,t){e.exports={id:"#payload",oneOf:[{$ref:"#PostedStatement"},{id:"#ArrayOfPostedStatement",type:"array",items:{$ref:"#PostedStatement"}}]}},function(e,t){e.exports={type:"object",properties:{activityId:{type:"string",format:"uri"},stateId:{type:"string"},agent:{type:"object"},registration:{type:"string",format:"uuid"},since:{oneOf:[{type:"string",format:"date-time"},{type:"string",format:"date"}]}},required:["activityId","agent"],additionalProperties:!1}},function(e,t){e.exports={type:"object",properties:{profileId:{type:"string"},activityId:{type:"string",format:"uri"},since:{oneOf:[{type:"string",format:"date-time"},{type:"string",format:"date"}]}},required:["activityId"],additionalProperties:!1}},function(e,t){e.exports={type:"object",properties:{profileId:{type:"string"},agent:{type:"object"},since:{oneOf:[{type:"string",format:"date-time"},{type:"string",format:"date"}]}},required:["agent"],additionalProperties:!1}},function(e,t){e.exports={type:"object",properties:{statementId:{type:"string",format:"uuid"}},required:["statementId"],additionalProperties:!1}},function(e,t,a){const n={type:"object",properties:{agent:a(17)},required:["agent"],additionalProperties:!1};e.exports=n},function(e,t){e.exports={type:"object",properties:{activityId:{type:"string",format:"uri"}},required:["activityId"],additionalProperties:!1}},function(e,t){e.exports={id:"#advancedQuery",type:"object",properties:{query:{type:"object"},limit:{type:"number",minimum:1,maximum:500},skip:{type:"number",minimum:1}},required:["query"],additionalProperties:!1}},function(e,t){e.exports=require("json-6")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("crypto")},function(e,t,a){var n,i,r,s,o,l,c,d,u,m,p,h,y,g=g||function(e,t){var a={},n=a.lib={},i=function(){},r=n.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=n.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,a=e.words,n=this.sigBytes;if(e=e.sigBytes,this.clamp(),n%4)for(var i=0;i<e;i++)t[n+i>>>2]|=(a[i>>>2]>>>24-i%4*8&255)<<24-(n+i)%4*8;else if(65535<a.length)for(i=0;i<e;i+=4)t[n+i>>>2]=a[i>>>2];else t.push.apply(t,a);return this.sigBytes+=e,this},clamp:function(){var t=this.words,a=this.sigBytes;t[a>>>2]&=4294967295<<32-a%4*8,t.length=e.ceil(a/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var a=[],n=0;n<t;n+=4)a.push(4294967296*e.random()|0);return new s.init(a,t)}}),o=a.enc={},l=o.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var a=[],n=0;n<e;n++){var i=t[n>>>2]>>>24-n%4*8&255;a.push((i>>>4).toString(16)),a.push((15&i).toString(16))}return a.join("")},parse:function(e){for(var t=e.length,a=[],n=0;n<t;n+=2)a[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new s.init(a,t/2)}},c=o.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var a=[],n=0;n<e;n++)a.push(String.fromCharCode(t[n>>>2]>>>24-n%4*8&255));return a.join("")},parse:function(e){for(var t=e.length,a=[],n=0;n<t;n++)a[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new s.init(a,t)}},d=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},u=n.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var a=this._data,n=a.words,i=a.sigBytes,r=this.blockSize,o=i/(4*r);if(t=(o=t?e.ceil(o):e.max((0|o)-this._minBufferSize,0))*r,i=e.min(4*t,i),t){for(var l=0;l<t;l+=r)this._doProcessBlock(n,l);l=n.splice(0,t),a.sigBytes-=i}return new s.init(l,i)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=u.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){u.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,a){return new e.init(a).finalize(t)}},_createHmacHelper:function(e){return function(t,a){return new m.HMAC.init(e,a).finalize(t)}}});var m=a.algo={};return a}(Math);i=(o=(n=g).lib).WordArray,r=o.Hasher,s=[],o=n.algo.SHA1=r.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var a=this._hash.words,n=a[0],i=a[1],r=a[2],o=a[3],l=a[4],c=0;80>c;c++){if(16>c)s[c]=0|e[t+c];else{var d=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=d<<1|d>>>31}d=(n<<5|n>>>27)+l+s[c],d=20>c?d+(1518500249+(i&r|~i&o)):40>c?d+(1859775393+(i^r^o)):60>c?d+((i&r|i&o|r&o)-1894007588):d+((i^r^o)-899497514),l=o,o=r,r=i<<30|i>>>2,i=n,n=d}a[0]=a[0]+n|0,a[1]=a[1]+i|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+l|0},_doFinalize:function(){var e=this._data,t=e.words,a=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(a/4294967296),t[15+(n+64>>>9<<4)]=a,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=r._createHelper(o),n.HmacSHA1=r._createHmacHelper(o),c=(l=g).enc.Utf8,l.algo.HMAC=l.lib.Base.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=c.parse(t));var a=e.blockSize,n=4*a;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),r=this._iKey=t.clone(),s=i.words,o=r.words,l=0;l<a;l++)s[l]^=1549556828,o[l]^=909522486;i.sigBytes=r.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}}),m=(d=(u=g).lib).Base,p=d.WordArray,h=(d=u.algo).HMAC,y=d.PBKDF2=m.extend({cfg:m.extend({keySize:4,hasher:d.SHA1,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var a=this.cfg,n=h.create(a.hasher,e),i=p.create(),r=p.create([1]),s=i.words,o=r.words,l=a.keySize;for(a=a.iterations;s.length<l;){var c=n.update(t).finalize(r);n.reset();for(var d=c.words,u=d.length,m=c,y=1;y<a;y++){m=n.finalize(m),n.reset();for(var g=m.words,f=0;f<u;f++)d[f]^=g[f]}i.concat(c),o[0]++}return i.sigBytes=4*l,i}}),u.PBKDF2=function(e,t,a){return y.create(a).compute(e,t)},t.CryptoJS=g},function(e,t){e.exports=require("human-interval")},function(e,t,a){const n=a(27),i=e.exports.permissionTree=a(131),r=e.exports.permissionRoot=a(22),s=e.exports.expandDoubleStars=function(e,t){const a=t.findIndex(e=>"**"==e);if(a>-1){const n=e.length-t.length,i=[];return i.length=Math.max(1,n+1),i.fill("*",0),t.splice(a,1,...i),t}return t},o=e.exports.matchOnePerm=function(e,t){let a=e,n=t;if("."==a||"."==a.toString())return!0;if(n.constructor!==String&&(n=n.toString()),n=n.split("."),a.constructor!==String&&(a=a.toString()),a=a.split("."),n=s(a,n),a=s(n,a),n.length<a.length)return!1;n=n.slice(0,a.length);for(let e=0;e<n.length;e++)if(n[e]!==a[e]&&"*"!==a[e]&&"*"!==n[e])return!1;return!0},l=e.exports.checkPermission=function(t,n,i){let s=n;if(s||(s=r),s.owner&&s.owner===i.uuid)return!0;if(s.permissions)for(const e in s.permissions)if(e==i.uuid)for(const a in s.permissions[e])if(o(s.permissions[e][a],t))return!0;if(s.roles)for(const e in s.roles)if(e==i.uuid)for(const n in s.roles[e]){const i=a(132)[s.roles[e][n]];if(i&&i.permissions)for(const e in i.permissions)if(o(i.permissions[e],t))return!0}return s.parent?e.exports.checkPermission(t,s.parent,i):s!==r&&e.exports.checkPermission(t,r,i)},c=e.exports.genTree=function(t,a,n){let r=t;r||(r=i),r.toString=n?function(){return"."!==n.toString()?`${n.toString()}.${a}`:a}:function(){return"."};for(const t in r)"toString"!==t&&e.exports.genTree(r[t],t,r)},d=e.exports.hasSuper=function(e,t){for(const a in e)if(o(e[a],t))return!0;return!1};e.exports.setPermission=function(e,t,a){let r,s=e;if(!t||!a)return!1;if(t.permissions||(t.permissions={}),t.permissions[a.uuid]||(t.permissions[a.uuid]=[]),s.constructor===String){if((s=s.trim()).indexOf("*")==s.length-1)throw new Error("Ending a permission with a start is the same as setting the super permission. You can query this way, but not set.");if(s.indexOf("**"),s.indexOf("*")>-1)return void t.permissions[a.uuid].push(s);r=n.get(i,s),"."===s&&(r=i)}if(r||(r=s.toString(),r=n.get(i,s)),!r)throw`permission string not in tree ${s}`;d(t.permissions[a.uuid],r)?console.log("user already has a higher level permission"):l(r,t.parent,a)?console.log("user already has permission on higher level object"):t.permissions[a.uuid].push(r.toString())},e.exports.permsMiddleware=function(e,t,a="user"){if(!e)throw"misconfigured permsMiddleware";let s;e.constructor==String?s=n.get(i,e):(s=e.toString(),s=n.get(i,e)),s||(-1==e.indexOf("*")&&(process.parsed_env.production||console.log(`permission not in tree ${e}`)),s=e);const o=function(i,o,c){if("*"===e)return c();let d;d=t?n.get(i,t):r;const u=n.get(i,a);return d?u?l(s,d,u)?c():"application/x-www-form-urlencoded"==i.get("content-type")||"multipart/form-data"==i.get("content-type")?o.send({text:"Permission denied"}):(o.status(401),o.render("message",{title:"Permission Denied",message:`You need ${s} on this resource.`})):c("failed to lookup user in request for permission management"):c("failed to lookup object in request for permission management")};return o.type="permissionMiddleware",o};c()},function(e,t,a){e.exports=a(137)},function(e,t){e.exports=require("debug")},function(e,t,a){var n=a(2)();e.exports.getRandomDate=function(){var e=new Date;e.setDate(e.getDate()-1);var t=new Date;return t.setMonth(t.getMonth()-3),n.date(t,e)},e.exports.smallTimeIncrement=function(e){var t=new Date(e);return t.setSeconds(e.getSeconds()+n.integer(10,360)),t},e.exports.largeTimeIncrement=function(e){var t=new Date(e);return t.setHours(e.getHours()+n.integer(1,36)),t.setSeconds(e.getSeconds()+n.integer(10,3500)),t},e.exports.attemptTimeIncrement=function(e,t){var a=new Date(e);return a.setDate(e.getDate()+n.integer(1,t)),a.setHours(e.getHours()+n.integer(1,5)),a.setSeconds(e.getSeconds()+n.integer(10,3500)),a}},function(e,t){e.exports=require("object-path")},function(e,t,a){if(e.exports=a(80),"-start"==process.argv[2]){const t=e.exports,n=new(a(8));a(190).config();const i=function(e,a,n){return process.env.username&&process.env.password?a==process.env.username&&n==process.env.password?new t.Account(a,!0,!0,!1,!0):null:new t.Account(a,!0,!0,!1,!0)},r=new t.LRS;"-loose"==process.argv[3]&&(r.strict=!1),r.on("ready",e=>{console.log("LRS ready")}),r.on("clientError",e=>{console.log(e)}),r.on("statementStored",e=>{console.log(`Statement ${e.join(",")} stored`);for(let t=0;t<e.length;t++)r.getStatement(e[t]).then(e=>{console.log(e)})});const s=new t({lrs:r,getUser:i,connectionString:process.env.connectionString||"mongodb://localhost/myLRS",baseUrl:(process.env.host||"http://localhost:3000")+(process.env.apiPath||"/xapi")});n.use(process.env.apiPath||"/xapi",s),n.use("/ui",s.simpleUI()),n.get("/",(e,t)=>{t.redirect("/ui/statements/0")}),n.get("/testinsert",(e,t)=>{r.insertStatement({actor:{mbox:"mailto:[email protected]",name:"Rob Chadwick",objectType:"Agent"},verb:{id:"http://adlnet.gov/expapi/verbs/answered",display:{"en-US":"answered"}},object:{id:"http://adlnet.gov/expapi/activities/example",definition:{name:{"en-US":"Example Activity"},description:{"en-US":"Example activity description"}},objectType:"Activity"},timestamp:"2018-01-10T15:20:10.978Z",authority:{objectType:"Agent",account:{homePage:"https://localhost:3000/users/test",name:"test"}}}).then(()=>{t.send("inserted")}).catch(e=>{t.send(e.message)})}),n.listen(process.env.port||3e3)}},function(e,t,a){const n=a(8),i=(n.Router,a(81)),r=a(91),s=a(92),o=a(93).BasicStrategy,l=a(94),c=a(95),d=a(97),u=a(19),m=a(98),p=a(105),h=a(106),y=a(11),g=a(21),f=a(175),b=a(69),{AccountError:v,ClientError:S,ConflictError:w,PreconditionError:x,ServerError:A,NotFoundError:D}=a(10);class M{constructor(e,t,a,n,i,r){this.name=e,this.read=t,this.write=a,this.limitedRead=n,this.advancedQueries=i,this.lrsName=r?r.lrsName:"local"}authority(){const e={objectType:"Agent"};return e.account={homePage:`https://${this.lrsName}.lrs.io/keys/${this.name}`,name:this.name},e}}s.use("basic",new o({passReqToCallback:!0},async(e,t,a,n)=>{const i=await e.getUser(e,t,a);return n(null,i||null)}));const C=function(e,t,a){return t.set("X-Experience-API-Version","1.0.3"),!1===e.lrs.strict?a():"1.0.3"===e.get("X-Experience-API-Version")||"1.0.2"===e.get("X-Experience-API-Version")||"1.0.1"===e.get("X-Experience-API-Version")||"1.0.0"===e.get("X-Experience-API-Version")||"1.0"===e.get("X-Experience-API-Version")||"0.95"===e.get("X-Experience-API-Version")||"0.90"===e.get("X-Experience-API-Version")?a():e.get("X-Experience-API-Version")?a(`X-Experience-API-Version header is not set correctly. The Client sent ${e.get("X-Experience-API-Version")}`):a("X-Experience-API-Version header is not set")};function L(e,t,a){for(const t in e.headers){const a=t.toLowerCase();e.headers[a]=e.headers[t],t!==a&&delete e.headers[t]}a()}async function P(e,t){if(e.DAL){if(e.lrs.emit)try{e.lrs.emit("clientError",{type:t?t.constructor.name:null,message:t.message,body:e.body,query:e.query,url:e.baseUrl+e.url,headers:e.headers,method:e.method})}catch(e){}e.lrs.verboseLogs&&await e.DAL.userLog(t.constructor.name,t.message,{body:e.body,query:e.query,url:e.baseUrl+e.url,headers:e.headers,method:e.method}),await e.DAL.accessLog(t.constructor.name)}}function j(e,t,a){if(t.___send)return a();t.___send=t.send,t.send=async function(a){a instanceof S?(await P(e,a),this.status(400),this.___send(a.message)):a instanceof x?(await P(e,a),this.status(412),this.___send(a.message)):a instanceof w?(await P(e,a),this.status(409),this.___send(a.message)):a instanceof A?(await P(e,a),this.status(500),this.___send("An unspecified error occured.")):a instanceof D?(await P(e,a),this.status(404),this.___send(a.message)):a instanceof v?(await P(e,a),this.status(401),this.___send(a.message)):a instanceof Error?(await P(e,a),this.status(500),this.___send("An unspecified error occured.")):a&&a.constructor==Number?(t.write(a.toString()),t.end()):t.___send(a)},a()}function E(e,t,a){try{if(!e.query.method)return a();{if("POST"!==e.method)return t.send(new S("An LRS rejects an alternate request syntax not issued as a POST"));if(Object.keys(e.query).length>1)return t.send(new S(" An LRS will reject an alternate request syntax which contains any extra information with error code 400 Bad Request"));e.body.constructor===String&&!1===e.lrs.strict&&(e.body=function(e){const t={};let a=e.split("&");a=a.map(e=>e.split("="));for(const e in a)t[decodeURIComponent(a[e][0])]=decodeURIComponent(a[e][1]);return t}(e.body),e.lrs.verboseLogs&&P(e,new S("The body of the requst was not sent with the content-type application/x-www-form-urlencoded. We fixed this for you. ")));const a={},i={};if(("PUT"==e.query.method||"POST"==e.query.method)&&!e.body.content)return t.send(new S("Must include the body parameter 'content' when using ARS with method=POST or method=PUT"));const r=["Authorization","X-Experience-API-Version","Content-Type","Content-Length","If-Match","If-None-Match"];for(var n in r){const t=e.body[r[n]]||e.body[r[n].toLowerCase()];t&&(a[r[n].toLowerCase()]=t,delete e.body[r[n]],delete e.body[r[n].toLowerCase()])}let s=!1,o=e.body.content;try{o&&(o=JSON.parse(o),s=!0)}catch(e){}delete e.body.content;for(var n in e.body)i[n]=e.body[n];a.Host=e.get("host"),a["User-Agent"]=e.headers["user-agent"],a["x-experience-api-version"]||(a["x-experience-api-version"]=e.headers["x-experience-api-version"]),a.authorization||(a.authorization=e.headers.authorization),0==s&&"application/json"==a["content-type"]&&(P(e,new S("The body of the ARS request sent a header of application/json, but the content field could not be parsed. We fixed this for you. ")),a["content-type"]="text/plain"),console.log("computed base url:"+e.xAPIBaseUrl(e)+e.path);const l={url:e.xAPIBaseUrl(e)+e.path,headers:a,method:e.query.method,qs:i,body:o,json:s};u(l).pipe(t)}}catch(e){t.send(e)}}async function T(e,t,a){g.get(e.lrs.uuid,e.lrs.strict,e.lrs.preferRead,!0,(t,n)=>{e.DAL=n,a()},e.debugmessage)}async function R(e,t,a){if(!e.preAuth){if(("PUT"==e.method||"POST"==e.method)&&!e.user.write)return t.send(new v("The provided user account does not have write permissions"));if("GET"==e.method&&!e.user.read)return t.send(new v("The provided user account does not have read permissions"))}if(!e.lrs.active)return t.send(new v("This LRS is currently offline."));a()}function k(e){return"function"==typeof e?e:function(){return e}}const I={strict:!0,verboseLogs:!0,preferRead:!1,active:!0,uuid:"myLRS",maxStatements:1e7,maxStorage:1e9},B=function(e,t,a){return new M(t,!0,!0,!1,!0,e.lrs)},$="mongodb://localhost/myLRS",J="/xapi";function O(e){return e&&e.name&&e.name.constructor==Array&&(e.name=e.name[0]),e&&e.mbox&&e.mbox.constructor==Array&&(e.mbox=e.mbox[0]),e&&e.mbox_sha1sum&&e.mbox_sha1sum.constructor==Array&&(e.mbox_sha1sum=e.mbox_sha1sum[0]),e.openid&&e.openid&&e.openid.constructor==Array&&(e.openid=e.openid[0]),e.account&&e.account&&e.account.constructor==Array&&(e.account=e.account[0]),e.account&&e.account.accountName&&(e.account.name=e.account.accountName,delete e.account.accountName),e.account&&e.account.accountServiceHomePage&&(e.account.homePage=e.account.accountServiceHomePage,delete e.account.accountServiceHomePage),e}function N(e,t){const n=a(78);if(n.has(e,t)){const a=n.get(e,t);a&&0==Object.keys(a).length&&(a["en-US"]="Undefined")}return e}function K(e,t,n){const i=a(78);if(i.has(e,t)){let a=i.get(e,t);a&&a.constructor===Array?(a=a.map(e=>N(e,n)),i.set(e,t,a)):N(a,n)}}function G(e){let t=e;var a;if(K(a=t,"attachments","display"),K(a,"attachments","description"),K(a,"context.contextActivities.grouping","definition.description"),K(a,"context.contextActivities.grouping","definition.name"),K(a,"context.contextActivities.parent","definition.description"),K(a,"context.contextActivities.parent","definition.name"),K(a,"context.contextActivities.context","definition.description"),K(a,"context.contextActivities.context","definition.name"),K(a,"context.contextActivities.other","definition.description"),K(a,"context.contextActivities.other","definition.name"),N(a,"verb.display"),N(a,"object.definition.name"),N(a,"object.definition.description"),N(a,"object.verb.display"),N(a,"object.object.definition.name"),N(a,"object.object.definition.description"),(t=a).actor=O(t.actor),t.result&&t.result.extensions)for(const e in t.result.extensions)d.isURL(e)||0===e.indexOf("tag:adlnet.gov,2013:expapi:0.9:extensions:")||(t.result.extensions[`tag:adlnet.gov,2013:expapi:0.9:extensions:${e}`]=t.result.extensions[e],delete t.result.extensions[e]);if(t.context&&t.context.extensions)for(const e in t.context.extensions)d.isURL(e)||0===e.indexOf("tag:adlnet.gov,2013:expapi:0.9:extensions:")||(t.context.extensions[`tag:adlnet.gov,2013:expapi:0.9:extensions:${e}`]=t.context.extensions[e],delete t.context.extensions[e]);return t.verb&&t.verb.constructor==String&&(t.verb={id:t.verb}),t.authority&&delete t.authority,t.verb&&!d.isURL(t.verb.id)&&(t.verb.id=`http://adlnet.gov/expapi/verbs/${t.verb.id}`),t.object&&t.object.definition&&t.object.definition.type&&!d.isURL(t.object.definition.type)&&(t.object.definition.type=`http://adlnet.gov/expapi/activities/${t.object.definition.type}`),t.object&&t.object.id&&"StatementRef"!==t.object.objectType&&!d.isURL(t.object.id)&&0!==t.object.id.indexOf("tag:adlnet.gov,2013:expapi:0.9:activities:")&&(t.object.id=`tag:adlnet.gov,2013:expapi:0.9:activities:${t.object.id}`,t.object.id=t.object.id.replace(/ /g,"%20")),t.result&&0==Object.keys(t.result).length&&delete t.result,t.context&&0==Object.keys(t.context).length&&delete t.context,t}function q(e,t,a){return e.lrs.strict?a():("GET"==e.method&&(e.query.verb&&!d.isURL(e.query.verb)&&(e.query.verb=`http://adlnet.gov/expapi/verbs/${e.query.verb}`),e.query.actor&&(e.query.actor=JSON.parse(e.query.actor),e.query.agent=O(e.query.actor),delete e.query.actor)),delete e.query.tincan,"POST"!=e.method&&"PUT"!=e.method||0!=e.url.indexOf("/activities/state")&&0!=e.url.indexOf("/activities/profile")&&0!=e.url.indexOf("/agents/profile")||e.query.actor&&(e.query.actor=JSON.parse(e.query.actor),e.query.agent=O(e.query.actor),delete e.query.actor),("POST"==e.method||"PUT"==e.method)&&e.url.indexOf("/statements")>=0&&(e.body.constructor==String&&(e.body=b.parse(e.body)),e.query.registration&&e.body.constructor!==Array&&(e.body.context||(e.body.context={}),e.body.context.registration=e.query.registration,delete e.query.registration),e.query.statementId&&e.body.constructor!==Array&&"POST"==e.method&&(e.body.id=e.query.statementId,delete e.query.statementId),e.body&&e.body.constructor===Array?e.body=e.body.map(G):e.body&&(e.body=G(e.body))),delete e.query.tincan,a())}function U(e){return function(t,a,n){return t.preAuth?n():e(t,a,n)}}function F(e,t,a){const n=l.json({limit:"100mb",verify(e,t,a,n){e.rawBody=a.toString()}});try{n(e,t,n=>{if(n&&!1!==e.lrs.strict)t.send(new S("Invalid json in post body. Set your LRS strict mode to false to allow loose JSON parsing."));else{if(e.body&&(i=e.body,Object.keys(i).length))return a();if(!n)return a();try{e.body=b.parse(n.body)}catch(n){return e.query.method?(e.body=e.rawBody,a()):-1!==e.url.indexOf("/activities")||-1!==e.url.indexOf("/state")?(e.body=e.rawBody,e.headers["content-type"]="text/plain",e.headers["Content-Type"]="text/plain",a()):t.send(new S("Invalid json in post body. Loose parsing is enabled, but we still could not parse this."))}a()}})}catch(e){a(e)}var i}e.exports=class extends n.Router{constructor(t){let a=t;g.startLoop(),super({mergeParams:!0}),a||(a={});let n=a.lrs||I;const o=a.getUser||B,d=a.connectionString||$;let u=a.baseUrl||J;n instanceof e.exports.LRS&&(console.log("attaching DB to LRS"),async function(e,t){const a=new y(t,e.strict,e.preferRead);if(e.dal=a,e.emit)try{a.on("ready",()=>e.emit("ready"))}catch(e){}}(n,d),this.simpleUI=function(){return new f(b,n())});let b=d;if(!n||!o||!u)throw new Error("invalid parameters in constructor.");if(n=k(n),u=k(u),"function"!=typeof o)throw new Error("the second parameter to the xapi constructor must be a user validation function. Static values not supported for this parameter.");this.use(r()),this.get("/about",(e,t)=>{t.send({version:["1.0.3"]})}),this.use(j),this.use("/",async(e,t,a)=>(e.xAPIBaseUrl=u,e.getUser=o,e.lrs?a():(e.lrs=await n(e),e.lrs?void a():t.status(400).send("This does not seem to be a valid LRS.")))),a.lrs instanceof e.exports.LRS?this.use((e,t,n)=>{e.DAL=a.lrs.dal,n()}):this.use(T.bind(this)),this.use(L),this.use(s.initialize()),this.use(U(c)),this.use(U(F)),this.use(U(l.text({limit:"100mb"}))),this.use(U(l.urlencoded({limit:"100mb"}))),this.use(U(l.raw({limit:"100mb"}))),this.use(E),this.use(U(C)),this.use((e,t,a)=>{if(e.preAuth)return e.user=new M("Launch/user/"+e.user.uuid,!0,!0,!0,!0,e.lrs),a();s.authenticate("basic",(n,i)=>{if(!i)return t.status(401).send(new v("invalid login"));e.user=i,a()})(e,t,a)}),this.use((e,t,a)=>{e.key=e.user,a()}),this.use(U(R)),this.use((e,t,a)=>a()),this.use(q),this.use("/statements",new i),this.use("/activities/state",new m("state","stateId",["activityId","agent","registration"],"validateActivityState",!1,!1)),this.use("/agents/profile",new m("agentProfile","profileId",["agent"],"validateAgentProfile",!0,!0)),this.use("/activities/profile",new m("activityProfile","profileId",["activityId"],"validateActivityProfile",!0,!0)),this.use("/agents",new p),this.use("/activities",new h),this.use((e,t,a,n)=>{a.send(new S(e))}),this.attachDAL=T}},e.exports.fixupTincan=q,e.exports.cleanStatement=G,e.exports.Account=M,e.exports.LRS=a(189),e.exports.forgivingJson=F},function(e,t,a){const n=a(8),i=(new n.Router,a(9)),r=a(89),{ClientError:s,ConflictError:o,PreconditionError:l,ServerError:c,NotFoundError:d}=a(10),u=function(e,t){return function(a,n,r){const s=i[`validate${e}`](a[t]);return s.valid?r():r(`${t} does not meet schema: ${s.error}`)}},m=function(e,t,a){return e.body.constructor===Array?a():(e.body=[e.body],a())},p=function(e,t,a){t.set("X-Experience-API-Consistent-Through",(new Date).toISOString()),a()};e.exports=class extends n.Router{constructor(){return super(),this.putStatements=async function(e,t,a){if(!e.key.write)return t.status(401).send("this key does not have write permission");const n=e.query.statementId;if(1!==e.body.length)return t.send(new s("Wrong body in PUT. Should be a single statement"));let i;e.body[0].id=n;try{i=await e.DAL.store(e.body,e.user.authority(),e.attachments)}catch(e){return t.send(e)}if(i){if(e.lrs.emit)try{e.lrs.emit("statementStored",[n])}catch(e){}return t.status(204).send("")}return t.send(new s(i.error))},this.postStatements=async function(e,t,n){if(!e.key.write)return t.status(401).send("this key does not have write permission");const i=[];for(const n in e.body){if(e.body[n].id||(e.body[n].id=a(3).v4()),i.indexOf(e.body[n].id)>-1)return t.send(new s("Collision between statement ids in the batch"));i.push(e.body[n].id)}let r;try{r=await e.DAL.store(e.body,e.user.authority(),e.attachments)}catch(e){return t.send(e)}if(r){if(e.lrs.emit)try{e.lrs.emit("statementStored",i)}catch(e){}return t.status(200).send(i)}return t.send(new s(r.error))},this.populateMore=async function(e,t,a){const n=e.query.id,i=await e.DAL.moreLinks.find({id:n}).toArray();if(i[0])return e.query=i[0].query,a();t.send(new d)},this.genMore=async function(e,t){const n={},i=a(3).v4();return n.id=i,n.query=e,n.when=new Date,void 0===e.page?e.page=0:e.page+=1,await t.moreLinks.insert(n),await t.moreLinks.remove({when:{$lt:new Date(Date.now()-864e5)}}),i},this.getAttachments=async function(e,t){const a=[];for(const n in e.statements)for(const i in e.statements[n].attachments){const r=await t.getAttachment(e.statements[n].attachments[i].sha2);r&&a.push(r)}return a},this.sendWithAttachments=function(e,t,a){const n=new r;var i={header:`\r\n--${n.getBoundary()}\r\nContent-Type: application/json\r\n\r\n`};n.append("statements",JSON.stringify(e),i);for(var s in t)i={header:`\r\n--${n.getBoundary()}\r\nContent-Type: ${t[s].contentType}\r\nContent-Transfer-Encoding: binary\r\nX-Experience-API-Hash: ${t[s].xApiHash}\r\n\r\n`},n.append(s,t[s].data,i);const o=n.getHeaders();o["content-type"]=o["content-type"].replace("multipart/form-data","multipart/mixed");for(var s in o)a.set(s,o[s]);n.pipe(a)},this.getStatementsAdvanced=async function(e,t,a){if(!e.key.advancedQueries)return t.status(401).send("this key does not have advancedQueries permission");try{const a=await e.DAL.findAdvanced(e.query.query,e.query.skip||0,e.query.limit||300);return t.send(a)}catch(e){return t.send(e)}},this.aggregate=async function(e,t,n){if(!e.key.advancedQueries)return t.status(401).send("this key does not have advancedQueries permission");const i=(0,a(90).validateAggregation)(e.body);if(!i.valid)return t.status(400).send(i.error);const r=await e.DAL.aggregate(e.body);return t.send(r)},this.getStatements=async function(e,t,n){if(!e.key.read)return t.status(401).send("this key does not have read permission");e.key.limitedRead&&(e.query.authority=e.key.authority());const i=e.query.attachments;let r=null;try{r=await e.DAL.find(e.query,e.headers)}catch(e){return t.send(e)}if(r&&r.constructor!==Array){if(!i)return t.send(r);const a=await this.getAttachments({statements:[r]},e.DAL);return this.sendWithAttachments(r,a,t)}if(r&&r.constructor===Array){const n={statements:r};if(r.more){const t=`${e.xAPIBaseUrl(e)}/statements/more`;n.more=`${a(14).parse(t).path}?id=${await this.genMore(e.query,e.DAL)}`}if(!i)return t.send(n);const s=await this.getAttachments(n,e.DAL);return this.sendWithAttachments(n,s,t)}return r?t.send(new c("No statement results returned")):t.send(new d("Statement not found"))},this.use(p),this.get("/",u("Query","query"),this.getStatements.bind(this)),this.post("/",u("Payload","body"),m,this.postStatements.bind(this)),this.put("/",u("Payload","body"),u("Put","query"),m,this.putStatements.bind(this)),this.get("/more",this.populateMore.bind(this),this.getStatements.bind(this)),this.get("/search",u("AdvancedQuery","query"),this.getStatementsAdvanced.bind(this)),this.post("/aggregate",this.aggregate.bind(this)),this}}},function(e,t){e.exports=require("better-ajv-errors")},function(e,t,a){const n=a(28),i=a(30),r=a(31),s=a(32),o=a(33),l=a(34),c=a(35),d=a(36),u=a(37),m=a(16),p=a(38),h=a(39),y=a(40),g=a(41),f=a(17),b=a(42),v=a(43),S=a(44),w=a(45),x=a(46),A=a(12),D=a(13),M=a(47),C=a(48),L=a(49),P=a(50),j=a(51),E=a(52),T=a(53),R=a(54),k=a(55),I=a(56),B=a(57),$=a(58),J=a(59),O=a(60),N=a(61),K=a(84),G=a(62),q=a(63),U=a(64),F=a(65),_=a(66),z=a(67),H=a(68),V=a(85),W=a(86);var Z=a(87).Validator;Z.prototype.customFormats.mbox=function(e){if(void 0==e)return!0;return/mailto\:[-_a-zA-Z0-9\.]+@[-_a-zA-Z0-9]+\.[a-zA-Z0-9]{2,20}/.test(e)},Z.prototype.customFormats.iso8601=function(e){if(void 0==e)return!0;if("P4W1D"==e)return!1;return new RegExp("^P((?=[\\d\\.]+[YMWD])([\\d\\.]+Y)?([\\d\\.]+M)?([\\d\\.]+W)?([\\d\\.]+D)?)?(T(?=[\\d\\.]+[HMS])([\\d\\.]+H)?([\\d\\.]+M)?([\\d\\.]+S)?)?$").test(e)},Z.prototype.customFormats.uuid=function(e){if(void 0==e)return!0;return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)};var Y=new Z;function Q(e){let t={valid:null,error:""};if(0==e.errors.length?t.valid=!0:t.valid=!1,t.error=e.errors.map(e=>e.stack).join(", "),e.errors[0]&&"instance.object"==e.errors[0].property&&("Activity"==e.instance.object.objectType||!e.instance.object.objectType)){let a=Q(Y.validate(e.instance.object,S));t.error+=`. ${a.error.replace(/instance/gi,"object")}`}if(e.errors[0]&&"instance.object"==e.errors[0].property&&"SubStatement"==e.instance.object.objectType){let a=Q(Y.validate(e.instance.object,E));t.error+=`. ${a.error.replace(/instance/gi,"object")}`}if(e.errors[0]&&"instance.object"==e.errors[0].property&&"Agent"==e.instance.object.objectType){let a=Q(Y.validate(e.instance.object,K));t.error+=`. ${a.error.replace(/instance/gi,"object")}`}if(e.errors[0]&&"instance.object"==e.errors[0].property&&"Group"==e.instance.object.objectType){let a=Y.validate(e.instance.object,k),n=Q(a);t.error+=`. If .object is an #AnonyousGroup, then ${n.error.replace(/instance/gi,"object")}`,n=Q(a=Y.validate(e.instance.object,V)),t.error+=`. If .object is an #IdentifiedGroup, then ${n.error.replace(/instance/gi,"object")}`}if(e.errors[0]&&"instance.actor"==e.errors[0].property&&("Agent"==e.instance.actor.objectType||!e.instance.actor.objectType)){let a=Q(Y.validate(e.instance.actor,K));t.error+=`. ${a.error.replace(/instance/gi,"actor")}`}if(e.errors[0]&&"instance.actor"==e.errors[0].property&&"Group"==e.instance.actor.objectType){let a=Y.validate(e.instance.actor,W),n=Q(a);t.error+=`. If .actor is an #AnonyousGroup, then ${n.error.replace(/instance/gi,"actor")}`,n=Q(a=Y.validate(e.instance.actor,V)),t.error+=`. If .actor is an #IdentifiedGroup, then ${n.error.replace(/instance/gi,"actor")}`}if(e.errors[0]&&"instance.context.instructor"==e.errors[0].property){let a=Q(Y.validate(e.instance.context.instructor,K));t.error+=`. ${a.error.replace(/instance/gi,"instructor")}`}if(e.errors[0]&&"instance.context.team"==e.errors[0].property){let a=Y.validate(e.instance.context.team,W),n=Q(a);t.error+=`. If .context.team is an #AnonyousGroup, then ${n.error.replace(/instance/gi,"context.team")}`,n=Q(a=Y.validate(e.instance.context.team,V)),t.error+=`. If .context.team is an #IdentifiedGroup, then ${n.error.replace(/instance/gi,"context.team")}`}return t}Y.addSchema(K,K.id.replace("#","/#")),Y.addSchema(n,n.id.replace("#","/#")),Y.addSchema(i,i.id.replace("#","/#")),Y.addSchema(r,r.id.replace("#","/#")),Y.addSchema(s,s.id.replace("#","/#")),Y.addSchema(o,o.id.replace("#","/#")),Y.addSchema(l,l.id.replace("#","/#")),Y.addSchema(c,c.id.replace("#","/#")),Y.addSchema(d,d.id.replace("#","/#")),Y.addSchema(u,u.id.replace("#","/#")),Y.addSchema(m,m.id.replace("#","/#")),Y.addSchema(p,p.id.replace("#","/#")),Y.addSchema(h,h.id.replace("#","/#")),Y.addSchema(y,y.id.replace("#","/#")),Y.addSchema(g,g.id.replace("#","/#")),Y.addSchema(f,f.id.replace("#","/#")),Y.addSchema(b,b.id.replace("#","/#")),Y.addSchema(v,v.id.replace("#","/#")),Y.addSchema(S,S.id.replace("#","/#")),Y.addSchema(w,w.id.replace("#","/#")),Y.addSchema(x,x.id.replace("#","/#")),Y.addSchema(A,A.id.replace("#","/#")),Y.addSchema(D,D.id.replace("#","/#")),Y.addSchema(M,M.id.replace("#","/#")),Y.addSchema(C,C.id.replace("#","/#")),Y.addSchema(L,L.id.replace("#","/#")),Y.addSchema(P,P.id.replace("#","/#")),Y.addSchema(j,j.id.replace("#","/#")),Y.addSchema(E,E.id.replace("#","/#")),Y.addSchema(T,T.id.replace("#","/#")),Y.addSchema(R,R.id.replace("#","/#")),Y.addSchema(k,k.id.replace("#","/#")),Y.addSchema(I,I.id.replace("#","/#")),Y.addSchema(B,B.id.replace("#","/#")),Y.addSchema($,$.id.replace("#","/#")),Y.addSchema(J,J.id.replace("#","/#")),Y.addSchema(O,O.id.replace("#","/#")),Y.addSchema(N,N.id.replace("#","/#")),Y.addSchema(V,V.id.replace("#","/#")),Y.addSchema(W,W.id.replace("#","/#")),e.exports.validateStatement=function(e){let t=Y.validate(e,C);return(t=Q(t)).error=t.error.replace(/instance/gi,"statement"),t},e.exports.validatePayload=function(t){let a=Y.validate(t,N);if(a=Q(a),t instanceof Array)for(let n in t){let i=e.exports.validateStatement(t[n]);!1===i.valid&&(a.error+=` In statement ${n}, ${i.error}.`)}else{let n=e.exports.validateStatement(t);!1===n.valid&&(a.error+=` In statement ${n.error}.`)}return a.error=a.error.replace(/instance/gi,"statements"),a},e.exports.validateAdvancedQuery=function(e){let t=Y.validate(e,H);return(t=Q(t)).error=t.error.replace(/instance/gi,"queryString"),t},e.exports.validateQuery=function(e){let t=Y.validate(e,P);return(t=Q(t)).error=t.error.replace(/instance/gi,"queryString"),t},e.exports.validateActivityProfile=function(e){let t=Y.validate(e,q);return(t=Q(t)).error=t.error.replace(/instance/gi,"queryString"),t},e.exports.validateActivityState=function(e){let t=Y.validate(e,G);return(t=Q(t)).error=t.error.replace(/instance/gi,"queryString"),t},e.exports.validateAgentQuery=function(e){let t=Y.validate(e,_);return(t=Q(t)).error=t.error.replace(/instance/gi,"queryString"),t},e.exports.validateActivityQuery=function(e){let t=Y.validate(e,z);return(t=Q(t)).error=t.error.replace(/instance/gi,"queryString"),t},e.exports.validateAgentProfile=function(e){let t=Y.validate(e,U);return(t=Q(t)).error=t.error.replace(/instance/gi,"queryString"),t},e.exports.validatePut=function(e){let t=Y.validate(e,F);return(t=Q(t)).error=t.error.replace(/instance/gi,"statement"),t}},function(e,t){e.exports={id:"#agentDisplay",type:"object",properties:{objectType:{type:"string",enum:["Agent"]},name:{type:"string",chance:{name:null}},account:{$ref:"#Account"},mbox:{type:"string",format:"mbox"},mbox_sha1sum:{type:"string",chance:{hash:null}},openid:{type:"string",format:"uri"}},required:["objectType","name"],additionalProperties:!1,minProperties:3,maxProperties:3}},function(e,t){e.exports={id:"#identifiedGroupDisplay",type:"object",properties:{objectType:{type:"string",enum:["Group"]},name:{type:"string",chance:{name:null}},account:{$ref:"#Account"},mbox:{type:"string",format:"mbox"},mbox_sha1sum:{type:"string",chance:{hash:null}},openid:{type:"string",format:"uri"},member:{type:"array",items:{$ref:"#agentDisplay"},minItems:1}},required:["objectType","name","member"],additionalProperties:!1,minProperties:4,maxProperties:4}},function(e,t){e.exports={id:"#anonymousGroupDisplay",type:"object",properties:{objectType:{type:"string",enum:["Group"]},name:{type:"string",chance:{name:null}},member:{type:"array",items:{$ref:"#agentDisplay"},minItems:1}},required:["objectType","member"],additionalProperties:!1}},function(e,t){e.exports=require("jsonschema")},function(e,t){e.exports=require("json-schema-faker")},function(e,t){e.exports=require("form-data")},function(e,t,a){const n=new(a(26))({format:"full",jsonPointers:!0}),i=(new(a(15)),{id:"#aggregationPipeline",type:"array",items:{$ref:"#aggregationStage"},minItems:1});n.addSchema({id:"#aggregationStage",type:"object",additionalProperties:!1,minProperties:1,maxProperties:1,properties:{$addFields:{type:"object"},$bucketAuto:{type:"object"},$bucket:{type:"object"},$count:{type:"string"},$facet:{type:"object",patternProperties:{"^.*$":{$ref:"#aggregationPipeline"}},properties:{},additionalProperties:!1},$geoNear:{type:"object"},$graphLookup:{type:"object"},$group:{type:"object"},$limit:{type:"number",minimum:1},$lookup:{type:"object"},$match:{type:"object"},$project:{type:"object"},$redact:{type:"object"},$replaceRoot:{type:"object"},$sample:{type:"object"},$skip:{type:"number",minimum:1},$sort:{type:"object"},$sortByCount:{type:"object"},$unwind:{oneof:[{type:"object"},{type:"string"}]}}}),n.addSchema(i);const r=n.compile(i);e.exports.validateAggregation=function(e){return{valid:r(e),error:n.errorsText(r.errors,{verbose:!0})}}},function(e,t){e.exports=require("cors")},function(e,t){e.exports=require("passport")},function(e,t){e.exports=require("passport-http")},function(e,t){e.exports=require("body-parser")},function(e,t,a){const n=a(96),{ClientError:i,ConflictError:r,PreconditionError:s,ServerError:o,NotFoundError:l}=a(10);e.exports=function(e,t,a){if(e.attachments)return a();if(e.lrs.strict&&e.headers["content-type"]&&e.headers["content-type"].indexOf("multipart/form-data")>-1)return t.send(new i("use multipart/mixed instead of multipart/form-data"));const r=e.headers["content-type"]||"";if(0!=r.trim().indexOf("multipart/mixed")&&0!=r.trim().indexOf("multipart/form-data"))return a();{e.headers["content-type"]=r.replace("multipart/mixed","multipart/form-data");const s=new n.Form,o=[];s.on("part",e=>{const a={data:[],contentType:e.headers["content-type"]||e.headers["Content-Type"],xApiHash:e.headers["x-experience-api-hash"]||e.headers["X-Experience-API-Hash"],encoding:e.headers["content-transfer-encoding"]||e.headers["Content-Transfer-Encoding"]};e.on("data",e=>{a.data.push(e),a.data.reduce((e,t)=>e+t.length,0)>1e6&&t.send(new i("Upload too large"))}),e.on("end",e=>{a.data=Buffer.concat(a.data),o.push(a)}),e.on("error",t=>{e.resume()})}),s.on("error",e=>{t.send(new i(e.message))}),s.on("close",()=>{if("application/json"!==o[0].contentType)return t.send(new i("the first part of a multipart post should be application/json, and should be a Statement or an array of Statements"));try{e.body=JSON.parse(o[0].data)}catch(e){return t.send(new i("Bad json in multipart part 0"))}e.attachments=[];const n={};for(let a=1;a<o.length;a++){if(!o[a].xApiHash)return t.send(new i("multipart uploads must include the custom field X-Experience-API-Hash"));if("binary"!==o[a].encoding)return t.send(new i(') An LRS rejects with error code 400 Bad Request, a PUT or POST Request which uses Attachments, has a "Content Type" header with value "multipart/mixed", and for any part except the first does not have a Header named "Content-Transfer-Encoding" with a value of "binary"'));e.attachments.push(o[a]),n[o[a].xApiHash]=o[a]}let r=[];const s={};r=e.body.constructor==Array?e.body:[e.body];for(const e in r)if(r[e].attachments)for(const t in r[e].attachments)s[r[e].attachments[t].sha2]=r[e].attachments[t];for(const e in n)if(!s[e])return t.send(new i("There are attachment in the multipart post that are not refernced by the statements"));for(const e in s)if(!n[e])return t.send(new i("The statements in the multipart post reference attachments that are not present "));a()}),s.parse(e)}}},function(e,t){e.exports=require("multiparty")},function(e,t){e.exports=require("validator")},function(e,t,a){const n=a(8).Router,i=a(20),r=a(9),s=a(4),{ClientError:o,ConflictError:l,PreconditionError:c,ServerError:d,NotFoundError:u}=a(10);e.exports=class extends n{constructor(e,t,n,d,m,p){super(),this.type=e,this.contextFields=n,this.idField=t,this.validationKey=d,this.useETAGs=p,this.documentStorageCache={},this.requireIdForDelete=m,this.use((e,t,a)=>{if(this.documentStorageCache[e.lrs.uuid])e.documentStorage=this.documentStorageCache[e.lrs.uuid];else{const t=e.documentStorage=this.documentStorageCache[e.lrs.uuid]=new class{constructor(e){this.type=e}collection(e){return e[this.type]}prepDocumentForInsert(e,t){return"application/octet-stream"==t?new s.Binary(e):e}prepDocumentForServe(e,t){return"application/octet-stream"==t?e.read(0,e.length):e}async save(e,t,a,n,r){const s={context:a,contextID:i(a),id:t,document:this.prepDocumentForInsert(n,r["content-type"]),contentType:r["content-type"],lastModified:new Date((new Date).valueOf()-2e3)},l=await this.get(e,t,a);if(l)if("application/json"==l.contentType&&"application/json"==r["content-type"])s.document=this.merge(s.document,l.document);else{if("application/json"!=l.contentType&&"application/json"==r["content-type"])throw new o("If the document being posted to the State Resource does not have a Content-Type of application/json and the existing document does, the LRS MUST respond with HTTP status code 400 Bad Request, and MUST NOT update the target document as a result of the request.");if("application/json"==l.contentType&&"application/json"!=r["content-type"])throw new o("If the existing document does have a Content-Type of application/json and the document being posted to the State Resource does not the LRS MUST respond with HTTP status code 400 Bad Request, and MUST NOT update the target document as a result of the request.")}s.tag=i(n),await this.collection(e).replaceOne({contextID:s.contextID,id:s.id},s,{upsert:!0}),e.log("storeDocument",null,s.contextID,t)}async get(e,t,a,n){const r={contextID:i(a),id:t};n&&(r.lastModified={$gte:new Date(n)});const s=await this.collection(e).find(r).toArray();return e.log("getDocument",null,r.contextID,t),s[0]}merge(e,t){return Object.assign({},t,e)}async delete(e,t,a){const n={contextID:i(a)};t&&(n.id=t),await this.collection(e).remove(n),e.log("deleteDocument",null,n.contextID,t)}async getIds(e,t,a){const n={contextID:i(t)};a&&(n.lastModified={$gt:new Date(a)});const r=await this.collection(e).find(n).toArray();return e.log("getDocumentIDs",null,n.contextID),r.map(e=>e.id)}}(this.type);this.documentStorageCache[e.lrs.uuid]=t}return a()}),this.buildContext=function(e){const t={};for(const n in this.contextFields)e[this.contextFields[n]]&&(t[n]=e[this.contextFields[n]],"agent"==this.contextFields[n]&&(t[n]=a(11).getIFI(t[n])));return t},this.validate=function(e,t,a){try{this.useETAGs&&("PUT"==e.method||"POST"==e.method||e.method)}catch(e){return t.send(e)}const n=r[this.validationKey](e.query);return n.valid?a():t.send(new o(`Query does not match schema: ${n.error}`))},this.etags=async function(e,t,a,n){if(this.useETAGs){a.headers["if-none-match"]&&"*"!==a.headers["if-none-match"]&&(a.headers["if-none-match"]=JSON.parse(a.headers["if-none-match"].replace("W/",""))),a.headers["if-match"]&&"*"!==a.headers["if-match"]&&(a.headers["if-match"]=JSON.parse(a.headers["if-match"].replace("W/","")));const i=await a.documentStorage.get(a.DAL,e,t);if(!i&&"PUT"==a.method&&!a.headers["if-match"]&&!a.headers["if-none-match"])return n.send(new o('A Client making a PUT or POST request to either the Agent Profile Resource or Activity Profile Resource MUST include the "If-Match" header or the If-None-Match header.')),!1;if("PUT"==a.method&&i&&!a.headers["if-none-match"]&&!a.headers["if-match"])return n.send(new l(" If put request is received without either header for a resource that already exists")),!1;if(i&&"*"==a.headers["if-none-match"])return n.send(new c('An LRS responding to a PUT request MUST handle the "If-None-Match" header as described in RFC2616, HTTP 1.1 if it contains "*", in order to to detect when there is a resource present that the Client is not aware of.')),!1;if(i&&a.headers["if-none-match"]&&"*"!==a.headers["if-none-match"]&&i.tag==a.headers["if-none-match"])return n.send(new c('An LRS responding to a PUT request MUST handle the "If-None-Match" header as described in RFC2616, HTTP 1.1 if it contains "*", in order to to detect when there is a resource present that the Client is not aware of.')),!1;if(i&&"*"!==a.headers["if-match"]&&a.headers["if-match"]!==i.tag&&a.headers["if-match"])return n.send(new c('An LRS responding to a PUT request MUST handle the "If-Match" header as described in RFC2616, HTTP 1.1 if it contains an ETag, in order to detect modifications made after the Client last fetched the document.')),!1}return!0},this.get("/",this.validate.bind(this),async(e,t,a)=>{if(!e.key.read)return t.status(401).send("this key does not have read permission");try{const a=e.query[this.idField],n=this.buildContext(e.query);if(a){const i=await e.documentStorage.get(e.DAL,a,n,e.query.since);return i?(t.set("etag",`"${i.tag}"`),t.status(200).send(e.documentStorage.prepDocumentForServe(i.document,i.contentType))):t.send(new u)}const i=await e.documentStorage.getIds(e.DAL,n,e.query.since);return t.send(i)}catch(e){console.log(e),t.send(e)}});["post","put"].forEach(e=>{this[e]("/",this.validate.bind(this),async(e,t,a)=>{if(!e.key.write)return t.status(401).send("this key does not have write permission");try{const a=e.query[this.idField],n=this.buildContext(e.query);if(!await this.etags(a,n,e,t))return;return a?(await e.documentStorage.save(e.DAL,a,n,e.body,e.headers),e.lrs.emit&&e.lrs.emit(`${this.type}Stored`,{id:a,context:n,document:e.body}),t.status(204).send()):t.send(new o("Did not provide an ID to post"))}catch(e){console.log(e),t.send(e)}})}),this.delete("/",this.validate.bind(this),async(e,t,a)=>{if(!e.key.write)return t.status(401).send("this key does not have write permission");try{const a=e.query[this.idField];if(this.requireIdForDelete&&!a)throw new o(`rejects a DELETE request without "${this.idField}" as a parameter with error code 400 Bad Request `);const n=this.buildContext(e.query);return await e.documentStorage.delete(e.DAL,a,n),e.lrs.emit&&e.lrs.emit(`${this.type}Deleted`,{id:a,context:n}),t.status(204).send()}catch(e){t.send(e)}})}}},function(e,t){e.exports=require("moment")},function(e,t){e.exports=require("moment-interval")},function(e,t){e.exports=require("object-foreach")},function(e,t){e.exports=require("deepmerge")},function(e,t){e.exports=require("jsonwebtoken")},function(e,t){e.exports=require("dateformat")},function(e,t,a){const n=a(8).Router,i=a(9),{ClientError:r,ConflictError:s,PreconditionError:o,ServerError:l,NotFoundError:c}=a(10);e.exports=class extends n{constructor(){super(),this.validate=function(e,t,a){try{const t=i.validateAgentQuery(e.query);if(!t.valid)throw new r(`Query does not meet schema: ${t.error}`);a()}catch(e){throw e}},this.concurrency=function(e,t,a){return a()},this.get("/",this.validate.bind(this),this.concurrency.bind(this),async(e,t,a)=>{if(!e.key.read)return t.status(401).send("this key does not have read permission");const n=await e.DAL.getAgentAsPerson(e.query.agent);t.send(n)})}}},function(e,t,a){const n=a(8).Router,i=a(9),{ClientError:r,ConflictError:s,PreconditionError:o,ServerError:l,NotFoundError:c}=a(10);e.exports=class extends n{constructor(){super(),this.validate=function(e,t,a){try{const t=i.validateActivityQuery(e.query);if(!t.valid)throw new r(`Query does not meet schema: ${t.error}`);a()}catch(e){throw e}},this.concurrency=function(e,t,a){return a()},this.get("/",this.validate.bind(this),this.concurrency.bind(this),async(e,t,a)=>{if(!e.key.read)return t.status(401).send("this key does not have read permission");const n=await e.DAL.getActivity(e.query.activityId);t.send(n)})}}},function(e,t){e.exports=["material-design-account4","material-design-add179","material-design-add180","material-design-add181","material-design-add182","material-design-add183","material-design-add184","material-design-add186","material-design-adjust6","material-design-airplane106","material-design-android11","material-design-android12","material-design-apple70","material-design-attachment19","material-design-auto1","material-design-automatic2","material-design-automatic3","material-design-back57","material-design-backspace1","material-design-bed24","material-design-been","material-design-birthday20","material-design-black394","material-design-black395","material-design-black396","material-design-black397","material-design-black398","material-design-black399","material-design-black400","material-design-black401","material-design-black402","material-design-blank30","material-design-blank31","material-design-blank32","material-design-blank33","material-design-blogger12","material-design-blueetooth","material-design-bluetooth21","material-design-bluetooth22","material-design-bluetooth23","material-design-bluetooth24","material-design-bluetooth25","material-design-bookmark45","material-design-bookmark46","material-design-bookmark47","material-design-bookmark48","material-design-briefcase49","material-design-briefcase50","material-design-brightness10","material-design-brochure6","material-design-bubble8","material-design-bug18","material-design-burn9","material-design-button11","material-design-call47","material-design-call48","material-design-call49","material-design-camera59","material-design-camera60","material-design-cancel19","material-design-caps1","material-design-caps","material-design-car145","material-design-car146","material-design-car147","material-design-cell10","material-design-cell11","material-design-cell12","material-design-change3","material-design-chat75","material-design-chat76","material-design-check51","material-design-check52","material-design-chemistry17","material-design-circle107","material-design-circle108","material-design-circles23","material-design-circumference","material-design-city24","material-design-clapperboard4","material-design-clapperboard5","material-design-clear5","material-design-clipboard99","material-design-clock100","material-design-close47","material-design-closed64","material-design-cloud302","material-design-cloud303","material-design-cloud304","material-design-cloud305","material-design-cloud306","material-design-cloud307","material-design-compass106","material-design-connection21","material-design-copy31","material-design-create2","material-design-create3","material-design-credit98","material-design-crop13","material-design-crop14","material-design-cut23","material-design-dark55","material-design-developer2","material-design-device4","material-design-device5","material-design-disc30","material-design-do10","material-design-double126","material-design-download162","material-design-download164","material-design-download166","material-design-downwards","material-design-drafts","material-design-drop25","material-design-drop26","material-design-drop27","material-design-earth205","material-design-ellipsis1","material-design-email107","material-design-emoticon117","material-design-end3","material-design-enter5","material-design-exit13","material-design-expand38","material-design-expand39","material-design-facebook56","material-design-fast46","material-design-favorite21","material-design-favorite22","material-design-filled13","material-design-film61","material-design-filter20","material-design-flash25","material-design-flash26","material-design-folder215","material-design-forward18","material-design-forward19","material-design-framed1","material-design-front15","material-design-front16","material-design-front17","material-design-full46","material-design-gamepad3","material-design-gamepad4","material-design-get","material-design-gmail3","material-design-go10","material-design-good4","material-design-good5","material-design-google117","material-design-google118","material-design-google119","material-design-google120","material-design-google121","material-design-google122","material-design-google123","material-design-google124","material-design-google125","material-design-google126","material-design-google127","material-design-google128","material-design-google129","material-design-google130","material-design-google131","material-design-google132","material-design-google133","material-design-google134","material-design-google135","material-design-google136","material-design-google137","material-design-gps25","material-design-gps26","material-design-gps27","material-design-gps28","material-design-graduate32","material-design-halffilled1","material-design-hangouts","material-design-headset11","material-design-headset12","material-design-help18","material-design-help19","material-design-hide3","material-design-high20","material-design-high21","material-design-high22","material-design-history6","material-design-home149","material-design-horizontal39","material-design-hotel68","material-design-https","material-design-import","material-design-insert4","material-design-instagram16","material-design-invert1","material-design-keyboard53","material-design-keyboard54","material-design-label31","material-design-landscape10","material-design-laptop117","material-design-left216","material-design-left217","material-design-left218","material-design-light88","material-design-link60","material-design-linkedin24","material-design-list88","material-design-list89","material-design-location41","material-design-locked57","material-design-locked58","material-design-low34","material-design-magic20","material-design-man459","material-design-man460","material-design-map102","material-design-map103","material-design-mark1","material-design-mark2","material-design-medium5","material-design-medium6","material-design-medium7","material-design-memory1","material-design-menu55","material-design-merge","material-design-microphone84","material-design-microphone85","material-design-microsoft7","material-design-microsoft8","material-design-missed","material-design-mountain31","material-design-mountain32","material-design-mountains14","material-design-move26","material-design-new102","material-design-new103","material-design-nfc1","material-design-notifications1","material-design-notifications2","material-design-notifications","material-design-painter14","material-design-panoramic1","material-design-parking14","material-design-pause44","material-design-person325","material-design-phone370","material-design-phone371","material-design-phone372","material-design-phone373","material-design-phone374","material-design-phone375","material-design-photo210","material-design-photo211","material-design-photo212","material-design-photographic1","material-design-pinterest33","material-design-planet29","material-design-play105","material-design-play106","material-design-play107","material-design-play108","material-design-play109","material-design-plus80","material-design-poll","material-design-power106","material-design-previous14","material-design-printer88","material-design-problems","material-design-progress10","material-design-public10","material-design-public11","material-design-public9","material-design-puzzle37","material-design-radio51","material-design-random5","material-design-rate","material-design-read5","material-design-receipt9","material-design-record9","material-design-refresh55","material-design-refresh56","material-design-reminder6","material-design-replay4","material-design-reply18","material-design-report","material-design-rewind45","material-design-right237","material-design-right244","material-design-ring24","material-design-rotate11","material-design-rotate12","material-design-round50","material-design-round51","material-design-round52","material-design-round53","material-design-round54","material-design-round55","material-design-round56","material-design-round57","material-design-round58","material-design-rounded54","material-design-rounded55","material-design-rounded56","material-design-rounded57","material-design-rounded58","material-design-rounded59","material-design-rounded60","material-design-rubbish","material-design-save20","material-design-schedule2","material-design-screen44","material-design-screen45","material-design-screen46","material-design-screen47","material-design-screen48","material-design-screen49","material-design-sd7","material-design-sd8","material-design-search100","material-design-searching41","material-design-select3","material-design-select4","material-design-send12","material-design-send13","material-design-send14","material-design-server40","material-design-set5","material-design-set6","material-design-settings49","material-design-settings50","material-design-share39","material-design-shared1","material-design-shining2","material-design-shining3","material-design-shopping231","material-design-shopping232","material-design-show4","material-design-show5","material-design-show6","material-design-show7","material-design-show8","material-design-shuffle24","material-design-sim2","material-design-smartphone19","material-design-smartphone20","material-design-sms5","material-design-sms6","material-design-sms7","material-design-snake4","material-design-sort52","material-design-speech108","material-design-split4","material-design-square181","material-design-stop46","material-design-swap2","material-design-swap3","material-design-switch27","material-design-switch28","material-design-switch29","material-design-switch30","material-design-synchronization3","material-design-synchronization4","material-design-synchronization5","material-design-tab3","material-design-tablet95","material-design-tack","material-design-tag71","material-design-telephone105","material-design-thermostat1","material-design-three168","material-design-three170","material-design-thumb53","material-design-thumb54","material-design-tick7","material-design-timelapse","material-design-traffic21","material-design-tumblr22","material-design-turn17","material-design-turn18","material-design-turn19","material-design-turn20","material-design-turn21","material-design-turn22","material-design-turn23","material-design-twitter47","material-design-two375","material-design-two385","material-design-two393","material-design-underline6","material-design-underline7","material-design-undo19","material-design-unlocked43","material-design-up176","material-design-upload119","material-design-upload120","material-design-usb33","material-design-user157","material-design-user158","material-design-users25","material-design-verification24","material-design-videocall","material-design-view12","material-design-virtual2","material-design-visibility1","material-design-voice32","material-design-voicemail1","material-design-volume47","material-design-volume49","material-design-volume50","material-design-volume51","material-design-warning37","material-design-watch16","material-design-waving","material-design-web37","material-design-website12","material-design-wifi81","material-design-wifi82","material-design-wifi83","material-design-window57","material-design-work3","material-design-workspace","material-design-world96","material-design-write20","material-design-youtube35"]},function(e,t,a){const n=a(0),i=a(5),r=a(72).CryptoJS,s=(process.env,n.Schema({username:String,passwordHash:String,email:{type:String,unique:!0,lowercase:!0,trim:!0},verifiedEmail:Boolean,salt:String,verifyCode:String,passwordResetKey:String,acceptsTOS:{type:Date,default:null},oldpasswords:[String],oldsalt:[String],lastLogin:Date,lastLoginIp:String,uuid:String,_modified:Number,_created:Number,type:{type:String,default:"user"},tier:{type:String,default:"free"},tierExpiration:{type:Date,default:new Date(0)}},{usePushEach:!0}));s.virtual("owner").get(function(){return this.uuid}),s.virtual("parent").get(()=>a(22)),s.pre("remove",async function(e){const t=a(1).lrs,n=await t.find({owner:this.uuid}).exec();for(const e in n)await n[e].remove();e()}),s.methods.checkPassword=function(e){const t=i.hashPassword(this.username,this.salt,e);return this.passwordHash==t},s.methods.getTier=function(){const e=a(109);return e[this.tier]||e.free},s.methods.checkResetKey=function(e){return this.passwordResetKey==e},s.methods.forgotPassword=function(e){return this.passwordResetKey=r.lib.WordArray.random(16).toString(),this.save()},s.methods.resetPassword=function(e,t=!1){if(this.oldpasswords.push(this.passwordHash),this.oldsalt.push(this.salt),this.salt=r.lib.WordArray.random(16).toString(),!t&&this.oldpasswords.length>5&&(this.oldpasswords.shift(),this.oldsalt.shift()),this.passwordHash=i.hashPassword(this.username,this.salt,e),!t)for(let t=0;t<this.oldpasswords.length;t++)if(this.oldpasswords[t]&&this.oldsalt[t]&&this.oldpasswords[t]==i.hashPassword(this.username,this.oldsalt[t],e))throw"This password has been used recently. Please choose a new password.";return this.passwordResetKey=r.lib.WordArray.random(16).toString(),this.save()},s.pre("save",function(e){this._modified=Date.now(),this._created||(this._created=Date.now()),e()}),e.exports=n.model("user.js",s)},function(e,t){"lrs.io"===BUILD_TYPE?e.exports={free:{maxStorage:1e8,lrsLimit:3,maxLearners:100,maxOpsPerDay:1e4,pricePerMonth:0,level:0},promoELB:{maxStorage:25e7,lrsLimit:3,maxLearners:200,maxOpsPerDay:1e4,pricePerMonth:0,level:11},starter:{maxStorage:1e9,lrsLimit:5,maxLearners:500,maxOpsPerDay:25e3,pricePerMonth:100,level:1},pro:{maxStorage:5e9,lrsLimit:10,maxLearners:2500,maxOpsPerDay:1e5,pricePerMonth:400,level:2},expert:{maxStorage:1/0,lrsLimit:1/0,maxLearners:1/0,maxOpsPerDay:1e8,pricePerMonth:800,level:3}}:e.exports={free:{maxStorage:1/0,lrsLimit:1/0,maxLearners:1/0,maxOpsPerDay:1e8,pricePerMonth:800,level:3},promoELB:{maxStorage:1/0,lrsLimit:1/0,maxLearners:1/0,maxOpsPerDay:1e8,pricePerMonth:800,level:3},starter:{maxStorage:1/0,lrsLimit:1/0,maxLearners:1/0,maxOpsPerDay:1e8,pricePerMonth:800,level:3},pro:{maxStorage:1/0,lrsLimit:1/0,maxLearners:1/0,maxOpsPerDay:1e8,pricePerMonth:800,level:3},expert:{maxStorage:1/0,lrsLimit:1/0,maxLearners:1/0,maxOpsPerDay:1e8,pricePerMonth:800,level:3}}},function(e,t,a){const n=a(0),i=a(6),r=a(125),s=a(11).prepStatementForDisplay,o=a(21),l=n.Schema({lrsName:{type:String,unique:!0},owner:String,maxStorage:{type:Number,default:1e8},maxStatements:Number,maxOpsPerDay:{type:Number,default:1e4},uuid:String,createdOn:Date,active:{type:Boolean,default:!0},strict:{type:Boolean,default:!1},preferRead:{type:Boolean,default:!1},verboseLogs:{type:Boolean,default:!0},permissions:{type:Object},prettyURL:{type:String,unique:!0},secret:String},{usePushEach:!0});l.pre("remove",async function(e){(await i.connect(this)).dropDatabase((t,a)=>{e()})}),l.post("init",function(e,t){this.on("statementStored",async(e,t)=>{const a=await i.odm(this);o.get(this.uuid,this.strict,this.preferRead,(n,r)=>{a.upstreamLRS.find({},async(a,n)=>{if(0==n.length)return!!t&&t();const r=await i.connect(this);let o=await r.collection("statements").find({id:{$in:e}});o=o.map(e=>{let t=e;return delete(t=s(t)).stored,delete t.authority,t}),n.forEach(async e=>{await this.statementForward(o)})})})}),a(1).user.findOne({uuid:this.owner},(e,a)=>{this.parent=a,t()})}),l.methods.statementForward=async function(e,t){try{const t=await r(e,doc.endpoint,doc.username,doc.password);t.response.statusCode>=400&&thisDAL.userLog("StatementForwardError",`Status Code: ${t.response.statusCode}`,t.body)}catch(e){thisDAL.userLog("StatementForwardError",e.message,e)}if(t)return t()},e.exports=n.model("lrs.js",l)},function(e,t,a){const n={};n.class=a(112),n.content=a(113),n.course=a(114),n.file=a(115),n.key=a(116),n.launch=a(117),n.learner=a(118),n.package=a(119),n.upstreamLRS=a(121),n.portalSettings=a(122),n.page=a(123),n.customDashboard=a(124),e.exports.attachLrsModels=function(e,t){for(const a in n){const i=a;n[a].virtual("parent").get(function(){return this.constructor.lrs}),e[i]=e.model(`${a}.js`,n[a]),e[i].odm=e,e[i].lrs=t}e.modelNames=Object.keys(n)}},function(e,t,a){const n=a(0),i=(process.env,n.Schema({uuid:{type:String,unique:!0},title:String,description:String,created:Date,accessed:Date,owner:String,available:Date,assignments:[{title:String,uuid:String}],members:[{email:String,username:String,uuid:String}],instructor:{email:String,username:String,uuid:String}},{usePushEach:!0}));i.pre("save",function(e){for(let e in this.members)if(this.members[e]instanceof this.constructor.odm.learner){let t={username:this.members[e].firstName+" "+this.members[e].lastName,uuid:this.members[e].uuid,email:this.members[e].email};this.members[e]=t}e()}),i.methods.populateMembers=async function(){for(let e in this.members){let t=this.constructor.odm.learner.findOne({uuid:this.members[e].uuid});t&&(this.members[e]=t)}},e.exports=i},function(e,t,a){const n=a(0),i=a(23).pullGenerator,r=a(23).setGenerator,s=a(23).incGenerator,o=process.env;function l(e){return o.domainRouting?`${o.protocol}://${e.lrs.prettyURL}.${o.host}:${o.port}`||"http://localhost:3000":`${o.protocol}://${o.host}:${o.port}`||"http://localhost:3000"}const c=n.Schema({uuid:{type:String,unique:!0},url:{type:String},title:String,description:String,created:Date,accessed:Date,owner:String,publicKey:String,timeToConsume:{type:Number,default:1e3},sessionLength:Number,iconURL:String,mediaTypeKey:{type:String,default:"web"},launchType:{type:String,default:"popup"},launches:{type:Number,default:0},stars:Array,packageLink:String,logoLink:{type:String,default:null},customData:String,trackInitializeTerminate:{type:Boolean,default:!0},supportsXapiLaunch:{type:Boolean,default:!1},supportsTincanLaunch:{type:Boolean,default:!1}},{usePushEach:!0});c.methods.xapiForm=function(e){const t={};return t.id=`${l(e)}/content/${this.uuid}`,t.definition={},t.definition.name={"en-US":this.title},t.definition.description={"en-US":this.description},t.definition.type=`${l(e)}/content/`,t},c.methods.dbForm=function(){return this.toObject()},c.methods.star=r("stars",this),c.methods.unStar=i("stars",this),c.methods.incLaunches=s("launches",this),c.pre("remove",async function(e){if(this.packageLink){const e=await this.constructor.odm.package.findOne({uuid:this.packageLink});e&&await e.remove()}if(this.logoLink){const e=await this.constructor.odm.file.findOne({uuid:this.logoLink});e&&await e.remove()}e()}),e.exports=c},function(e,t,a){const n=a(0),i=(process.env,n.Schema({uuid:{type:String,unique:!0},url:{type:String,unique:!0},title:String,description:String,created:Date,accessed:Date,owner:String,available:Date,lessons:[{title:String,uuid:String}]},{usePushEach:!0}));e.exports=i},function(e,t,a){const n=a(0).Schema({packageID:String,data:String,path:String,fileSize:Number,type:String,owner:String,uuid:String,gridfsuuid:String},{usePushEach:!0}),i=a(4),r=a(4).GridStore;n.methods.generateGridID=function(){this.gridfsuuid=(new i.ObjectID).toString()},n.methods.saveData=async function(e,t){let a=e;const n=this;this.gridfsuuid||this.generateGridID();const s=this.constructor.odm;this.fileSize=a.length;const o=new r(s.db,new i.ObjectID(n.gridfsuuid),n.uuid,"w");return new Promise((e,i)=>{o.open(r=>{r&&i(r),o.rewind(r=>{r&&i(r),a||(a=""),o.write(a,a=>{a&&i(a),o.close(a=>{a&&i(a),n.save(()=>{t&&t(),e()})})})})})})},n.methods.fromZipEntry=function(e,t){return new Promise((a,n)=>{this.path=e.entryName,e.getDataAsync(e=>{this.saveData(e,()=>{t&&t(),a()})})})},n.methods.getData=function(e){return new Promise((t,a)=>{const n=this.constructor.odm;r.read(n.db,new i.ObjectID(this.gridfsuuid),(a,n)=>{e&&e(a,n),t(n)})})},n.methods.deleteData=function(e){return new Promise((t,a)=>{const n=this.constructor.odm.db;r.unlink(n,new i.ObjectID(this.gridfsuuid),a=>{e&&e(a),t()})})},n.methods.dbForm=function(){return this.toObject()},n.pre("remove",async function(e){await this.deleteData(),e()}),e.exports=n},function(e,t,a){const n=a(0);e.exports=n.Schema({name:{type:String,unique:!0},read:{type:Boolean,default:!0},write:{type:Boolean,default:!0},advancedQueries:{type:Boolean,default:!1},limitedRead:{type:Boolean,default:!1},uuid:{type:String,unique:!0},password:String},{usePushEach:!0})},function(e,t,a){const n=a(0).Schema({learnerId:String,contentId:String,created:Date,state:Number,uuid:String,client:String,publicKey:String,mediaId:String,termination:{code:Number,message:String},userguid:String,passguid:String,customData:String,courseContext:String,credentials:{username:String,password:String}},{usePushEach:!0}),i=process.env;function r(e){return i.domainRouting?`${i.protocol}://${e.lrs.prettyURL}.${i.host}:${i.port}`||"http://localhost:3000":`${i.protocol}://${i.host}:${i.port}`||"http://localhost:3000"}n.methods.xapiForm=function(e){const t={};return t.id=`${r(e)}/launches/${this.uuid}`,t.definition={},t.definition.name={"en-US":"Launch Record"},t.definition.description={"en-US":"The user launched xAPI enabled content."},t.definition.type=`${r(e)}/launch/`,t.definition.moreInfo=`${r(e)}/content/${this.contentId}`,t},n.methods.dbForm=function(){return this.toObject()},e.exports=n},function(e,t,a){const n=a(0),i=a(5),r=a(72).CryptoJS,s=(process.env,a(20)),o=n.Schema({firstName:String,lastName:String,streetAddress:String,city:String,region:String,postalCode:String,phone:String,passwordHash:String,actor:Object,actorID:{type:String,unique:!0},rating:String,mbox_sha1sum:String,email:{type:String,unique:!0,lowercase:!0,trim:!0},verifiedEmail:Boolean,salt:String,verifyCode:String,passwordResetKey:String,uuid:String,_modified:Date,_created:Date,type:{type:String,default:"learner"}},{usePushEach:!0});o.methods.setEmail=function(e){this.email=e,this.mbox_sha1sum=i.sumMBox(e)},o.methods.setActor=function(e){if(e){this.actor=e;try{this.actorID=(t=JSON.parse(e)).mbox?t.mbox:t.mbox_sha1sum?t.mbox_sha1sum:t.openid?t.openid:t.account?s(t.account):t.member?s(t):void 0}catch(e){console.log(e)}}var t},o.methods.checkPassword=function(e){return this.passwordHash==i.hashPassword(this.username,this.salt,e)},o.methods.checkResetKey=function(e){return this.passwordResetKey==e},o.methods.forgotPassword=function(e){this.passwordResetKey=r.lib.WordArray.random(16).toString(),console.log("password reset key is",this.passwordResetKey),this.save()},o.methods.resetPassword=function(e){this.salt=r.lib.WordArray.random(16).toString(),this.passwordHash=i.hashPassword(this.username,this.salt,e),this.passwordResetKey=r.lib.WordArray.random(16).toString(),this.save()},o.virtual("lrs").get(function(){return this.parent.uuid}),e.exports=o},function(e,t,a){(function(t){const n=a(120),i=a(0).Schema({uuid:String,owner:String,name:String,fileSize:{type:Number,default:0},fileCount:{type:Number,default:0},associatedContent:String},{usePushEach:!0});i.methods.cleanup=function(e){return new Promise((i,r)=>{const s=a(24).join(t,"../../../filedata",this.uuid);n(s,(t,a)=>{e&&e(),i()})})},i.methods.dbForm=function(){return this.toObject()},i.pre("remove",async function(e){const t=await this.constructor.odm.file.find({packageID:this.uuid}).exec();for(const e in t)await t[e].remove();await this.cleanup(),e()}),e.exports=i}).call(t,"/")},function(e,t){e.exports=require("rimraf")},function(e,t,a){const n=a(0),i=a(71);function r(e){const t=i.createCipher("aes-256-cbc",process.parsed_env.SERVER_SECRET);let a=t.update(e,"utf8","hex");return a+=t.final("hex")}function s(e){if(null===e||void 0===e)return e;const t=i.createDecipher("aes-256-cbc",process.parsed_env.SERVER_SECRET);let a=t.update(e,"hex","utf8");return a+=t.final("utf8")}const o=n.Schema({name:{type:String,unique:!0},description:String,endpoint:String,username:{type:String,get:s,set:r},password:{type:String,get:s,set:r}},{usePushEach:!0});o.set("toJSON",{getters:!0}),o.set("toObject",{getters:!0}),e.exports=o},function(e,t,a){const n=a(0),i=(process.env,n.Schema({uuid:{type:String,unique:!0},displayName:String,homePage:String,adminEmail:String,logoLink:String,markdown:String},{usePushEach:!0}));e.exports=i},function(e,t,a){const n=a(0).Schema({uuid:{type:String,unique:!0},title:String,markdown:String,url:String},{usePushEach:!0});e.exports=n},function(e,t,a){const n=a(0),i=(process.env,n.Schema({uuid:{type:String,unique:!0},title:String,name:String,created:Date,graphs:[{handler:String,params:Object}]},{usePushEach:!0}));e.exports=i},function(e,t,a){const n=a(19);e.exports=function(e,t,a,i){let r=t;return new Promise((t,s)=>{r=r.endsWith("/")?r:`${r}/`,n({method:"POST",url:`${r}statements`,auth:{user:a,pass:i},headers:{"Content-Type":"application/json","X-Experience-API-Version":"1.0.3"},body:e,json:!0},(e,a,n)=>{e&&s(e),t({response:a,body:n})})})}},function(e,t,a){const n=a(0),i=n.Schema({uuid:{type:String,unique:!0},createdOn:Date,name:String,stack:String,message:String,user:String,url:String,body:Object},{usePushEach:!0});e.exports=n.model("error.js",i)},function(e,t,a){const n=a(0),i=n.Schema({uuid:{type:String,unique:!0},owner:String,created:Date,viewed:Date,dismissed:{type:Boolean,default:!1},text:String,type:String,lrs:String},{usePushEach:!0});e.exports=n.model("message.js",i)},function(e,t,a){const n=a(0),i=n.Schema({uuid:{type:String,unique:!0},owner:String,created:Date,owner:String,uuid:String,tier:String,duration:Number,state:String},{usePushEach:!0});e.exports=n.model("payment.js",i)},function(e,t,a){const n=a(0),i=n.Schema({createdOn:Date,numberOfStatements:Number,numberOfActors:Number,numberOfLRSs:Number,numberOfActivities:Number,numberOfUsers:Number},{usePushEach:!0});e.exports=n.model("count.js",i)},function(e,t,a){const n=a(0),i=(process.env,n.Schema({uuid:{type:String,unique:!0},handler:String,owner:String,lrs:String,created:Date,params:{type:Object},paramsHash:String},{usePushEach:!0}));e.exports=n.model("embedableChart.js",i)},function(e,t){e.exports={lrs:{portal:{view:{},edit:{}},create:{},view:{},edit:{settings:{},upstream:{},clear:{logs:{},statements:{},documents:{},attachments:{}},backups:{import:{},export:{}}},delete:{},learner:{delete:{},create:{},view:{},edit:{resetPassword:{},contact:{}}},key:{delete:{},view:{},create:{},view:{},edit:{disable:{},enable:{},name:{}}},content:{delete:{},create:{},view:{},edit:{url:{},title:{}}},class:{delete:{},create:{},view:{},edit:{}},course:{delete:{},create:{},view:{},edit:{}},analytics:{view:{}},files:{upload:{},view:{}},permissions:{edit:{}}},admin:{view:{user:{},users:{},lrs:{},logs:{}},edit:{user:{},lrs:{}},create:{user:{}},delete:{user:{}},scheduling:{}}}},function(e,t){e.exports={teacher:{requiredConstructor:"lrs",permissions:["lrs.learner","lrs.content","lrs.course","lrs.learner"]},admin:{requiredConstructor:"lrs",permissions:["lrs.learner","lrs.content","lrs.course","lrs.learner","lrs.edit","lrs.key"]},view:{requiredConstructor:"lrs",permissions:["lrs.view","lrs.*.view"]}}},function(e,t){e.exports=function(e){let t=e;for(t=t.toLowerCase().replace(/[^a-zA-Z0-9]/g,"-");t.length&&t[0].match(/[^a-zA-Z]/);)t=t.substr(1);for(;t.length&&t[t.length-1].match(/[^a-zA-Z0-9]/);)t=t.substr(0,t.length-1);return t}},function(e,t,a){if(process.jobProcessor)e.exports=process.jobProcessor;else{const t=a(135);process.jobProcessor=e.exports=new t,e.exports.go()}},function(e,t,a){const n=a(136),i=a(24),r=a(1).message;stringOrFunc=function(e,t){return"function"==typeof e?e(t):e};e.exports=class{constructor(){this.jobs=[],this.agenda=null,this.startPromise=null;const e=a(75);for(const t in e.keys()){const a=e.keys()[t];if("./index.js"!==a){0;i.basename(a,i.extname(a));const t=new(e(a));for(const e in this.jobs)if(this.jobs[e].name==t.name)throw new Error("There is a duplicate job name in the jobs folder!");this.jobs.push(t)}}}genProcessor(e){return async function(t,n){if(console.log(`Starting ${e.name}`),e.messageInitiate&&t.attrs.data.user){const n=new r;n.created=new Date,n.text=stringOrFunc(e.initiateMessage,t)||`Your ${e.name} job has been started.`,n.type="initiate",n.owner=t.attrs.data&&t.attrs.data.user.uuid,n.uuid=a(3).v4(),n.lrs=t.attrs.data&&t.attrs.data.lrs&&t.attrs.data.lrs.uuid,n.save()}try{const i=await async function(e,t){return"AsyncFunction"===e.constructor.name?await e(t):new Promise((a,n)=>{e(t,e=>a(e))})}(e.processor,t);if(!i&&e.messageTerminate&&t.attrs.data&&t.attrs.data.user){const n=new r;n.created=new Date,n.text=stringOrFunc(e.terminateMessage,t)||`Your ${e.name} job has completed.`,n.type="terminate",n.owner=t.attrs.data.user.uuid,n.uuid=a(3).v4(),n.lrs=t.attrs.data&&t.attrs.data.lrs&&t.attrs.data.lrs.uuid,n.save()}else if(i&&t.attrs.data&&t.attrs.data.user){const e=new r;e.created=new Date,e.text=i.toString(),e.type="error",e.owner=t.attrs.data.user.uuid,e.uuid=a(3).v4(),e.lrs=t.attrs.data&&t.attrs.data.lrs&&t.attrs.data.lrs.uuid,e.save()}return console.log(`finished ${e.name}`),i&&console.log(`error ${e.name}`,i),n()}catch(i){console.log(`error ${e.name}`,i);const s=new(a(1).error);if(s.uuid=a(3).v4(),s.createdOn=new Date,s.name=i.name,s.message=i.message,s.stack=i.stack,s.url=`scheduled job ${e.name}`,s.user=t.attrs.data&&t.attrs.data.user?t.attrs.data.user.uuid:"",s.body=t.attrs.data,s.save(e=>{console.log("err in save error",i)}),i&&t.attrs.data&&t.attrs.data.user){const n=new r;n.created=new Date,n.owner=t.attrs.data&&t.attrs.data.user.uuid,n.uuid=a(3).v4(),n.text=stringOrFunc(e.errorMessage,t)||`There was a problem with your ${e.name} job. ${s.uuid}`,n.lrs=t.attrs.data&&t.attrs.data.lrs&&t.attrs.data.lrs.uuid,n.type="error",n.save()}return n()}}}go(e){return this.startPromise||(this.startPromise=new Promise((t,i)=>{let r=a(5).getMongoConnectionString(process.parsed_env.adminDBName);const s=new n({db:{address:r,processEvery:"10 seconds"}});s.on("ready",()=>{console.log("agenda ready"),this.agenda=s;for(const e in this.jobs)this.agenda.define(this.jobs[e].name,this.genProcessor(this.jobs[e]));e&&e(),t()})})),this.startPromise}async start(){if(await this.go(),!this.agenda)throw new Error("Agenda is not ready");for(const e in this.jobs)this.jobs[e].schedule&&this.agenda.schedule(this.jobs[e].schedule,this.jobs[e].name),this.jobs[e].every&&this.agenda.every(this.jobs[e].every,this.jobs[e].name);console.log("start processing"),this.agenda.start(),this.agenda.on("start",e=>{}),this.agenda.on("complete",e=>{}),this.agenda.on("fail",e=>{})}schedule(e,t,a="now",n){let i=n;for(const n in this.jobs)if(this.jobs[n].name==e){if(this.jobs[n].schedule||this.jobs[n].every)throw new Error("This job is scheduled at startup, there is no need to schedule again.");return process.parsed_env.debugSyncJobs?(console.log("Debug sync running job ",e),i||(i=(e=>{console.log("Debug job callback returned",e)})),this.jobs[n].processor({attrs:{data:t}},i)):"now"===a?this.agenda.now(e,t):this.agenda.schedule(a,e,t)}throw new Error("There is no job with this name")}}},function(e,t){e.exports=require("agenda")},function(e,t,a){var n={"./demoJob.js":138,"./generateStatements.js":139,"./harvestStatements.js":140,"./index.js":75,"./reIndexStatements.js":141,"./sendAccountValidateEmail.js":142,"./sendContactUsEmail.js":155,"./sendForgotPasswordEmail.js":156,"./setExpiredUsersToFreeTier.js":157,"./storeStats.js":158};function i(e){return a(r(e))}function r(e){var t=n[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}i.keys=function(){return Object.keys(n)},i.resolve=r,e.exports=i,i.id=137},function(e,t){e.exports=class{constructor(){this.name="demo job"}processor(e,t){e.attrs.data;return console.log("demo job run"),t()}}},function(e,t,a){e.exports=class{constructor(){this.name="generateStatements",this.messageInitiate=!0,this.messageTerminate=!0,this.initiateMessage=function(e){return`We've begun generating sample data for the ${e.attrs.data.lrs.lrsName} lrs`},this.terminateMessage=function(e){return`We've finished generating sample data for the ${e.attrs.data.lrs.lrsName} lrs`}}async processor(e){const t=a(5);await t.generateStatements(e.attrs.data.lrs.uuid)}}},function(e,t,a){const n=function(e,t){e.userLog("SystemError","Error in harvest statements",{body:t.body,query:t.query,url:t.baseUrl+t.url,headers:t.headers,method:t.method})};e.exports=class{constructor(){this.name="harvestStatements",this.messageInitiate=!0,this.messageTerminate=!0}processor(e,t){console.log("harvestStatements");const i=e.attrs.data.lrs,r=e.attrs.data.body,s=r.since,o=new(a(11))(`${process.parsed_env.mongoServer}/${i.uuid}?authSource=admin`,i.strict,i.preferRead),l=a(19),c=a(14);o.on("ready",()=>{let e=r.url;console.log("fetching",e);let a=0;"/"==e[e.length-1]&&(e=e.substr(0,e.length-1));let i=`${e}/statements?format=exact`;s&&(i+=`&since=${encodeURIComponent(new Date(s).toISOString())}`),function e(i){l.get({url:i,headers:{"X-EXPERIENCE-API-VERSION":"1.0.3"}},async(s,l,d)=>{let u=d;if(s)return console.log(s),n(o,l),++a>5?t(s):e(i);if(u&&200==l.statusCode){console.log("harvested: ",u);try{u=JSON.parse(u)}catch(r){return n(o,l),++a>5?t(s):e(i)}a=0;for(const e in u.statements){const t=u.statements[e];try{await o.store([t],t.authority,null,t.stored?new Date(t.stored):null)}catch(e){}}if(!u.more)return t();{const t=c.parse(r.url);t.pathname="",t.path="",e(t.format()+u.more)}}else{if(console.log(l),n(o,l),a>5)return t("We could not contact this LRS");a++,e(i)}}).auth(r.username,r.password,!0)}(i)})}}},function(e,t,a){async function n(e,t,n){const i=a(6),r=e.db,s=r.collection("statements"),o=r.collection("statementsReindex"),l=s.find({});for(e.statements=o;await l.hasNext();){const a=await l.next();await e.store([a.statement],a.statement.authority,[],a.statement.stored),i.touchDal(t),0}await s.drop(),await o.rename("statements"),n()}e.exports=class{constructor(){this.name="reIndexStatements"}processor(e,t){const i=e.attrs.data,r=a(6).dal(i.uuid).then(()=>{r.ready?n(r,i.uuid,t):r.on("ready",()=>n(r,i.uuid,t))})}}},function(e,t,a){e.exports=class{constructor(){this.name="sendAccountValidateEmail"}processor(e,t){const n=e.attrs.data;a(25).sendAccountValidateEmail(n,t)}}},function(e,t){t.strings={unverified_login_ok:"You have not verified your email address. You should receive an email with an account activation link.",already_verified:"You've already verified your email address",validation_sent:"A validation email has been sent to this address. When you receive it, click the link it contains, or <a href='/ui/users/validateEmail/'> enter your validation code here. </a>",login_unvalidated:"This account's email address is not validated. Do you want to <a href='/ui/users/resendValidation/'> send it again? </a>",password_reset_sent:"An email has been sent to your address with instructions on how to reset your password. ",user_exists:"A user with this email address already exists.",verified_code_error:"This verification code is invalid.",forgot_password_email_subject:"Password reset notice",validate_email_subject:"Account activation",not_authorized:"Not Authorized",login_failure:"Incorrect email or password. ",account_confirmation:"Your account has been verified",not_admin:"This function is not available for the admin user."}},function(e,t){e.exports=require("mustache")},function(e,t,a){const n=a(146);a(147).MongoDB;process.env;let i;i=process.env&&process.env.mongoServer&&process.env.adminDBName?new n.Logger({transports:[new n.transports.MongoDB({db:a(5).getMongoConnectionString(process.env.adminDBName),collection:"logs",level:"info"})]}):new n.Logger,e.exports=i},function(e,t){e.exports=require("winston")},function(e,t){e.exports=require("winston-mongodb")},function(e,t){throw new Error("Module parse failed: Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type.\n| <!DOCTYPE html>\n| <html>\n| <head>")},function(e,t){throw new Error("Module parse failed: Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type.\n| <!DOCTYPE html>\n| <html>\n| <head>")},function(e,t){throw new Error("Module parse failed: Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type.\n| <!DOCTYPE html>\n| <html>\n| <head>")},function(e,t){throw new Error("Module parse failed: Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type.\n| <!DOCTYPE html>\n| <html>\n| <head>")},function(e,t){throw new Error("Module parse failed: Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type.\n| <!DOCTYPE html>\n| <html>\n| <head>")},function(e,t){throw new Error("Module parse failed: Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type.\n| <!DOCTYPE html>\n| <html>\n| <head>")},function(e,t){e.exports=require("nodemailer")},function(e,t,a){e.exports=class{constructor(){this.name="sendContactUsEmail"}processor(e,t){const n=e.attrs.data;a(25).sendContactUsEmail(n,t)}}},function(e,t,a){e.exports=class{constructor(){this.name="sendForgotPasswordEmail"}processor(e,t){const n=e.attrs.data;a(25).sendForgotPasswordEmail(n,t)}}},function(e,t,a){e.exports=class{constructor(){this.name="setExpiredUsersToFree",this.every="1 hour"}async processor(e){try{const e=a(1).user,t=await e.find({});for(const e in t)"free"!==t[e].tier&&t[e].tierExpiration>new Date(Date.now()-864e5)&&t[e].tierExpiration<new Date(Date.now()+2592e5)&&(t[e].tier="free",t[e].tierExpiration=new Date(0),await t[e].save())}catch(e){console.log(e)}}}},function(e,t,a){e.exports=class{constructor(){this.name="store stats",this.every="12 hours"}async processor(e){console.log("stats store run");const t=a(159),n=a(1).count,i=await t.get(),r=new n;Object.assign(r,i),r.createdOn=new Date,await r.save()}}},function(e,t,a){a(4).MongoClient,a(76)("default");const n=a(5),i=(process.env.mongoServer,process.env.adminDBName,a(6));e.exports=new function(){this.getNumberOfStatements=async function(){const e=await a(1).lrs.find({}).exec();for(const t in e){e[t]=await n.populateLrsStats(e[t]);const i=e[t].stats;i.cached=new Date,i.uuid=e[t].uuid,a(0).connection.db.collection("lrsStatsCache").insert(i)}return e.reduce((e,t)=>e+t.stats.counts.statements,0)},this.getNumberOfActors=async function(){let e=0;try{const t=await a(1).lrs.find({}).exec();for(const a in t){const n=await i.connect(t[a]);e+=(await n.collection("statements").distinct("statement.actor.id")).length}}catch(t){e=1e5}return e},this.getNumberOfLRSs=async function(){return(await a(1).lrs.find({}).exec()).length},this.getNumberOfUsers=async function(){return(await a(1).user.find({}).exec()).length},this.getNumberOfActivities=async function(){let e=0;try{const t=await a(1).lrs.find({}).exec();for(const a in t){const n=await i.connect(t[a]);e+=(await n.collection("statements").distinct("statement.object.id")).length}}catch(t){e=1e5}return e}},e.exports.get=async function(){const t={};return t.numberOfStatements=await e.exports.getNumberOfStatements(),t.numberOfActors=await e.exports.getNumberOfActors(),t.numberOfLRSs=await e.exports.getNumberOfLRSs(),t.numberOfActivities=await e.exports.getNumberOfActivities(),t.numberOfUsers=await e.exports.getNumberOfUsers(),t},e.exports.populate=async function(e,t,n){const i=a(1).count,r=await i.find({}).sort({createdOn:-1}).limit(1).exec();t.locals.stats=r[0],n()}},function(e,t){const a="https://w3id.org/xapi/scorm/activity-state";e.exports=class{constructor(e,t){this.DAL=e,this.authority=t}async send(e){await this.DAL.store(e,this.authority)}async updateActivityStateAttempts(e,t,n){var i=await this._getState(e,t,a);return i?("string"==typeof i&&(i=JSON.parse(i)),i.attempts.push(n)):i={attempts:[n]},await this._putState(e,t,a,void 0,i)}_putState(e,t,a,n,i){let r=i;return r instanceof Object&&(r=JSON.stringify(r)),new Promise((i,s)=>{var o={uri:`${this.endpoint}activities/state`,method:"PUT",rejectUnauthorized:!1,auth:{user:this.user,pass:this.pass},headers:{"X-Experience-API-Version":"1.0.1","Content-Type":"application/json"},qs:{agent:JSON.stringify(e),activityId:t,stateId:a,registration:n},body:r};request(o,(e,t,a)=>{e?s(e):i({status:t.statusCode,body:a})})})}_getState(e,t,a,n){return new Promise((i,r)=>{var s={uri:`${this.endpoint}activities/state`,method:"GET",rejectUnauthorized:!1,auth:{user:this.user,pass:this.pass},headers:{"X-Experience-API-Version":"1.0.1"},qs:{agent:JSON.stringify(e),activityId:t,stateId:a,registration:n}};request(s,(e,t,a)=>{e?r(e):404===t.statusCode?i():i(a)})})}print(){console.log(this.endpoint)}}},function(e,t,a){var n=a(2)(),i=a(162),r=a(77);e.exports.generateStatements=function(t,a){let n=a;return new Promise(async(a,i)=>{try{for(;n>0;n--)await e.exports.doAttempts(t);a()}catch(e){i(e)}})},e.exports.doAttempts=function(t){return new Promise(async(a,n)=>{try{var s=i.getRandomActor();for(let a=0;a<10*Math.random();a++){var o=r.getRandomDate(),l=e.exports.getAttemptGuidsArray();o.setDate(o.getDate()-6*l.length);for(var c in l){var d=i.getRandomActivityAndContextInfo(),u=l[c],m=`${d.activity.id}?attemptId=${u}`,p=e.exports.createAttemptStatements(s,d,m,o);await t.send(p.statements);o=p.timestamp}}a()}catch(e){n(e)}})},e.exports.getAttemptGuidsArray=function(){return Array(n.integer(1,5)).fill(0).map(()=>n.uuid4())},e.exports.sendAttemptIRIToState=async function(e,t,a,n){return new Promise(async i=>{i(await e.updateActivityStateAttempts(t,a.activity.id,n))})},e.exports.createAttemptStatements=function(e,t,a,s){var o=[],l={timestamp:r.attemptTimeIncrement(s,5),statements:[],verb:""};do{if(""===l.verb?(l=i.generateInitialize(e,t,a,l.timestamp),o=[...o,...l.statements]):(l=i.generateResume(e,t,a,l.timestamp),o=[...o,...l.statements]),1===n.die(50))break;if(l=i.generateMiddle(e,t,a,l.timestamp),o=[...o,...l.statements],1===n.die(50))break;l=i.generateEnd(e,t,a,l.timestamp),o=[...o,...l.statements]}while("http://adlnet.gov/expapi/verbs/terminated"!==l.verb);return{timestamp:l.timestamp,statements:o}}},function(e,t,a){var n=a(2)(),i=a(77),r=a(163),s=a(165),o=a(166),l=a(167),c=a(168),d=a(169),u=a(170),m=a(171),p=a(172),h=a(173);e.exports.getRandomActivityAndContextInfo=s.getRandom,e.exports.getRandomActor=r.getRandom,e.exports.generateInitialize=function(e,t,a,n){return{timestamp:n,statements:[o.getSingleInitializedStmt(e,t,a,n)]}},e.exports.generateResume=function(e,t,a,n){var r=i.largeTimeIncrement(n);return{timestamp:r,statements:[o.getSingleResumedStmt(e,t,a,r)]}},e.exports.generateMiddle=function(t,a,r,s){var o=[],l=i.smallTimeIncrement(s);if(a.interactions){var c=e.exports.generateInteractions(t,a,r,s);o=[...o,...c.statements],l=c.timestamp}for(var d=0;d<n.integer(0,4);d++){var u=e.exports.generateOtherMiddle(t,a,r,l);o=[...o,...u.statements],l=u.timestamp}return{timestamp:l,statements:o}},e.exports.generateInteractions=function(e,t,a,r){for(var s=i.smallTimeIncrement(r),o=[],c=t.interactions,d=JSON.parse(JSON.stringify(c.activities)),u=0;u<c.count;u++){var m=d.splice(n.integer(0,d.length-1),1)[0],p=l.getSingleStmt(e,t,a,s,m);o=[...o,p],s=i.smallTimeIncrement(s)}return{timestamp:s,statements:o}},e.exports.generateOtherMiddle=function(e,t,a,r){var s=i.smallTimeIncrement(r),o=[c,d,u,m,p];return{timestamp:s,statements:[n.pick(o).getSingleStmt(e,t,a,s)]}},e.exports.generateEnd=function(e,t,a,r){var s=i.smallTimeIncrement(r),o=n.pick([h.getSingleTerminatedStmt,h.getSingleSuspendStmt])(e,t,a,s);return{timestamp:s,statements:[o],verb:o.verb.id}}},function(e,t,a){var n=a(164),i={account:{homePage:"http://lms.veracity.it",name:"<actor id>"},name:"<actor name>"};e.exports.get=function(e,t){var a=JSON.parse(JSON.stringify(i));return a.account.name=e,a.name=t,a},e.exports.getRandom=function(){var t=n.getRandom();return e.exports.get(n.getId(t),t)}},function(e,t,a){var n=a(2)(),i=["Aaren","Aarika","Abagael","Abagail","Abbe","Abbey","Abbi","Abbie","Abby","Abbye","Abigael","Abigail","Abigale","Abra","Ada","Adah","Adaline","Adan","Adara","Adda","Addi","Addia","Addie","Addy","Adel","Adela","Adelaida","Adelaide","Adele","Adelheid","Adelice","Adelina","Adelind","Adeline","Adella","Adelle","Adena","Adey","Adi","Adiana","Adina","Adora","Adore","Adoree","Adorne","Adrea","Adria","Adriaens","Adrian","Adriana","Adriane","Adrianna","Adrianne","Adriena","Adrienne","Aeriel","Aeriela","Aeriell","Afton","Ag","Agace","Agata","Agatha","Agathe","Aggi","Aggie","Aggy","Agna","Agnella","Agnes","Agnese","Agnesse","Agneta","Agnola","Agretha","Aida","Aidan","Aigneis","Aila","Aile","Ailee","Aileen","Ailene","Ailey","Aili","Ailina","Ailis","Ailsun","Ailyn","Aime","Aimee","Aimil","Aindrea","Ainslee","Ainsley","Ainslie","Ajay","Alaine","Alameda","Alana","Alanah","Alane","Alanna","Alayne","Alberta","Albertina","Albertine","Albina","Alecia","Aleda","Aleece","Aleen","Alejandra","Alejandrina","Alena","Alene","Alessandra","Aleta","Alethea","Alex","Alexa","Alexandra","Alexandrina","Alexi","Alexia","Alexina","Alexine","Alexis","Alfi","Alfie","Alfreda","Alfy","Ali","Alia","Alica","Alice","Alicea","Alicia","Alida","Alidia","Alie","Alika","Alikee","Alina","Aline","Alis","Alisa","Alisha","Alison","Alissa","Alisun","Alix","Aliza","Alla","Alleen","Allegra","Allene","Alli","Allianora","Allie","Allina","Allis","Allison","Allissa","Allix","Allsun","Allx","Ally","Allyce","Allyn","Allys","Allyson","Alma","Almeda","Almeria","Almeta","Almira","Almire","Aloise","Aloisia","Aloysia","Alta","Althea","Alvera","Alverta","Alvina","Alvinia","Alvira","Alyce","Alyda","Alys","Alysa","Alyse","Alysia","Alyson","Alyss","Alyssa","Amabel","Amabelle","Amalea","Amalee","Amaleta","Amalia","Amalie","Amalita","Amalle","Amanda","Amandi","Amandie","Amandy","Amara","Amargo","Amata","Amber","Amberly","Ambur","Ame","Amelia","Amelie","Amelina","Ameline","Amelita","Ami","Amie","Amii","Amil","Amitie","Amity","Ammamaria","Amy","Amye","Ana","Anabal","Anabel","Anabella","Anabelle","Analiese","Analise","Anallese","Anallise","Anastasia","Anastasie","Anastassia","Anatola","Andee","Andeee","Anderea","Andi","Andie","Andra","Andrea","Andreana","Andree","Andrei","Andria","Andriana","Andriette","Andromache","Andy","Anestassia","Anet","Anett","Anetta","Anette","Ange","Angel","Angela","Angele","Angelia","Angelica","Angelika","Angelina","Angeline","Angelique","Angelita","Angelle","Angie","Angil","Angy","Ania","Anica","Anissa","Anita","Anitra","Anjanette","Anjela","Ann","Ann-Marie","Anna","Anna-Diana","Anna-Diane","Anna-Maria","Annabal","Annabel","Annabela","Annabell","Annabella","Annabelle","Annadiana","Annadiane","Annalee","Annaliese","Annalise","Annamaria","Annamarie","Anne","Anne-Corinne","Anne-Marie","Annecorinne","Anneliese","Annelise","Annemarie","Annetta","Annette","Anni","Annice","Annie","Annis","Annissa","Annmaria","Annmarie","Annnora","Annora","Anny","Anselma","Ansley","Anstice","Anthe","Anthea","Anthia","Anthiathia","Antoinette","Antonella","Antonetta","Antonia","Antonie","Antonietta","Antonina","Anya","Appolonia","April","Aprilette","Ara","Arabel","Arabela","Arabele","Arabella","Arabelle","Arda","Ardath","Ardeen","Ardelia","Ardelis","Ardella","Ardelle","Arden","Ardene","Ardenia","Ardine","Ardis","Ardisj","Ardith","Ardra","Ardyce","Ardys","Ardyth","Aretha","Ariadne","Ariana","Aridatha","Ariel","Ariela","Ariella","Arielle","Arlana","Arlee","Arleen","Arlen","Arlena","Arlene","Arleta","Arlette","Arleyne","Arlie","Arliene","Arlina","Arlinda","Arline","Arluene","Arly","Arlyn","Arlyne","Aryn","Ashely","Ashia","Ashien","Ashil","Ashla","Ashlan","Ashlee","Ashleigh","Ashlen","Ashley","Ashli","Ashlie","Ashly","Asia","Astra","Astrid","Astrix","Atalanta","Athena","Athene","Atlanta","Atlante","Auberta","Aubine","Aubree","Aubrette","Aubrey","Aubrie","Aubry","Audi","Audie","Audra","Audre","Audrey","Audrie","Audry","Audrye","Audy","Augusta","Auguste","Augustina","Augustine","Aundrea","Aura","Aurea","Aurel","Aurelea","Aurelia","Aurelie","Auria","Aurie","Aurilia","Aurlie","Auroora","Aurora","Aurore","Austin","Austina","Austine","Ava","Aveline","Averil","Averyl","Avie","Avis","Aviva","Avivah","Avril","Avrit","Ayn","Bab","Babara","Babb","Babbette","Babbie","Babette","Babita","Babs","Bambi","Bambie","Bamby","Barb","Barbabra","Barbara","Barbara-Anne","Barbaraanne","Barbe","Barbee","Barbette","Barbey","Barbi","Barbie","Barbra","Barby","Bari","Barrie","Barry","Basia","Bathsheba","Batsheva","Bea","Beatrice","Beatrisa","Beatrix","Beatriz","Bebe","Becca","Becka","Becki","Beckie","Becky","Bee","Beilul","Beitris","Bekki","Bel","Belia","Belicia","Belinda","Belita","Bell","Bella","Bellanca","Belle","Bellina","Belva","Belvia","Bendite","Benedetta","Benedicta","Benedikta","Benetta","Benita","Benni","Bennie","Benny","Benoite","Berenice","Beret","Berget","Berna","Bernadene","Bernadette","Bernadina","Bernadine","Bernardina","Bernardine","Bernelle","Bernete","Bernetta","Bernette","Berni","Bernice","Bernie","Bernita","Berny","Berri","Berrie","Berry","Bert","Berta","Berte","Bertha","Berthe","Berti","Bertie","Bertina","Bertine","Berty","Beryl","Beryle","Bess","Bessie","Bessy","Beth","Bethanne","Bethany","Bethena","Bethina","Betsey","Betsy","Betta","Bette","Bette-Ann","Betteann","Betteanne","Betti","Bettina","Bettine","Betty","Bettye","Beulah","Bev","Beverie","Beverlee","Beverley","Beverlie","Beverly","Bevvy","Bianca","Bianka","Bibbie","Bibby","Bibbye","Bibi","Biddie","Biddy","Bidget","Bili","Bill","Billi","Billie","Billy","Billye","Binni","Binnie","Binny","Bird","Birdie","Birgit","Birgitta","Blair","Blaire","Blake","Blakelee","Blakeley","Blanca","Blanch","Blancha","Blanche","Blinni","Blinnie","Blinny","Bliss","Blisse","Blithe","Blondell","Blondelle","Blondie","Blondy","Blythe","Bobbe","Bobbee","Bobbette","Bobbi","Bobbie","Bobby","Bobbye","Bobette","Bobina","Bobine","Bobinette","Bonita","Bonnee","Bonni","Bonnibelle","Bonnie","Bonny","Brana","Brandais","Brande","Brandea","Brandi","Brandice","Brandie","Brandise","Brandy","Breanne","Brear","Bree","Breena","Bren","Brena","Brenda","Brenn","Brenna","Brett","Bria","Briana","Brianna","Brianne","Bride","Bridget","Bridgette","Bridie","Brier","Brietta","Brigid","Brigida","Brigit","Brigitta","Brigitte","Brina","Briney","Brinn","Brinna","Briny","Brit","Brita","Britney","Britni","Britt","Britta","Brittan","Brittaney","Brittani","Brittany","Britte","Britteny","Brittne","Brittney","Brittni","Brook","Brooke","Brooks","Brunhilda","Brunhilde","Bryana","Bryn","Bryna","Brynn","Brynna","Brynne","Buffy","Bunni","Bunnie","Bunny","Cacilia","Cacilie","Cahra","Cairistiona","Caitlin","Caitrin","Cal","Calida","Calla","Calley","Calli","Callida","Callie","Cally","Calypso","Cam","Camala","Camel","Camella","Camellia","Cami","Camila","Camile","Camilla","Camille","Cammi","Cammie","Cammy","Candace","Candi","Candice","Candida","Candide","Candie","Candis","Candra","Candy","Caprice","Cara","Caralie","Caren","Carena","Caresa","Caressa","Caresse","Carey","Cari","Caria","Carie","Caril","Carilyn","Carin","Carina","Carine","Cariotta","Carissa","Carita","Caritta","Carla","Carlee","Carleen","Carlen","Carlene","Carley","Carlie","Carlin","Carlina","Carline","Carlita","Carlota","Carlotta","Carly","Carlye","Carlyn","Carlynn","Carlynne","Carma","Carmel","Carmela","Carmelia","Carmelina","Carmelita","Carmella","Carmelle","Carmen","Carmencita","Carmina","Carmine","Carmita","Carmon","Caro","Carol","Carol-Jean","Carola","Carolan","Carolann","Carole","Carolee","Carolin","Carolina","Caroline","Caroljean","Carolyn","Carolyne","Carolynn","Caron","Carree","Carri","Carrie","Carrissa","Carroll","Carry","Cary","Caryl","Caryn","Casandra","Casey","Casi","Casie","Cass","Cassandra","Cassandre","Cassandry","Cassaundra","Cassey","Cassi","Cassie","Cassondra","Cassy","Catarina","Cate","Caterina","Catha","Catharina","Catharine","Cathe","Cathee","Catherin","Catherina","Catherine","Cathi","Cathie","Cathleen","Cathlene","Cathrin","Cathrine","Cathryn","Cathy","Cathyleen","Cati","Catie","Catina","Catlaina","Catlee","Catlin","Catrina","Catriona","Caty","Caye","Cayla","Cecelia","Cecil","Cecile","Ceciley","Cecilia","Cecilla","Cecily","Ceil","Cele","Celene","Celesta","Celeste","Celestia","Celestina","Celestine","Celestyn","Celestyna","Celia","Celie","Celina","Celinda","Celine","Celinka","Celisse","Celka","Celle","Cesya","Chad","Chanda","Chandal","Chandra","Channa","Chantal","Chantalle","Charil","Charin","Charis","Charissa","Charisse","Charita","Charity","Charla","Charlean","Charleen","Charlena","Charlene","Charline","Charlot","Charlotta","Charlotte","Charmain","Charmaine","Charmane","Charmian","Charmine","Charmion","Charo","Charyl","Chastity","Chelsae","Chelsea","Chelsey","Chelsie","Chelsy","Cher","Chere","Cherey","Cheri","Cherianne","Cherice","Cherida","Cherie","Cherilyn","Cherilynn","Cherin","Cherise","Cherish","Cherlyn","Cherri","Cherrita","Cherry","Chery","Cherye","Cheryl","Cheslie","Chiarra","Chickie","Chicky","Chiquia","Chiquita","Chlo","Chloe","Chloette","Chloris","Chris","Chrissie","Chrissy","Christa","Christabel","Christabella","Christal","Christalle","Christan","Christean","Christel","Christen","Christi","Christian","Christiana","Christiane","Christie","Christin","Christina","Christine","Christy","Christye","Christyna","Chrysa","Chrysler","Chrystal","Chryste","Chrystel","Cicely","Cicily","Ciel","Cilka","Cinda","Cindee","Cindelyn","Cinderella","Cindi","Cindie","Cindra","Cindy","Cinnamon","Cissiee","Cissy","Clair","Claire","Clara","Clarabelle","Clare","Claresta","Clareta","Claretta","Clarette","Clarey","Clari","Claribel","Clarice","Clarie","Clarinda","Clarine","Clarissa","Clarisse","Clarita","Clary","Claude","Claudelle","Claudetta","Claudette","Claudia","Claudie","Claudina","Claudine","Clea","Clem","Clemence","Clementia","Clementina","Clementine","Clemmie","Clemmy","Cleo","Cleopatra","Clerissa","Clio","Clo","Cloe","Cloris","Clotilda","Clovis","Codee","Codi","Codie","Cody","Coleen","Colene","Coletta","Colette","Colleen","Collen","Collete","Collette","Collie","Colline","Colly","Con","Concettina","Conchita","Concordia","Conni","Connie","Conny","Consolata","Constance","Constancia","Constancy","Constanta","Constantia","Constantina","Constantine","Consuela","Consuelo","Cookie","Cora","Corabel","Corabella","Corabelle","Coral","Coralie","Coraline","Coralyn","Cordelia","Cordelie","Cordey","Cordi","Cordie","Cordula","Cordy","Coreen","Corella","Corenda","Corene","Coretta","Corette","Corey","Cori","Corie","Corilla","Corina","Corine","Corinna","Corinne","Coriss","Corissa","Corliss","Corly","Cornela","Cornelia","Cornelle","Cornie","Corny","Correna","Correy","Corri","Corrianne","Corrie","Corrina","Corrine","Corrinne","Corry","Cortney","Cory","Cosetta","Cosette","Costanza","Courtenay","Courtnay","Courtney","Crin","Cris","Crissie","Crissy","Crista","Cristabel","Cristal","Cristen","Cristi","Cristie","Cristin","Cristina","Cristine","Cristionna","Cristy","Crysta","Crystal","Crystie","Cthrine","Cyb","Cybil","Cybill","Cymbre","Cynde","Cyndi","Cyndia","Cyndie","Cyndy","Cynthea","Cynthia","Cynthie","Cynthy","Dacey","Dacia","Dacie","Dacy","Dael","Daffi","Daffie","Daffy","Dagmar","Dahlia","Daile","Daisey","Daisi","Daisie","Daisy","Dale","Dalenna","Dalia","Dalila","Dallas","Daloris","Damara","Damaris","Damita","Dana","Danell","Danella","Danette","Dani","Dania","Danica","Danice","Daniela","Daniele","Daniella","Danielle","Danika","Danila","Danit","Danita","Danna","Danni","Dannie","Danny","Dannye","Danya","Danyelle","Danyette","Daphene","Daphna","Daphne","Dara","Darb","Darbie","Darby","Darcee","Darcey","Darci","Darcie","Darcy","Darda","Dareen","Darell","Darelle","Dari","Daria","Darice","Darla","Darleen","Darlene","Darline","Darlleen","Daron","Darrelle","Darryl","Darsey","Darsie","Darya","Daryl","Daryn","Dasha","Dasi","Dasie","Dasya","Datha","Daune","Daveen","Daveta","Davida","Davina","Davine","Davita","Dawn","Dawna","Dayle","Dayna","Ddene","De","Deana","Deane","Deanna","Deanne","Deb","Debbi","Debbie","Debby","Debee","Debera","Debi","Debor","Debora","Deborah","Debra","Dede","Dedie","Dedra","Dee","Dee Dee","Deeann","Deeanne","Deedee","Deena","Deerdre","Deeyn","Dehlia","Deidre","Deina","Deirdre","Del","Dela","Delcina","Delcine","Delia","Delila","Delilah","Delinda","Dell","Della","Delly","Delora","Delores","Deloria","Deloris","Delphine","Delphinia","Demeter","Demetra","Demetria","Demetris","Dena","Deni","Denice","Denise","Denna","Denni","Dennie","Denny","Deny","Denys","Denyse","Deonne","Desdemona","Desirae","Desiree","Desiri","Deva","Devan","Devi","Devin","Devina","Devinne","Devon","Devondra","Devonna","Devonne","Devora","Di","Diahann","Dian","Diana","Diandra","Diane","Diane-Marie","Dianemarie","Diann","Dianna","Dianne","Diannne","Didi","Dido","Diena","Dierdre","Dina","Dinah","Dinnie","Dinny","Dion","Dione","Dionis","Dionne","Dita","Dix","Dixie","Dniren","Dode","Dodi","Dodie","Dody","Doe","Doll","Dolley","Dolli","Dollie","Dolly","Dolores","Dolorita","Doloritas","Domeniga","Dominga","Domini","Dominica","Dominique","Dona","Donella","Donelle","Donetta","Donia","Donica","Donielle","Donna","Donnamarie","Donni","Donnie","Donny","Dora","Doralia","Doralin","Doralyn","Doralynn","Doralynne","Dore","Doreen","Dorelia","Dorella","Dorelle","Dorena","Dorene","Doretta","Dorette","Dorey","Dori","Doria","Dorian","Dorice","Dorie","Dorine","Doris","Dorisa","Dorise","Dorita","Doro","Dorolice","Dorolisa","Dorotea","Doroteya","Dorothea","Dorothee","Dorothy","Dorree","Dorri","Dorrie","Dorris","Dorry","Dorthea","Dorthy","Dory","Dosi","Dot","Doti","Dotti","Dottie","Dotty","Dre","Dreddy","Dredi","Drona","Dru","Druci","Drucie","Drucill","Drucy","Drusi","Drusie","Drusilla","Drusy","Dulce","Dulcea","Dulci","Dulcia","Dulciana","Dulcie","Dulcine","Dulcinea","Dulcy","Dulsea","Dusty","Dyan","Dyana","Dyane","Dyann","Dyanna","Dyanne","Dyna","Dynah","Eachelle","Eada","Eadie","Eadith","Ealasaid","Eartha","Easter","Eba","Ebba","Ebonee","Ebony","Eda","Eddi","Eddie","Eddy","Ede","Edee","Edeline","Eden","Edi","Edie","Edin","Edita","Edith","Editha","Edithe","Ediva","Edna","Edwina","Edy","Edyth","Edythe","Effie","Eileen","Eilis","Eimile","Eirena","Ekaterina","Elaina","Elaine","Elana","Elane","Elayne","Elberta","Elbertina","Elbertine","Eleanor","Eleanora","Eleanore","Electra","Eleen","Elena","Elene","Eleni","Elenore","Eleonora","Eleonore","Elfie","Elfreda","Elfrida","Elfrieda","Elga","Elianora","Elianore","Elicia","Elie","Elinor","Elinore","Elisa","Elisabet","Elisabeth","Elisabetta","Elise","Elisha","Elissa","Elita","Eliza","Elizabet","Elizabeth","Elka","Elke","Ella","Elladine","Elle","Ellen","Ellene","Ellette","Elli","Ellie","Ellissa","Elly","Ellyn","Ellynn","Elmira","Elna","Elnora","Elnore","Eloisa","Eloise","Elonore","Elora","Elsa","Elsbeth","Else","Elset","Elsey","Elsi","Elsie","Elsinore","Elspeth","Elsy","Elva","Elvera","Elvina","Elvira","Elwira","Elyn","Elyse","Elysee","Elysha","Elysia","Elyssa","Em","Ema","Emalee","Emalia","Emelda","Emelia","Emelina","Emeline","Emelita","Emelyne","Emera","Emilee","Emili","Emilia","Emilie","Emiline","Emily","Emlyn","Emlynn","Emlynne","Emma","Emmalee","Emmaline","Emmalyn","Emmalynn","Emmalynne","Emmeline","Emmey","Emmi","Emmie","Emmy","Emmye","Emogene","Emyle","Emylee","Engracia","Enid","Enrica","Enrichetta","Enrika","Enriqueta","Eolanda","Eolande","Eran","Erda","Erena","Erica","Ericha","Ericka","Erika","Erin","Erina","Erinn","Erinna","Erma","Ermengarde","Ermentrude","Ermina","Erminia","Erminie","Erna","Ernaline","Ernesta","Ernestine","Ertha","Eryn","Esma","Esmaria","Esme","Esmeralda","Essa","Essie","Essy","Esta","Estel","Estele","Estell","Estella","Estelle","Ester","Esther","Estrella","Estrellita","Ethel","Ethelda","Ethelin","Ethelind","Etheline","Ethelyn","Ethyl","Etta","Etti","Ettie","Etty","Eudora","Eugenia","Eugenie","Eugine","Eula","Eulalie","Eunice","Euphemia","Eustacia","Eva","Evaleen","Evangelia","Evangelin","Evangelina","Evangeline","Evania","Evanne","Eve","Eveleen","Evelina","Eveline","Evelyn","Evey","Evie","Evita","Evonne","Evvie","Evvy","Evy","Eyde","Eydie","Ezmeralda","Fae","Faina","Faith","Fallon","Fan","Fanchette","Fanchon","Fancie","Fancy","Fanechka","Fania","Fanni","Fannie","Fanny","Fanya","Fara","Farah","Farand","Farica","Farra","Farrah","Farrand","Faun","Faunie","Faustina","Faustine","Fawn","Fawne","Fawnia","Fay","Faydra","Faye","Fayette","Fayina","Fayre","Fayth","Faythe","Federica","Fedora","Felecia","Felicdad","Felice","Felicia","Felicity","Felicle","Felipa","Felisha","Felita","Feliza","Fenelia","Feodora","Ferdinanda","Ferdinande","Fern","Fernanda","Fernande","Fernandina","Ferne","Fey","Fiann","Fianna","Fidela","Fidelia","Fidelity","Fifi","Fifine","Filia","Filide","Filippa","Fina","Fiona","Fionna","Fionnula","Fiorenze","Fleur","Fleurette","Flo","Flor","Flora","Florance","Flore","Florella","Florence","Florencia","Florentia","Florenza","Florette","Flori","Floria","Florida","Florie","Florina","Florinda","Floris","Florri","Florrie","Florry","Flory","Flossi","Flossie","Flossy","Flss","Fran","Francene","Frances","Francesca","Francine","Francisca","Franciska","Francoise","Francyne","Frank","Frankie","Franky","Franni","Frannie","Franny","Frayda","Fred","Freda","Freddi","Freddie","Freddy","Fredelia","Frederica","Fredericka","Frederique","Fredi","Fredia","Fredra","Fredrika","Freida","Frieda","Friederike","Fulvia","Gabbey","Gabbi","Gabbie","Gabey","Gabi","Gabie","Gabriel","Gabriela","Gabriell","Gabriella","Gabrielle","Gabriellia","Gabrila","Gaby","Gae","Gael","Gail","Gale","Gale","Galina","Garland","Garnet","Garnette","Gates","Gavra","Gavrielle","Gay","Gaye","Gayel","Gayla","Gayle","Gayleen","Gaylene","Gaynor","Gelya","Gena","Gene","Geneva","Genevieve","Genevra","Genia","Genna","Genni","Gennie","Gennifer","Genny","Genovera","Genvieve","George","Georgeanna","Georgeanne","Georgena","Georgeta","Georgetta","Georgette","Georgia","Georgiana","Georgianna","Georgianne","Georgie","Georgina","Georgine","Geralda","Geraldine","Gerda","Gerhardine","Geri","Gerianna","Gerianne","Gerladina","Germain","Germaine","Germana","Gerri","Gerrie","Gerrilee","Gerry","Gert","Gerta","Gerti","Gertie","Gertrud","Gertruda","Gertrude","Gertrudis","Gerty","Giacinta","Giana","Gianina","Gianna","Gigi","Gilberta","Gilberte","Gilbertina","Gilbertine","Gilda","Gilemette","Gill","Gillan","Gilli","Gillian","Gillie","Gilligan","Gilly","Gina","Ginelle","Ginevra","Ginger","Ginni","Ginnie","Ginnifer","Ginny","Giorgia","Giovanna","Gipsy","Giralda","Gisela","Gisele","Gisella","Giselle","Giuditta","Giulia","Giulietta","Giustina","Gizela","Glad","Gladi","Gladys","Gleda","Glen","Glenda","Glenine","Glenn","Glenna","Glennie","Glennis","Glori","Gloria","Gloriana","Gloriane","Glory","Glyn","Glynda","Glynis","Glynnis","Gnni","Godiva","Golda","Goldarina","Goldi","Goldia","Goldie","Goldina","Goldy","Grace","Gracia","Gracie","Grata","Gratia","Gratiana","Gray","Grayce","Grazia","Greer","Greta","Gretal","Gretchen","Grete","Gretel","Grethel","Gretna","Gretta","Grier","Griselda","Grissel","Guendolen","Guenevere","Guenna","Guglielma","Gui","Guillema","Guillemette","Guinevere","Guinna","Gunilla","Gus","Gusella","Gussi","Gussie","Gussy","Gusta","Gusti","Gustie","Gusty","Gwen","Gwendolen","Gwendolin","Gwendolyn","Gweneth","Gwenette","Gwenneth","Gwenni","Gwennie","Gwenny","Gwenora","Gwenore","Gwyn","Gwyneth","Gwynne","Gypsy","Hadria","Hailee","Haily","Haleigh","Halette","Haley","Hali","Halie","Halimeda","Halley","Halli","Hallie","Hally","Hana","Hanna","Hannah","Hanni","Hannie","Hannis","Hanny","Happy","Harlene","Harley","Harli","Harlie","Harmonia","Harmonie","Harmony","Harri","Harrie","Harriet","Harriett","Harrietta","Harriette","Harriot","Harriott","Hatti","Hattie","Hatty","Hayley","Hazel","Heath","Heather","Heda","Hedda","Heddi","Heddie","Hedi","Hedvig","Hedvige","Hedwig","Hedwiga","Hedy","Heida","Heidi","Heidie","Helaina","Helaine","Helen","Helen-Elizabeth","Helena","Helene","Helenka","Helga","Helge","Helli","Heloise","Helsa","Helyn","Hendrika","Henka","Henrie","Henrieta","Henrietta","Henriette","Henryetta","Hephzibah","Hermia","Hermina","Hermine","Herminia","Hermione","Herta","Hertha","Hester","Hesther","Hestia","Hetti","Hettie","Hetty","Hilary","Hilda","Hildagard","Hildagarde","Hilde","Hildegaard","Hildegarde","Hildy","Hillary","Hilliary","Hinda","Holli","Hollie","Holly","Holly-Anne","Hollyanne","Honey","Honor","Honoria","Hope","Horatia","Hortense","Hortensia","Hulda","Hyacinth","Hyacintha","Hyacinthe","Hyacinthia","Hyacinthie","Hynda","Ianthe","Ibbie","Ibby","Ida","Idalia","Idalina","Idaline","Idell","Idelle","Idette","Ileana","Ileane","Ilene","Ilise","Ilka","Illa","Ilsa","Ilse","Ilysa","Ilyse","Ilyssa","Imelda","Imogen","Imogene","Imojean","Ina","Indira","Ines","Inesita","Inessa","Inez","Inga","Ingaberg","Ingaborg","Inge","Ingeberg","Ingeborg","Inger","Ingrid","Ingunna","Inna","Iolande","Iolanthe","Iona","Iormina","Ira","Irena","Irene","Irina","Iris","Irita","Irma","Isa","Isabel","Isabelita","Isabella","Isabelle","Isadora","Isahella","Iseabal","Isidora","Isis","Isobel","Issi","Issie","Issy","Ivett","Ivette","Ivie","Ivonne","Ivory","Ivy","Izabel","Jacenta","Jacinda","Jacinta","Jacintha","Jacinthe","Jackelyn","Jacki","Jackie","Jacklin","Jacklyn","Jackquelin","Jackqueline","Jacky","Jaclin","Jaclyn","Jacquelin","Jacqueline","Jacquelyn","Jacquelynn","Jacquenetta","Jacquenette","Jacquetta","Jacquette","Jacqui","Jacquie","Jacynth","Jada","Jade","Jaime","Jaimie","Jaine","Jami","Jamie","Jamima","Jammie","Jan","Jana","Janaya","Janaye","Jandy","Jane","Janean","Janeczka","Janeen","Janel","Janela","Janella","Janelle","Janene","Janenna","Janessa","Janet","Janeta","Janetta","Janette","Janeva","Janey","Jania","Janice","Janie","Janifer","Janina","Janine","Janis","Janith","Janka","Janna","Jannel","Jannelle","Janot","Jany","Jaquelin","Jaquelyn","Jaquenetta","Jaquenette","Jaquith","Jasmin","Jasmina","Jasmine","Jayme","Jaymee","Jayne","Jaynell","Jazmin","Jean","Jeana","Jeane","Jeanelle","Jeanette","Jeanie","Jeanine","Jeanna","Jeanne","Jeannette","Jeannie","Jeannine","Jehanna","Jelene","Jemie","Jemima","Jemimah","Jemmie","Jemmy","Jen","Jena","Jenda","Jenelle","Jeni","Jenica","Jeniece","Jenifer","Jeniffer","Jenilee","Jenine","Jenn","Jenna","Jennee","Jennette","Jenni","Jennica","Jennie","Jennifer","Jennilee","Jennine","Jenny","Jeralee","Jere","Jeri","Jermaine","Jerrie","Jerrilee","Jerrilyn","Jerrine","Jerry","Jerrylee","Jess","Jessa","Jessalin","Jessalyn","Jessamine","Jessamyn","Jesse","Jesselyn","Jessi","Jessica","Jessie","Jessika","Jessy","Jewel","Jewell","Jewelle","Jill","Jillana","Jillane","Jillayne","Jilleen","Jillene","Jilli","Jillian","Jillie","Jilly","Jinny","Jo","Jo Ann","Jo-Ann","Jo-Anne","Joan","Joana","Joane","Joanie","Joann","Joanna","Joanne","Joannes","Jobey","Jobi","Jobie","Jobina","Joby","Jobye","Jobyna","Jocelin","Joceline","Jocelyn","Jocelyne","Jodee","Jodi","Jodie","Jody","Joeann","Joela","Joelie","Joell","Joella","Joelle","Joellen","Joelly","Joellyn","Joelynn","Joete","Joey","Johanna","Johannah","Johna","Johnath","Johnette","Johnna","Joice","Jojo","Jolee","Joleen","Jolene","Joletta","Joli","Jolie","Joline","Joly","Jolyn","Jolynn","Jonell","Joni","Jonie","Jonis","Jordain","Jordan","Jordana","Jordanna","Jorey","Jori","Jorie","Jorrie","Jorry","Joscelin","Josee","Josefa","Josefina","Josepha","Josephina","Josephine","Josey","Josi","Josie","Josselyn","Josy","Jourdan","Joy","Joya","Joyan","Joyann","Joyce","Joycelin","Joye","Jsandye","Juana","Juanita","Judi","Judie","Judith","Juditha","Judy","Judye","Juieta","Julee","Juli","Julia","Juliana","Juliane","Juliann","Julianna","Julianne","Julie","Julienne","Juliet","Julieta","Julietta","Juliette","Julina","Juline","Julissa","Julita","June","Junette","Junia","Junie","Junina","Justina","Justine","Justinn","Jyoti","Kacey","Kacie","Kacy","Kaela","Kai","Kaia","Kaila","Kaile","Kailey","Kaitlin","Kaitlyn","Kaitlynn","Kaja","Kakalina","Kala","Kaleena","Kali","Kalie","Kalila","Kalina","Kalinda","Kalindi","Kalli","Kally","Kameko","Kamila","Kamilah","Kamillah","Kandace","Kandy","Kania","Kanya","Kara","Kara-Lynn","Karalee","Karalynn","Kare","Karee","Karel","Karen","Karena","Kari","Karia","Karie","Karil","Karilynn","Karin","Karina","Karine","Kariotta","Karisa","Karissa","Karita","Karla","Karlee","Karleen","Karlen","Karlene","Karlie","Karlotta","Karlotte","Karly","Karlyn","Karmen","Karna","Karol","Karola","Karole","Karolina","Karoline","Karoly","Karon","Karrah","Karrie","Karry","Kary","Karyl","Karylin","Karyn","Kasey","Kass","Kassandra","Kassey","Kassi","Kassia","Kassie","Kat","Kata","Katalin","Kate","Katee","Katerina","Katerine","Katey","Kath","Katha","Katharina","Katharine","Katharyn","Kathe","Katherina","Katherine","Katheryn","Kathi","Kathie","Kathleen","Kathlin","Kathrine","Kathryn","Kathryne","Kathy","Kathye","Kati","Katie","Katina","Katine","Katinka","Katleen","Katlin","Katrina","Katrine","Katrinka","Katti","Kattie","Katuscha","Katusha","Katy","Katya","Kay","Kaycee","Kaye","Kayla","Kayle","Kaylee","Kayley","Kaylil","Kaylyn","Keeley","Keelia","Keely","Kelcey","Kelci","Kelcie","Kelcy","Kelila","Kellen","Kelley","Kelli","Kellia","Kellie","Kellina","Kellsie","Kelly","Kellyann","Kelsey","Kelsi","Kelsy","Kendra","Kendre","Kenna","Keri","Keriann","Kerianne","Kerri","Kerrie","Kerrill","Kerrin","Kerry","Kerstin","Kesley","Keslie","Kessia","Kessiah","Ketti","Kettie","Ketty","Kevina","Kevyn","Ki","Kiah","Kial","Kiele","Kiersten","Kikelia","Kiley","Kim","Kimberlee","Kimberley","Kimberli","Kimberly","Kimberlyn","Kimbra","Kimmi","Kimmie","Kimmy","Kinna","Kip","Kipp","Kippie","Kippy","Kira","Kirbee","Kirbie","Kirby","Kiri","Kirsten","Kirsteni","Kirsti","Kirstin","Kirstyn","Kissee","Kissiah","Kissie","Kit","Kitti","Kittie","Kitty","Kizzee","Kizzie","Klara","Klarika","Klarrisa","Konstance","Konstanze","Koo","Kora","Koral","Koralle","Kordula","Kore","Korella","Koren","Koressa","Kori","Korie","Korney","Korrie","Korry","Kris","Krissie","Krissy","Krista","Kristal","Kristan","Kriste","Kristel","Kristen","Kristi","Kristien","Kristin","Kristina","Kristine","Kristy","Kristyn","Krysta","Krystal","Krystalle","Krystle","Krystyna","Kyla","Kyle","Kylen","Kylie","Kylila","Kylynn","Kym","Kynthia","Kyrstin","La Verne","Lacee","Lacey","Lacie","Lacy","Ladonna","Laetitia","Laina","Lainey","Lana","Lanae","Lane","Lanette","Laney","Lani","Lanie","Lanita","Lanna","Lanni","Lanny","Lara","Laraine","Lari","Larina","Larine","Larisa","Larissa","Lark","Laryssa","Latashia","Latia","Latisha","Latrena","Latrina","Laura","Lauraine","Laural","Lauralee","Laure","Lauree","Laureen","Laurel","Laurella","Lauren","Laurena","Laurene","Lauretta","Laurette","Lauri","Laurianne","Laurice","Laurie","Lauryn","Lavena","Laverna","Laverne","Lavina","Lavinia","Lavinie","Layla","Layne","Layney","Lea","Leah","Leandra","Leann","Leanna","Leanor","Leanora","Lebbie","Leda","Lee","Leeann","Leeanne","Leela","Leelah","Leena","Leesa","Leese","Legra","Leia","Leigh","Leigha","Leila","Leilah","Leisha","Lela","Lelah","Leland","Lelia","Lena","Lenee","Lenette","Lenka","Lenna","Lenora","Lenore","Leodora","Leoine","Leola","Leoline","Leona","Leonanie","Leone","Leonelle","Leonie","Leonora","Leonore","Leontine","Leontyne","Leora","Leshia","Lesley","Lesli","Leslie","Lesly","Lesya","Leta","Lethia","Leticia","Letisha","Letitia","Letizia","Letta","Letti","Lettie","Letty","Lexi","Lexie","Lexine","Lexis","Lexy","Leyla","Lezlie","Lia","Lian","Liana","Liane","Lianna","Lianne","Lib","Libbey","Libbi","Libbie","Libby","Licha","Lida","Lidia","Liesa","Lil","Lila","Lilah","Lilas","Lilia","Lilian","Liliane","Lilias","Lilith","Lilla","Lilli","Lillian","Lillis","Lilllie","Lilly","Lily","Lilyan","Lin","Lina","Lind","Linda","Lindi","Lindie","Lindsay","Lindsey","Lindsy","Lindy","Linea","Linell","Linet","Linette","Linn","Linnea","Linnell","Linnet","Linnie","Linzy","Lira","Lisa","Lisabeth","Lisbeth","Lise","Lisetta","Lisette","Lisha","Lishe","Lissa","Lissi","Lissie","Lissy","Lita","Liuka","Liv","Liva","Livia","Livvie","Livvy","Livvyy","Livy","Liz","Liza","Lizabeth","Lizbeth","Lizette","Lizzie","Lizzy","Loella","Lois","Loise","Lola","Loleta","Lolita","Lolly","Lona","Lonee","Loni","Lonna","Lonni","Lonnie","Lora","Lorain","Loraine","Loralee","Loralie","Loralyn","Loree","Loreen","Lorelei","Lorelle","Loren","Lorena","Lorene","Lorenza","Loretta","Lorette","Lori","Loria","Lorianna","Lorianne","Lorie","Lorilee","Lorilyn","Lorinda","Lorine","Lorita","Lorna","Lorne","Lorraine","Lorrayne","Lorri","Lorrie","Lorrin","Lorry","Lory","Lotta","Lotte","Lotti","Lottie","Lotty","Lou","Louella","Louisa","Louise","Louisette","Loutitia","Lu","Luce","Luci","Lucia","Luciana","Lucie","Lucienne","Lucila","Lucilia","Lucille","Lucina","Lucinda","Lucine","Lucita","Lucky","Lucretia","Lucy","Ludovika","Luella","Luelle","Luisa","Luise","Lula","Lulita","Lulu","Lura","Lurette","Lurleen","Lurlene","Lurline","Lusa","Luz","Lyda","Lydia","Lydie","Lyn","Lynda","Lynde","Lyndel","Lyndell","Lyndsay","Lyndsey","Lyndsie","Lyndy","Lynea","Lynelle","Lynett","Lynette","Lynn","Lynna","Lynne","Lynnea","Lynnell","Lynnelle","Lynnet","Lynnett","Lynnette","Lynsey","Lyssa","Mab","Mabel","Mabelle","Mable","Mada","Madalena","Madalyn","Maddalena","Maddi","Maddie","Maddy","Madel","Madelaine","Madeleine","Madelena","Madelene","Madelin","Madelina","Madeline","Madella","Madelle","Madelon","Madelyn","Madge","Madlen","Madlin","Madonna","Mady","Mae","Maegan","Mag","Magda","Magdaia","Magdalen","Magdalena","Magdalene","Maggee","Maggi","Maggie","Maggy","Mahala","Mahalia","Maia","Maible","Maiga","Maighdiln","Mair","Maire","Maisey","Maisie","Maitilde","Mala","Malanie","Malena","Malia","Malina","Malinda","Malinde","Malissa","Malissia","Mallissa","Mallorie","Mallory","Malorie","Malory","Malva","Malvina","Malynda","Mame","Mamie","Manda","Mandi","Mandie","Mandy","Manon","Manya","Mara","Marabel","Marcela","Marcelia","Marcella","Marcelle","Marcellina","Marcelline","Marchelle","Marci","Marcia","Marcie","Marcile","Marcille","Marcy","Mareah","Maren","Marena","Maressa","Marga","Margalit","Margalo","Margaret","Margareta","Margarete","Margaretha","Margarethe","Margaretta","Margarette","Margarita","Margaux","Marge","Margeaux","Margery","Marget","Margette","Margi","Margie","Margit","Margo","Margot","Margret","Marguerite","Margy","Mari","Maria","Mariam","Marian","Mariana","Mariann","Marianna","Marianne","Maribel","Maribelle","Maribeth","Marice","Maridel","Marie","Marie-Ann","Marie-Jeanne","Marieann","Mariejeanne","Mariel","Mariele","Marielle","Mariellen","Marietta","Mariette","Marigold","Marijo","Marika","Marilee","Marilin","Marillin","Marilyn","Marin","Marina","Marinna","Marion","Mariquilla","Maris","Marisa","Mariska","Marissa","Marita","Maritsa","Mariya","Marj","Marja","Marje","Marji","Marjie","Marjorie","Marjory","Marjy","Marketa","Marla","Marlane","Marleah","Marlee","Marleen","Marlena","Marlene","Marley","Marlie","Marline","Marlo","Marlyn","Marna","Marne","Marney","Marni","Marnia","Marnie","Marquita","Marrilee","Marris","Marrissa","Marsha","Marsiella","Marta","Martelle","Martguerita","Martha","Marthe","Marthena","Marti","Martica","Martie","Martina","Martita","Marty","Martynne","Mary","Marya","Maryann","Maryanna","Maryanne","Marybelle","Marybeth","Maryellen","Maryjane","Maryjo","Maryl","Marylee","Marylin","Marylinda","Marylou","Marylynne","Maryrose","Marys","Marysa","Masha","Matelda","Mathilda","Mathilde","Matilda","Matilde","Matti","Mattie","Matty","Maud","Maude","Maudie","Maura","Maure","Maureen","Maureene","Maurene","Maurine","Maurise","Maurita","Maurizia","Mavis","Mavra","Max","Maxi","Maxie","Maxine","Maxy","May","Maybelle","Maye","Mead","Meade","Meagan","Meaghan","Meara","Mechelle","Meg","Megan","Megen","Meggi","Meggie","Meggy","Meghan","Meghann","Mehetabel","Mei","Mel","Mela","Melamie","Melania","Melanie","Melantha","Melany","Melba","Melesa","Melessa","Melicent","Melina","Melinda","Melinde","Melisa","Melisande","Melisandra","Melisenda","Melisent","Melissa","Melisse","Melita","Melitta","Mella","Melli","Mellicent","Mellie","Mellisa","Mellisent","Melloney","Melly","Melodee","Melodie","Melody","Melonie","Melony","Melosa","Melva","Mercedes","Merci","Mercie","Mercy","Meredith","Meredithe","Meridel","Meridith","Meriel","Merilee","Merilyn","Meris","Merissa","Merl","Merla","Merle","Merlina","Merline","Merna","Merola","Merralee","Merridie","Merrie","Merrielle","Merrile","Merrilee","Merrili","Merrill","Merrily","Merry","Mersey","Meryl","Meta","Mia","Micaela","Michaela","Michaelina","Michaeline","Michaella","Michal","Michel","Michele","Michelina","Micheline","Michell","Michelle","Micki","Mickie","Micky","Midge","Mignon","Mignonne","Miguela","Miguelita","Mikaela","Mil","Mildred","Mildrid","Milena","Milicent","Milissent","Milka","Milli","Millicent","Millie","Millisent","Milly","Milzie","Mimi","Min","Mina","Minda","Mindy","Minerva","Minetta","Minette","Minna","Minnaminnie","Minne","Minni","Minnie","Minnnie","Minny","Minta","Miof Mela","Miquela","Mira","Mirabel","Mirabella","Mirabelle","Miran","Miranda","Mireielle","Mireille","Mirella","Mirelle","Miriam","Mirilla","Mirna","Misha","Missie","Missy","Misti","Misty","Mitzi","Modesta","Modestia","Modestine","Modesty","Moina","Moira","Moll","Mollee","Molli","Mollie","Molly","Mommy","Mona","Monah","Monica","Monika","Monique","Mora","Moreen","Morena","Morgan","Morgana","Morganica","Morganne","Morgen","Moria","Morissa","Morna","Moselle","Moyna","Moyra","Mozelle","Muffin","Mufi","Mufinella","Muire","Mureil","Murial","Muriel","Murielle","Myra","Myrah","Myranda","Myriam","Myrilla","Myrle","Myrlene","Myrna","Myrta","Myrtia","Myrtice","Myrtie","Myrtle","Nada","Nadean","Nadeen","Nadia","Nadine","Nadiya","Nady","Nadya","Nalani","Nan","Nana","Nananne","Nance","Nancee","Nancey","Nanci","Nancie","Nancy","Nanete","Nanette","Nani","Nanice","Nanine","Nannette","Nanni","Nannie","Nanny","Nanon","Naoma","Naomi","Nara","Nari","Nariko","Nat","Nata","Natala","Natalee","Natalie","Natalina","Nataline","Natalya","Natasha","Natassia","Nathalia","Nathalie","Natividad","Natka","Natty","Neala","Neda","Nedda","Nedi","Neely","Neila","Neile","Neilla","Neille","Nelia","Nelie","Nell","Nelle","Nelli","Nellie","Nelly","Nerissa","Nerita","Nert","Nerta","Nerte","Nerti","Nertie","Nerty","Nessa","Nessi","Nessie","Nessy","Nesta","Netta","Netti","Nettie","Nettle","Netty","Nevsa","Neysa","Nichol","Nichole","Nicholle","Nicki","Nickie","Nicky","Nicol","Nicola","Nicole","Nicolea","Nicolette","Nicoli","Nicolina","Nicoline","Nicolle","Nikaniki","Nike","Niki","Nikki","Nikkie","Nikoletta","Nikolia","Nina","Ninetta","Ninette","Ninnetta","Ninnette","Ninon","Nissa","Nisse","Nissie","Nissy","Nita","Nixie","Noami","Noel","Noelani","Noell","Noella","Noelle","Noellyn","Noelyn","Noemi","Nola","Nolana","Nolie","Nollie","Nomi","Nona","Nonah","Noni","Nonie","Nonna","Nonnah","Nora","Norah","Norean","Noreen","Norene","Norina","Norine","Norma","Norri","Norrie","Norry","Novelia","Nydia","Nyssa","Octavia","Odele","Odelia","Odelinda","Odella","Odelle","Odessa","Odetta","Odette","Odilia","Odille","Ofelia","Ofella","Ofilia","Ola","Olenka","Olga","Olia","Olimpia","Olive","Olivette","Olivia","Olivie","Oliy","Ollie","Olly","Olva","Olwen","Olympe","Olympia","Olympie","Ondrea","Oneida","Onida","Oona","Opal","Opalina","Opaline","Ophelia","Ophelie","Ora","Oralee","Oralia","Oralie","Oralla","Oralle","Orel","Orelee","Orelia","Orelie","Orella","Orelle","Oriana","Orly","Orsa","Orsola","Ortensia","Otha","Othelia","Othella","Othilia","Othilie","Ottilie","Page","Paige","Paloma","Pam","Pamela","Pamelina","Pamella","Pammi","Pammie","Pammy","Pandora","Pansie","Pansy","Paola","Paolina","Papagena","Pat","Patience","Patrica","Patrice","Patricia","Patrizia","Patsy","Patti","Pattie","Patty","Paula","Paule","Pauletta","Paulette","Pauli","Paulie","Paulina","Pauline","Paulita","Pauly","Pavia","Pavla","Pearl","Pearla","Pearle","Pearline","Peg","Pegeen","Peggi","Peggie","Peggy","Pen","Penelopa","Penelope","Penni","Pennie","Penny","Pepi","Pepita","Peri","Peria","Perl","Perla","Perle","Perri","Perrine","Perry","Persis","Pet","Peta","Petra","Petrina","Petronella","Petronia","Petronilla","Petronille","Petunia","Phaedra","Phaidra","Phebe","Phedra","Phelia","Phil","Philipa","Philippa","Philippe","Philippine","Philis","Phillida","Phillie","Phillis","Philly","Philomena","Phoebe","Phylis","Phyllida","Phyllis","Phyllys","Phylys","Pia","Pier","Pierette","Pierrette","Pietra","Piper","Pippa","Pippy","Polly","Pollyanna","Pooh","Poppy","Portia","Pris","Prisca","Priscella","Priscilla","Prissie","Pru","Prudence","Prudi","Prudy","Prue","Queenie","Quentin","Querida","Quinn","Quinta","Quintana","Quintilla","Quintina","Rachael","Rachel","Rachele","Rachelle","Rae","Raeann","Raf","Rafa","Rafaela","Rafaelia","Rafaelita","Rahal","Rahel","Raina","Raine","Rakel","Ralina","Ramona","Ramonda","Rana","Randa","Randee","Randene","Randi","Randie","Randy","Ranee","Rani","Rania","Ranice","Ranique","Ranna","Raphaela","Raquel","Raquela","Rasia","Rasla","Raven","Ray","Raychel","Raye","Rayna","Raynell","Rayshell","Rea","Reba","Rebbecca","Rebe","Rebeca","Rebecca","Rebecka","Rebeka","Rebekah","Rebekkah","Ree","Reeba","Reena","Reeta","Reeva","Regan","Reggi","Reggie","Regina","Regine","Reiko","Reina","Reine","Remy","Rena","Renae","Renata","Renate","Rene","Renee","Renell","Renelle","Renie","Rennie","Reta","Retha","Revkah","Rey","Reyna","Rhea","Rheba","Rheta","Rhetta","Rhiamon","Rhianna","Rhianon","Rhoda","Rhodia","Rhodie","Rhody","Rhona","Rhonda","Riane","Riannon","Rianon","Rica","Ricca","Rici","Ricki","Rickie","Ricky","Riki","Rikki","Rina","Risa","Rita","Riva","Rivalee","Rivi","Rivkah","Rivy","Roana","Roanna","Roanne","Robbi","Robbie","Robbin","Robby","Robbyn","Robena","Robenia","Roberta","Robin","Robina","Robinet","Robinett","Robinetta","Robinette","Robinia","Roby","Robyn","Roch","Rochell","Rochella","Rochelle","Rochette","Roda","Rodi","Rodie","Rodina","Rois","Romola","Romona","Romonda","Romy","Rona","Ronalda","Ronda","Ronica","Ronna","Ronni","Ronnica","Ronnie","Ronny","Roobbie","Rora","Rori","Rorie","Rory","Ros","Rosa","Rosabel","Rosabella","Rosabelle","Rosaleen","Rosalia","Rosalie","Rosalind","Rosalinda","Rosalinde","Rosaline","Rosalyn","Rosalynd","Rosamond","Rosamund","Rosana","Rosanna","Rosanne","Rose","Roseann","Roseanna","Roseanne","Roselia","Roselin","Roseline","Rosella","Roselle","Rosemaria","Rosemarie","Rosemary","Rosemonde","Rosene","Rosetta","Rosette","Roshelle","Rosie","Rosina","Rosita","Roslyn","Rosmunda","Rosy","Row","Rowe","Rowena","Roxana","Roxane","Roxanna","Roxanne","Roxi","Roxie","Roxine","Roxy","Roz","Rozalie","Rozalin","Rozamond","Rozanna","Rozanne","Roze","Rozele","Rozella","Rozelle","Rozina","Rubetta","Rubi","Rubia","Rubie","Rubina","Ruby","Ruperta","Ruth","Ruthann","Ruthanne","Ruthe","Ruthi","Ruthie","Ruthy","Ryann","Rycca","Saba","Sabina","Sabine","Sabra","Sabrina","Sacha","Sada","Sadella","Sadie","Sadye","Saidee","Sal","Salaidh","Sallee","Salli","Sallie","Sally","Sallyann","Sallyanne","Saloma","Salome","Salomi","Sam","Samantha","Samara","Samaria","Sammy","Sande","Sandi","Sandie","Sandra","Sandy","Sandye","Sapphira","Sapphire","Sara","Sara-Ann","Saraann","Sarah","Sarajane","Saree","Sarena","Sarene","Sarette","Sari","Sarina","Sarine","Sarita","Sascha","Sasha","Sashenka","Saudra","Saundra","Savina","Sayre","Scarlet","Scarlett","Sean","Seana","Seka","Sela","Selena","Selene","Selestina","Selia","Selie","Selina","Selinda","Seline","Sella","Selle","Selma","Sena","Sephira","Serena","Serene","Shae","Shaina","Shaine","Shalna","Shalne","Shana","Shanda","Shandee","Shandeigh","Shandie","Shandra","Shandy","Shane","Shani","Shanie","Shanna","Shannah","Shannen","Shannon","Shanon","Shanta","Shantee","Shara","Sharai","Shari","Sharia","Sharity","Sharl","Sharla","Sharleen","Sharlene","Sharline","Sharon","Sharona","Sharron","Sharyl","Shaun","Shauna","Shawn","Shawna","Shawnee","Shay","Shayla","Shaylah","Shaylyn","Shaylynn","Shayna","Shayne","Shea","Sheba","Sheela","Sheelagh","Sheelah","Sheena","Sheeree","Sheila","Sheila-Kathryn","Sheilah","Shel","Shela","Shelagh","Shelba","Shelbi","Shelby","Shelia","Shell","Shelley","Shelli","Shellie","Shelly","Shena","Sher","Sheree","Sheri","Sherie","Sherill","Sherilyn","Sherline","Sherri","Sherrie","Sherry","Sherye","Sheryl","Shina","Shir","Shirl","Shirlee","Shirleen","Shirlene","Shirley","Shirline","Shoshana","Shoshanna","Siana","Sianna","Sib","Sibbie","Sibby","Sibeal","Sibel","Sibella","Sibelle","Sibilla","Sibley","Sibyl","Sibylla","Sibylle","Sidoney","Sidonia","Sidonnie","Sigrid","Sile","Sileas","Silva","Silvana","Silvia","Silvie","Simona","Simone","Simonette","Simonne","Sindee","Siobhan","Sioux","Siouxie","Sisely","Sisile","Sissie","Sissy","Siusan","Sofia","Sofie","Sondra","Sonia","Sonja","Sonni","Sonnie","Sonnnie","Sonny","Sonya","Sophey","Sophi","Sophia","Sophie","Sophronia","Sorcha","Sosanna","Stace","Stacee","Stacey","Staci","Stacia","Stacie","Stacy","Stafani","Star","Starla","Starlene","Starlin","Starr","Stefa","Stefania","Stefanie","Steffane","Steffi","Steffie","Stella","Stepha","Stephana","Stephani","Stephanie","Stephannie","Stephenie","Stephi","Stephie","Stephine","Stesha","Stevana","Stevena","Stoddard","Storm","Stormi","Stormie","Stormy","Sue","Suellen","Sukey","Suki","Sula","Sunny","Sunshine","Susan","Susana","Susanetta","Susann","Susanna","Susannah","Susanne","Susette","Susi","Susie","Susy","Suzann","Suzanna","Suzanne","Suzette","Suzi","Suzie","Suzy","Sybil","Sybila","Sybilla","Sybille","Sybyl","Sydel","Sydelle","Sydney","Sylvia","Tabatha","Tabbatha","Tabbi","Tabbie","Tabbitha","Tabby","Tabina","Tabitha","Taffy","Talia","Tallia","Tallie","Tallou","Tallulah","Tally","Talya","Talyah","Tamar","Tamara","Tamarah","Tamarra","Tamera","Tami","Tamiko","Tamma","Tammara","Tammi","Tammie","Tammy","Tamqrah","Tamra","Tana","Tandi","Tandie","Tandy","Tanhya","Tani","Tania","Tanitansy","Tansy","Tanya","Tara","Tarah","Tarra","Tarrah","Taryn","Tasha","Tasia","Tate","Tatiana","Tatiania","Tatum","Tawnya","Tawsha","Ted","Tedda","Teddi","Teddie","Teddy","Tedi","Tedra","Teena","TEirtza","Teodora","Tera","Teresa","Terese","Teresina","Teresita","Teressa","Teri","Teriann","Terra","Terri","Terrie","Terrijo","Terry","Terrye","Tersina","Terza","Tess","Tessa","Tessi","Tessie","Tessy","Thalia","Thea","Theadora","Theda","Thekla","Thelma","Theo","Theodora","Theodosia","Theresa","Therese","Theresina","Theresita","Theressa","Therine","Thia","Thomasa","Thomasin","Thomasina","Thomasine","Tiena","Tierney","Tiertza","Tiff","Tiffani","Tiffanie","Tiffany","Tiffi","Tiffie","Tiffy","Tilda","Tildi","Tildie","Tildy","Tillie","Tilly","Tim","Timi","Timmi","Timmie","Timmy","Timothea","Tina","Tine","Tiphani","Tiphanie","Tiphany","Tish","Tisha","Tobe","Tobey","Tobi","Toby","Tobye","Toinette","Toma","Tomasina","Tomasine","Tomi","Tommi","Tommie","Tommy","Toni","Tonia","Tonie","Tony","Tonya","Tonye","Tootsie","Torey","Tori","Torie","Torrie","Tory","Tova","Tove","Tracee","Tracey","Traci","Tracie","Tracy","Trenna","Tresa","Trescha","Tressa","Tricia","Trina","Trish","Trisha","Trista","Trix","Trixi","Trixie","Trixy","Truda","Trude","Trudey","Trudi","Trudie","Trudy","Trula","Tuesday","Twila","Twyla","Tybi","Tybie","Tyne","Ula","Ulla","Ulrica","Ulrika","Ulrikaumeko","Ulrike","Umeko","Una","Ursa","Ursala","Ursola","Ursula","Ursulina","Ursuline","Uta","Val","Valaree","Valaria","Vale","Valeda","Valencia","Valene","Valenka","Valentia","Valentina","Valentine","Valera","Valeria","Valerie","Valery","Valerye","Valida","Valina","Valli","Vallie","Vally","Valma","Valry","Van","Vanda","Vanessa","Vania","Vanna","Vanni","Vannie","Vanny","Vanya","Veda","Velma","Velvet","Venita","Venus","Vera","Veradis","Vere","Verena","Verene","Veriee","Verile","Verina","Verine","Verla","Verna","Vernice","Veronica","Veronika","Veronike","Veronique","Vevay","Vi","Vicki","Vickie","Vicky","Victoria","Vida","Viki","Vikki","Vikky","Vilhelmina","Vilma","Vin","Vina","Vinita","Vinni","Vinnie","Vinny","Viola","Violante","Viole","Violet","Violetta","Violette","Virgie","Virgina","Virginia","Virginie","Vita","Vitia","Vitoria","Vittoria","Viv","Viva","Vivi","Vivia","Vivian","Viviana","Vivianna","Vivianne","Vivie","Vivien","Viviene","Vivienne","Viviyan","Vivyan","Vivyanne","Vonni","Vonnie","Vonny","Vyky","Wallie","Wallis","Walliw","Wally","Waly","Wanda","Wandie","Wandis","Waneta","Wanids","Wenda","Wendeline","Wendi","Wendie","Wendy","Wendye","Wenona","Wenonah","Whitney","Wileen","Wilhelmina","Wilhelmine","Wilie","Willa","Willabella","Willamina","Willetta","Willette","Willi","Willie","Willow","Willy","Willyt","Wilma","Wilmette","Wilona","Wilone","Wilow","Windy","Wini","Winifred","Winna","Winnah","Winne","Winni","Winnie","Winnifred","Winny","Winona","Winonah","Wren","Wrennie","Wylma","Wynn","Wynne","Wynnie","Wynny","Xaviera","Xena","Xenia","Xylia","Xylina","Yalonda","Yasmeen","Yasmin","Yelena","Yetta","Yettie","Yetty","Yevette","Ynes","Ynez","Yoko","Yolanda","Yolande","Yolane","Yolanthe","Yoshi","Yoshiko","Yovonnda","Ysabel","Yvette","Yvonne","Zabrina","Zahara","Zandra","Zaneta","Zara","Zarah","Zaria","Zarla","Zea","Zelda","Zelma","Zena","Zenia","Zia","Zilvia","Zita","Zitella","Zoe","Zola","Zonda","Zondra","Zonnya","Zora","Zorah","Zorana","Zorina","Zorine","Zsa Zsa","Zsazsa","Zulema","Zuzana"];e.exports.getRandom=function(){return`${n.pick(i)} ${n.pick(i)}`},e.exports.getId=function(e){return e.split("").map(e=>e.charCodeAt(0)).join("")}},function(e,t,a){var n=a(2)(),i=[{activity:{id:"https://www.coursera.org/specializations/deep-learning/1",definition:{name:{"en-US":"Neural Networks and Deep Learning"},description:{"en-US":"Neural Networks and Deep Learning"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/deep-learning",definition:{name:{"en-US":"Deep Learning"},description:{"en-US":"Deep Learning"},type:"http://adlnet.gov/expapi/activities/course"}},interactions:{count:1,activities:[{id:"1",definition:{description:{"en-US":"Backpropagation is often used in neural networks."},type:"http://adlnet.gov/expapi/activities/interaction",interactionType:"true-false"}},{id:"2",definition:{description:{"en-US":"Neural networks have been used in"},type:"http://adlnet.gov/expapi/activities/interaction",interactionType:"choice",choices:[{id:"speech-recognition",description:{"en-US":"speech recognition"}},{id:"playing-video-games",description:{"en-US":"playing video games"}},{id:"computer-vision",description:{"en-US":"computer vision"}},{id:"all",description:{"en-US":"all of the above"}}]}}]}},{activity:{id:"https://www.coursera.org/specializations/deep-learning/2",definition:{name:{"en-US":"Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization"},description:{"en-US":"Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/deep-learning",definition:{name:{"en-US":"Deep Learning"},description:{"en-US":"Deep Learning"},type:"http://adlnet.gov/expapi/activities/course"}},interactions:{count:1,activities:[{id:"1",definition:{description:{"en-US":"LSTM is effective in the use of language modeling"},type:"http://adlnet.gov/expapi/activities/interaction",interactionType:"true-false"}}]}},{activity:{id:"https://www.coursera.org/specializations/deep-learning/3",definition:{name:{"en-US":"Structuring Machine Learning Projects"},description:{"en-US":"Structuring Machine Learning Projects"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/deep-learning",definition:{name:{"en-US":"Deep Learning"},description:{"en-US":"Deep Learning"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/deep-learning/4",definition:{name:{"en-US":"Convolutional Neural Networks"},description:{"en-US":"Convolutional Neural Networks"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/deep-learning",definition:{name:{"en-US":"Deep Learning"},description:{"en-US":"Deep Learning"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/deep-learning/5",definition:{name:{"en-US":"Sequence Models"},description:{"en-US":"Sequence Models"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/deep-learning",definition:{name:{"en-US":"Deep Learning"},description:{"en-US":"Deep Learning"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/1",definition:{name:{"en-US":"The Data Scientist’s Toolbox"},description:{"en-US":"The Data Scientist’s Toolbox"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/2",definition:{name:{"en-US":"R Programming"},description:{"en-US":"R Programming"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/3",definition:{name:{"en-US":"Getting and Cleaning Data"},description:{"en-US":"Getting and Cleaning Data"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/4",definition:{name:{"en-US":"Exploratory Data Analysis"},description:{"en-US":"Exploratory Data Analysis"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/5",definition:{name:{"en-US":"Reproducible Research"},description:{"en-US":"Reproducible Research"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/6",definition:{name:{"en-US":"Statistical Inference"},description:{"en-US":"Statistical Inference"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/7",definition:{name:{"en-US":"Regression Models"},description:{"en-US":"Regression Models"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/8",definition:{name:{"en-US":"Practical Machine Learning"},description:{"en-US":"Practical Machine Learning"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/9",definition:{name:{"en-US":"Developing Data Products"},description:{"en-US":"Developing Data Products"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/jhu-data-science/10",definition:{name:{"en-US":"Data Science Capstone"},description:{"en-US":"Data Science Capstone"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/jhu-data-science",definition:{name:{"en-US":"Data Science"},description:{"en-US":"Data Science"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/python/1",definition:{name:{"en-US":"Programming for Everybody (Getting Started with Python)"},description:{"en-US":"Programming for Everybody (Getting Started with Python)"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/python",definition:{name:{"en-US":"Learn to Program and Analyze Data with Python"},description:{"en-US":"Learn to Program and Analyze Data with Python"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/python/2",definition:{name:{"en-US":"Python Data Structures"},description:{"en-US":"Python Data Structures"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/python",definition:{name:{"en-US":"Learn to Program and Analyze Data with Python"},description:{"en-US":"Learn to Program and Analyze Data with Python"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/python/3",definition:{name:{"en-US":"Using Python to Access Web Data"},description:{"en-US":"Using Python to Access Web Data"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/python",definition:{name:{"en-US":"Learn to Program and Analyze Data with Python"},description:{"en-US":"Learn to Program and Analyze Data with Python"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/python/4",definition:{name:{"en-US":"Using Databases with Python"},description:{"en-US":"Using Databases with Python"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/python",definition:{name:{"en-US":"Learn to Program and Analyze Data with Python"},description:{"en-US":"Learn to Program and Analyze Data with Python"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/specializations/python/5",definition:{name:{"en-US":"Retrieving, Processing, and Visualizing Data with Python"},description:{"en-US":"Retrieving, Processing, and Visualizing Data with Python"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/specializations/python",definition:{name:{"en-US":"Learn to Program and Analyze Data with Python"},description:{"en-US":"Learn to Program and Analyze Data with Python"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/learn/machine-learning/1",definition:{name:{"en-US":"Machine Learning Lesson"},description:{"en-US":"Machine Learning Lesson"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/learn/machine-learning",definition:{name:{"en-US":"Machine Learning"},description:{"en-US":"Machine Learning"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/learn/programming-languages-part-b/1",definition:{name:{"en-US":"Programming Languages, Part B Lesson"},description:{"en-US":"Programming Languages, Part B Lesson"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/learn/programming-languages-part-b",definition:{name:{"en-US":"Programming Languages, Part B"},description:{"en-US":"Programming Languages, Part B"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/learn/algorithms-part1/1",definition:{name:{"en-US":"Algorithms, Part I Lesson"},description:{"en-US":"Algorithms, Part I Lesson"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/learn/algorithms-part1",definition:{name:{"en-US":"Algorithms, Part I"},description:{"en-US":"Algorithms, Part I"},type:"http://adlnet.gov/expapi/activities/course"}}},{activity:{id:"https://www.coursera.org/learn/neural-networks/1",definition:{name:{"en-US":"Neural Networks for Machine Learning Lesson"},description:{"en-US":"Neural Networks for Machine Learning Lesson"},type:"http://adlnet.gov/expapi/activities/lesson"}},contextActivity:{id:"https://www.coursera.org/learn/neural-networks",definition:{name:{"en-US":"Neural Networks for Machine Learning"},description:{"en-US":"Neural Networks for Machine Learning"},type:"http://adlnet.gov/expapi/activities/course"}}}];e.exports.getRandom=function(){return n.pick(JSON.parse(JSON.stringify(i)))},e.exports.get=function(e){var t=JSON.parse(JSON.stringify(i));return e<t.length?t[e]:t[0]}},function(e,t,a){a(2)();var n=a(7);e.exports.getSingleInitializedStmt=function(e,t,a,i){var r=n.getBase(e,t,a,i);return r.verb={id:"http://adlnet.gov/expapi/verbs/initialized",display:{"en-US":"initialized"}},r},e.exports.getSingleResumedStmt=function(e,t,a,i){var r=n.getBase(e,t,a,i);return r.verb={id:"http://adlnet.gov/expapi/verbs/resumed",display:{"en-US":"resumed"}},r}},function(e,t,a){var n=a(2)(),i=a(7);e.exports.getSingleStmt=function(e,t,a,r,s){var o,l=i.getBase(e,t,a,r);if(l.verb={id:"http://adlnet.gov/expapi/verbs/responded",display:{"en-US":"responded"}},!t.interactions)throw new Error("this activity doesn't have an interactions object");return l.context.contextActivities.parent=[l.object],l.object=s,l.object.id=`${l.context.contextActivities.parent[0].id}/interactions/${s.id}`,l.result={response:(o=s,{"true-false":()=>`${n.bool()}`,choice:()=>n.pick(o.definition.choices).id}[o.definition.interactionType]())},l}},function(e,t,a){var n=a(2)(),i=a(7),r=["There's a typo in this","I don't understand this material","This is too easy","The video isn't playing","Good stuff!","Can we go over this in class?","This is confusing","The audio isn't clear","Ha ha! Who is speaking? Were they sick?","The form isn't submitting","I'm lost, cold and hungry. Send help please!"];e.exports.getSingleStmt=function(e,t,a,s){var o=i.getBase(e,t,a,s);return o.verb={id:"http://adlnet.gov/expapi/verbs/commented",display:{"en-US":"commented"}},o.result={response:n.pick(r)},o}},function(e,t,a){a(2)();var n=a(7);e.exports.getSingleStmt=function(e,t,a,i){var r=n.getBase(e,t,a,i);return r.verb={id:"http://adlnet.gov/expapi/verbs/completed",display:{"en-US":"completed"}},r}},function(e,t,a){var n=a(2)(),i=a(7);e.exports.getSingleStmt=function(e,t,a,r){var s=i.getBase(e,t,a,r);return s.verb={id:"http://adlnet.gov/expapi/verbs/progressed",display:{"en-US":"progressed"}},s.result={score:{scaled:Number.parseFloat(n.real(0,1).toFixed(2))}},s}},function(e,t,a){var n=a(2)(),i=a(7);e.exports.getSingleStmt=function(e,t,a,r){var s=i.getBase(e,t,a,r);return s.verb={id:"http://adlnet.gov/expapi/verbs/scored",display:{"en-US":"scored"}},s.result={score:{scaled:Number.parseFloat(n.real(0,1).toFixed(2))}},s}},function(e,t,a){var n=a(2)(),i=a(7),r=[{id:"http://adlnet.gov/expapi/verbs/passed",display:{"en-US":"passed"}},{id:"http://adlnet.gov/expapi/verbs/failed",display:{"en-US":"failed"}}];e.exports.getSingleStmt=function(e,t,a,s){var o=i.getBase(e,t,a,s);return o.verb=n.pick(r),o}},function(e,t,a){var n=a(2)(),i=a(174),r=a(7);e.exports.getSingleTerminatedStmt=function(e,t,a,n){var s=r.getBase(e,t,a,n);return s.verb={id:"http://adlnet.gov/expapi/verbs/terminated",display:{"en-US":"terminated"}},s.result=i.getRandom(),s},e.exports.getSingleSuspendStmt=function(e,t,a,s){var o=r.getBase(e,t,a,s);return o.verb={id:"http://adlnet.gov/expapi/verbs/suspended",display:{"en-US":"suspended"}},n.bool(.3)&&(o.result=i.getRandom()),o}},function(e,t,a){var n=a(2)(),i={success:!1,completion:!1,score:{scaled:0}};e.exports.getRandom=function(){var e=JSON.parse(JSON.stringify(i)),t=n.bool(.68),a=0;t&&(a=Number.parseFloat(n.real(0,1).toFixed(2)));var r=!1;return a>=.7&&(r=!0),e.success=r,e.completion=t,t?e.score.scaled=a:delete e.score,e}},function(e,t,a){(function(t){const n=a(8),i=(n.Router,a(24)),r=a(4).MongoClient,s=(a(4),a(11),a(9)),o=a(14);e.exports=class extends n{constructor(e,l){super(),this.connectionString=e,this.db=null,this.lrs=l,this.use("/public",n.static("simpleUI/public"));var c=a(176);c.registerHelper("json",a(177)),c.registerHelper("actorDisplay",a(178)),c.registerHelper("verbDisplay",a(179)),c.registerHelper("objectDisplay",a(180)),c.registerHelper("timeAgo",a(181));let d=a(183);var u={defaultLayout:i.join("./simpleUI/views/layouts/layout.html"),layoutsDir:i.join("./simpleUI/views/layouts"),partialsDir:i.join("./simpleUI/views/partials"),extname:"html"};this.set("views",t+"/views");{let e=c.handlebars;e.templates={};for(let t=0;t<d.keys().length;t++){let a=d.keys()[t],n=d(a),r=e.template(n);e.templates[a]=r,e.templates[i.basename(a).replace(".html.compiled.js","")]=r,e.templates[i.basename(a).replace(".compiled.js","")]=r,e.partials[i.basename(a).replace(".html.compiled.js","")]=r,e.partials[i.basename(a).replace(".compiled.js","")]=r}this.use(function(t,a,n){a.render=function(t,i){i=Object.assign({},a.locals,i),/html$/.test(t)||(t+=".html"),t="./"+t+".compiled.js";let r=e.templates[t];if(!r)return n("Template not found");i.layout||(i.layout="layout"),/html$/.test(i.layout)||(i.layout+=".html");let s=e.templates["./layouts/"+i.layout+".compiled.js"],o=r(i);i.body=o,a.send(s(i))},n()})}let m=c.express3(u);this.engine("html",m),this.set("view engine","html"),this.use(function(e,t,a){t.locals.basePath=e.app.path(),a()});let p=this;r.connect(e,(e,t)=>{this.get("/",function(e,t,a){t.redirect(e.app.path()+"/statements/0")}),this.get("/statements/:page",async function(e,t,a){if(s.parseJSONQuery(e.query||{}),!p.lrs||!p.lrs.dal)return t.send("dal not ready");e.query.page=e.params.page;let n=await p.lrs.dal.find(e.query,{}),i="";o.parse(e.url).query&&(i="?"+o.parse(e.url).query),t.render("statementViewer",{statements:n,next:parseInt(e.params.page)+1+i})})})}}}).call(t,"/")},function(e,t){e.exports=require("express-hbs")},function(e,t){e.exports=function(e){return JSON.stringify(e,null,4)}},function(e,t){e.exports=function(e){return e&&!e.actor&&(e={actor:e}),e.actor.name?e.actor.name:e.actor.account&&e.actor.account.name?e.actor.account.name:e.actor.mbox?e.actor.mbox:"Unknown Actor"}},function(e,t){e.exports=function(e){return e&&!e.verb&&(e={verb:e}),e.verb.display&&e.verb.display["en-US"]?e.verb.display["en-US"]:e.verb.display&&e.verb.display.en?e.verb.display.en:e.verb.id}},function(e,t){e.exports=function e(t){return t&&!t.object&&(t={object:t}),t.object.definition&&t.object.definition.name?t.object.definition.name["en-US"]||t.object.definition.name.en:t.object.definition&&t.object.definition.description?t.object.definition.description["en-US"]||t.object.definition.description.en:"SubStatement"==t.object.objectType?e(t.object)?"Sub-Statement: "+e(t.object):" a sub statement":t.object.id?t.object.id:void 0}},function(e,t,a){let n=new(a(182));e.exports=function(e){return n.ago(new Date(e))}},function(e,t){e.exports=require("time-ago")},function(e,t,a){e.exports=a(184)},function(e,t,a){var n={"./layouts/layout.html.compiled.js":185,"./partials/footer.html.compiled.js":186,"./partials/header.html.compiled.js":187,"./statementViewer.html.compiled.js":188};function i(e){return a(r(e))}function r(e){var t=n[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}i.keys=function(){return Object.keys(n)},i.resolve=r,e.exports=i,i.id=184},function(e,t){e.exports={compiler:[7,">= 4.0.0"],main:function(e,t,a,n,i){var r,s,o=null!=t?t:{},l=a.helperMissing,c="function",d=e.escapeExpression;return'<!DOCTYPE html>\r\n<html lang="en">\r\n\r\n<head>\r\n <title>Veracity LRS</title>\r\n <meta charset="utf-8">\r\n <meta name="format-detection" content="telephone=no" />\r\n \r\n <link rel="icon" href="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/images/favicon.ico" type="image/x-icon">\r\n <link rel="stylesheet" href="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/bootstrap-3.3.6-dist/css/bootstrap.css">\r\n \x3c!-- link rel="stylesheet" href="/public/css/bootstrap-material-design.min.css" --\x3e\r\n <link rel="stylesheet" href="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/css/bootstrap-material-design.min.css"></link>\r\n <link href="https://fonts.googleapis.com/css?family=Titillium+Web:400,700" rel="stylesheet">\r\n <link rel="stylesheet" href="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/css/grid.css">\r\n <link rel="stylesheet" href="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/css/style.css">\r\n <link rel="stylesheet" href="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/css/sidebar.css">\r\n <script src="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/js/jquery.js"><\/script>\r\n <script src="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/js/material.min.js"><\/script>\r\n <script src="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/js/ripples.min.js"><\/script>\r\n <script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"><\/script>\r\n <script src="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/js/jquery-migrate-1.2.1.js"><\/script>\r\n \x3c!--[if lt IE 9]> \r\n <html class="lt-ie9">\r\n <div style=\' clear: both; text-align:center; position: relative;\'>\r\n <a href="/public/http://windows.microsoft.com/en-US/internet-explorer/..">\r\n <img src="/public/images/ie8-panel/warning_bar_0000_us.jpg" border="0" height="42" width="820"\r\n alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today."/>\r\n </a>\r\n </div>\r\n <script src="/public/js/html5shiv.js"><\/script>\r\n <![endif]--\x3e\r\n <script src=\''+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/js/device.min.js\'><\/script>\r\n \r\n</head>\r\n\r\n<body>\r\n <div class="page">\r\n'+(null!=(r=e.invokePartial(n.header,t,{name:"header",hash:{root_path:null!=t?t.root_path:t},data:i,indent:" ",helpers:a,partials:n,decorators:e.decorators}))?r:"")+' \x3c!--========================================================\r\n CONTENT\r\n =========================================================--\x3e\r\n \x3c!-- Sidebar --\x3e\r\n <div class="wrapper">\r\n <nav id="sidebar">\r\n \x3c!-- Sidebar Links --\x3e\r\n <ul class="list-unstyled components">\r\n <li>\r\n \x3c!-- Link with dropdown items --\x3e\r\n <a href="#dataSubmenu" data-toggle="collapse" aria-expanded="true"><i class="fa fa-database"></i>xAPI Data</a>\r\n <ul class="collapse in list-unstyled" id="dataSubmenu">\r\n <li class=""><a href="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/statements/0">Statements</a></li>\r\n </ul>\r\n </li>\r\n </ul>\r\n </nav>\r\n <main id="content" class="sidebarOpen" >\r\n \r\n\r\n '+(null!=(r=typeof(s=null!=(s=a.body||(null!=t?t.body:t))?s:l)===c?s.call(o,{name:"body",hash:{},data:i}):s)?r:"")+"\r\n"+(null!=(r=e.invokePartial(n.footer,t,{name:"footer",data:i,indent:" \t",helpers:a,partials:n,decorators:e.decorators}))?r:"")+' </main>\r\n \x3c!--========================================================\r\n FOOTER\r\n =========================================================--\x3e\r\n </div>\r\n </div>\r\n <script src="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+'/public/bootstrap-3.3.6-dist/js/bootstrap.min.js"><\/script>\r\n <script src="'+d(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:l)===c?s.call(o,{name:"basePath",hash:{},data:i}):s)+"/public/js/bootstrap-confirmation.min.js\"><\/script>\r\n \r\n <script type=\"text/javascript\">\r\n $('[data-toggle=\"confirmation\"]').confirmation({\r\n href: function(elem) {\r\n return $(elem).attr('href');\r\n }\r\n });\r\n <\/script>\r\n <script type=\"text/javascript\">\r\n $(document).ready(function() {\r\n $.material.init()\r\n\r\n\r\n \r\n $('#sidebar').find(\"a\").each((j,i)=>{\r\n\r\n if($(i).attr('href') == window.location.pathname)\r\n {\r\n $(i).parent().addClass('active') ;\r\n $(i).parent().parent().addClass('in') ;\r\n }\r\n })\r\n })\r\n <\/script>\r\n</body>\r\n\r\n</html>"},usePartial:!0,useData:!0}},function(e,t){e.exports={compiler:[7,">= 4.0.0"],main:function(e,t,a,n,i){return'<footer>\n <section class="footer-section1">\n <div class="container-fluid">\n <div class="row">\n <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 wow fadeIn">\n <div class="brand">\n <h1 class="brand_name">\n <a href="https://github.com/veracity-tech/vtc-lrs">VeracityLRS Lite</a>\n </h1>\n </div>\n <p><a href="https://www.veracity.it">VeracityLRS® 2018.</a></p>\n <p>Non-commercial use only.</p>\n </div>\n\n \x3c!-- <div class="col-lg-2 col-md-3 col-sm-3 col-xs-12 wow fadeIn">\n <h3>Navigation</h3>\n <ul class="list2">\n <li><a href="/public/./">Home</a></li>\n <li class="active"><a href="/public/index-1.html">About</a></li>\n <li><a href="/public/index-2.html">Services</a></li>\n <li><a href="/public/index-3.html">News</a></li>\n <li><a href="/public/index-4.html">Contacts</a></li>\n </ul>\n </div>\n\n <div class="col-lg-2 col-md-3 col-sm-3 col-xs-12 wow fadeIn">\n <h3>Services</h3>\n <ul class="list2">\n <li><a href="/public/#">Tablet Repair</a></li>\n <li><a href="/public/#">Computer Repair</a></li>\n <li><a href="/public/#">Laptop Repair</a></li>\n <li><a href="/public/#">Mobile Repair</a></li>\n </ul>\n </div> --\x3e\n\n \n </div>\n\n\n </div>\n \n </div>\n </section>\n\n <section class="footer-section2">\n <div class="container">\n \n </div>\n </section>\n </footer>'},useData:!0}},function(e,t){e.exports={1:function(e,t,a,n,i){return' style="width: 100%" '},compiler:[7,">= 4.0.0"],main:function(e,t,a,n,i){var r,s,o,l=' \x3c!--========================================================\n HEADER\n =========================================================--\x3e\n\n <header style="position: fixed; top:0; width: 100%; z-index: 100000; margin-bottom: 200px">\n\n\n <div id="stuck_container" class="stuck_container" >\n <div class="container-fluid" ';return s=null!=(s=a.wide||(null!=t?t.wide:t))?s:a.helperMissing,o={name:"wide",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i},r="function"==typeof s?s.call(null!=t?t:{},o):s,a.wide||(r=a.blockHelperMissing.call(t,r,o)),null!=r&&(l+=r),l+'>\n <div class="brand">\n <h1 class="brand_name">\n <a href="/ui/">Veracity <span>LRS Lite</span></a>\n </h1>\n </div>\n \n </div>\n </div>\n </header>\n <div style="height: 94px"></div>'},useData:!0}},function(e,t){e.exports={1:function(e,t,a,n,i){var r,s=null!=t?t:{},o=a.helperMissing,l="function",c=e.escapeExpression;return'\r\n <div class="row marTop3 statement">\r\n <div class="col-md-1"><em class="actor"> <a aria-expanded="false" data-toggle="collapse" href="#'+c(typeof(r=null!=(r=a.id||(null!=t?t.id:t))?r:o)===l?r.call(s,{name:"id",hash:{},data:i}):r)+'" class="btn"></a> </em> </div>\r\n <div class="col-md-2"><em class="actor"> '+c((a.actorDisplay||t&&t.actorDisplay||o).call(s,t,{name:"actorDisplay",hash:{},data:i}))+' </em> </div>\r\n <div class="col-md-2"><em> '+c((a.verbDisplay||t&&t.verbDisplay||o).call(s,t,{name:"verbDisplay",hash:{},data:i}))+' </em> </div>\r\n <div class="col-md-4"><em class="actor"> '+c((a.objectDisplay||t&&t.objectDisplay||o).call(s,t,{name:"objectDisplay",hash:{},data:i}))+' </em></div>\r\n <div class="col-md-3"><em class="">'+c((a.timeAgo||t&&t.timeAgo||o).call(s,null!=t?t.timestamp:t,{name:"timeAgo",hash:{},data:i}))+' </em></div>\r\n </div>\r\n <pre class="collapse" id="'+c(typeof(r=null!=(r=a.id||(null!=t?t.id:t))?r:o)===l?r.call(s,{name:"id",hash:{},data:i}):r)+'"><code>'+c((a.json||t&&t.json||o).call(s,t,{name:"json",hash:{},data:i}))+"</code></pre> "},compiler:[7,">= 4.0.0"],main:function(e,t,a,n,i){var r,s,o,l=null!=t?t:{},c=a.helperMissing,d="function",u=e.escapeExpression,m=e.lambda,p='\r\n\r\n\t\t\r\n<link rel="stylesheet" type="text/css" href="'+u(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:c)===d?s.call(l,{name:"basePath",hash:{},data:i}):s)+'/public/css/formstyle.css">\r\n<main>\r\n <link rel="stylesheet" type="text/css" href="'+u(typeof(s=null!=(s=a.basePath||(null!=t?t.basePath:t))?s:c)===d?s.call(l,{name:"basePath",hash:{},data:i}):s)+'/public/css/viewer.css">\r\n <section class="well bg0">\r\n <div class="container-fluid">\r\n <div class="row marTop3">\r\n <div class="form-group" for="agent">\r\n <label for="agent" class="col-md-3 control-label">Agent</label>\r\n <div class="col-md-9 ">\r\n <div class="input-group">\r\n <input name="agent" id="agent" type="text" class="form-control" value="'+u(m(null!=(r=null!=t?t.query:t)?r.agent:r,t))+'">\r\n </div>\r\n <p class="help-block ">An Actor identifier in JSON.</p>\r\n </div>\r\n </div>\r\n <div class="form-group" for="related_agents">\r\n <label for="related_agents" class="col-md-3 control-label">Related Agents</label>\r\n <div class="col-md-9 ">\r\n <div class="input-group">\r\n <input name="related_agents" id="related_agents" type="checkbox" class="form-control" value="'+u(m(null!=(r=null!=t?t.query:t)?r.related_agents:r,t))+'">\r\n </div>\r\n <p class="help-block ">Should the LRS return statements related to this agent.</p>\r\n </div>\r\n </div>\r\n <div class="form-group" for="verb">\r\n <label for="verb" class="col-md-3 control-label">Verb</label>\r\n <div class="col-md-9 ">\r\n <div class="input-group">\r\n <input name="verb" id="verb" type="text" class="form-control" value="'+u(m(null!=(r=null!=t?t.query:t)?r.verb:r,t))+'">\r\n </div>\r\n <p class="help-block ">A verb URI</p>\r\n </div>\r\n </div>\r\n <div class="form-group" for="activity">\r\n <label for="activity" class="col-md-3 control-label">Activity</label>\r\n <div class="col-md-9 ">\r\n <div class="input-group">\r\n <input name="activity" id="activity" type="text" class="form-control" value="'+u(m(null!=(r=null!=t?t.query:t)?r.activity:r,t))+'">\r\n </div>\r\n <p class="help-block ">An activity identifier ID.</p>\r\n </div>\r\n </div>\r\n <div class="form-group" for="related_activities">\r\n <label for="related_activities" class="col-md-3 control-label">Related Activities</label>\r\n <div class="col-md-9 ">\r\n <div class="input-group">\r\n <input name="related_activities" id="related_activities" type="checkbox" class="form-control" value="'+u(m(null!=(r=null!=t?t.query:t)?r.related_activities:r,t))+'">\r\n </div>\r\n <p class="help-block ">Should the LRS return statements related to this activity.</p>\r\n </div>\r\n </div>\r\n <div class="form-group" for="registration">\r\n <label for="registration" class="col-md-3 control-label">Registration</label>\r\n <div class="col-md-9 ">\r\n <div class="input-group">\r\n <input name="registration" id="registration" type="text" class="form-control" value="'+u(m(null!=(r=null!=t?t.query:t)?r.registration:r,t))+'">\r\n </div>\r\n <p class="help-block ">An registration identifier UUID.</p>\r\n </div>\r\n </div>\r\n <div class="form-group" for="since">\r\n <label for="since" class="col-md-3 control-label">Since</label>\r\n <div class="col-md-9 ">\r\n <div class="input-group">\r\n <input name="since" id="since" type="date" class="form-control" value="'+u(m(null!=(r=null!=t?t.query:t)?r.since:r,t))+'">\r\n </div>\r\n <p class="help-block ">Only retrieve statements that happened after this date.</p>\r\n </div>\r\n </div>\r\n <div class="form-group" for="until">\r\n <label for="until" class="col-md-3 control-label">Until</label>\r\n <div class="col-md-9 ">\r\n <div class="input-group">\r\n <input name="until" id="until" type="date" class="form-control" value="'+u(m(null!=(r=null!=t?t.query:t)?r.until:r,t))+'">\r\n </div>\r\n <p class="help-block ">Only retrieve statements that happened before this date.</p>\r\n </div>\r\n </div>\r\n <div class="form-group">\r\n <div class="col-md-12 ">\r\n <div class="input-group">\r\n <div id="submit" class="btn btn-block btn-primary">Search</div>\r\n </div>\r\n </div>\r\n </div>\r\n <script type="text/javascript">\r\n $(\'#submit\').click(function() {\r\n let query = {\r\n verb: null || $("#verb").val(),\r\n activity: null || $("#activity").val(),\r\n limit: null || $("#limit").val(),\r\n until: null || $("#until").val(),\r\n since: null || $("#since").val(),\r\n registration: null || $("#registration").val(),\r\n agent: null || $("#agent").val(),\r\n related_agents: $("#related_agents")[0].checked ? true : null,\r\n related_activities: $("#related_activities")[0].checked ? true : null\r\n }\r\n for(let i in query)\r\n {\r\n if(!query[i])\r\n delete query[i];\r\n }\r\n console.log(query)\r\n var loc = window.location;\r\n let location = window.location.pathname.split("/")\r\n location.pop();\r\n \r\n location.push("0")\r\n window.location = location.join("/") + "?" + $.param(query)\r\n\r\n })\r\n <\/script>\r\n </div>\r\n <h2>Statements</h2> ';return s=null!=(s=a.statements||(null!=t?t.statements:t))?s:c,o={name:"statements",hash:{},fn:e.program(1,i,0),inverse:e.noop,data:i},r=typeof s===d?s.call(l,o):s,a.statements||(r=a.blockHelperMissing.call(t,r,o)),null!=r&&(p+=r),p+'\r\n <div class="row marTop3 ">\r\n <div class="col-md-12 col-sm-12 col-xs-12 ">\r\n <a href="./'+u(typeof(s=null!=(s=a.next||(null!=t?t.next:t))?s:c)===d?s.call(l,{name:"next",hash:{},data:i}):s)+'" class="btn" style="width: 100%">More Statements</a>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n</main>\r\n\r\n'},useData:!0}},function(e,t,a){const n=a(70).EventEmitter,i=a(3),r=a(11),s=a(9).validatePayload;e.exports=class extends n{constructor(e){super(),this.strict=!0,this.verboseLogs=!0,this.preferRead=!1,this.active=!0,this.uuid=e,this.dal=null}async getStatement(e){if(!this.dal)throw new Error("LRS not ready");let t=await this.dal.find({statementId:e});return console.log("ret",t,e),t&&(t=r.prepStatementForDisplay(t)),t}async insertStatement(e){if(!this.dal)throw new Error("LRS not ready");const t=s(e);if(!t.valid)throw console.log(t.error),new Error(t.error);e.id||(e.id=i.v4());let a=null;try{a=await this.dal.store([e],e.authority,null)}catch(e){throw new Error(e)}if(a)try{this.emit("statementStored",[e.id])}catch(e){}return!0}}},function(e,t){e.exports=require("dotenv")}]);