!function(t){if("function"==typeofbootstrap)bootstrap("nedb",t);elseif("object"==typeofexports)module.exports=t();elseif("function"==typeofdefine&&define.amd)define(t);elseif("undefined"!=typeofses){if(!ses.ok())return;ses.makeNedb=t}else"undefined"!=typeofwindow?window.Nedb=t():global.Nedb=t()}(function(){vart;returnfunction(t,e,n){functionr(n,o){if(!e[n]){if(!t[n]){vara="function"==typeofrequire&&require;if(!o&&a)returna(n,!0);if(i)returni(n,!0);thrownewError("Cannot find module '"+n+"'")}varu=e[n]={exports:{}};t[n][0].call(u.exports,function(e){vari=t[n][1][e];returnr(i?i:e)},u,u.exports)}returne[n].exports}for(vari="function"==typeofrequire&&require,o=0;o<n.length;o++)r(n[o]);returnr}({1:[function(t,e,n){functionr(t,e){if(t.indexOf)returnt.indexOf(e);for(varn=0;n<t.length;n++)if(e===t[n])returnn;return-1}vari=t("__browserify_process");i.EventEmitter||(i.EventEmitter=function(){});varo=n.EventEmitter=i.EventEmitter,a="function"==typeofArray.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},u=10;o.prototype.setMaxListeners=function(t){this._events||(this._events={}),this._events.maxListeners=t},o.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||a(this._events.error)&&!this._events.error.length))throwarguments[1]instanceofError?arguments[1]:newError("Uncaught, unspecified 'error' event.");if(!this._events)return!1;vare=this._events[t];if(!e)return!1;if("function"==typeofe){switch(arguments.length){case1:e.call(this);break;case2:e.call(this,arguments[1]);break;case3:e.call(this,arguments[1],arguments[2]);break;default:varn=Array.prototype.slice.call(arguments,1);e.apply(this,n)}return!0}if(a(e)){for(varn=Array.prototype.slice.call(arguments,1),r=e.slice(),i=0,o=r.length;o>i;i++)r[i].apply(this,n);return!0}return!1},o.prototype.addListener=function(t,e){if("function"!=typeofe)thrownewError("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",t,e),this._events[t])if(a(this._events[t])){if(!this._events[t].warned){varn;n=void0!==this._events.maxListeners?this._events.maxListeners:u,n&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}this._events[t].push(e)}elsethis._events[t]=[this._events[t],e];elsethis._events[t]=e;returnthis},o.prototype.on=o.prototype.addListener,o.prototype.once=function(t,e){varn=this;returnn.on(t,functionr(){n.removeListener(t,r),e.apply(this,arguments)}),this},o.prototype.removeListener=function(t,e){if("function"!=typeofe)thrownewError("removeListener only takes instances of Function");if(!this._events||!this._events[t])returnthis;varn=this._events[t];if(a(n)){vari=r(n,e);if(0>i)returnthis;n.splice(i,1),0==n.length&&deletethis._events[t]}elsethis._events[t]===e&&deletethis._events[t];returnthis},o.prototype.removeAllListeners=function(t){return0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},o.prototype.listeners=function(t){returnthis._events||(this._events={}),this._events[t]||(this._events[t]=[]),a(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]},o.listenerCount=function(t,e){varn;returnn=t._events&&t._events[e]?"function"==typeoft._events[e]?1:t._events[e].length:0}},{__browserify_process:4}],2:[function(t,e,n){functionr(t,e){for(varn=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);returnn}functioni(t,e){for(varn=0,r=t.length;r>=0;r--){vari=t[r];"."==i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");returnt}varo=t("__browserify_process"),a=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;n.resolve=function(){for(vart="",e=!1,n=arguments.length;n>=-1&&!e;n--){vara=n>=0?arguments[n]:o.cwd();"string"==typeofa&&a&&(t=a+"/"+t,e="/"===a.charAt(0))}returnt=i(r(t.split("/"),function(t
}),u.waterfall([u.apply(n.ensureFileDoesntExist,o.tempFilename),u.apply(n.ensureFileDoesntExist,o.oldFilename),function(t){i.exists(o.filename,function(e){returne?(i.rename(o.filename,o.oldFilename,function(e){returnt(e)}),void0):t()})},function(t){i.writeFile(o.tempFilename,r,function(e){returnt(e)})},function(t){i.rename(o.tempFilename,o.filename,function(e){returnt(e)})},u.apply(n.ensureFileDoesntExist,o.oldFilename)],function(t){returnt?e(t):e(null)}),void0)},n.prototype.compactDatafile=function(){this.db.executor.push({"this":this,fn:this.persistCachedDatabase,arguments:[]})},n.prototype.setAutocompactionInterval=function(t){vare=this,n=5e3,r=Math.max(t||0,n);this.stopAutocompaction(),this.autocompactionIntervalId=setInterval(function(){e.compactDatafile()},r)},n.prototype.stopAutocompaction=function(){this.autocompactionIntervalId&&clearInterval(this.autocompactionIntervalId)},n.prototype.persistNewState=function(t,e){varn=this,r="",o=e||function(){};returnn.inMemoryOnly?o(null):(t.forEach(function(t){r+=a.serialize(t)+"\n"}),0===r.length?o(null):(i.appendFile(n.filename,r,"utf8",function(t){returno(t)}),void0))},n.treatRawData=function(t){vare,n=t.split("\n"),r={},i=[],o={};for(e=0;e<n.length;e+=1){varu;try{u=a.deserialize(n[e]),u._id?u.$$deleted===!0?deleter[u._id]:r[u._id]=u:u.$$indexCreated&&void0!=u.$$indexCreated.fieldName?o[u.$$indexCreated.fieldName]=u.$$indexCreated:"string"==typeofu.$$indexRemoved&&deleteo[u.$$indexRemoved]}catch(s){}}returnObject.keys(r).forEach(function(t){i.push(r[t])}),{data:i,indexes:o}},n.prototype.ensureDatafileIntegrity=function(t){vare=this;i.exists(e.filename,function(n){returnn?t(null):(i.exists(e.oldFilename,function(n){returnn?(i.rename(e.oldFilename,e.filename,function(e){returnt(e)}),void0):i.writeFile(e.filename,"","utf8",function(e){t(e)})}),void0)})},n.prototype.loadDatabase=function(t){vare=t||function(){},r=this;returnr.db.resetIndexes(),r.inMemoryOnly?e(null):(u.waterfall([function(t){n.ensureDirectoryExists(o.dirname(r.filename),function(){r.ensureDatafileIntegrity(function(){i.readFile(r.filename,"utf8",function(e,i){if(e)returnt(e);varo=n.treatRawData(i);Object.keys(o.indexes).forEach(function(t){r.db.indexes[t]=news(o.indexes[t])});try{r.db.resetIndexes(o.data)}catch(a){returnr.db.resetIndexes(),t(a)}r.db.persistence.persistCachedDatabase(t)})})})}],function(t){returnt?e(t):(r.db.executor.processBuffer(),e(null))}),void0)},e.exports=n},{"./customUtils":6,"./indexes":9,"./model":10,"./storage":12,__browserify_process:4,async:13,path:2}],12:[function(t,e){functionn(t,e){return"undefined"==typeoflocalStorage?(console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!"),e()):null!==localStorage.getItem(t)?e(!0):e(!1)}functionr(t,e,n){return"undefined"==typeoflocalStorage?(console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!"),n()):(null===localStorage.getItem(t)?localStorage.removeItem(e):(localStorage.setItem(e,localStorage.getItem(t)),localStorage.removeItem(t)),n())}functioni(t,e,n,r){return"undefined"==typeoflocalStorage?(console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!"),r()):("function"==typeofn&&(r=n),localStorage.setItem(t,e),r())}functiono(t,e,n,r){if("undefined"==typeoflocalStorage)returnconsole.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!"),r();"function"==typeofn&&(r=n);vari=localStorage.getItem(t)||"";returni+=e,localStorage.setItem(t,i),r()}functiona(t,e,n){if("undefined"==typeoflocalStorage)returnconsole.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!"),n();"function"==typeofe&&(n=e);varr=localStorage.getItem(t)||"";returnn(null,r)}functionu(t,e){return"undefined"==typeoflocalStorage?(console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!"),e()):(localStorage.removeItem(t),e())}functions(t,e){returne()}e.exports.exists=n,e.exports.rename=r,e.exp