entity-serves
Version:
Backend for entity.works, a Dead by Daylight wiki.
6 lines • 42.9 kB
JavaScript
/*!
*** EntityServes 3.9.0
*** Copyright © 2020, Jaid <jaid.jsx@gmail.com> (https://github.com/Jaid)
*** @license MIT
!*/!function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=100)}([function(t,r){t.exports=require("sequelize")},function(t,r,e){"use strict";e.r(r),e.d(r,"schema",(function(){return a}));var n=e(0),o=e.n(n),i=e(10);class u extends o.a.Model{static associate(){}async createLogin(){return await i.default.create({UserId:this.id})}}const a={title:{type:o.a.STRING(64),allowNull:!1},name:{type:o.a.STRING(64),allowNull:!1,unique:!0},password:{type:o.a.CHAR(60),allowNull:!1}};r.default=u},function(t,r,e){"use strict";e.r(r),e.d(r,"schema",(function(){return c})),e.d(r,"modelOptions",(function(){return s}));var n=e(55),o=e(0),i=e.n(o),u=e(33);class a extends i.a.Model{static associate(t){a.belongsTo(t.User,{foreignKey:{allowNull:!1}})}static async addBuild(t,r,e){const o=u.a[t](e);return await a.create({type:t,UserId:r,data:o,seoLinkId:Object(n.paramCase)(e.title||Object(n.paramCase)(t))})}}const c={type:{type:i.a.STRING(32),allowNull:!1},data:{type:i.a.JSONB,allowNull:!1},seoLinkId:i.a.STRING},s={paranoid:!0};r.default=a},function(t,r,e){var n=e(57),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,r){var e=Array.isArray;t.exports=e},function(t,r){t.exports=require("has-content")},function(t,r){t.exports=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}},function(t,r){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,r,e){"use strict";e.d(r,"b",(function(){return c}));var n=e(15),o=e.n(n),i=e(91),u=e.n(i);const a=new o.a({name:"EntityServes",version:"3.9.0",insecurePort:13251,database:"entityServes",useGot:!0,databaseExtensions:"hstore",koaSession:{key:"abc"},configSetup:{defaults:u()}}),c=a.logger;a.got,a.config,a.appFolder,a.koa,r.a=a},function(t,r,e){var n=e(115),o=e(120);t.exports=function(t,r){var e=o(t,r);return n(e)?e:void 0}},function(t,r,e){"use strict";e.r(r),e.d(r,"schema",(function(){return u}));var n=e(0),o=e.n(n);class i extends o.a.Model{static associate(t){i.belongsTo(t.User,{foreignKey:{allowNull:!1}})}}const u={apiKey:{type:o.a.UUID,defaultValue:o.a.UUIDV4,allowNull:!1,unique:!0}};r.default=i},function(t,r,e){var n=e(12),o=e(116),i=e(117),u=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},function(t,r,e){var n=e(3).Symbol;t.exports=n},function(t,r,e){var n=e(4),o=e(49),i=e(166),u=e(169);t.exports=function(t,r){return n(t)?t:o(t,r)?[t]:i(u(t))}},function(t,r,e){var n=e(31);t.exports=function(t){if("string"==typeof t||n(t))return t;var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},function(t,r){t.exports=require("jaid-core")},function(t,r,e){var n=e(70),o=e(159),i=e(185),u=e(190),a=i((function(t,r){if(null==t)return[];var e=r.length;return e>1&&u(t,r[0],r[1])?r=[]:e>2&&u(r[0],r[1],r[2])&&(r=[r[0]]),o(t,n(r,1),[])}));t.exports=a},function(t,r,e){var n=e(66),o=e(144),i=e(18);t.exports=function(t){return i(t)?n(t):o(t)}},function(t,r,e){var n=e(56),o=e(45);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},function(t,r,e){var n=e(50),o=e(78);t.exports=function(t,r,e,i){var u=!e;e||(e={});for(var a=-1,c=r.length;++a<c;){var s=r[a],f=i?i(e[s],t[s],s,e,t):void 0;void 0===f&&(f=t[s]),u?o(e,s,f):n(e,s,f)}return e}},function(t,r,e){var n=e(149);t.exports=function(t){return t&&t.length?n(t):[]}},function(t,r){t.exports=require("filter-nil")},function(t,r,e){var n=e(105),o=e(106),i=e(107),u=e(108),a=e(109);function c(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},function(t,r,e){var n=e(24);t.exports=function(t,r){for(var e=t.length;e--;)if(n(t[e][0],r))return e;return-1}},function(t,r){t.exports=function(t,r){return t===r||t!=t&&r!=r}},function(t,r,e){var n=e(9)(Object,"create");t.exports=n},function(t,r,e){var n=e(129);t.exports=function(t,r){var e=t.__data__;return n(r)?e["string"==typeof r?"string":"hash"]:e.map}},function(t,r){var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&r>t}},function(t,r){t.exports=function(t){return function(r){return t(r)}}},function(t,r,e){var n=e(146),o=e(37),i=e(147),u=e(69),a=e(148),c=e(11),s=e(58),f=s(n),l=s(o),p=s(i),v=s(u),d=s(a),y=c;(n&&"[object DataView]"!=y(new n(new ArrayBuffer(1)))||o&&"[object Map]"!=y(new o)||i&&"[object Promise]"!=y(i.resolve())||u&&"[object Set]"!=y(new u)||a&&"[object WeakMap]"!=y(new a))&&(y=function(t){var r=c(t),e="[object Object]"==r?t.constructor:void 0,n=e?s(e):"";if(n)switch(n){case f:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case v:return"[object Set]";case d:return"[object WeakMap]"}return r}),t.exports=y},function(t,r,e){var n=e(13),o=e(14);t.exports=function(t,r){for(var e=0,i=(r=n(r,t)).length;null!=t&&i>e;)t=t[o(r[e++])];return e&&e==i?t:void 0}},function(t,r,e){var n=e(11),o=e(7);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},function(t,r){t.exports=function(t){return t}},function(t,r,e){"use strict";var n=e(20),o=e.n(n),i=e(16),u=e.n(i),a=e(21),c=e.n(a),s=e(5),f=e.n(s);function l(t,r){f()(t.title)&&(r.title=t.title.trim()),f()(t.description)&&(r.description=t.description.trim())}r.a={survivorLoadout(t){const r={},e=[t.perk1,t.perk2,t.perk3,t.perk4],n=u()(o()(c()(e)));for(let t=0;4!==t;t++)n.length>t&&(r[`perk${t+1}`]=n[t].trim());if(f()(t.offering)&&(r.offering=t.offering.trim()),f()(t.survivor)&&(r.survivor=t.survivor.trim()),f()(t.item)){r.item=t.item.trim();const e=[t.addOn1,t.addOn2],n=u()(o()(c()(e)));for(let t=0;2!==t;t++)n.length>t&&(r[`addOn${t+1}`]=n[t].trim())}return l(t,r),r},killerLoadout(t){const r={},e=[t.perk1,t.perk2,t.perk3,t.perk4],n=u()(o()(c()(e)));for(let t=0;4!==t;t++)n.length>t&&(r[`perk${t+1}`]=n[t].trim());if(f()(t.offering)&&(r.offering=t.offering.trim()),f()(t.killer)){r.killer=t.killer.trim();const e=[t.addOn1,t.addOn2],n=u()(o()(c()(e)));for(let t=0;2!==t;t++)n.length>t&&(r[`addOn${t+1}`]=n[t].trim())}return l(t,r),r},killerTierList(t){const r={tiers:{}};l(t,r);const e=u()(Object.keys(t.tiers));for(const n of e){const e=n.trim();r.tiers[e]={tier:t.tiers[n].tier},f()(t.tiers[n].comment)&&(r.tiers[e].comment=t.tiers[n].comment.trim())}return r}}},function(t,r){t.exports=require("bcrypt")},function(t,r,e){var n=e(104),o=e(7);t.exports=function t(r,e,i,u,a){return r===e||(null==r||null==e||!o(r)&&!o(e)?r!=r&&e!=e:n(r,e,i,u,t,a))}},function(t,r,e){var n=e(22),o=e(110),i=e(111),u=e(112),a=e(113),c=e(114);function s(t){var r=this.__data__=new n(t);this.size=r.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=u,s.prototype.has=a,s.prototype.set=c,t.exports=s},function(t,r,e){var n=e(9)(e(3),"Map");t.exports=n},function(t,r,e){var n=e(121),o=e(128),i=e(130),u=e(131),a=e(132);function c(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},function(t,r){t.exports=function(t){var r=-1,e=Array(t.size);return t.forEach((function(t){e[++r]=t})),e}},function(t,r){t.exports=function(t,r){for(var e=-1,n=r.length,o=t.length;++e<n;)t[o+e]=r[e];return t}},function(t,r,e){var n=e(139),o=e(65),i=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols,a=u?function(t){return null==t?[]:(t=Object(t),n(u(t),(function(r){return i.call(t,r)})))}:o;t.exports=a},function(t,r,e){var n=e(141),o=e(7),i=Object.prototype,u=i.hasOwnProperty,a=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(t){return o(t)&&u.call(t,"callee")&&!a.call(t,"callee")};t.exports=c},function(t,r,e){(function(t){var n=e(3),o=e(142),i=r&&!r.nodeType&&r,u=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=u&&u.exports===i?n.Buffer:void 0,c=(a?a.isBuffer:void 0)||o;t.exports=c}).call(this,e(44)(t))},function(t,r){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,r){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&9007199254740991>=t}},function(t,r,e){(function(t){var n=e(57),o=r&&!r.nodeType&&r,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,u=i&&i.exports===o&&n.process,a=function(){try{return i&&i.require&&i.require("util").types||u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=a}).call(this,e(44)(t))},function(t,r){var e=Object.prototype;t.exports=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}},function(t,r){t.exports=function(t,r){for(var e=-1,n=null==t?0:t.length,o=Array(n);++e<n;)o[e]=r(t[e],e,t);return o}},function(t,r,e){var n=e(4),o=e(31),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=function(t,r){if(n(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!o(t))||u.test(t)||!i.test(t)||null!=r&&t in Object(r)}},function(t,r,e){var n=e(78),o=e(24),i=Object.prototype.hasOwnProperty;t.exports=function(t,r,e){var u=t[r];i.call(t,r)&&o(u,e)&&(void 0!==e||r in t)||n(t,r,e)}},function(t,r,e){var n=e(68)(Object.getPrototypeOf,Object);t.exports=n},function(t,r,e){var n=e(62);t.exports=function(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}},function(t,r,e){"use strict";e.r(r),e.d(r,"schema",(function(){return a}));var n=e(0),o=e.n(n),i=e(10);class u extends o.a.Model{static associate(t){u.belongsTo(t.User)}async createLogin(){return await i.default.create({UserId:this.id})}}const a={type:{type:o.a.STRING(64),allowNull:!1},payload:o.a.JSONB,time:{type:o.a.INTEGER,allowNull:!1},result:o.a.JSONB};r.default=u},function(t,r){t.exports=function(t){var r=null==t?0:t.length;return r?t[r-1]:void 0}},function(t,r){t.exports=require("param-case")},function(t,r,e){var n=e(11),o=e(6);t.exports=function(t){if(!o(t))return!1;var r=n(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}},function(t,r){var e="object"==typeof global&&global&&global.Object===Object&&global;t.exports=e},function(t,r){var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,r,e){var n=e(60),o=e(135),i=e(61);t.exports=function(t,r,e,u,a,c){var s=1&e,f=t.length,l=r.length;if(!(f==l||s&&l>f))return!1;var p=c.get(t);if(p&&c.get(r))return p==r;var v=-1,d=!0,y=2&e?new n:void 0;for(c.set(t,r),c.set(r,t);++v<f;){var b=t[v],h=r[v];if(u)var x=s?u(h,b,v,r,t,c):u(b,h,v,t,r,c);if(void 0!==x){if(x)continue;d=!1;break}if(y){if(!o(r,(function(t,r){if(!i(y,r)&&(b===t||a(b,t,e,u,c)))return y.push(r)}))){d=!1;break}}else if(b!==h&&!a(b,h,e,u,c)){d=!1;break}}return c.delete(t),c.delete(r),d}},function(t,r,e){var n=e(38),o=e(133),i=e(134);function u(t){var r=-1,e=null==t?0:t.length;for(this.__data__=new n;++r<e;)this.add(t[r])}u.prototype.add=u.prototype.push=o,u.prototype.has=i,t.exports=u},function(t,r){t.exports=function(t,r){return t.has(r)}},function(t,r,e){var n=e(3).Uint8Array;t.exports=n},function(t,r,e){var n=e(64),o=e(41),i=e(17);t.exports=function(t){return n(t,i,o)}},function(t,r,e){var n=e(40),o=e(4);t.exports=function(t,r,e){var i=r(t);return o(t)?i:n(i,e(t))}},function(t,r){t.exports=function(){return[]}},function(t,r,e){var n=e(140),o=e(42),i=e(4),u=e(43),a=e(27),c=e(67),s=Object.prototype.hasOwnProperty;t.exports=function(t,r){var e=i(t),f=!e&&o(t),l=!e&&!f&&u(t),p=!e&&!f&&!l&&c(t),v=e||f||l||p,d=v?n(t.length,String):[],y=d.length;for(var b in t)!r&&!s.call(t,b)||v&&("length"==b||l&&("offset"==b||"parent"==b)||p&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||a(b,y))||d.push(b);return d}},function(t,r,e){var n=e(143),o=e(28),i=e(46),u=i&&i.isTypedArray,a=u?o(u):n;t.exports=a},function(t,r){t.exports=function(t,r){return function(e){return t(r(e))}}},function(t,r,e){var n=e(9)(e(3),"Set");t.exports=n},function(t,r,e){var n=e(40),o=e(158);t.exports=function t(r,e,i,u,a){var c=-1,s=r.length;for(i||(i=o),a||(a=[]);++c<s;){var f=r[c];e>0&&i(f)?e>1?t(f,e-1,i,u,a):n(a,f):u||(a[a.length]=f)}return a}},function(t,r,e){var n=e(6);t.exports=function(t){return t==t&&!n(t)}},function(t,r){t.exports=function(t,r){return function(e){return null!=e&&e[t]===r&&(void 0!==r||t in Object(e))}}},function(t,r,e){var n=e(171),o=e(172);t.exports=function(t,r){return null!=t&&o(t,r,n)}},function(t,r,e){var n=e(186),o=Math.max;t.exports=function(t,r,e){return r=o(void 0===r?t.length-1:r,0),function(){for(var i=arguments,u=-1,a=o(i.length-r,0),c=Array(a);++u<a;)c[u]=i[r+u];u=-1;for(var s=Array(r+1);++u<r;)s[u]=i[u];return s[r]=e(c),n(t,this,s)}}},function(t,r,e){var n=e(187),o=e(189)(n);t.exports=o},function(t,r,e){var n=e(9),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,r,e){"use strict";e.r(r);var n=e(97),o=e.n(n),i=e(2),u=e(1);r.default=async(t,r)=>{if(!t.userId)return t.client.emit("toast","Not logged in!"),{error:"Not logged in!"};const e=await u.default.findByPk(t.userId),n=await i.default.addBuild(r.formType,e.id,r.formData);return o()(n,["id","seoLinkId"])}},function(t,r,e){var n=e(76);t.exports=function(t,r,e){"__proto__"==r&&n?n(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}},function(t,r,e){var n=e(196),o=e(74),i=e(75);t.exports=function(t){return i(o(t,void 0,n),t+"")}},function(t,r,e){"use strict";e.r(r),r.default=()=>({version:"3.9.0"})},function(t,r,e){"use strict";e.r(r);var n=e(98),o=e.n(n),i=e(2),u=e(1);r.default=async(t,r)=>{const e=await i.default.findByPk(+r,{attributes:["UserId","data","type","createdAt","updatedAt"],raw:!0});if(!e)return null;const n=await u.default.findByPk(e.UserId,{attributes:["name","title"],raw:!0});return{...o()(e,"UserId"),userName:n.name,userTitle:n.title}}},function(t,r,e){var n=e(66),o=e(201),i=e(18);t.exports=function(t){return i(t)?n(t,!0):o(t)}},function(t,r,e){var n=e(40),o=e(51),i=e(41),u=e(65),a=Object.getOwnPropertySymbols?function(t){for(var r=[];t;)n(r,i(t)),t=o(t);return r}:u;t.exports=a},function(t,r,e){var n=e(64),o=e(83),i=e(82);t.exports=function(t){return n(t,i,o)}},function(t,r,e){"use strict";e.r(r);var n=e(0),o=e.n(n),i=e(2);r.default=async()=>{const t=await i.default.findAll({attributes:["type",[o.a.fn("COUNT","id"),"count"]],group:["type"],raw:!0});return Object.values(t)}},function(t,r,e){"use strict";e.r(r);var n=e(99),o=e.n(n),i=e(0),u=e(2),a=e(1);function c(t){const r={};if(t.type&&(r.type=t.type),"perk"===t.filterType){const e=o.a.perks[t.value];r.type="killer"===e.for?"killerLoadout":"survivorLoadout",r[i.Op.or]=[1,2,3,4].map(t=>({data:{[`perk${t}`]:e.id}}))}return r}function s(t){return"latest"===t?[["id","DESC"]]:"updated"===t?[["updatedAt","DESC"]]:[["id","DESC"]]}function f(t){return t||["UserId","data","type","createdAt","updatedAt"]}function l(t){return t?{model:a.default,attributes:t.userAttributes}:{model:a.default,attributes:["name","title"]}}function p(t){return t||10}r.default=async(t,r)=>await u.default.findAndCountAll({where:c(r),limit:p(r.limit),attributes:f(r.attributes),raw:!0,order:s(r.order),include:[l(r.userAttributes)]})},function(t,r,e){"use strict";e.r(r);var n=e(2),o=e(1);r.default=async(t,r)=>{const e=r.toLowerCase(),i=await o.default.findOne({where:{name:e},attributes:["id","title","name","createdAt"],raw:!0});return i?{user:i,latestBuilds:await n.default.findAndCountAll({where:{UserId:i.id},limit:10,attributes:["id","data","type","seoLinkId","createdAt","updatedAt"],order:[["updatedAt","DESC"]],raw:!0})}:null}},function(t,r,e){"use strict";e.r(r);var n=e(34),o=e.n(n),i=e(1);r.default=async(t,r)=>{const e=r.user.toLowerCase(),n=await i.default.findOne({where:{name:e}});if(!n)return t.client.emit("toast","User not found!"),{error:"User not found!"};if(!await o.a.compare(r.password,n.password))return t.client.emit("toast","Incorrect password!"),{error:"Incorrect password!"};const u=await n.createLogin();return t.client.apiKey=u.apiKey,t.client.userId=n.id,t.client.emit("toast",`Hello, ${n.title}!`),{title:n.title,name:n.name,key:u.apiKey}}},function(t,r,e){"use strict";e.r(r);var n=e(34),o=e.n(n),i=e(1);r.default=async(t,r)=>{const e=r.user.toLowerCase(),n=await i.default.findOne({where:{name:e}});if(n)return t.client.emit("toast",`${n.title} already exists`),{error:"Already exists!"};const u=await o.a.hash(r.password,5),a=await i.default.create({title:r.user,name:e,password:u}),c=await a.createLogin();return t.client.apiKey=c.apiKey,t.client.userId=a.id,t.client.emit("toast",`Welcome, ${a.title}!`),{title:a.title,name:a.name,key:c.apiKey}}},function(t,r){t.exports=require("yargs")},function(t,r){t.exports={twitchClientCallbackUrl:"https://server.preis.farm/auth/twitch/callback",loginRedirectUrl:"https://preis.farm",frontendHost:"entity.works"}},function(t,r){t.exports=require("jaid-core-dashboard")},function(t,r,e){var n=e(35);t.exports=function(t,r){return n(t,r)}},function(t,r){t.exports=require("cookie")},function(t,r){t.exports=require("socket.io")},function(t,r){t.exports=require("socket-enhance")},function(t,r,e){var n=e(193),o=e(79)((function(t,r){return null==t?{}:n(t,r)}));t.exports=o},function(t,r,e){var n=e(48),o=e(197),i=e(219),u=e(13),a=e(19),c=e(222),s=e(79),f=e(84),l=s((function(t,r){var e={};if(null==t)return e;var s=!1;r=n(r,(function(r){return r=u(r,t),s||(s=r.length>1),r})),a(t,f(t),e),s&&(e=o(e,7,c));for(var l=r.length;l--;)i(e,r[l]);return e}));t.exports=l},function(t,r){t.exports=require("dead-by-daylight")},function(t,r,e){"use strict";e.r(r);var n=e(90),o=e.n(n),i=e(8);function u(t){var r;(null===i.a||void 0===i.a||null===(r=i.a.logger)||void 0===r?void 0:r.error)?i.a.logger.error(t):console.error(t)}process.on("unhandledRejection",t=>{u(t?`Unhandled promise rejection: ${(null==t?void 0:t.message)||t}`:"Unhandled promise rejection"),(null==t?void 0:t.stack)&&u(t.stack)}),o.a.scriptName("entity-serves").version("3.9.0").command("$0","Backend for entity.works, a Dead by Daylight wiki.",{},(function(){(async function(){const t={},r=e(101);for(const e of r.keys()){const{pluginName:n}=e.match(/[/\\](?<pluginName>.+?)[/\\]index\.js$/).groups;t[n]=r(e).default}await i.a.init(t)})().catch(t=>{u("Core process crashed"),u(t),process.exit(1)})})).argv},function(t,r,e){var n={"./dashboard/index.js":102,"./main/index.js":103,"./socketServer/index.js":224};function o(t){var r=i(t);return e(r)}function i(t){if(!e.o(n,t)){var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}return n[t]}o.keys=function(){return Object.keys(n)},o.resolve=i,t.exports=o,o.id=101},function(t,r,e){"use strict";e.r(r);var n=e(92),o=e.n(n);r.default=new o.a},function(t,r,e){"use strict";e.r(r),e.d(r,"default",(function(){return c}));var n=e(93),o=e.n(n),i=e(15),u=e(33),a=e(2);class c extends i.JaidCorePlugin{async normalizeBuilds(){const t=await a.default.findAll({attributes:["id","data","type"]});for(const r of t){const t=u.a[r.type](r.data);o()(r.data,t)||(await r.update({data:t},{silent:!0}),this.log(`Build #${r.id} has been normalized`))}}async ready(){await this.normalizeBuilds()}collectModels(){const t={},r=e(191);for(const e of r.keys())t[e.match(/\.\/(?<key>[\da-z]+)\./i).groups.key]=r(e);return t}}},function(t,r,e){var n=e(36),o=e(59),i=e(136),u=e(138),a=e(29),c=e(4),s=e(43),f=e(67),l="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(t,r,e,v,d,y){var b=c(t),h=c(r),x=b?"[object Array]":a(t),g=h?"[object Array]":a(r),j=(x="[object Arguments]"==x?l:x)==l,w=(g="[object Arguments]"==g?l:g)==l,_=x==g;if(_&&s(t)){if(!s(r))return!1;b=!0,j=!1}if(_&&!j)return y||(y=new n),b||f(t)?o(t,r,e,v,d,y):i(t,r,x,e,v,d,y);if(!(1&e)){var m=j&&p.call(t,"__wrapped__"),O=w&&p.call(r,"__wrapped__");if(m||O){var k=m?t.value():t,A=O?r.value():r;return y||(y=new n),d(k,A,e,v,y)}}return!!_&&(y||(y=new n),u(t,r,e,v,d,y))}},function(t,r){t.exports=function(){this.__data__=[],this.size=0}},function(t,r,e){var n=e(23),o=Array.prototype.splice;t.exports=function(t){var r=this.__data__,e=n(r,t);return e>=0&&(e==r.length-1?r.pop():o.call(r,e,1),--this.size,!0)}},function(t,r,e){var n=e(23);t.exports=function(t){var r=this.__data__,e=n(r,t);return 0>e?void 0:r[e][1]}},function(t,r,e){var n=e(23);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,r,e){var n=e(23);t.exports=function(t,r){var e=this.__data__,o=n(e,t);return 0>o?(++this.size,e.push([t,r])):e[o][1]=r,this}},function(t,r,e){var n=e(22);t.exports=function(){this.__data__=new n,this.size=0}},function(t,r){t.exports=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}},function(t,r){t.exports=function(t){return this.__data__.get(t)}},function(t,r){t.exports=function(t){return this.__data__.has(t)}},function(t,r,e){var n=e(22),o=e(37),i=e(38);t.exports=function(t,r){var e=this.__data__;if(e instanceof n){var u=e.__data__;if(!o||199>u.length)return u.push([t,r]),this.size=++e.size,this;e=this.__data__=new i(u)}return e.set(t,r),this.size=e.size,this}},function(t,r,e){var n=e(56),o=e(118),i=e(6),u=e(58),a=Function.prototype,c=Object.prototype,s=a.toString,f=c.hasOwnProperty,l=RegExp("^"+s.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?l:/^\[object .+?Constructor\]$/).test(u(t))}},function(t,r,e){var n=e(12),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,a=n?n.toStringTag:void 0;t.exports=function(t){var r=i.call(t,a),e=t[a];try{t[a]=void 0;var n=!0}catch(t){}var o=u.call(t);return n&&(r?t[a]=e:delete t[a]),o}},function(t,r){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},function(t,r,e){var n,o=e(119),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},function(t,r,e){var n=e(3)["__core-js_shared__"];t.exports=n},function(t,r){t.exports=function(t,r){return null==t?void 0:t[r]}},function(t,r,e){var n=e(122),o=e(22),i=e(37);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},function(t,r,e){var n=e(123),o=e(124),i=e(125),u=e(126),a=e(127);function c(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},function(t,r,e){var n=e(25);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,r){t.exports=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}},function(t,r,e){var n=e(25),o=Object.prototype.hasOwnProperty;t.exports=function(t){var r=this.__data__;if(n){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return o.call(r,t)?r[t]:void 0}},function(t,r,e){var n=e(25),o=Object.prototype.hasOwnProperty;t.exports=function(t){var r=this.__data__;return n?void 0!==r[t]:o.call(r,t)}},function(t,r,e){var n=e(25);t.exports=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=n&&void 0===r?"__lodash_hash_undefined__":r,this}},function(t,r,e){var n=e(26);t.exports=function(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}},function(t,r){t.exports=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t}},function(t,r,e){var n=e(26);t.exports=function(t){return n(this,t).get(t)}},function(t,r,e){var n=e(26);t.exports=function(t){return n(this,t).has(t)}},function(t,r,e){var n=e(26);t.exports=function(t,r){var e=n(this,t),o=e.size;return e.set(t,r),this.size+=e.size==o?0:1,this}},function(t,r){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,r){t.exports=function(t){return this.__data__.has(t)}},function(t,r){t.exports=function(t,r){for(var e=-1,n=null==t?0:t.length;++e<n;)if(r(t[e],e,t))return!0;return!1}},function(t,r,e){var n=e(12),o=e(62),i=e(24),u=e(59),a=e(137),c=e(39),s=n?n.prototype:void 0,f=s?s.valueOf:void 0;t.exports=function(t,r,e,n,s,l,p){switch(e){case"[object DataView]":if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=r.byteLength||!l(new o(t),new o(r)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+r);case"[object Error]":return t.name==r.name&&t.message==r.message;case"[object RegExp]":case"[object String]":return t==r+"";case"[object Map]":var v=a;case"[object Set]":var d=1&n;if(v||(v=c),t.size!=r.size&&!d)return!1;var y=p.get(t);if(y)return y==r;n|=2,p.set(t,r);var b=u(v(t),v(r),n,s,l,p);return p.delete(t),b;case"[object Symbol]":if(f)return f.call(t)==f.call(r)}return!1}},function(t,r){t.exports=function(t){var r=-1,e=Array(t.size);return t.forEach((function(t,n){e[++r]=[n,t]})),e}},function(t,r,e){var n=e(63),o=Object.prototype.hasOwnProperty;t.exports=function(t,r,e,i,u,a){var c=1&e,s=n(t),f=s.length;if(f!=n(r).length&&!c)return!1;for(var l=f;l--;){var p=s[l];if(!(c?p in r:o.call(r,p)))return!1}var v=a.get(t);if(v&&a.get(r))return v==r;var d=!0;a.set(t,r),a.set(r,t);for(var y=c;++l<f;){var b=t[p=s[l]],h=r[p];if(i)var x=c?i(h,b,p,r,t,a):i(b,h,p,t,r,a);if(!(void 0===x?b===h||u(b,h,e,i,a):x)){d=!1;break}y||(y="constructor"==p)}if(d&&!y){var g=t.constructor,j=r.constructor;g!=j&&"constructor"in t&&"constructor"in r&&!("function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j)&&(d=!1)}return a.delete(t),a.delete(r),d}},function(t,r){t.exports=function(t,r){for(var e=-1,n=null==t?0:t.length,o=0,i=[];++e<n;){var u=t[e];r(u,e,t)&&(i[o++]=u)}return i}},function(t,r){t.exports=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n}},function(t,r,e){var n=e(11),o=e(7);t.exports=function(t){return o(t)&&"[object Arguments]"==n(t)}},function(t,r){t.exports=function(){return!1}},function(t,r,e){var n=e(11),o=e(45),i=e(7),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!u[n(t)]}},function(t,r,e){var n=e(47),o=e(145),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var r=[];for(var e in Object(t))i.call(t,e)&&"constructor"!=e&&r.push(e);return r}},function(t,r,e){var n=e(68)(Object.keys,Object);t.exports=n},function(t,r,e){var n=e(9)(e(3),"DataView");t.exports=n},function(t,r,e){var n=e(9)(e(3),"Promise");t.exports=n},function(t,r,e){var n=e(9)(e(3),"WeakMap");t.exports=n},function(t,r,e){var n=e(60),o=e(150),i=e(155),u=e(61),a=e(156),c=e(39);t.exports=function(t,r,e){var s=-1,f=o,l=t.length,p=!0,v=[],d=v;if(e)p=!1,f=i;else if(200>l)d=r?[]:v;else{var y=r?null:a(t);if(y)return c(y);p=!1,f=u,d=new n}t:for(;++s<l;){var b=t[s],h=r?r(b):b;if(b=e||0!==b?b:0,p&&h==h){for(var x=d.length;x--;)if(d[x]===h)continue t;r&&d.push(h),v.push(b)}else f(d,h,e)||(d!==v&&d.push(h),v.push(b))}return v}},function(t,r,e){var n=e(151);t.exports=function(t,r){return!(null==t||!t.length)&&n(t,r,0)>-1}},function(t,r,e){var n=e(152),o=e(153),i=e(154);t.exports=function(t,r,e){return r==r?i(t,r,e):n(t,o,e)}},function(t,r){t.exports=function(t,r,e,n){for(var o=t.length,i=e+(n?1:-1);n?i--:++i<o;)if(r(t[i],i,t))return i;return-1}},function(t,r){t.exports=function(t){return t!=t}},function(t,r){t.exports=function(t,r,e){for(var n=e-1,o=t.length;++n<o;)if(t[n]===r)return n;return-1}},function(t,r){t.exports=function(t,r,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(r,t[n]))return!0;return!1}},function(t,r,e){var n=e(69),o=e(157),i=e(39),u=n&&1/i(new n([,-0]))[1]==1/0?function(t){return new n(t)}:o;t.exports=u},function(t,r){t.exports=function(){}},function(t,r,e){var n=e(12),o=e(42),i=e(4),u=n?n.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(u&&t&&t[u])}},function(t,r,e){var n=e(48),o=e(160),i=e(176),u=e(182),a=e(28),c=e(183),s=e(32);t.exports=function(t,r,e){var f=-1;r=n(r.length?r:[s],a(o));var l=i(t,(function(t,e,o){return{criteria:n(r,(function(r){return r(t)})),index:++f,value:t}}));return u(l,(function(t,r){return c(t,r,e)}))}},function(t,r,e){var n=e(161),o=e(164),i=e(32),u=e(4),a=e(173);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?u(t)?o(t[0],t[1]):n(t):a(t)}},function(t,r,e){var n=e(162),o=e(163),i=e(72);t.exports=function(t){var r=o(t);return 1==r.length&&r[0][2]?i(r[0][0],r[0][1]):function(e){return e===t||n(e,t,r)}}},function(t,r,e){var n=e(36),o=e(35);t.exports=function(t,r,e,i){var u=e.length,a=u,c=!i;if(null==t)return!a;for(t=Object(t);u--;){var s=e[u];if(c&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++u<a;){var f=(s=e[u])[0],l=t[f],p=s[1];if(c&&s[2]){if(void 0===l&&!(f in t))return!1}else{var v=new n;if(i)var d=i(l,p,f,t,r,v);if(!(void 0===d?o(p,l,3,i,v):d))return!1}}return!0}},function(t,r,e){var n=e(71),o=e(17);t.exports=function(t){for(var r=o(t),e=r.length;e--;){var i=r[e],u=t[i];r[e]=[i,u,n(u)]}return r}},function(t,r,e){var n=e(35),o=e(165),i=e(73),u=e(49),a=e(71),c=e(72),s=e(14);t.exports=function(t,r){return u(t)&&a(r)?c(s(t),r):function(e){var u=o(e,t);return void 0===u&&u===r?i(e,t):n(r,u,3)}}},function(t,r,e){var n=e(30);t.exports=function(t,r,e){var o=null==t?void 0:n(t,r);return void 0===o?e:o}},function(t,r,e){var n=e(167)((function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,(function(t,e,n,o){r.push(n?o.replace(/\\(\\)?/g,"$1"):e||t)})),r}));t.exports=n},function(t,r,e){var n=e(168);t.exports=function(t){var r=n(t,(function(t){return 500===e.size&&e.clear(),t})),e=r.cache;return r}},function(t,r,e){var n=e(38);function o(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var e=function(){var n=arguments,o=r?r.apply(this,n):n[0],i=e.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return e.cache=i.set(o,u)||i,u};return e.cache=new(o.Cache||n),e}o.Cache=n,t.exports=o},function(t,r,e){var n=e(170);t.exports=function(t){return null==t?"":n(t)}},function(t,r,e){var n=e(12),o=e(48),i=e(4),u=e(31),a=n?n.prototype:void 0,c=a?a.toString:void 0;t.exports=function t(r){if("string"==typeof r)return r;if(i(r))return o(r,t)+"";if(u(r))return c?c.call(r):"";var e=r+"";return"0"==e&&1/r==-1/0?"-0":e}},function(t,r){t.exports=function(t,r){return null!=t&&r in Object(t)}},function(t,r,e){var n=e(13),o=e(42),i=e(4),u=e(27),a=e(45),c=e(14);t.exports=function(t,r,e){for(var s=-1,f=(r=n(r,t)).length,l=!1;++s<f;){var p=c(r[s]);if(!(l=null!=t&&e(t,p)))break;t=t[p]}return l||++s!=f?l:!!(f=null==t?0:t.length)&&a(f)&&u(p,f)&&(i(t)||o(t))}},function(t,r,e){var n=e(174),o=e(175),i=e(49),u=e(14);t.exports=function(t){return i(t)?n(u(t)):o(t)}},function(t,r){t.exports=function(t){return function(r){return null==r?void 0:r[t]}}},function(t,r,e){var n=e(30);t.exports=function(t){return function(r){return n(r,t)}}},function(t,r,e){var n=e(177),o=e(18);t.exports=function(t,r){var e=-1,i=o(t)?Array(t.length):[];return n(t,(function(t,n,o){i[++e]=r(t,n,o)})),i}},function(t,r,e){var n=e(178),o=e(181)(n);t.exports=o},function(t,r,e){var n=e(179),o=e(17);t.exports=function(t,r){return t&&n(t,r,o)}},function(t,r,e){var n=e(180)();t.exports=n},function(t,r){t.exports=function(t){return function(r,e,n){for(var o=-1,i=Object(r),u=n(r),a=u.length;a--;){var c=u[t?a:++o];if(!1===e(i[c],c,i))break}return r}}},function(t,r,e){var n=e(18);t.exports=function(t,r){return function(e,o){if(null==e)return e;if(!n(e))return t(e,o);for(var i=e.length,u=r?i:-1,a=Object(e);(r?u--:++u<i)&&!1!==o(a[u],u,a););return e}}},function(t,r){t.exports=function(t,r){var e=t.length;for(t.sort(r);e--;)t[e]=t[e].value;return t}},function(t,r,e){var n=e(184);t.exports=function(t,r,e){for(var o=-1,i=t.criteria,u=r.criteria,a=i.length,c=e.length;++o<a;){var s=n(i[o],u[o]);if(s)return c>o?s*("desc"==e[o]?-1:1):s}return t.index-r.index}},function(t,r,e){var n=e(31);t.exports=function(t,r){if(t!==r){var e=void 0!==t,o=null===t,i=t==t,u=n(t),a=void 0!==r,c=null===r,s=r==r,f=n(r);if(!c&&!f&&!u&&t>r||u&&a&&s&&!c&&!f||o&&a&&s||!e&&s||!i)return 1;if(!o&&!u&&!f&&r>t||f&&e&&i&&!o&&!u||c&&e&&i||!a&&i||!s)return-1}return 0}},function(t,r,e){var n=e(32),o=e(74),i=e(75);t.exports=function(t,r){return i(o(t,r,n),t+"")}},function(t,r){t.exports=function(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}},function(t,r,e){var n=e(188),o=e(76),i=e(32),u=o?function(t,r){return o(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:i;t.exports=u},function(t,r){t.exports=function(t){return function(){return t}}},function(t,r){var e=Date.now;t.exports=function(t){var r=0,n=0;return function(){var o=e(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}},function(t,r,e){var n=e(24),o=e(18),i=e(27),u=e(6);t.exports=function(t,r,e){if(!u(e))return!1;var a=typeof r;return!!("number"==a?o(e)&&i(r,e.length):"string"==a&&r in e)&&n(e[r],t)}},function(t,r,e){var n={"./ApiCall.js":53,"./Build.js":2,"./Login.js":10,"./User.js":1};function o(t){var r=i(t);return e(r)}function i(t){if(!e.o(n,t)){var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}return n[t]}o.keys=function(){return Object.keys(n)},o.resolve=i,t.exports=o,o.id=191},function(t,r,e){var n={"./addBuild":77,"./addBuild.js":77,"./getBackendInfo":80,"./getBackendInfo.js":80,"./getBuild":81,"./getBuild.js":81,"./getBuildTypes":85,"./getBuildTypes.js":85,"./getBuilds":86,"./getBuilds.js":86,"./getProfile":87,"./getProfile.js":87,"./login":88,"./login.js":88,"./register":89,"./register.js":89};function o(t){var r=i(t);return e(r)}function i(t){if(!e.o(n,t)){var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}return n[t]}o.keys=function(){return Object.keys(n)},o.resolve=i,t.exports=o,o.id=192},function(t,r,e){var n=e(194),o=e(73);t.exports=function(t,r){return n(t,r,(function(r,e){return o(t,e)}))}},function(t,r,e){var n=e(30),o=e(195),i=e(13);t.exports=function(t,r,e){for(var u=-1,a=r.length,c={};++u<a;){var s=r[u],f=n(t,s);e(f,s)&&o(c,i(s,t),f)}return c}},function(t,r,e){var n=e(50),o=e(13),i=e(27),u=e(6),a=e(14);t.exports=function(t,r,e,c){if(!u(t))return t;for(var s=-1,f=(r=o(r,t)).length,l=f-1,p=t;null!=p&&++s<f;){var v=a(r[s]),d=e;if(s!=l){var y=p[v];void 0===(d=c?c(y,v,p):void 0)&&(d=u(y)?y:i(r[s+1])?[]:{})}n(p,v,d),p=p[v]}return t}},function(t,r,e){var n=e(70);t.exports=function(t){return null!=t&&t.length?n(t,1):[]}},function(t,r,e){var n=e(36),o=e(198),i=e(50),u=e(199),a=e(200),c=e(203),s=e(204),f=e(205),l=e(206),p=e(63),v=e(84),d=e(29),y=e(207),b=e(208),h=e(213),x=e(4),g=e(43),j=e(215),w=e(6),_=e(217),m=e(17),O={};O["[object Arguments]"]=O["[object Array]"]=O["[object ArrayBuffer]"]=O["[object DataView]"]=O["[object Boolean]"]=O["[object Date]"]=O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Map]"]=O["[object Number]"]=O["[object Object]"]=O["[object RegExp]"]=O["[object Set]"]=O["[object String]"]=O["[object Symbol]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O["[object Error]"]=O["[object Function]"]=O["[object WeakMap]"]=!1,t.exports=function t(r,e,k,A,S,I){var U,P=1&e,N=2&e,B=4&e;if(k&&(U=S?k(r,A,S,I):k(r)),void 0!==U)return U;if(!w(r))return r;var T=x(r);if(T){if(U=y(r),!P)return s(r,U)}else{var z=d(r),E="[object Function]"==z||"[object GeneratorFunction]"==z;if(g(r))return c(r,P);if("[object Object]"==z||"[object Arguments]"==z||E&&!S){if(U=N||E?{}:h(r),!P)return N?l(r,a(U,r)):f(r,u(U,r))}else{if(!O[z])return S?r:{};U=b(r,z,P)}}I||(I=new n);var C=I.get(r);if(C)return C;I.set(r,U),_(r)?r.forEach((function(n){U.add(t(n,e,k,n,r,I))})):j(r)&&r.forEach((function(n,o){U.set(o,t(n,e,k,o,r,I))}));var D=B?N?v:p:N?keysIn:m,L=T?void 0:D(r);return o(L||r,(function(n,o){L&&(n=r[o=n]),i(U,o,t(n,e,k,o,r,I))})),U}},function(t,r){t.exports=function(t,r){for(var e=-1,n=null==t?0:t.length;++e<n&&!1!==r(t[e],e,t););return t}},function(t,r,e){var n=e(19),o=e(17);t.exports=function(t,r){return t&&n(r,o(r),t)}},function(t,r,e){var n=e(19),o=e(82);t.exports=function(t,r){return t&&n(r,o(r),t)}},function(t,r,e){var n=e(6),o=e(47),i=e(202),u=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return i(t);var r=o(t),e=[];for(var a in t)("constructor"!=a||!r&&u.call(t,a))&&e.push(a);return e}},function(t,r){t.exports=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r}},function(t,r,e){(function(t){var n=e(3),o=r&&!r.nodeType&&r,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,u=i&&i.exports===o?n.Buffer:void 0,a=u?u.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=a?a(e):new t.constructor(e);return t.copy(n),n}}).call(this,e(44)(t))},function(t,r){t.exports=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++e<n;)r[e]=t[e];return r}},function(t,r,e){var n=e(19),o=e(41);t.exports=function(t,r){return n(t,o(t),r)}},function(t,r,e){var n=e(19),o=e(83);t.exports=function(t,r){return n(t,o(t),r)}},function(t,r){var e=Object.prototype.hasOwnProperty;t.exports=function(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}},function(t,r,e){var n=e(52),o=e(209),i=e(210),u=e(211),a=e(212);t.exports=function(t,r,e){var c=t.constructor;switch(r){case"[object ArrayBuffer]":return n(t);case"[object Boolean]":case"[object Date]":return new c(+t);case"[object DataView]":return o(t,e);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(t,e);case"[object Map]":return new c;case"[object Number]":case"[object String]":return new c(t);case"[object RegExp]":return i(t);case"[object Set]":return new c;case"[object Symbol]":return u(t)}}},function(t,r,e){var n=e(52);t.exports=function(t,r){var e=r?n(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}},function(t,r){var e=/\w*$/;t.exports=function(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}},function(t,r,e){var n=e(12),o=n?n.prototype:void 0,i=o?o.valueOf:void 0;t.exports=function(t){return i?Object(i.call(t)):{}}},function(t,r,e){var n=e(52);t.exports=function(t,r){var e=r?n(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}},function(t,r,e){var n=e(214),o=e(51),i=e(47);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:n(o(t))}},function(t,r,e){var n=e(6),o=Object.create,i=function(){function t(){}return function(r){if(!n(r))return{};if(o)return o(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();t.exports=i},function(t,r,e){var n=e(216),o=e(28),i=e(46),u=i&&i.isMap,a=u?o(u):n;t.exports=a},function(t,r,e){var n=e(29),o=e(7);t.exports=function(t){return o(t)&&"[object Map]"==n(t)}},function(t,r,e){var n=e(218),o=e(28),i=e(46),u=i&&i.isSet,a=u?o(u):n;t.exports=a},function(t,r,e){var n=e(29),o=e(7);t.exports=function(t){return o(t)&&"[object Set]"==n(t)}},function(t,r,e){var n=e(13),o=e(54),i=e(220),u=e(14);t.exports=function(t,r){return r=n(r,t),null==(t=i(t,r))||delete t[u(o(r))]}},function(t,r,e){var n=e(30),o=e(221);t.exports=function(t,r){return 2>r.length?t:n(t,o(r,0,-1))}},function(t,r){t.exports=function(t,r,e){var n=-1,o=t.length;0>r&&(r=-r>o?0:o+r),0>(e=e>o?o:e)&&(e+=o),o=r>e?0:e-r>>>0,r>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+r];return i}},function(t,r,e){var n=e(223);t.exports=function(t){return n(t)?void 0:t}},function(t,r,e){var n=e(11),o=e(51),i=e(7),u=Function.prototype,a=Object.prototype,c=u.toString,s=a.hasOwnProperty,f=c.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=n(t))return!1;var r=o(t);if(null===r)return!0;var e=s.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&c.call(e)==f}},function(t,r,e){"use strict";e.r(r),e.d(r,"default",(function(){return h}));var n=e(54),o=e.n(n),i=e(94),u=e.n(i),a=e(15),c=e(95),s=e.n(c),f=e(96),l=e.n(f),p=e(8),v=new l.a({logger:p.b}),d=e(53),y=e(10);const b=e(192);class h extends a.JaidCorePlugin{init(){this.socketServer=s()(this.core.insecureServer),this.socketServer.on("connection",async t=>{if(t.handshake.headers.cookie){const r=u.a.parse(t.handshake.headers.cookie).login;if(r){const e=JSON.parse(r);if(e.key){t.apiKey=e.key;const r=await y.default.findOne({where:{apiKey:t.apiKey},attributes:["UserId"],raw:!0});r?t.userId=r.UserId:t.emit("invalidateLogin")}}}for(const[r,e]of Object.entries(this.commands))t.on(r,async(...n)=>{const i={client:t,userId:t.userId,logger:this.logger},u=Date.now(),a=n.length>1?n.slice(0,-1):null,c=await e.default(i,...n),s=Date.now()-u;d.default.create({result:c,time:s,type:r,payload:a,UserId:t.userId}),void 0!==c&&o()(n)(c)})}),v.enhanceServer(this.socketServer),this.commands=b.keys().reduce((t,r)=>(t[r.match(/\.\/(?<key>[\da-z]+)/i).groups.key]=b(r),t),{})}}}]);