From bee9c629b71be3ed10bb290a1cb1e84be8a22324 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 28 Jun 2017 17:04:08 +0000 Subject: [PATCH] Webpack build for branch data-store-refactor: f36fbd8edfb7911509e0a23c71d5c3bc3cf145ad --- discord.data-store-refactor.js | 214 +++++++++++++++++------------ discord.data-store-refactor.min.js | 12 +- 2 files changed, 129 insertions(+), 97 deletions(-) diff --git a/discord.data-store-refactor.js b/discord.data-store-refactor.js index 87ad612b..ea966f1c 100644 --- a/discord.data-store-refactor.js +++ b/discord.data-store-refactor.js @@ -127,7 +127,7 @@ exports.DefaultOptions = { */ ws: { large_threshold: 250, - compress: __webpack_require__(27).platform() !== 'browser', + compress: __webpack_require__(28).platform() !== 'browser', properties: { $os: process ? process.platform : 'discord.js', $browser: 'discord.js', @@ -4880,10 +4880,10 @@ module.exports = Channel; /* 18 */ /***/ (function(module, exports, __webpack_require__) { -const TextBasedChannel = __webpack_require__(26); +const TextBasedChannel = __webpack_require__(27); const Constants = __webpack_require__(0); const Presence = __webpack_require__(14).Presence; -const UserProfile = __webpack_require__(194); +const UserProfile = __webpack_require__(195); const Snowflake = __webpack_require__(8); const Base = __webpack_require__(7); @@ -5387,7 +5387,7 @@ const Long = __webpack_require__(36); const User = __webpack_require__(18); const Role = __webpack_require__(22); const Emoji = __webpack_require__(19); -const Invite = __webpack_require__(28); +const Invite = __webpack_require__(29); const GuildAuditLogs = __webpack_require__(48); const Webhook = __webpack_require__(23); const Presence = __webpack_require__(14).Presence; @@ -5400,6 +5400,7 @@ const Snowflake = __webpack_require__(8); const Permissions = __webpack_require__(11); const Shared = __webpack_require__(76); const EmojiStore = __webpack_require__(190); +const GuildChannelStore = __webpack_require__(191); const Base = __webpack_require__(7); const { Error, TypeError } = __webpack_require__(5); @@ -5422,7 +5423,7 @@ class Guild extends Base { * A collection of channels that are in this guild. The key is the channel's ID, the value is the channel * @type {Collection} */ - this.channels = new Collection(); + this.channels = new GuildChannelStore(this); /** * A collection of roles that are in this guild. The key is the role's ID, the value is the role @@ -6629,7 +6630,7 @@ module.exports = Guild; /* 21 */ /***/ (function(module, exports, __webpack_require__) { -const TextBasedChannel = __webpack_require__(26); +const TextBasedChannel = __webpack_require__(27); const Role = __webpack_require__(22); const Permissions = __webpack_require__(11); const Collection = __webpack_require__(3); @@ -7522,7 +7523,7 @@ module.exports = Role; /* 23 */ /***/ (function(module, exports, __webpack_require__) { -const path = __webpack_require__(30); +const path = __webpack_require__(31); const Util = __webpack_require__(4); /** @@ -7891,7 +7892,37 @@ exports.PassThrough = __webpack_require__(92); /* 26 */ /***/ (function(module, exports, __webpack_require__) { -const path = __webpack_require__(30); +const Collection = __webpack_require__(3); + +/** + * A data store what else???? + * @class DataStore + * @extends {Collection} + */ +class DataStore extends Collection { + constructor(client, iterable) { + super(iterable); + + Object.defineProperty(this, 'client', { + value: client, + enumerable: false, + writable: false, + }); + } + + // Stubs + create() { return undefined; } + remove() { return undefined; } +} + +module.exports = DataStore; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +const path = __webpack_require__(31); const MessageCollector = __webpack_require__(50); const Shared = __webpack_require__(76); const Collection = __webpack_require__(3); @@ -8309,7 +8340,7 @@ exports.applyToClass = (structure, full = false, ignore = []) => { /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, exports) { exports.endianness = function () { return 'LE' }; @@ -8360,7 +8391,7 @@ exports.EOL = '\n'; /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { const PartialGuild = __webpack_require__(54); @@ -8524,7 +8555,7 @@ module.exports = Invite; /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { const Snowflake = __webpack_require__(8); @@ -8690,7 +8721,7 @@ module.exports = OAuth2Application; /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. @@ -8920,42 +8951,12 @@ var substr = 'ab'.substr(-1) === 'b' /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -const Collection = __webpack_require__(3); - -/** - * A data store what else???? - * @class DataStore - * @extends {Collection} - */ -class DataStore extends Collection { - constructor(client, iterable) { - super(iterable); - - Object.defineProperty(this, 'client', { - value: client, - enumerable: false, - writable: false, - }); - } - - // Stubs - create() { return undefined; } - remove() { return undefined; } -} - -module.exports = DataStore; - - /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { const Channel = __webpack_require__(17); -const TextBasedChannel = __webpack_require__(26); +const TextBasedChannel = __webpack_require__(27); const Collection = __webpack_require__(3); /* @@ -9138,7 +9139,7 @@ module.exports = GroupDMChannel; const Channel = __webpack_require__(17); const Role = __webpack_require__(22); -const Invite = __webpack_require__(28); +const Invite = __webpack_require__(29); const PermissionOverwrites = __webpack_require__(56); const Permissions = __webpack_require__(11); const Collection = __webpack_require__(3); @@ -12803,7 +12804,7 @@ module.exports = ClientUserSettings; /***/ (function(module, exports, __webpack_require__) { const Channel = __webpack_require__(17); -const TextBasedChannel = __webpack_require__(26); +const TextBasedChannel = __webpack_require__(27); const Collection = __webpack_require__(3); /** @@ -14111,7 +14112,7 @@ module.exports = ReactionCollector; const GuildChannel = __webpack_require__(33); const Webhook = __webpack_require__(23); -const TextBasedChannel = __webpack_require__(26); +const TextBasedChannel = __webpack_require__(27); const Collection = __webpack_require__(3); /** @@ -14414,7 +14415,7 @@ util.inherits = __webpack_require__(13); /**/ /**/ -var debugUtil = __webpack_require__(197); +var debugUtil = __webpack_require__(198); var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); @@ -16769,7 +16770,7 @@ function base64DetectIncompleteChar(buffer) { /* 69 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(Buffer) {const path = __webpack_require__(30); +/* WEBPACK VAR INJECTION */(function(Buffer) {const path = __webpack_require__(31); const fs = __webpack_require__(43); const snekfetch = __webpack_require__(41); @@ -17193,14 +17194,14 @@ module.exports = RequestHandler; /* 73 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(Buffer) {const browser = __webpack_require__(27).platform() === 'browser'; +/* WEBPACK VAR INJECTION */(function(Buffer) {const browser = __webpack_require__(28).platform() === 'browser'; const EventEmitter = __webpack_require__(15); const Constants = __webpack_require__(0); const zlib = __webpack_require__(43); const PacketManager = __webpack_require__(150); const erlpack = (function findErlpack() { try { - const e = __webpack_require__(201); + const e = __webpack_require__(202); if (!e.pack) return null; return e; } catch (e) { @@ -17211,9 +17212,9 @@ const erlpack = (function findErlpack() { const WebSocket = (function findWebSocket() { if (browser) return window.WebSocket; // eslint-disable-line no-undef try { - return __webpack_require__(202); - } catch (e) { return __webpack_require__(203); + } catch (e) { + return __webpack_require__(204); } }()); @@ -17831,8 +17832,8 @@ module.exports = VoiceRegion; /***/ (function(module, exports, __webpack_require__) { module.exports = { - search: __webpack_require__(195), - sendMessage: __webpack_require__(196), + search: __webpack_require__(196), + sendMessage: __webpack_require__(197), }; @@ -17840,7 +17841,7 @@ module.exports = { /* 77 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(process) {const os = __webpack_require__(27); +/* WEBPACK VAR INJECTION */(function(process) {const os = __webpack_require__(28); const EventEmitter = __webpack_require__(15).EventEmitter; const Constants = __webpack_require__(0); const Permissions = __webpack_require__(11); @@ -17848,20 +17849,20 @@ const Util = __webpack_require__(4); const RESTManager = __webpack_require__(71); const ClientManager = __webpack_require__(114); const ClientDataResolver = __webpack_require__(69); -const ClientVoiceManager = __webpack_require__(199); +const ClientVoiceManager = __webpack_require__(200); const WebSocketManager = __webpack_require__(149); const ActionsManager = __webpack_require__(115); const Collection = __webpack_require__(3); const Presence = __webpack_require__(14).Presence; const VoiceRegion = __webpack_require__(75); const Webhook = __webpack_require__(23); -const Invite = __webpack_require__(28); -const OAuth2Application = __webpack_require__(29); -const ShardClientUtil = __webpack_require__(198); -const VoiceBroadcast = __webpack_require__(200); -const UserStore = __webpack_require__(192); +const Invite = __webpack_require__(29); +const OAuth2Application = __webpack_require__(30); +const ShardClientUtil = __webpack_require__(199); +const VoiceBroadcast = __webpack_require__(201); +const UserStore = __webpack_require__(193); const ChannelStore = __webpack_require__(189); -const GuildStore = __webpack_require__(191); +const GuildStore = __webpack_require__(192); const { Error, TypeError, RangeError } = __webpack_require__(5); /** @@ -20673,7 +20674,7 @@ module.exports = { /* 99 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(Buffer) {const path = __webpack_require__(30); +/* WEBPACK VAR INJECTION */(function(Buffer) {const path = __webpack_require__(31); const mime = __webpack_require__(101); class FormData { @@ -26166,15 +26167,15 @@ module.exports = { GuildAuditLogs: __webpack_require__(48), GuildChannel: __webpack_require__(33), GuildMember: __webpack_require__(21), - Invite: __webpack_require__(28), + Invite: __webpack_require__(29), Message: __webpack_require__(10), MessageAttachment: __webpack_require__(49), MessageCollector: __webpack_require__(50), MessageEmbed: __webpack_require__(51), MessageMentions: __webpack_require__(52), MessageReaction: __webpack_require__(53), - OAuth2Application: __webpack_require__(29), - ClientOAuth2Application: __webpack_require__(29), + OAuth2Application: __webpack_require__(30), + ClientOAuth2Application: __webpack_require__(30), PartialGuild: __webpack_require__(54), PartialGuildChannel: __webpack_require__(55), PermissionOverwrites: __webpack_require__(56), @@ -26189,18 +26190,16 @@ module.exports = { Webhook: __webpack_require__(23), }; -if (__webpack_require__(27).platform() === 'browser') window.Discord = module.exports; // eslint-disable-line no-undef +if (__webpack_require__(28).platform() === 'browser') window.Discord = module.exports; // eslint-disable-line no-undef /***/ }), /* 189 */ /***/ (function(module, exports, __webpack_require__) { -const DataStore = __webpack_require__(31); +const DataStore = __webpack_require__(26); const DMChannel = __webpack_require__(47); const GroupDMChannel = __webpack_require__(32); -const TextChannel = __webpack_require__(58); -const VoiceChannel = __webpack_require__(59); const Constants = __webpack_require__(0); class ChannelStore extends DataStore { @@ -26219,14 +26218,12 @@ class ChannelStore extends DataStore { channel = new GroupDMChannel(this.client, data); break; default: // eslint-disable-line no-case-declarations - const ChannelModel = data.type === Constants.ChannelTypes.TEXT ? TextChannel : VoiceChannel; guild = guild || this.client.guilds.get(data.guild_id); if (!guild) { this.client.emit('debug', `Failed to find guild for channel ${data.id}`); return null; } - channel = new ChannelModel(guild, data); - guild.channels.set(channel.id, channel); + channel = guild.channels.create(data); break; } @@ -26240,9 +26237,7 @@ class ChannelStore extends DataStore { remove(id) { super.remove(); const channel = this.get(id); - if (channel.guild) { - channel.guild.channels.delete(id); - } + if (channel.guild) channel.guild.channels.remove(id); this.delete(id); } } @@ -26254,7 +26249,7 @@ module.exports = ChannelStore; /* 190 */ /***/ (function(module, exports, __webpack_require__) { -const DataStore = __webpack_require__(31); +const DataStore = __webpack_require__(26); const Emoji = __webpack_require__(19); const Constants = __webpack_require__(0); @@ -26297,7 +26292,44 @@ module.exports = EmojiStore; /* 191 */ /***/ (function(module, exports, __webpack_require__) { -const DataStore = __webpack_require__(31); +const DataStore = __webpack_require__(26); +const TextChannel = __webpack_require__(58); +const VoiceChannel = __webpack_require__(59); +const Constants = __webpack_require__(0); + +class GuildChannelStore extends DataStore { + constructor(guild, iterable) { + super(guild.client, iterable); + this.guild = guild; + } + + create(data) { + super.create(); + + const existing = this.get(data.id); + if (existing) return existing; + + const ChannelModel = data.type === Constants.ChannelTypes.TEXT ? TextChannel : VoiceChannel; + const channel = new ChannelModel(this.guild, data); + this.set(channel.id, channel); + + return channel; + } + + remove(id) { + super.remove(); + this.delete(id); + } +} + +module.exports = GuildChannelStore; + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +const DataStore = __webpack_require__(26); const Guild = __webpack_require__(20); const Constants = __webpack_require__(0); @@ -26343,10 +26375,10 @@ module.exports = GuildStore; /***/ }), -/* 192 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { -const DataStore = __webpack_require__(31); +const DataStore = __webpack_require__(26); const User = __webpack_require__(18); class UserStore extends DataStore { @@ -26387,7 +26419,7 @@ module.exports = UserStore; /***/ }), -/* 193 */ +/* 194 */ /***/ (function(module, exports) { /** @@ -26442,11 +26474,11 @@ module.exports = UserConnection; /***/ }), -/* 194 */ +/* 195 */ /***/ (function(module, exports, __webpack_require__) { const Collection = __webpack_require__(3); -const UserConnection = __webpack_require__(193); +const UserConnection = __webpack_require__(194); const Base = __webpack_require__(7); /** @@ -26506,7 +26538,7 @@ module.exports = UserProfile; /***/ }), -/* 195 */ +/* 196 */ /***/ (function(module, exports, __webpack_require__) { const long = __webpack_require__(36); @@ -26612,7 +26644,7 @@ module.exports = function search(target, options) { /***/ }), -/* 196 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { const Util = __webpack_require__(4); @@ -26679,12 +26711,6 @@ module.exports = function sendMessage(channel, options) { }; -/***/ }), -/* 197 */ -/***/ (function(module, exports) { - -/* (ignored) */ - /***/ }), /* 198 */ /***/ (function(module, exports) { @@ -26721,5 +26747,11 @@ module.exports = function sendMessage(channel, options) { /* (ignored) */ +/***/ }), +/* 204 */ +/***/ (function(module, exports) { + +/* (ignored) */ + /***/ }) /******/ ]); \ No newline at end of file diff --git a/discord.data-store-refactor.min.js b/discord.data-store-refactor.min.js index 85ca433c..811d53a0 100644 --- a/discord.data-store-refactor.min.js +++ b/discord.data-store-refactor.min.js @@ -1,4 +1,4 @@ -!function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=188)}([function(t,e,n){(function(t){function i({size:size,format:format}){if(format&&!s.includes(format))throw new Error("IMAGE_FORMAT",format);if(size&&!r.includes(size))throw new RangeError("IMAGE_SIZE",size)}e.Package=n(44);const{Error:Error,RangeError:RangeError}=n(5);e.DefaultOptions={apiRequestMethod:"sequential",shardId:0,shardCount:0,internalSharding:!1,messageCacheMaxSize:200,messageCacheLifetime:0,messageSweepInterval:0,fetchAllMembers:!1,disableEveryone:!1,sync:!1,restWsBridgeTimeout:5e3,disabledEvents:[],restTimeOffset:500,ws:{large_threshold:250,compress:"browser"!==n(27).platform(),properties:{$os:t?t.platform:"discord.js",$browser:"discord.js",$device:"discord.js",$referrer:"",$referring_domain:""},version:6},http:{version:7,host:"https://discordapp.com",cdn:"https://cdn.discordapp.com"}},e.WSCodes={1e3:"Connection gracefully closed",4004:"Tried to identify with an invalid token",4010:"Sharding data provided was invalid",4011:"Shard would be on too many guilds if connected"};const s=["webp","png","jpg","gif"],r=[128,256,512,1024,2048];e.Endpoints={CDN(t){return{Emoji:e=>`${t}/emojis/${e}.png`,Asset:e=>`${t}/assets/${e}`,DefaultAvatar:e=>`${t}/embed/avatars/${e}.png`,Avatar:(e,n,s="default",r)=>{"default"===s&&(s=n.startsWith("a_")?"gif":"webp");i({size:r,format:s});return`${t}/avatars/${e}/${n}.${s}${r?`?size=${r}`:""}`},Icon:(e,n,s="webp",r)=>{i({size:r,format:s});return`${t}/icons/${e}/${n}.${s}${r?`?size=${r}`:""}`},AppIcon:(e,n,s="webp",r)=>{i({size:r,format:s});return`${t}/app-icons/${e}/${n}.${s}${r?`?size=${r}`:""}`},Splash:(e,n,s="webp",r)=>{i({size:r,format:s});return`${t}/splashes/${e}/${n}.${s}${r?`?size=${r}`:""}`}}},invite:t=>`https://discord.gg/${t}`,botGateway:"/gateway/bot"},e.Status={READY:0,CONNECTING:1,RECONNECTING:2,IDLE:3,NEARLY:4,DISCONNECTED:5},e.VoiceStatus={CONNECTED:0,CONNECTING:1,AUTHENTICATING:2,RECONNECTING:3,DISCONNECTED:4},e.ChannelTypes={TEXT:0,DM:1,VOICE:2,GROUP_DM:3},e.OPCodes={DISPATCH:0,HEARTBEAT:1,IDENTIFY:2,STATUS_UPDATE:3,VOICE_STATE_UPDATE:4,VOICE_GUILD_PING:5,RESUME:6,RECONNECT:7,REQUEST_GUILD_MEMBERS:8,INVALID_SESSION:9,HELLO:10,HEARTBEAT_ACK:11},e.VoiceOPCodes={IDENTIFY:0,SELECT_PROTOCOL:1,READY:2,HEARTBEAT:3,SESSION_DESCRIPTION:4,SPEAKING:5},e.Events={READY:"ready",GUILD_CREATE:"guildCreate",GUILD_DELETE:"guildDelete",GUILD_UPDATE:"guildUpdate",GUILD_UNAVAILABLE:"guildUnavailable",GUILD_AVAILABLE:"guildAvailable",GUILD_MEMBER_ADD:"guildMemberAdd",GUILD_MEMBER_REMOVE:"guildMemberRemove",GUILD_MEMBER_UPDATE:"guildMemberUpdate",GUILD_MEMBER_AVAILABLE:"guildMemberAvailable",GUILD_MEMBER_SPEAKING:"guildMemberSpeaking",GUILD_MEMBERS_CHUNK:"guildMembersChunk",GUILD_ROLE_CREATE:"roleCreate",GUILD_ROLE_DELETE:"roleDelete",GUILD_ROLE_UPDATE:"roleUpdate",GUILD_EMOJI_CREATE:"emojiCreate",GUILD_EMOJI_DELETE:"emojiDelete",GUILD_EMOJI_UPDATE:"emojiUpdate",GUILD_BAN_ADD:"guildBanAdd",GUILD_BAN_REMOVE:"guildBanRemove",CHANNEL_CREATE:"channelCreate",CHANNEL_DELETE:"channelDelete",CHANNEL_UPDATE:"channelUpdate",CHANNEL_PINS_UPDATE:"channelPinsUpdate",MESSAGE_CREATE:"message",MESSAGE_DELETE:"messageDelete",MESSAGE_UPDATE:"messageUpdate",MESSAGE_BULK_DELETE:"messageDeleteBulk",MESSAGE_REACTION_ADD:"messageReactionAdd",MESSAGE_REACTION_REMOVE:"messageReactionRemove",MESSAGE_REACTION_REMOVE_ALL:"messageReactionRemoveAll",USER_UPDATE:"userUpdate",USER_NOTE_UPDATE:"userNoteUpdate",USER_SETTINGS_UPDATE:"clientUserSettingsUpdate",PRESENCE_UPDATE:"presenceUpdate",VOICE_STATE_UPDATE:"voiceStateUpdate",TYPING_START:"typingStart",TYPING_STOP:"typingStop",DISCONNECT:"disconnect",RECONNECTING:"reconnecting",ERROR:"error",WARN:"warn",DEBUG:"debug"},e.WSEvents={READY:"READY",RESUMED:"RESUMED",GUILD_SYNC:"GUILD_SYNC",GUILD_CREATE:"GUILD_CREATE",GUILD_DELETE:"GUILD_DELETE",GUILD_UPDATE:"GUILD_UPDATE",GUILD_MEMBER_ADD:"GUILD_MEMBER_ADD",GUILD_MEMBER_REMOVE:"GUILD_MEMBER_REMOVE",GUILD_MEMBER_UPDATE:"GUILD_MEMBER_UPDATE",GUILD_MEMBERS_CHUNK:"GUILD_MEMBERS_CHUNK",GUILD_ROLE_CREATE:"GUILD_ROLE_CREATE",GUILD_ROLE_DELETE:"GUILD_ROLE_DELETE",GUILD_ROLE_UPDATE:"GUILD_ROLE_UPDATE",GUILD_BAN_ADD:"GUILD_BAN_ADD",GUILD_BAN_REMOVE:"GUILD_BAN_REMOVE",GUILD_EMOJIS_UPDATE:"GUILD_EMOJIS_UPDATE",CHANNEL_CREATE:"CHANNEL_CREATE",CHANNEL_DELETE:"CHANNEL_DELETE",CHANNEL_UPDATE:"CHANNEL_UPDATE",CHANNEL_PINS_UPDATE:"CHANNEL_PINS_UPDATE",MESSAGE_CREATE:"MESSAGE_CREATE",MESSAGE_DELETE:"MESSAGE_DELETE",MESSAGE_UPDATE:"MESSAGE_UPDATE",MESSAGE_DELETE_BULK:"MESSAGE_DELETE_BULK",MESSAGE_REACTION_ADD:"MESSAGE_REACTION_ADD",MESSAGE_REACTION_REMOVE:"MESSAGE_REACTION_REMOVE",MESSAGE_REACTION_REMOVE_ALL:"MESSAGE_REACTION_REMOVE_ALL",USER_UPDATE:"USER_UPDATE",USER_NOTE_UPDATE:"USER_NOTE_UPDATE",USER_SETTINGS_UPDATE:"USER_SETTINGS_UPDATE",PRESENCE_UPDATE:"PRESENCE_UPDATE",VOICE_STATE_UPDATE:"VOICE_STATE_UPDATE",TYPING_START:"TYPING_START",VOICE_SERVER_UPDATE:"VOICE_SERVER_UPDATE",RELATIONSHIP_ADD:"RELATIONSHIP_ADD",RELATIONSHIP_REMOVE:"RELATIONSHIP_REMOVE"},e.MessageTypes=["DEFAULT","RECIPIENT_ADD","RECIPIENT_REMOVE","CALL","CHANNEL_NAME_CHANGE","CHANNEL_ICON_CHANGE","PINS_ADD","GUILD_MEMBER_JOIN"],e.ExplicitContentFilterTypes=["DISABLED","NON_FRIENDS","FRIENDS_AND_NON_FRIENDS"],e.UserSettingsMap={convert_emoticons:"convertEmoticons",default_guilds_restricted:"defaultGuildsRestricted",detect_platform_accounts:"detectPlatformAccounts",developer_mode:"developerMode",enable_tts_command:"enableTTSCommand",theme:"theme",status:"status",show_current_game:"showCurrentGame",inline_attachment_media:"inlineAttachmentMedia",inline_embed_media:"inlineEmbedMedia",locale:"locale",message_display_compact:"messageDisplayCompact",render_reactions:"renderReactions",guild_positions:"guildPositions",restricted_guilds:"restrictedGuilds",explicit_content_filter:function(t){return e.ExplicitContentFilterTypes[t]},friend_source_flags:function(t){return{all:t.all||!1,mutualGuilds:!!t.all||(t.mutual_guilds||!1),mutualFriends:!!t.all||(t.mutualFriends||!1)}}},e.Colors={DEFAULT:0,AQUA:1752220,GREEN:3066993,BLUE:3447003,PURPLE:10181046,GOLD:15844367,ORANGE:15105570,RED:15158332,GREY:9807270,NAVY:3426654,DARK_AQUA:1146986,DARK_GREEN:2067276,DARK_BLUE:2123412,DARK_PURPLE:7419530,DARK_GOLD:12745742,DARK_ORANGE:11027200,DARK_RED:10038562,DARK_GREY:9936031,DARKER_GREY:8359053,LIGHT_GREY:12370112,DARK_NAVY:2899536,BLURPLE:7506394,GREYPLE:10070709,DARK_BUT_NOT_BLACK:2895667,NOT_QUITE_BLACK:2303786}}).call(e,n(9))},function(t,e){class n{constructor(t){this.packetManager=t}handle(t){return t}}t.exports=n},function(t,e){class n{constructor(t){this.client=t}handle(t){return t}}t.exports=n},function(t,e){class n extends Map{constructor(t){super(t),Object.defineProperty(this,"_array",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"_keyArray",{value:null,writable:!0,configurable:!0})}set(t,e){return this._array=null,this._keyArray=null,super.set(t,e)}delete(t){return this._array=null,this._keyArray=null,super.delete(t)}array(){return this._array&&this._array.length===this.size||(this._array=Array.from(this.values())),this._array}keyArray(){return this._keyArray&&this._keyArray.length===this.size||(this._keyArray=Array.from(this.keys())),this._keyArray}first(t){if(void 0===t)return this.values().next().value;if("number"!=typeof t)throw new TypeError("The count must be a number.");if(!Number.isInteger(t)||t<1)throw new RangeError("The count must be an integer greater than 0.");t=Math.min(this.size,t);const e=new Array(t),n=this.values();for(let i=0;i{const i=t.get(n);return i!==e||void 0===i&&!t.has(n)}))}sort(t=((t,e)=>+(t>e)||+(t===e)-1)){return new n(Array.from(this.entries()).sort((e,n)=>t(e[1],n[1],e[0],n[0])))}}t.exports=n},function(t,e,n){(function(e){const i=n(41),s=n(0),r=s.DefaultOptions.http,{RangeError:RangeError,TypeError:TypeError}=n(5);class o{constructor(){throw new Error(`The ${this.constructor.name} class may not be instantiated.`)}static splitMessage(t,{maxLength:maxLength=1950,char:char="\n",prepend:prepend="",append:append=""}={}){if(t.length<=maxLength)return t;const e=t.split(char);if(1===e.length)throw new RangeError("SPLIT_MAX_LEN");const n=[""];let i=0;for(let t=0;tmaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+e[t];return n.filter(t=>t)}static escapeMarkdown(t,e=!1,n=!1){return e?t.replace(/```/g,"`​``"):n?t.replace(/\\(`|\\)/g,"$1").replace(/(`|\\)/g,"\\$1"):t.replace(/\\(\*|_|`|~|\\)/g,"$1").replace(/(\*|_|`|~|\\)/g,"\\$1")}static fetchRecommendedShards(t,e=1e3){return new Promise((n,o)=>{if(!t)throw new Error("TOKEN_MISSING");i.get(`${r.host}/api/v${r.version}${s.Endpoints.botGateway}`).set("Authorization",`Bot ${t.replace(/^Bot\s*/i,"")}`).end((t,i)=>{t&&o(t);n(i.body.shards*(1e3/e))})})}static parseEmoji(t){if(t.includes("%")&&(t=decodeURIComponent(t)),t.includes(":")){const[e,n]=t.split(":");return{name:e,id:n}}return{name:t,id:null}}static arraysEqual(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(const n of t){const t=e.indexOf(n);-1!==t&&e.splice(t,1)}return 0===e.length}static cloneObject(t){return Object.assign(Object.create(t),t)}static mergeDefault(t,e){if(!e)return t;for(const n in t)!{}.hasOwnProperty.call(e,n)?e[n]=t[n]:e[n]===Object(e[n])&&(e[n]=this.mergeDefault(t[n],e[n]));return e}static convertToBuffer(t){return"string"==typeof t&&(t=this.str2ab(t)),e.from(t)}static str2ab(t){const e=new ArrayBuffer(2*t.length),n=new Uint16Array(e);for(var i=0,s=t.length;i-1&&n16777215)throw new RangeError("COLOR_RANGE");if(t&&isNaN(t))throw new TypeError("COLOR_CONVERT");return t}}t.exports=o}).call(e,n(6).Buffer)},function(t,e,n){t.exports=n(74),t.exports.Messages=n(187)},function(t,e,n){"use strict";(function(t){function i(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function m(t){return+t!=t&&(t=0),r.alloc(+t)}function g(t,e){if(r.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(i)return V(t).length;e=(""+e).toLowerCase(),i=!0}}function v(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,n);case"utf8":case"utf-8":return D(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return M(this,e,n);case"base64":return R(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function E(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function _(t,e,n,i,s){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=s?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=r.from(e,i)),r.isBuffer(e))return 0===e.length?-1:b(t,e,n,i,s);if("number"==typeof e)return e&=255,r.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):b(t,[e],n,i,s);throw new TypeError("val must be string, number or Buffer")}function b(t,e,n,i,s){function r(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,a=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,n/=2}var u;if(s){var l=-1;for(u=n;ua&&(n=a-c),u=n;u>=0;u--){for(var h=!0,p=0;ps&&(i=s):i=s;var r=e.length;if(r%2!=0)throw new TypeError("Invalid hex string");i>r/2&&(i=r/2);for(var o=0;o239?4:r>223?3:r>191?2:1;if(s+a<=n){var c,u,l,h;switch(a){case 1:r<128&&(o=r);break;case 2:c=t[s+1],128==(192&c)&&(h=(31&r)<<6|63&c)>127&&(o=h);break;case 3:c=t[s+1],u=t[s+2],128==(192&c)&&128==(192&u)&&(h=(15&r)<<12|(63&c)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:c=t[s+1],u=t[s+2],l=t[s+3],128==(192&c)&&128==(192&u)&&128==(192&l)&&(h=(15&r)<<18|(63&c)<<12|(63&u)<<6|63&l)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),s+=a}return I(i)}function I(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var s="",r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,n,i,s,o){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||et.length)throw new RangeError("Index out of range")}function U(t,e,n,i){e<0&&(e=65535+e+1);for(var s=0,r=Math.min(t.length-n,2);s>>8*(i?s:1-s)}function P(t,e,n,i){e<0&&(e=4294967295+e+1);for(var s=0,r=Math.min(t.length-n,4);s>>8*(i?s:3-s)&255}function j(t,e,n,i,s,r){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function G(t,e,n,i,s){return s||j(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(t,e,n,i,23,4),n+4}function B(t,e,n,i,s){return s||j(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(t,e,n,i,52,8),n+8}function q(t){if(t=z(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(t,e){e=e||1/0;for(var n,i=t.length,s=null,r=[],o=0;o55295&&n<57344){if(!s){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&r.push(239,191,189);continue}s=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),s=n;continue}n=65536+(s-55296<<10|n-56320)}else s&&(e-=3)>-1&&r.push(239,191,189);if(s=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function F(t){for(var e=[],n=0;n>8,s=n%256,r.push(s),r.push(i);return r}function Y(t){return X.toByteArray(q(t))}function K(t,e,n,i){for(var s=0;s=e.length||s>=t.length);++s)e[s+n]=t[s];return s}function J(t){return t!==t}/*! +!function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=188)}([function(t,e,n){(function(t){function i({size:size,format:format}){if(format&&!s.includes(format))throw new Error("IMAGE_FORMAT",format);if(size&&!r.includes(size))throw new RangeError("IMAGE_SIZE",size)}e.Package=n(44);const{Error:Error,RangeError:RangeError}=n(5);e.DefaultOptions={apiRequestMethod:"sequential",shardId:0,shardCount:0,internalSharding:!1,messageCacheMaxSize:200,messageCacheLifetime:0,messageSweepInterval:0,fetchAllMembers:!1,disableEveryone:!1,sync:!1,restWsBridgeTimeout:5e3,disabledEvents:[],restTimeOffset:500,ws:{large_threshold:250,compress:"browser"!==n(28).platform(),properties:{$os:t?t.platform:"discord.js",$browser:"discord.js",$device:"discord.js",$referrer:"",$referring_domain:""},version:6},http:{version:7,host:"https://discordapp.com",cdn:"https://cdn.discordapp.com"}},e.WSCodes={1e3:"Connection gracefully closed",4004:"Tried to identify with an invalid token",4010:"Sharding data provided was invalid",4011:"Shard would be on too many guilds if connected"};const s=["webp","png","jpg","gif"],r=[128,256,512,1024,2048];e.Endpoints={CDN(t){return{Emoji:e=>`${t}/emojis/${e}.png`,Asset:e=>`${t}/assets/${e}`,DefaultAvatar:e=>`${t}/embed/avatars/${e}.png`,Avatar:(e,n,s="default",r)=>{"default"===s&&(s=n.startsWith("a_")?"gif":"webp");i({size:r,format:s});return`${t}/avatars/${e}/${n}.${s}${r?`?size=${r}`:""}`},Icon:(e,n,s="webp",r)=>{i({size:r,format:s});return`${t}/icons/${e}/${n}.${s}${r?`?size=${r}`:""}`},AppIcon:(e,n,s="webp",r)=>{i({size:r,format:s});return`${t}/app-icons/${e}/${n}.${s}${r?`?size=${r}`:""}`},Splash:(e,n,s="webp",r)=>{i({size:r,format:s});return`${t}/splashes/${e}/${n}.${s}${r?`?size=${r}`:""}`}}},invite:t=>`https://discord.gg/${t}`,botGateway:"/gateway/bot"},e.Status={READY:0,CONNECTING:1,RECONNECTING:2,IDLE:3,NEARLY:4,DISCONNECTED:5},e.VoiceStatus={CONNECTED:0,CONNECTING:1,AUTHENTICATING:2,RECONNECTING:3,DISCONNECTED:4},e.ChannelTypes={TEXT:0,DM:1,VOICE:2,GROUP_DM:3},e.OPCodes={DISPATCH:0,HEARTBEAT:1,IDENTIFY:2,STATUS_UPDATE:3,VOICE_STATE_UPDATE:4,VOICE_GUILD_PING:5,RESUME:6,RECONNECT:7,REQUEST_GUILD_MEMBERS:8,INVALID_SESSION:9,HELLO:10,HEARTBEAT_ACK:11},e.VoiceOPCodes={IDENTIFY:0,SELECT_PROTOCOL:1,READY:2,HEARTBEAT:3,SESSION_DESCRIPTION:4,SPEAKING:5},e.Events={READY:"ready",GUILD_CREATE:"guildCreate",GUILD_DELETE:"guildDelete",GUILD_UPDATE:"guildUpdate",GUILD_UNAVAILABLE:"guildUnavailable",GUILD_AVAILABLE:"guildAvailable",GUILD_MEMBER_ADD:"guildMemberAdd",GUILD_MEMBER_REMOVE:"guildMemberRemove",GUILD_MEMBER_UPDATE:"guildMemberUpdate",GUILD_MEMBER_AVAILABLE:"guildMemberAvailable",GUILD_MEMBER_SPEAKING:"guildMemberSpeaking",GUILD_MEMBERS_CHUNK:"guildMembersChunk",GUILD_ROLE_CREATE:"roleCreate",GUILD_ROLE_DELETE:"roleDelete",GUILD_ROLE_UPDATE:"roleUpdate",GUILD_EMOJI_CREATE:"emojiCreate",GUILD_EMOJI_DELETE:"emojiDelete",GUILD_EMOJI_UPDATE:"emojiUpdate",GUILD_BAN_ADD:"guildBanAdd",GUILD_BAN_REMOVE:"guildBanRemove",CHANNEL_CREATE:"channelCreate",CHANNEL_DELETE:"channelDelete",CHANNEL_UPDATE:"channelUpdate",CHANNEL_PINS_UPDATE:"channelPinsUpdate",MESSAGE_CREATE:"message",MESSAGE_DELETE:"messageDelete",MESSAGE_UPDATE:"messageUpdate",MESSAGE_BULK_DELETE:"messageDeleteBulk",MESSAGE_REACTION_ADD:"messageReactionAdd",MESSAGE_REACTION_REMOVE:"messageReactionRemove",MESSAGE_REACTION_REMOVE_ALL:"messageReactionRemoveAll",USER_UPDATE:"userUpdate",USER_NOTE_UPDATE:"userNoteUpdate",USER_SETTINGS_UPDATE:"clientUserSettingsUpdate",PRESENCE_UPDATE:"presenceUpdate",VOICE_STATE_UPDATE:"voiceStateUpdate",TYPING_START:"typingStart",TYPING_STOP:"typingStop",DISCONNECT:"disconnect",RECONNECTING:"reconnecting",ERROR:"error",WARN:"warn",DEBUG:"debug"},e.WSEvents={READY:"READY",RESUMED:"RESUMED",GUILD_SYNC:"GUILD_SYNC",GUILD_CREATE:"GUILD_CREATE",GUILD_DELETE:"GUILD_DELETE",GUILD_UPDATE:"GUILD_UPDATE",GUILD_MEMBER_ADD:"GUILD_MEMBER_ADD",GUILD_MEMBER_REMOVE:"GUILD_MEMBER_REMOVE",GUILD_MEMBER_UPDATE:"GUILD_MEMBER_UPDATE",GUILD_MEMBERS_CHUNK:"GUILD_MEMBERS_CHUNK",GUILD_ROLE_CREATE:"GUILD_ROLE_CREATE",GUILD_ROLE_DELETE:"GUILD_ROLE_DELETE",GUILD_ROLE_UPDATE:"GUILD_ROLE_UPDATE",GUILD_BAN_ADD:"GUILD_BAN_ADD",GUILD_BAN_REMOVE:"GUILD_BAN_REMOVE",GUILD_EMOJIS_UPDATE:"GUILD_EMOJIS_UPDATE",CHANNEL_CREATE:"CHANNEL_CREATE",CHANNEL_DELETE:"CHANNEL_DELETE",CHANNEL_UPDATE:"CHANNEL_UPDATE",CHANNEL_PINS_UPDATE:"CHANNEL_PINS_UPDATE",MESSAGE_CREATE:"MESSAGE_CREATE",MESSAGE_DELETE:"MESSAGE_DELETE",MESSAGE_UPDATE:"MESSAGE_UPDATE",MESSAGE_DELETE_BULK:"MESSAGE_DELETE_BULK",MESSAGE_REACTION_ADD:"MESSAGE_REACTION_ADD",MESSAGE_REACTION_REMOVE:"MESSAGE_REACTION_REMOVE",MESSAGE_REACTION_REMOVE_ALL:"MESSAGE_REACTION_REMOVE_ALL",USER_UPDATE:"USER_UPDATE",USER_NOTE_UPDATE:"USER_NOTE_UPDATE",USER_SETTINGS_UPDATE:"USER_SETTINGS_UPDATE",PRESENCE_UPDATE:"PRESENCE_UPDATE",VOICE_STATE_UPDATE:"VOICE_STATE_UPDATE",TYPING_START:"TYPING_START",VOICE_SERVER_UPDATE:"VOICE_SERVER_UPDATE",RELATIONSHIP_ADD:"RELATIONSHIP_ADD",RELATIONSHIP_REMOVE:"RELATIONSHIP_REMOVE"},e.MessageTypes=["DEFAULT","RECIPIENT_ADD","RECIPIENT_REMOVE","CALL","CHANNEL_NAME_CHANGE","CHANNEL_ICON_CHANGE","PINS_ADD","GUILD_MEMBER_JOIN"],e.ExplicitContentFilterTypes=["DISABLED","NON_FRIENDS","FRIENDS_AND_NON_FRIENDS"],e.UserSettingsMap={convert_emoticons:"convertEmoticons",default_guilds_restricted:"defaultGuildsRestricted",detect_platform_accounts:"detectPlatformAccounts",developer_mode:"developerMode",enable_tts_command:"enableTTSCommand",theme:"theme",status:"status",show_current_game:"showCurrentGame",inline_attachment_media:"inlineAttachmentMedia",inline_embed_media:"inlineEmbedMedia",locale:"locale",message_display_compact:"messageDisplayCompact",render_reactions:"renderReactions",guild_positions:"guildPositions",restricted_guilds:"restrictedGuilds",explicit_content_filter:function(t){return e.ExplicitContentFilterTypes[t]},friend_source_flags:function(t){return{all:t.all||!1,mutualGuilds:!!t.all||(t.mutual_guilds||!1),mutualFriends:!!t.all||(t.mutualFriends||!1)}}},e.Colors={DEFAULT:0,AQUA:1752220,GREEN:3066993,BLUE:3447003,PURPLE:10181046,GOLD:15844367,ORANGE:15105570,RED:15158332,GREY:9807270,NAVY:3426654,DARK_AQUA:1146986,DARK_GREEN:2067276,DARK_BLUE:2123412,DARK_PURPLE:7419530,DARK_GOLD:12745742,DARK_ORANGE:11027200,DARK_RED:10038562,DARK_GREY:9936031,DARKER_GREY:8359053,LIGHT_GREY:12370112,DARK_NAVY:2899536,BLURPLE:7506394,GREYPLE:10070709,DARK_BUT_NOT_BLACK:2895667,NOT_QUITE_BLACK:2303786}}).call(e,n(9))},function(t,e){class n{constructor(t){this.packetManager=t}handle(t){return t}}t.exports=n},function(t,e){class n{constructor(t){this.client=t}handle(t){return t}}t.exports=n},function(t,e){class n extends Map{constructor(t){super(t),Object.defineProperty(this,"_array",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"_keyArray",{value:null,writable:!0,configurable:!0})}set(t,e){return this._array=null,this._keyArray=null,super.set(t,e)}delete(t){return this._array=null,this._keyArray=null,super.delete(t)}array(){return this._array&&this._array.length===this.size||(this._array=Array.from(this.values())),this._array}keyArray(){return this._keyArray&&this._keyArray.length===this.size||(this._keyArray=Array.from(this.keys())),this._keyArray}first(t){if(void 0===t)return this.values().next().value;if("number"!=typeof t)throw new TypeError("The count must be a number.");if(!Number.isInteger(t)||t<1)throw new RangeError("The count must be an integer greater than 0.");t=Math.min(this.size,t);const e=new Array(t),n=this.values();for(let i=0;i{const i=t.get(n);return i!==e||void 0===i&&!t.has(n)}))}sort(t=((t,e)=>+(t>e)||+(t===e)-1)){return new n(Array.from(this.entries()).sort((e,n)=>t(e[1],n[1],e[0],n[0])))}}t.exports=n},function(t,e,n){(function(e){const i=n(41),s=n(0),r=s.DefaultOptions.http,{RangeError:RangeError,TypeError:TypeError}=n(5);class o{constructor(){throw new Error(`The ${this.constructor.name} class may not be instantiated.`)}static splitMessage(t,{maxLength:maxLength=1950,char:char="\n",prepend:prepend="",append:append=""}={}){if(t.length<=maxLength)return t;const e=t.split(char);if(1===e.length)throw new RangeError("SPLIT_MAX_LEN");const n=[""];let i=0;for(let t=0;tmaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+e[t];return n.filter(t=>t)}static escapeMarkdown(t,e=!1,n=!1){return e?t.replace(/```/g,"`​``"):n?t.replace(/\\(`|\\)/g,"$1").replace(/(`|\\)/g,"\\$1"):t.replace(/\\(\*|_|`|~|\\)/g,"$1").replace(/(\*|_|`|~|\\)/g,"\\$1")}static fetchRecommendedShards(t,e=1e3){return new Promise((n,o)=>{if(!t)throw new Error("TOKEN_MISSING");i.get(`${r.host}/api/v${r.version}${s.Endpoints.botGateway}`).set("Authorization",`Bot ${t.replace(/^Bot\s*/i,"")}`).end((t,i)=>{t&&o(t);n(i.body.shards*(1e3/e))})})}static parseEmoji(t){if(t.includes("%")&&(t=decodeURIComponent(t)),t.includes(":")){const[e,n]=t.split(":");return{name:e,id:n}}return{name:t,id:null}}static arraysEqual(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(const n of t){const t=e.indexOf(n);-1!==t&&e.splice(t,1)}return 0===e.length}static cloneObject(t){return Object.assign(Object.create(t),t)}static mergeDefault(t,e){if(!e)return t;for(const n in t)!{}.hasOwnProperty.call(e,n)?e[n]=t[n]:e[n]===Object(e[n])&&(e[n]=this.mergeDefault(t[n],e[n]));return e}static convertToBuffer(t){return"string"==typeof t&&(t=this.str2ab(t)),e.from(t)}static str2ab(t){const e=new ArrayBuffer(2*t.length),n=new Uint16Array(e);for(var i=0,s=t.length;i-1&&n16777215)throw new RangeError("COLOR_RANGE");if(t&&isNaN(t))throw new TypeError("COLOR_CONVERT");return t}}t.exports=o}).call(e,n(6).Buffer)},function(t,e,n){t.exports=n(74),t.exports.Messages=n(187)},function(t,e,n){"use strict";(function(t){function i(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function m(t){return+t!=t&&(t=0),r.alloc(+t)}function g(t,e){if(r.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(i)return V(t).length;e=(""+e).toLowerCase(),i=!0}}function v(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,n);case"utf8":case"utf-8":return D(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return M(this,e,n);case"base64":return R(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function E(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function _(t,e,n,i,s){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=s?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=r.from(e,i)),r.isBuffer(e))return 0===e.length?-1:b(t,e,n,i,s);if("number"==typeof e)return e&=255,r.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):b(t,[e],n,i,s);throw new TypeError("val must be string, number or Buffer")}function b(t,e,n,i,s){function r(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,a=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,n/=2}var u;if(s){var l=-1;for(u=n;ua&&(n=a-c),u=n;u>=0;u--){for(var h=!0,p=0;ps&&(i=s):i=s;var r=e.length;if(r%2!=0)throw new TypeError("Invalid hex string");i>r/2&&(i=r/2);for(var o=0;o239?4:r>223?3:r>191?2:1;if(s+a<=n){var c,u,l,h;switch(a){case 1:r<128&&(o=r);break;case 2:c=t[s+1],128==(192&c)&&(h=(31&r)<<6|63&c)>127&&(o=h);break;case 3:c=t[s+1],u=t[s+2],128==(192&c)&&128==(192&u)&&(h=(15&r)<<12|(63&c)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:c=t[s+1],u=t[s+2],l=t[s+3],128==(192&c)&&128==(192&u)&&128==(192&l)&&(h=(15&r)<<18|(63&c)<<12|(63&u)<<6|63&l)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),s+=a}return I(i)}function I(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var s="",r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,n,i,s,o){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||et.length)throw new RangeError("Index out of range")}function U(t,e,n,i){e<0&&(e=65535+e+1);for(var s=0,r=Math.min(t.length-n,2);s>>8*(i?s:1-s)}function P(t,e,n,i){e<0&&(e=4294967295+e+1);for(var s=0,r=Math.min(t.length-n,4);s>>8*(i?s:3-s)&255}function j(t,e,n,i,s,r){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function G(t,e,n,i,s){return s||j(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(t,e,n,i,23,4),n+4}function B(t,e,n,i,s){return s||j(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(t,e,n,i,52,8),n+8}function q(t){if(t=z(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(t,e){e=e||1/0;for(var n,i=t.length,s=null,r=[],o=0;o55295&&n<57344){if(!s){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&r.push(239,191,189);continue}s=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),s=n;continue}n=65536+(s-55296<<10|n-56320)}else s&&(e-=3)>-1&&r.push(239,191,189);if(s=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function F(t){for(var e=[],n=0;n>8,s=n%256,r.push(s),r.push(i);return r}function Y(t){return X.toByteArray(q(t))}function K(t,e,n,i){for(var s=0;s=e.length||s>=t.length);++s)e[s+n]=t[s];return s}function J(t){return t!==t}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh @@ -6,25 +6,25 @@ */ var X=n(84),$=n(87),Z=n(60);e.Buffer=r,e.SlowBuffer=m,e.INSPECT_MAX_BYTES=50,r.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=i(),r.poolSize=8192,r._augment=function(t){return t.__proto__=r.prototype,t},r.from=function(t,e,n){return o(null,t,e,n)},r.TYPED_ARRAY_SUPPORT&&(r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0})),r.alloc=function(t,e,n){return c(null,t,e,n)},r.allocUnsafe=function(t){return u(null,t)},r.allocUnsafeSlow=function(t){return u(null,t)},r.isBuffer=function(t){return!(null==t||!t._isBuffer)},r.compare=function(t,e){if(!r.isBuffer(t)||!r.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,s=0,o=Math.min(n,i);s0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},r.prototype.compare=function(t,e,n,i,s){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var o=s-i,a=n-e,c=Math.min(o,a),u=this.slice(i,s),l=t.slice(e,n),h=0;hs)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return w(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return A(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;r.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(s*=256);)i+=this[t+--e]*s;return i},r.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var i=this[t],s=1,r=0;++r=s&&(i-=Math.pow(2,8*e)),i},r.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var i=e,s=1,r=this[t+--i];i>0&&(s*=256);)r+=this[t+--i]*s;return s*=128,r>=s&&(r-=Math.pow(2,8*e)),r},r.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),$.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),$.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),$.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),$.read(this,t,!1,52,8)},r.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e|=0,n|=0,!i){O(this,t,e,n,Math.pow(2,8*n)-1,0)}var s=1,r=0;for(this[e]=255&t;++r=0&&(r*=256);)this[e+s]=t/r&255;return e+n},r.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,255,0),r.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},r.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):U(this,t,e,!0),e+2},r.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):U(this,t,e,!1),e+2},r.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},r.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},r.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var s=Math.pow(2,8*n-1);O(this,t,e,n,s-1,-s)}var r=0,o=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},r.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var s=Math.pow(2,8*n-1);O(this,t,e,n,s-1,-s)}var r=n-1,o=1,a=0;for(this[e+r]=255&t;--r>=0&&(o*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/o>>0)-a&255;return e+n},r.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,127,-128),r.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},r.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):U(this,t,e,!0),e+2},r.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):U(this,t,e,!1),e+2},r.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},r.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},r.prototype.writeFloatLE=function(t,e,n){return G(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){return G(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},r.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--s)t[s+e]=this[s+n];else if(o<1e3||!r.TYPED_ARRAY_SUPPORT)for(s=0;s>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o=e?String(t):(String(n).repeat(e)+t).slice(-e)}const s=n(36);let r=0;class o{constructor(){throw new Error(`The ${this.constructor.name} class may not be instantiated.`)}static generate(){r>=4095&&(r=0);const t=`${i((Date.now()-14200704e5).toString(2),42)}0000100000${i((r++).toString(2),12)}`;return s.fromString(t,2).toString()}static deconstruct(t){const e=i(s.fromString(t).toString(2),64),n={timestamp:parseInt(e.substring(0,42),2)+14200704e5,workerID:parseInt(e.substring(42,47),2),processID:parseInt(e.substring(47,52),2),increment:parseInt(e.substring(52,64),2),binary:e};return Object.defineProperty(n,"date",{get:function(){return new Date(this.timestamp)},enumerable:!0}),n}}t.exports=o},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function r(t){if(h===clearTimeout)return clearTimeout(t);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function o(){m&&d&&(m=!1,d.length?f=d.concat(f):g=-1,f.length&&a())}function a(){if(!m){var t=s(o);m=!0;for(var e=f.length;e;){for(d=f,f=[];++g1)for(var n=1;nnew r(t)),this.attachments=new u;for(const e of t.attachments)this.attachments.set(e.id,new s(this,e));if(this.createdTimestamp=new Date(t.timestamp).getTime(),this.editedTimestamp=t.edited_timestamp?new Date(t.edited_timestamp).getTime():null,this.reactions=new u,t.reactions&&t.reactions.length>0)for(const e of t.reactions){const t=e.emoji.id?`${e.emoji.name}:${e.emoji.id}`:e.emoji.name;this.reactions.set(t,new o(this,e.emoji,e.count,e.me))}this.mentions=new i(this,t.mentions,t.mention_roles,t.mention_everyone),this.webhookID=t.webhook_id||null,this.hit="boolean"==typeof t.hit?t.hit:null,this._edits=[]}patch(t){const e=c.cloneObject(this);if(this._edits.unshift(e),this.editedTimestamp=new Date(t.edited_timestamp).getTime(),"content"in t&&(this.content=t.content),"pinned"in t&&(this.pinned=t.pinned),"tts"in t&&(this.tts=t.tts),this.embeds="embeds"in t?t.embeds.map(t=>new r(t)):this.embeds.slice(),"attachments"in t){this.attachments=new u;for(const e of t.attachments)this.attachments.set(e.id,new s(this,e))}else this.attachments=new u(this.attachments);this.mentions=new i(this,"mentions"in t?t.mentions:this.mentions.users,"mentions_roles"in t?t.mentions_roles:this.mentions.roles,"mention_everyone"in t?t.mention_everyone:this.mentions.everyone)}get createdAt(){return new Date(this.createdTimestamp)}get editedAt(){return this.editedTimestamp?new Date(this.editedTimestamp):null}get guild(){return this.channel.guild||null}get cleanContent(){return this.content.replace(/@(everyone|here)/g,"@​$1").replace(/<@!?[0-9]+>/g,t=>{const e=t.replace(/<|!|>|@/g,"");if("dm"===this.channel.type||"group"===this.channel.type)return this.client.users.has(e)?`@${this.client.users.get(e).username}`:t;const n=this.channel.guild.members.get(e);if(n)return n.nickname?`@${n.nickname}`:`@${n.user.username}`;{const n=this.client.users.get(e);return n?`@${n.username}`:t}}).replace(/<#[0-9]+>/g,t=>{const e=this.client.channels.get(t.replace(/<|#|>/g,""));if(e)return`#${e.name}`;return t}).replace(/<@&[0-9]+>/g,t=>{if("dm"===this.channel.type||"group"===this.channel.type)return t;const e=this.guild.roles.get(t.replace(/<|@|>|&/g,""));if(e)return`@${e.name}`;return t})}createReactionCollector(t,e={}){return new a(this,t,e)}awaitReactions(t,e={}){return new Promise((n,i)=>{const s=this.createReactionCollector(t,e);s.once("end",(t,s)=>{e.errors&&e.errors.includes(s)?i(t):n(t)})})}get edits(){const t=this._edits.slice();return t.unshift(this),t}get editable(){return this.author.id===this.client.user.id}get deletable(){return this.author.id===this.client.user.id||this.guild&&this.channel.permissionsFor(this.client.user).has(h.FLAGS.MANAGE_MESSAGES)}get pinnable(){return!this.guild||this.channel.permissionsFor(this.client.user).has(h.FLAGS.MANAGE_MESSAGES)}isMentioned(t){return t=t&&t.id?t.id:t,this.mentions.users.has(t)||this.mentions.channels.has(t)||this.mentions.roles.has(t)}isMemberMentioned(t){return d||(d=n(21)),!!this.mentions.everyone||(!!this.mentions.users.has(t.id)||!!(t instanceof d&&t.roles.some(t=>this.mentions.roles.has(t.id))))}edit(t,e){e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),void 0!==t&&(t=c.resolveString(t));const{embed:embed,code:code,reply:reply}=e;if(void 0===code||"boolean"==typeof code&&!0!==code||(t=c.escapeMarkdown(c.resolveString(t),!0),t=`\`\`\`${"boolean"!=typeof code?code||"":""} ${t} -\`\`\``),reply&&"dm"!==this.channel.type){const e=this.client.resolver.resolveUserID(reply),n=`<@${reply instanceof d&&reply.nickname?"!":""}${e}>`;t=`${n}${t?`, ${t}`:""}`}return this.client.api.channels(this.channel.id).messages(this.id).patch({data:{content:t,embed:embed}}).then(t=>this.client.actions.MessageUpdate.handle(t).updated)}pin(){return this.client.api.channels(this.channel.id).pins(this.id).put().then(()=>this)}unpin(){return this.client.api.channels(this.channel.id).pins(this.id).delete().then(()=>this)}react(t){if(!(t=this.client.resolver.resolveEmojiIdentifier(t)))throw new TypeError("EMOJI_TYPE");return this.client.api.channels(this.channel.id).messages(this.id).reactions(t)["@me"].put().then(()=>this._addReaction(c.parseEmoji(t),this.client.user))}clearReactions(){return this.client.api.channels(this.channel.id).messages(this.id).reactions.delete().then(()=>this)}delete({timeout:timeout=0,reason:reason}={}){return timeout<=0?this.client.api.channels(this.channel.id).messages(this.id).delete({reason:reason}).then(()=>this.client.actions.MessageDelete.handle({id:this.id,channel_id:this.channel.id}).message):new Promise(t=>{this.client.setTimeout(()=>{t(this.delete({reason:reason}))},timeout)})}reply(t,e){return e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),this.channel.send(t,Object.assign(e,{reply:this.member||this.author}))}acknowledge(){return this.client.api.channels(this.channel.id).messages(this.id).ack.post({data:{token:this.client.rest._ackToken}}).then(t=>{t.token&&(this.client.rest._ackToken=t.token);return this})}fetchWebhook(){return this.webhookID?this.client.fetchWebhook(this.webhookID):Promise.reject(new Error("The message was not sent by a webhook."))}equals(t,e){if(!t)return!1;if(!t.author&&!t.attachments)return this.id===t.id&&this.embeds.length===t.embeds.length;let n=this.id===t.id&&this.author.id===t.author.id&&this.content===t.content&&this.tts===t.tts&&this.nonce===t.nonce&&this.embeds.length===t.embeds.length&&this.attachments.length===t.attachments.length;return n&&e&&(n=this.mentions.everyone===t.mentions.everyone&&this.createdTimestamp===new Date(e.timestamp).getTime()&&this.editedTimestamp===new Date(e.edited_timestamp).getTime()),n}toString(){return this.content}_addReaction(t,e){const n=t.id?`${t.name}:${t.id}`:encodeURIComponent(t.name);let i;return this.reactions.has(n)?(i=this.reactions.get(n),i.me||(i.me=e.id===this.client.user.id)):(i=new o(this,t,0,e.id===this.client.user.id),this.reactions.set(n,i)),i.users.has(e.id)||i.users.set(e.id,e),i.count++,i}_removeReaction(t,e){const n=t.id?`${t.name}:${t.id}`:encodeURIComponent(t.name);if(this.reactions.has(n)){const t=this.reactions.get(n);if(t.users.has(e.id))return t.users.delete(e.id),t.count--,e.id===this.client.user.id&&(t.me=!1),t.count<=0&&this.reactions.delete(n),t}return null}_clearReactions(){this.reactions.clear()}}t.exports=f},function(t,e,n){const{RangeError:RangeError}=n(5);class i{constructor(t){this.bitfield="number"==typeof t?t:this.constructor.resolve(t)}has(t,e=!0){return t instanceof Array?t.every(t=>this.has(t,e)):(t=this.constructor.resolve(t),!!(e&&(this.bitfield&this.constructor.FLAGS.ADMINISTRATOR)>0)||(this.bitfield&t)===t)}missing(t,e=!0){return t.filter(t=>!this.has(t,e))}add(...t){let e=0;for(let n=0;nthis.resolve(t)).reduce((t,e)=>t|e,0);if("string"==typeof t&&(t=this.FLAGS[t]),"number"!=typeof t||t<1)throw new RangeError("PERMISSION_INVALID");return t}}i.FLAGS={CREATE_INSTANT_INVITE:1,KICK_MEMBERS:2,BAN_MEMBERS:4,ADMINISTRATOR:8,MANAGE_CHANNELS:16,MANAGE_GUILD:32,ADD_REACTIONS:64,VIEW_AUDIT_LOG:128,READ_MESSAGES:1024,SEND_MESSAGES:2048,SEND_TTS_MESSAGES:4096,MANAGE_MESSAGES:8192,EMBED_LINKS:16384,ATTACH_FILES:32768,READ_MESSAGE_HISTORY:65536,MENTION_EVERYONE:1<<17,USE_EXTERNAL_EMOJIS:1<<18,CONNECT:1<<20,SPEAK:1<<21,MUTE_MEMBERS:1<<22,DEAFEN_MEMBERS:1<<23,MOVE_MEMBERS:1<<24,USE_VAD:1<<25,CHANGE_NICKNAME:1<<26,MANAGE_NICKNAMES:1<<27,MANAGE_ROLES:1<<28,MANAGE_WEBHOOKS:1<<29,MANAGE_EMOJIS:1<<30},i.ALL=Object.values(i.FLAGS).reduce((t,e)=>t|e,0),i.DEFAULT=104324097,t.exports=i},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){class n{constructor(t={}){this.status=t.status||"offline",this.game=t.game?new i(t.game):null}update(t){this.status=t.status||this.status,this.game=t.game?new i(t.game):null}equals(t){return this===t||(t&&this.status===t.status&&this.game?this.game.equals(t.game):!t.game)}}class i{constructor(t){this.name=t.name,this.type=t.type,this.url=t.url||null}get streaming(){return 1===this.type}equals(t){return this===t||t&&this.name===t.name&&this.type===t.type&&this.url===t.url}}e.Presence=n,e.Game=i},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function s(t){return"number"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!s(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,a,c,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var l=new Error('Uncaught, unspecified "error" event. ('+e+")");throw l.context=e,l}if(n=this._events[t],o(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(r(n))for(a=Array.prototype.slice.call(arguments,1),u=n.slice(),s=u.length,c=0;c0&&this._events[t].length>s&&(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),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),s||(s=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var s=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,s,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,s=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(a=o;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){s=a;break}if(s<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";function i(t){if(!(this instanceof i))return new i(t);u.call(this,t),l.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",s)}function s(){this.allowHalfOpen||this._writableState.ended||a(r,this)}function r(t){t.end()}var o=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=i;var a=n(37),c=n(24);c.inherits=n(13);var u=n(61),l=n(39);c.inherits(i,u);for(var h=o(l.prototype),p=0;pthis)}}t.exports=r},function(t,e,n){const i=n(26),s=n(0),r=n(14).Presence,o=n(194),a=n(8),c=n(7);class u extends c{constructor(t,e){super(t),this._patch(e)}_patch(t){super._patch(),this.id=t.id,this.username=t.username,this.discriminator=t.discriminator,this.avatar=t.avatar,this.bot=Boolean(t.bot),this.lastMessageID=null,this.lastMessage=null}patch(t){for(const e of["id","username","discriminator","avatar","bot"])void 0!==t[e]&&(this[e]=t[e]);t.token&&(this.client.token=t.token)}get createdTimestamp(){return a.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get presence(){if(this.client.presences.has(this.id))return this.client.presences.get(this.id);for(const t of this.client.guilds.values())if(t.presences.has(this.id))return t.presences.get(this.id);return new r}avatarURL({format:format,size:size}={}){return this.avatar?("number"==typeof format&&(size=format,format="default"),s.Endpoints.CDN(this.client.options.http.cdn).Avatar(this.id,this.avatar,format,size)):null}get defaultAvatarURL(){return s.Endpoints.CDN(this.client.options.http.cdn).DefaultAvatar(this.discriminator%5)}displayAvatarURL(t){return this.avatarURL(t)||this.defaultAvatarURL}get tag(){return`${this.username}#${this.discriminator}`}get note(){return this.client.user.notes.get(this.id)||null}typingIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)}typingSinceIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)?new Date(t._typing.get(this.id).since):null}typingDurationIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)?t._typing.get(this.id).elapsedTime:-1}get dmChannel(){return this.client.channels.filter(t=>"dm"===t.type).find(t=>t.recipient.id===this.id)}createDM(){return this.dmChannel?Promise.resolve(this.dmChannel):this.client.api.users(this.client.user.id).channels.post({data:{recipient_id:this.id}}).then(t=>this.client.actions.ChannelCreate.handle(t).channel)}deleteDM(){return this.dmChannel?this.client.api.channels(this.dmChannel.id).delete().then(t=>this.client.actions.ChannelDelete.handle(t).channel):Promise.reject(new Error("No DM Channel exists!"))}fetchProfile(){return this.client.api.users(this.id).profile.get().then(t=>new o(t))}setNote(t){return this.client.api.users("@me").notes(this.id).put({data:{note:t}}).then(()=>this)}equals(t){return t&&this.id===t.id&&this.username===t.username&&this.discriminator===t.discriminator&&this.avatar===t.avatar&&this.bot===Boolean(t.bot)}toString(){return`<@${this.id}>`}send(){}}i.applyToClass(u),t.exports=u},function(t,e,n){const i=n(0),s=n(3),r=n(8),o=n(7);class a extends o{constructor(t,e){super(t.client),this.guild=t,this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.requiresColons=t.require_colons,this.managed=t.managed,this._roles=t.roles}get createdTimestamp(){return r.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get roles(){const t=new s;for(const e of this._roles)this.guild.roles.has(e)&&t.set(e,this.guild.roles.get(e));return t}get url(){return i.Endpoints.CDN(this.client.options.http.cdn).Emoji(this.id)}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}edit(t,e){return this.client.api.guilds(this.guild.id).emojis(this.id).patch({data:{name:t.name,roles:t.roles?t.roles.map(t=>t.id?t.id:t):[]},reason:e}).then(()=>this)}setName(t){return this.edit({name:t})}addRestrictedRole(t){return this.addRestrictedRoles([t])}addRestrictedRoles(t){const e=new s(this.roles);for(const n of t)this.guild.roles.has(n.id)&&e.set(n.id,n);return this.edit({roles:e})}removeRestrictedRole(t){return this.removeRestrictedRoles([t])}removeRestrictedRoles(t){const e=new s(this.roles);for(const n of t)e.has(n.id)&&e.delete(n.id);return this.edit({roles:e})}toString(){return this.requiresColons?`<:${this.name}:${this.id}>`:this.name}equals(t){return t instanceof a?t.id===this.id&&t.name===this.name&&t.managed===this.managed&&t.requiresColons===this.requiresColons:t.id===this.id&&t.name===this.name}}t.exports=a},function(t,e,n){const i=n(36),s=n(18),r=n(22),o=n(19),a=n(28),c=n(48),u=n(23),l=n(14).Presence,h=n(21),p=n(75),d=n(0),f=n(3),m=n(4),g=n(8),v=n(11),E=n(76),_=n(190),b=n(7),{Error:Error,TypeError:TypeError}=n(5);class w extends b{constructor(t,e){super(t),this.members=new f,this.channels=new f,this.roles=new f,this.presences=new f,e&&(e.unavailable?(this.available=!1,this.id=e.id):(this._patch(e),e.channels||(this.available=!1)))}_patch(t){if(super._patch(t),this.name=t.name,this.icon=t.icon,this.splash=t.splash,this.region=t.region,this.memberCount=t.member_count||this.memberCount,this.large=Boolean("large"in t?t.large:this.large),this.features=t.features,this.applicationID=t.application_id,this.afkTimeout=t.afk_timeout,this.afkChannelID=t.afk_channel_id,this.embedEnabled=t.embed_enabled,this.verificationLevel=t.verification_level,this.explicitContentFilter=t.explicit_content_filter,this.joinedTimestamp=t.joined_at?new Date(t.joined_at).getTime():this.joinedTimestamp,this.id=t.id,this.available=!t.unavailable,this.features=t.features||this.features||[],t.members){this.members.clear();for(const e of t.members)this._addMember(e,!1)}if(t.owner_id&&(this.ownerID=t.owner_id),t.channels){this.channels.clear();for(const e of t.channels)this.client.channels.create(e,this)}if(t.roles){this.roles.clear();for(const e of t.roles){const t=new r(this,e);this.roles.set(t.id,t)}}if(t.presences)for(const e of t.presences)this._setPresence(e.user.id,e);if(this._rawVoiceStates=new f,t.voice_states)for(const e of t.voice_states){this._rawVoiceStates.set(e.user_id,e);const t=this.members.get(e.user_id);t&&(t.serverMute=e.mute,t.serverDeaf=e.deaf,t.selfMute=e.self_mute,t.selfDeaf=e.self_deaf,t.voiceSessionID=e.session_id,t.voiceChannelID=e.channel_id,this.channels.get(e.channel_id).members.set(t.user.id,t))}if(this.emojis)this.client.actions.GuildEmojisUpdate.handle({guild_id:this.id,emojis:t.emojis});else{this.emojis=new _(this);for(const e of t.emojis)this.emojis.create(e)}}get createdTimestamp(){return g.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get joinedAt(){return new Date(this.joinedTimestamp)}iconURL(t,e){return this.icon?("number"==typeof t&&(e=t,t="default"),d.Endpoints.CDN(this.client.options.http.cdn).Icon(this.id,this.icon,t,e)):null}get nameAcronym(){return this.name.replace(/\w+/g,t=>t[0]).replace(/\s/g,"")}get splashURL(){return this.splash?d.Endpoints.CDN(this.client.options.http.cdn).Splash(this.id,this.splash):null}get owner(){return this.members.get(this.ownerID)}get voiceConnection(){return this.client.browser?null:this.client.voice.connections.get(this.id)||null}get defaultChannel(){return this.channels.get(this.id)}get position(){return this.client.user.bot?null:this.client.user.settings.guildPositions?this.client.user.settings.guildPositions.indexOf(this.id):null}get defaultRole(){return this.roles.get(this.id)}get me(){return this.members.get(this.client.user.id)}get _sortedRoles(){return this._sortPositionWithID(this.roles)}member(t){return this.client.resolver.resolveGuildMember(this,t)}fetchBans(){return this.client.api.guilds(this.id).bans.get().then(t=>t.reduce((t,e)=>{t.set(e.user.id,{reason:e.reason,user:this.client.users.create(e.user)});return t},new f))}fetchInvites(){return this.client.api.guilds(this.id).invites.get().then(t=>{const e=new f;for(const n of t){const t=new a(this.client,n);e.set(t.code,t)}return e})}fetchWebhooks(){return this.client.api.guilds(this.id).webhooks.get().then(t=>{const e=new f;for(const n of t)e.set(n.id,new u(this.client,n));return e})}fetchVoiceRegions(){return this.client.api.guilds(this.id).regions.get().then(t=>{const e=new f;for(const n of t)e.set(n.id,new p(n));return e})}fetchAuditLogs(t={}){return t.before&&t.before instanceof c.Entry&&(t.before=t.before.id),t.after&&t.after instanceof c.Entry&&(t.after=t.after.id),"string"==typeof t.type&&(t.type=c.Actions[t.type]),this.client.api.guilds(this.id)["audit-logs"].get({query:{before:t.before,after:t.after,limit:t.limit,user_id:this.client.resolver.resolveUserID(t.user),action_type:t.type}}).then(t=>c.build(this,t))}addMember(t,e){if(this.members.has(t.id))return Promise.resolve(this.members.get(t.id));if(e.access_token=e.accessToken,e.roles){const t=e.roles;(t instanceof f||t instanceof Array&&t[0]instanceof r)&&(e.roles=t.map(t=>t.id))}return this.client.api.guilds(this.id).members(t.id).put({data:e}).then(t=>this.client.actions.GuildMemberGet.handle(this,t).member)}fetchMember(t,e=!0){return t=this.client.resolver.resolveUser(t),t?this.members.has(t.id)?Promise.resolve(this.members.get(t.id)):this.client.api.guilds(this.id).members(t.id).get().then(t=>e?this.client.actions.GuildMemberGet.handle(this,t).member:new h(this,t)):Promise.reject(new Error("User is not cached. Use Client.fetchUser first."))}fetchMembers(t="",e=0){return new Promise((n,i)=>{if(this.memberCount===this.members.size)return void n(new f);this.client.ws.send({op:d.OPCodes.REQUEST_GUILD_MEMBERS,d:{guild_id:this.id,query:t,limit:e}});const s=new f;const r=(i,o)=>{if(o.id!==this.id)return;for(const t of i.values())s.set(t.user.id,t);(this.memberCount===this.members.size||(t||e)&&i.size<1e3)&&(this.client.removeListener(d.Events.GUILD_MEMBERS_CHUNK,r),n(s))};this.client.on(d.Events.GUILD_MEMBERS_CHUNK,r);this.client.setTimeout(()=>{this.client.removeListener(d.Events.GUILD_MEMBERS_CHUNK,r);i(new Error("GUILD_MEMBERS_NOT_RECEIVED"))},12e4)})}search(t={}){return E.search(this,t)}edit(t,e){const n={};return t.name&&(n.name=t.name),t.region&&(n.region=t.region),void 0!==t.verificationLevel&&(n.verification_level=Number(t.verificationLevel)),t.afkChannel&&(n.afk_channel_id=this.client.resolver.resolveChannel(t.afkChannel).id),t.afkTimeout&&(n.afk_timeout=Number(t.afkTimeout)),t.icon&&(n.icon=this.client.resolver.resolveBase64(t.icon)),t.owner&&(n.owner_id=this.client.resolver.resolveUser(t.owner).id),t.splash&&(n.splash=this.client.resolver.resolveBase64(t.splash)),void 0!==t.explicitContentFilter&&(n.explicit_content_filter=Number(t.explicitContentFilter)),this.client.api.guilds(this.id).patch({data:n,reason:e}).then(t=>this.client.actions.GuildUpdate.handle(t).updated)}setExplicitContentFilter(t){return this.edit({explicitContentFilter:t})}setName(t){return this.edit({name:t})}setRegion(t){return this.edit({region:t})}setVerificationLevel(t){return this.edit({verificationLevel:t})}setAFKChannel(t){return this.edit({afkChannel:t})}setAFKTimeout(t){return this.edit({afkTimeout:t})}setIcon(t){return this.edit({icon:t})}setOwner(t){return this.edit({owner:t})}setSplash(t){return this.edit({splash:t})}setPosition(t,e){return this.client.user.bot?Promise.reject(new Error("Setting guild position is only available for user accounts")):this.client.user.settings.setGuildPosition(this,t,e)}acknowledge(){return this.client.api.guilds(this.id).ack.post({data:{token:this.client.rest._ackToken}}).then(t=>{t.token&&(this.client.rest._ackToken=t.token);return this})}allowDMs(t){const e=this.client.user.settings;return t?e.removeRestrictedGuild(this):e.addRestrictedGuild(this)}ban(t,e={days:0}){e.days&&(e["delete-message-days"]=e.days);const n=this.client.resolver.resolveUserID(t);return n?this.client.api.guilds(this.id).bans(n).put({query:e}).then(()=>{if(t instanceof h)return t;const e=this.client.resolver.resolveUser(n);if(e){const t=this.client.resolver.resolveGuildMember(this,e);return t||e}return n}):Promise.reject(new Error("Couldn't resolve the user ID to ban."))}unban(t,e){const n=this.client.resolver.resolveUserID(t);if(!n)throw new Error("BAN_RESOLVE_ID");return this.client.api.guilds(this.id).bans(n).delete({reason:e}).then(()=>t)}pruneMembers({days:days=7,dry:dry=!1,reason:reason}={}){if("number"!=typeof days)throw new TypeError("PRUNE_DAYS_TYPE");return this.client.api.guilds(this.id).prune[dry?"get":"post"]({query:{days:days},reason:reason}).then(t=>t.pruned)}sync(){this.client.user.bot||this.client.syncGuilds([this])}createChannel(t,e,{overwrites:overwrites,reason:reason}={}){return(overwrites instanceof f||overwrites instanceof Array)&&(overwrites=overwrites.map(t=>({allow:t.allow||t._allowed,deny:t.deny||t._denied,type:t.type,id:t.id}))),this.client.api.guilds(this.id).channels.post({data:{name:t,type:e,permission_overwrites:overwrites},reason:reason}).then(t=>this.client.actions.ChannelCreate.handle(t).channel)}setChannelPositions(t){const e=new Array(t.length);for(let n=0;nthis.client.actions.GuildChannelsPositionUpdate.handle({guild_id:this.id,channels:t}).guild)}createRole({data:data={},reason:reason}={}){return data.color&&(data.color=m.resolveColor(data.color)),data.permissions&&(data.permissions=v.resolve(data.permissions)),this.client.api.guilds(this.id).roles.post({data:data,reason:reason}).then(t=>this.client.actions.GuildRoleCreate.handle({guild_id:this.id,role:t}).role)}createEmoji(t,e,n){if("string"==typeof t&&t.startsWith("data:")){const i={image:t,name:e};return n&&(i.roles=n.map(t=>t.id?t.id:t)),this.client.api.guilds(this.id).emojis.post({data:i}).then(t=>this.client.actions.GuildEmojiCreate.handle(this,t).emoji)}return this.client.resolver.resolveBuffer(t).then(t=>{const i=this.client.resolver.resolveBase64(t);return this.createEmoji(i,e,n)})}deleteEmoji(t){return t instanceof o||(t=this.emojis.get(t)),this.client.api.guilds(this.id).emojis(this.id).delete().then(()=>this.client.actions.GuildEmojiDelete.handle(t).data)}leave(){return this.ownerID===this.client.user.id?Promise.reject(new Error("Guild is owned by the client.")):this.client.api.users("@me").guilds(this.id).delete().then(()=>this.client.actions.GuildDelete.handle({id:this.id}).guild)}delete(){return this.client.api.guilds(this.id).delete().then(()=>this.client.actions.GuildDelete.handle({id:this.id}).guild)}equals(t){let e=t&&this.id===t.id&&this.available===!t.unavailable&&this.splash===t.splash&&this.region===t.region&&this.name===t.name&&this.memberCount===t.member_count&&this.large===t.large&&this.icon===t.icon&&m.arraysEqual(this.features,t.features)&&this.ownerID===t.owner_id&&this.verificationLevel===t.verification_level&&this.embedEnabled===t.embed_enabled;return e&&(this.embedChannel?this.embedChannel.id!==t.embed_channel_id&&(e=!1):t.embed_channel_id&&(e=!1)),e}toString(){return this.name}_addMember(t,e=!0){const n=this.members.has(t.user.id);t.user instanceof s||(t.user=this.client.users.create(t.user)),t.joined_at=t.joined_at||0;const i=new h(this,t);if(this.members.set(i.id,i),this._rawVoiceStates&&this._rawVoiceStates.has(i.user.id)){const t=this._rawVoiceStates.get(i.user.id);i.serverMute=t.mute,i.serverDeaf=t.deaf,i.selfMute=t.self_mute,i.selfDeaf=t.self_deaf,i.voiceSessionID=t.session_id,i.voiceChannelID=t.channel_id,this.client.channels.has(t.channel_id)?this.client.channels.get(t.channel_id).members.set(i.user.id,i):this.client.emit("warn",`Member ${i.id} added in guild ${this.id} with an uncached voice channel`)}return this.client.ws.connection.status===d.Status.READY&&e&&!n&&this.client.emit(d.Events.GUILD_MEMBER_ADD,i),i}_updateMember(t,e){const n=m.cloneObject(t);e.roles&&(t._roles=e.roles),void 0!==e.nick&&(t.nickname=e.nick);const i=t.nickname!==n.nickname||!m.arraysEqual(t._roles,n._roles);return this.client.ws.connection.status===d.Status.READY&&i&&this.client.emit(d.Events.GUILD_MEMBER_UPDATE,n,t),{old:n,mem:t}}_removeMember(t){this.members.delete(t.id)}_memberSpeakUpdate(t,e){const n=this.members.get(t);n&&n.speaking!==e&&(n.speaking=e,this.client.emit(d.Events.GUILD_MEMBER_SPEAKING,n,e))}_setPresence(t,e){if(this.presences.get(t))return void this.presences.get(t).update(e);this.presences.set(t,new l(e))}setRolePosition(t,e,n=!1){if("string"==typeof t&&!(t=this.roles.get(t)))return Promise.reject(new Error("Supplied role is not a role or snowflake."));if(e=Number(e),isNaN(e))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedRoles.array();return m.moveElementInArray(i,t,e,n),i=i.map((t,e)=>({id:t.id,position:e})),this.client.api.guilds(this.id).roles.patch({data:i}).then(()=>this.client.actions.GuildRolesPositionUpdate.handle({guild_id:this.id,roles:i}).guild)}setChannelPosition(t,e,n=!1){if("string"==typeof t&&!(t=this.channels.get(t)))return Promise.reject(new Error("Supplied channel is not a channel or snowflake."));if(e=Number(e),isNaN(e))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedChannels(t.type).array();return m.moveElementInArray(i,t,e,n),i=i.map((t,e)=>({id:t.id,position:e})),this.client.api.guilds(this.id).channels.patch({data:i}).then(()=>this.client.actions.GuildChannelsPositionUpdate.handle({guild_id:this.id,roles:i}).guild)}_sortedChannels(t){return this._sortPositionWithID(this.channels.filter(e=>"voice"===t&&"voice"===e.type||("voice"!==t&&"voice"!==e.type||t===e.type)))}_sortPositionWithID(t){return t.sort((t,e)=>t.position!==e.position?t.position-e.position:i.fromString(t.id).sub(i.fromString(e.id)).toNumber())}}t.exports=w},function(t,e,n){const i=n(26),s=n(22),r=n(11),o=n(3),a=n(14).Presence,c=n(7),{Error:Error}=n(5);class u extends c{constructor(t,e){super(t.client),this.guild=t,this.user={},this._roles=[],e&&this._patch(e),this.lastMessageID=null,this.lastMessage=null}_patch(t){super._patch(t),this.serverDeaf=t.deaf,this.serverMute=t.mute,this.selfMute=t.self_mute,this.selfDeaf=t.self_deaf,this.voiceSessionID=t.session_id,this.voiceChannelID=t.channel_id,this.speaking=!1,this.nickname=t.nick||null,this.joinedTimestamp=new Date(t.joined_at).getTime(),this.user=t.user,this._roles=t.roles}get joinedAt(){return new Date(this.joinedTimestamp)}get presence(){return this.frozenPresence||this.guild.presences.get(this.id)||new a}get roles(){const t=new o,e=this.guild.roles.get(this.guild.id);e&&t.set(e.id,e);for(const e of this._roles){const n=this.guild.roles.get(e);n&&t.set(n.id,n)}return t}get highestRole(){return this.roles.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t)}get colorRole(){const t=this.roles.filter(t=>t.color);return t.size?t.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t):null}get displayColor(){const t=this.colorRole;return t&&t.color||0}get displayHexColor(){const t=this.colorRole;return t&&t.hexColor||"#000000"}get hoistRole(){const t=this.roles.filter(t=>t.hoist);return t.size?t.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t):null}get mute(){return this.selfMute||this.serverMute}get deaf(){return this.selfDeaf||this.serverDeaf}get voiceChannel(){return this.guild.channels.get(this.voiceChannelID)}get id(){return this.user.id}get displayName(){return this.nickname||this.user.username}get permissions(){if(this.user.id===this.guild.ownerID)return new r(r.ALL);let t=0;const e=this.roles;for(const n of e.values())t|=n.permissions;return new r(t)}get kickable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const t=this.guild.member(this.client.user);return!!t.permissions.has(r.FLAGS.KICK_MEMBERS)&&t.highestRole.comparePositionTo(this.highestRole)>0}get bannable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const t=this.guild.member(this.client.user);return!!t.permissions.has(r.FLAGS.BAN_MEMBERS)&&t.highestRole.comparePositionTo(this.highestRole)>0}permissionsIn(t){if(!(t=this.client.resolver.resolveChannel(t))||!t.guild)throw new Error("GUILD_CHANNEL_RESOLVE");return t.permissionsFor(this)}hasPermission(t,e=!1,n,i){return void 0===n&&(n=!e),void 0===i&&(i=!e),!(!i||this.user.id!==this.guild.ownerID)||this.roles.some(e=>e.hasPermission(t,void 0,n))}missingPermissions(t,e=!1){return t.missing(t,e)}edit(t,e){t.channel&&(t.channel_id=this.client.resolver.resolveChannel(t.channel).id,t.channel=null),t.roles&&(t.roles=t.roles.map(t=>t instanceof s?t.id:t));let n=this.client.api.guilds(this.guild.id);if(this.user.id===this.client.user.id){const e=Object.keys(t);n=1===e.length&&"nick"===e[0]?n.members("@me").nick:n.members(this.id)}else n=n.members(this.id);return n.patch({data:t,reason:e}).then(t=>this.guild._updateMember(this,t).mem)}setMute(t){return this.edit({mute:t})}setDeaf(t){return this.edit({deaf:t})}setVoiceChannel(t){return this.edit({channel:t})}setRoles(t){return this.edit({roles:t})}addRole(t){return t instanceof s||(t=this.guild.roles.get(t)),t?this._roles.includes(t.id)?Promise.resolve(this):this.client.api.guilds(this.guild.id).members(this.user.id).roles(t.id).put().then(()=>this):Promise.reject(new TypeError("Supplied parameter was neither a Role nor a Snowflake."))}addRoles(t){let e;if(t instanceof o){e=this._roles.slice();for(const n of t.values())e.push(n.id?n.id:n)}else e=this._roles.concat(t.map(t=>t.id?t.id:t));return this.edit({roles:e})}removeRole(t){return t instanceof s||(t=this.guild.roles.get(t)),t?this.client.api.guilds(this.guild.id).members(this.user.id).roles(t.id).delete().then(()=>this):Promise.reject(new TypeError("Supplied parameter was neither a Role nor a Snowflake."))}removeRoles(t){const e=this._roles.slice();if(t instanceof o)for(const n of t.values()){const t=e.indexOf(n.id);t>=0&&e.splice(t,1)}else for(const n of t){const t=e.indexOf(n instanceof s?n.id:n);t>=0&&e.splice(t,1)}return this.edit({roles:e})}setNickname(t){return this.edit({nick:t})}createDM(){return this.user.createDM()}deleteDM(){return this.user.deleteDM()}kick(t){return this.client.api.guilds(this.guild.id).members(this.user.id).delete({reason:t}).then(()=>this.client.actions.GuildMemberRemove.handle({guild_id:this.guild.id,user:this.user}).member)}ban(t){return this.guild.ban(this,t)}toString(){return`<@${this.nickname?"!":""}${this.user.id}>`}send(){}}i.applyToClass(u),t.exports=u},function(t,e,n){const i=n(8),s=n(11),r=n(4),o=n(7);class a extends o{constructor(t,e){super(t.client),this.guild=t,e&&this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.color=t.color,this.hoist=t.hoist,this.position=t.position,this.permissions=t.permissions,this.managed=t.managed,this.mentionable=t.mentionable}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let t=this.color.toString(16);for(;t.length<6;)t=`0${t}`;return`#${t}`}get members(){return this.guild.members.filter(t=>t.roles.has(this.id))}get editable(){if(this.managed)return!1;const t=this.guild.member(this.client.user);return!!t.permissions.has(s.FLAGS.MANAGE_ROLES)&&t.highestRole.comparePositionTo(this)>0}get calculatedPosition(){const t=this.guild._sortedRoles;return t.array().indexOf(t.get(this.id))}serialize(){return new s(this.permissions).serialize()}hasPermission(t,e=!1,n){return new s(this.permissions).has(t,void 0!==n?n:!e)}comparePositionTo(t){return this.constructor.comparePositions(this,t)}edit(t,e){return t.permissions?t.permissions=s.resolve(t.permissions):t.permissions=this.permissions,this.client.api.guilds(this.guild.id).roles(this.id).patch({data:{name:t.name||this.name,position:void 0!==t.position?t.position:this.position,color:r.resolveColor(t.color||this.color),hoist:void 0!==t.hoist?t.hoist:this.hoist,mentionable:void 0!==t.mentionable?t.mentionable:this.mentionable},reason:e}).then(t=>this.client.actions.GuildRoleUpdate.handle({role:t,guild_id:this.guild.id}).updated)}setName(t){return this.edit({name:t})}setColor(t){return this.edit({color:t})}setHoist(t){return this.edit({hoist:t})}setPosition(t,e){return this.guild.setRolePosition(this,t,e).then(()=>this)}setPermissions(t){return this.edit({permissions:t})}setMentionable(t){return this.edit({mentionable:t})}delete(t){return this.client.api.guilds(this.guild.id).roles(this.id).delete({reason:t}).then(()=>this.client.actions.GuildRoleDelete.handle({guild_id:this.guild.id,role_id:this.id}).role)}equals(t){return t&&this.id===t.id&&this.name===t.name&&this.color===t.color&&this.hoist===t.hoist&&this.position===t.position&&this.permissions===t.permissions&&this.managed===t.managed}toString(){return this.id===this.guild.id?"@everyone":`<@&${this.id}>`}static comparePositions(t,e){return t.position===e.position?e.id-t.id:t.position-e.position}}t.exports=a},function(t,e,n){const i=n(30),s=n(4);class r{constructor(t,e,n){t?(Object.defineProperty(this,"client",{value:t}),e&&this._patch(e)):(this.id=e,this.token=n,Object.defineProperty(this,"client",{value:this}))}_patch(t){this.name=t.name,this.token=t.token,this.avatar=t.avatar,this.id=t.id,this.guildID=t.guild_id,this.channelID=t.channel_id,t.user?this.owner=this.client.users?this.client.users.get(t.user.id):t.user:this.owner=null}send(t,e){if(e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),e.username||(e.username=this.name),e.avatarURL&&(e.avatar_url=e.avatarURL,e.avatarURL=null),void 0!==t&&(t=s.resolveString(t)),t&&(e.disableEveryone||void 0===e.disableEveryone&&this.client.options.disableEveryone)&&(t=t.replace(/@(everyone|here)/g,"@​$1")),e.content=t,e.file&&(e.files?e.files.push(e.file):e.files=[e.file]),e.files){for(let t=0;tthis.client.resolver.resolveBuffer(t.attachment).then(e=>{t.file=e;return t}))).then(t=>this.client.api.webhooks(this.id,this.token).post({data:e,query:{wait:!0},files:t,auth:!1}))}return this.client.api.webhooks(this.id,this.token).post({data:e,query:{wait:!0},auth:!1}).then(t=>{if(!this.client.channels)return t;const e=n(10);return new e(this.client.channels.get(t.channel_id,t,this.client))})}sendSlackMessage(t){return this.client.api.webhooks(this.id,this.token).slack.post({query:{wait:!0},auth:!1,data:t}).then(t=>{if(!this.client.channels)return t;const e=n(10);return new e(this.client.channels.get(t.channel_id,t,this.client))})}edit({name:name=this.name,avatar:avatar},t){return avatar&&"string"==typeof avatar&&!avatar.startsWith("data:")?this.client.resolver.resolveBuffer(avatar).then(e=>{const n=this.client.resolver.resolveBase64(e);return this.edit({name:name,avatar:n},t)}):this.client.api.webhooks(this.id,this.token).patch({data:{name:name,avatar:avatar},reason:t}).then(t=>{this.name=t.name;this.avatar=t.avatar;return this})}delete(t){return this.client.api.webhooks(this.id,this.token).delete({reason:t})}}t.exports=r},function(t,e,n){(function(t){function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===g(t)}function i(t){return"boolean"==typeof t}function s(t){return null===t}function r(t){return null==t}function o(t){return"number"==typeof t}function a(t){return"string"==typeof t}function c(t){return"symbol"==typeof t}function u(t){return void 0===t}function l(t){return"[object RegExp]"===g(t)}function h(t){return"object"==typeof t&&null!==t}function p(t){return"[object Date]"===g(t)}function d(t){return"[object Error]"===g(t)||t instanceof Error}function f(t){return"function"==typeof t}function m(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function g(t){return Object.prototype.toString.call(t)}e.isArray=n,e.isBoolean=i,e.isNull=s,e.isNullOrUndefined=r,e.isNumber=o,e.isString=a,e.isSymbol=c,e.isUndefined=u,e.isRegExp=l,e.isObject=h,e.isDate=p,e.isError=d,e.isFunction=f,e.isPrimitive=m,e.isBuffer=t.isBuffer}).call(e,n(6).Buffer)},function(t,e,n){e=t.exports=n(61),e.Stream=e,e.Readable=e,e.Writable=n(39),e.Duplex=n(16),e.Transform=n(62),e.PassThrough=n(92)},function(t,e,n){const i=n(30),s=n(50),r=n(76),o=n(3),a=n(8),{Error:Error,RangeError:RangeError,TypeError:TypeError}=n(5);class c{constructor(){this.messages=new o,this.lastMessageID=null,this.lastMessage=null}send(t,e){if(e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),e.content||(e.content=t),e.embed&&e.embed.file&&(e.file=e.embed.file),e.file&&(e.files?e.files.push(e.file):e.files=[e.file]),e.files){for(let t=0;tthis.client.resolver.resolveBuffer(t.attachment).then(e=>{t.file=e;return t}))).then(t=>{e.files=t;return r.sendMessage(this,e)})}return r.sendMessage(this,e)}fetchMessage(t){const e=n(10);return this.client.user.bot?this.client.api.channels(this.id).messages(t).get().then(t=>{const n=t instanceof e?t:new e(this,t,this.client);this._cacheMessage(n);return n}):this.fetchMessages({limit:1,around:t}).then(e=>{const n=e.get(t);if(!n)throw new Error("MESSAGE_MISSING");return n})}fetchMessages(t={}){const e=n(10);return this.client.api.channels(this.id).messages.get({query:t}).then(t=>{const n=new o;for(const i of t){const t=new e(this,i,this.client);n.set(i.id,t),this._cacheMessage(t)}return n})}fetchPinnedMessages(){const t=n(10);return this.client.api.channels(this.id).pins.get().then(e=>{const n=new o;for(const i of e){const e=new t(this,i,this.client);n.set(i.id,e),this._cacheMessage(e)}return n})}search(t={}){return r.search(this,t)}startTyping(t){if(void 0!==t&&t<1)throw new RangeError("TYPING_COUNT");if(this.client.user._typing.has(this.id)){const e=this.client.user._typing.get(this.id);e.count=t||e.count+1}else{const e=this.client.api.channels(this.id).typing;this.client.user._typing.set(this.id,{count:t||1,interval:this.client.setInterval(()=>{e.post()},9e3)}),e.post()}}stopTyping(t=!1){if(this.client.user._typing.has(this.id)){const e=this.client.user._typing.get(this.id);e.count--,(e.count<=0||t)&&(this.client.clearInterval(e.interval),this.client.user._typing.delete(this.id))}}get typing(){return this.client.user._typing.has(this.id)}get typingCount(){return this.client.user._typing.has(this.id)?this.client.user._typing.get(this.id).count:0}createMessageCollector(t,e={}){return new s(this,t,e)}awaitMessages(t,e={}){return new Promise((n,i)=>{const s=this.createMessageCollector(t,e);s.once("end",(t,s)=>{e.errors&&e.errors.includes(s)?i(t):n(t)})})}bulkDelete(t,e=!1){if(!isNaN(t))return this.fetchMessages({limit:t}).then(t=>this.bulkDelete(t,e));if(t instanceof Array||t instanceof o){let n=t instanceof o?t.keyArray():t.map(t=>t.id);return e&&(n=n.filter(t=>Date.now()-a.deconstruct(t).date.getTime()<12096e5)),this.client.api.channels(this.id).messages()["bulk-delete"].post({data:{messages:n}}).then(()=>this.client.actions.MessageDeleteBulk.handle({channel_id:this.id,ids:n}).messages)}throw new TypeError("MESSAGE_BULK_DELETE_TYPE")}acknowledge(){return this.lastMessageID?this.client.api.channels(this.id).messages(this.lastMessageID).ack.post({data:{token:this.client.rest._ackToken}}).then(t=>{t.token&&(this.client.rest._ackToken=t.token);return this}):Promise.resolve(this)}_cacheMessage(t){const e=this.client.options.messageCacheMaxSize;return 0===e?null:(this.messages.size>=e&&e>0&&this.messages.delete(this.messages.firstKey()),this.messages.set(t.id,t),t)}}e.applyToClass=((t,e=!1,n=[])=>{const i=["send"];e&&i.push("_cacheMessage","acknowledge","fetchMessages","fetchMessage","search","bulkDelete","startTyping","stopTyping","typing","typingCount","fetchPinnedMessages","createMessageCollector","awaitMessages");for(const e of i)n.includes(e)||Object.defineProperty(t.prototype,e,Object.getOwnPropertyDescriptor(c.prototype,e))})},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n"},function(t,e,n){const i=n(54),s=n(55),r=n(0),o=n(7);class a extends o{constructor(t,e){super(t),this._patch(e)}_patch(t){this.guild=this.client.guilds.get(t.guild.id)||new i(this.client,t.guild),this.code=t.code,this.presenceCount=t.approximate_presence_count,this.memberCount=t.approximate_member_count,this.textChannelCount=t.guild.text_channel_count,this.voiceChannelCount=t.guild.voice_channel_count,this.temporary=t.temporary,this.maxAge=t.max_age,this.uses=t.uses,this.maxUses=t.max_uses,t.inviter&&(this.inviter=this.client.users.create(t.inviter)),this.channel=this.client.channels.get(t.channel.id)||new s(this.client,t.channel),this.createdTimestamp=new Date(t.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.invite(this.code)}delete(t){return this.client.api.invites(this.code).delete({reason:t}).then(()=>this)}toString(){return this.url}}t.exports=a},function(t,e,n){const i=n(8),s=n(0),r=n(7);class o extends r{constructor(t,e){super(t),this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.description=t.description,this.icon=t.icon,this.rpcOrigins=t.rpc_origins,this.redirectURIs=t.redirect_uris,this.botRequireCodeGrant=t.bot_require_code_grant,this.botPublic=t.bot_public,this.rpcApplicationState=t.rpc_application_state,this.bot=t.bot,this.flags=t.flags,this.secret=t.secret,t.owner&&(this.owner=this.client.users.create(t.owner))}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}iconURL(t,e){return this.icon?("number"==typeof t&&(e=t,t="default"),s.Endpoints.CDN(this.client.options.http.cdn).AppIcon(this.id,this.icon,t,e)):null}resetSecret(){return this.client.api.oauth2.applications(this.id).reset.post().then(t=>new o(this.client,t))}resetToken(){return this.client.api.oauth2.applications(this.id).bot().reset.post().then(t=>new o(this.client,Object.assign({},this,{bot:t})))}toString(){return this.name}}t.exports=o},function(t,e,n){(function(t){function n(t,e){for(var n=0,i=t.length-1;i>=0;i--){var s=t[i];"."===s?t.splice(i,1):".."===s?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,s="/"===o.charAt(0))}return e=n(i(e.split("/"),function(t){return!!t}),!s).join("/"),(s?"/":"")+e||"."},e.normalize=function(t){var s=e.isAbsolute(t),r="/"===o(t,-1);return t=n(i(t.split("/"),function(t){return!!t}),!s).join("/"),t||s||(t="."),t&&r&&(t+="/"),(s?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var s=i(t.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),a=o,c=0;c[t.id,t.nick]))),this.recipients||(this.recipients=new r),t.recipients)for(const e of t.recipients){const t=this.client.users.create(e);this.recipients.set(t.id,t)}this.lastMessageID=t.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(t){const e=t&&this.id===t.id&&this.name===t.name&&this.icon===t.icon&&this.ownerID===t.ownerID;return e?this.recipients.equals(t.recipients):e}addUser(t,e){const n=this.client.resolver.resolveUserID(t),i=this.client.user.bot?{nick:e,access_token:t}:{recipient:n};return this.client.api.channels(this.id).recipients(n).put({data:i}).then(()=>this)}toString(){return this.name}send(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createMessageCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),t.exports=o},function(t,e,n){const i=n(17),s=n(22),r=n(28),o=n(56),a=n(11),c=n(3);class u extends i{constructor(t,e){super(t.client,e),this.guild=t}_patch(t){if(super._patch(t),this.name=t.name,this.position=t.position,this.permissionOverwrites=new c,t.permission_overwrites)for(const e of t.permission_overwrites)this.permissionOverwrites.set(e.id,new o(this,e))}get calculatedPosition(){const t=this.guild._sortedChannels(this.type);return t.array().indexOf(t.get(this.id))}permissionsFor(t){if(!(t=this.client.resolver.resolveGuildMember(this.guild,t)))return null;if(t.id===this.guild.ownerID)return new a(a.ALL);let e=0;const n=t.roles;for(const t of n.values())e|=t.permissions;const i=this.overwritesFor(t,!0,n);i.everyone&&(e&=~i.everyone._denied,e|=i.everyone._allowed);let s=0;for(const t of i.roles)e&=~t._denied,s|=t._allowed;return e|=s,i.member&&(e&=~i.member._denied,e|=i.member._allowed),Boolean(e&a.FLAGS.ADMINISTRATOR)&&(e=a.ALL),new a(e)}overwritesFor(t,e=!1,n=null){if(e||(t=this.client.resolver.resolveGuildMember(this.guild,t)),!t)return[];n=n||t.roles;const i=[];let s,r;for(const e of this.permissionOverwrites.values())e.id===this.guild.id?r=e:n.has(e.id)?i.push(e):e.id===t.id&&(s=e);return{everyone:r,roles:i,member:s}}overwritePermissions(t,e,n){const i={allow:0,deny:0};if(t instanceof s)i.type="role";else if(this.guild.roles.has(t))t=this.guild.roles.get(t),i.type="role";else if(t=this.client.resolver.resolveUser(t),i.type="member",!t)return Promise.reject(new TypeError("Supplied parameter was neither a User nor a Role."));i.id=t.id;const r=this.permissionOverwrites.get(t.id);r&&(i.allow=r._allowed,i.deny=r._denied);for(const t in e)!0===e[t]?(i.allow|=a.FLAGS[t]||0,i.deny&=~(a.FLAGS[t]||0)):!1===e[t]?(i.allow&=~(a.FLAGS[t]||0),i.deny|=a.FLAGS[t]||0):null===e[t]&&(i.allow&=~(a.FLAGS[t]||0),i.deny&=~(a.FLAGS[t]||0));return this.client.api.channels(this.id).permissions(i.id).put({data:i,reason:n}).then(()=>this)}edit(t,e){return this.client.api.channels(this.id).patch({data:{name:(t.name||this.name).trim(),topic:t.topic||this.topic,position:t.position||this.position,bitrate:t.bitrate||this.bitrate,user_limit:t.userLimit||this.userLimit},reason:e}).then(t=>this.client.actions.ChannelUpdate.handle(t).updated)}setName(t){return this.edit({name:t})}setPosition(t,e){return this.guild.setChannelPosition(this,t,e).then(()=>this)}setTopic(t){return this.edit({topic:t})}createInvite({temporary:temporary=!1,maxAge:maxAge=86400,maxUses:maxUses=0,reason:reason}={}){return this.client.api.channels(this.id).invites.post({data:{temporary:temporary,max_age:maxAge,max_uses:maxUses},reason:reason}).then(t=>new r(this.client,t))}clone(t=this.name,e=!0,n=!0){return this.guild.createChannel(t,this.type,{overwrites:e?this.permissionOverwrites:[]}).then(t=>n?t.setTopic(this.topic):t)}equals(t){let e=t&&this.id===t.id&&this.type===t.type&&this.topic===t.topic&&this.position===t.position&&this.name===t.name;return e&&(e=this.permissionOverwrites&&t.permissionOverwrites?this.permissionOverwrites.equals(t.permissionOverwrites):!this.permissionOverwrites&&!t.permissionOverwrites),e}get deletable(){return this.id!==this.guild.id&&this.permissionsFor(this.client.user).has(a.FLAGS.MANAGE_CHANNELS)}delete(t){return this.client.api.channels(this.id).delete({reason:t}).then(()=>this)}toString(){return`<#${this.id}>`}}t.exports=u},function(t,e){class n{constructor(t,e,n){this.reaction=t,this.name=e,this.id=n}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}toString(){return this.id?`<:${this.name}:${this.id}>`:this.name}}t.exports=n},function(t,e,n){const i=n(3),s=n(15).EventEmitter;class r extends s{constructor(t,e,n={}){super(),Object.defineProperty(this,"client",{value:t}),this.filter=e,this.options=n,this.collected=new i,this.ended=!1,this._timeout=null,this.listener=this._handle.bind(this),n.time&&(this._timeout=this.client.setTimeout(()=>this.stop("time"),n.time))}_handle(...t){const e=this.handle(...t);if(e&&this.filter(...t)){this.collected.set(e.key,e.value),this.emit("collect",e.value,this);const n=this.postCheck(...t);n&&this.stop(n)}}get next(){return new Promise((t,e)=>{if(this.ended)return void e(this.collected);const n=()=>{this.removeListener("collect",i);this.removeListener("end",s)};const i=e=>{n();t(e)};const s=()=>{n();e(this.collected)};this.on("collect",i);this.on("end",s)})}stop(t="user"){this.ended||(this._timeout&&this.client.clearTimeout(this._timeout),this.ended=!0,this.cleanup(),this.emit("end",this.collected,t))}handle(){}postCheck(){}cleanup(){}}t.exports=r},function(t,e,n){var i,s,r;/** +\`\`\``),reply&&"dm"!==this.channel.type){const e=this.client.resolver.resolveUserID(reply),n=`<@${reply instanceof d&&reply.nickname?"!":""}${e}>`;t=`${n}${t?`, ${t}`:""}`}return this.client.api.channels(this.channel.id).messages(this.id).patch({data:{content:t,embed:embed}}).then(t=>this.client.actions.MessageUpdate.handle(t).updated)}pin(){return this.client.api.channels(this.channel.id).pins(this.id).put().then(()=>this)}unpin(){return this.client.api.channels(this.channel.id).pins(this.id).delete().then(()=>this)}react(t){if(!(t=this.client.resolver.resolveEmojiIdentifier(t)))throw new TypeError("EMOJI_TYPE");return this.client.api.channels(this.channel.id).messages(this.id).reactions(t)["@me"].put().then(()=>this._addReaction(c.parseEmoji(t),this.client.user))}clearReactions(){return this.client.api.channels(this.channel.id).messages(this.id).reactions.delete().then(()=>this)}delete({timeout:timeout=0,reason:reason}={}){return timeout<=0?this.client.api.channels(this.channel.id).messages(this.id).delete({reason:reason}).then(()=>this.client.actions.MessageDelete.handle({id:this.id,channel_id:this.channel.id}).message):new Promise(t=>{this.client.setTimeout(()=>{t(this.delete({reason:reason}))},timeout)})}reply(t,e){return e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),this.channel.send(t,Object.assign(e,{reply:this.member||this.author}))}acknowledge(){return this.client.api.channels(this.channel.id).messages(this.id).ack.post({data:{token:this.client.rest._ackToken}}).then(t=>{t.token&&(this.client.rest._ackToken=t.token);return this})}fetchWebhook(){return this.webhookID?this.client.fetchWebhook(this.webhookID):Promise.reject(new Error("The message was not sent by a webhook."))}equals(t,e){if(!t)return!1;if(!t.author&&!t.attachments)return this.id===t.id&&this.embeds.length===t.embeds.length;let n=this.id===t.id&&this.author.id===t.author.id&&this.content===t.content&&this.tts===t.tts&&this.nonce===t.nonce&&this.embeds.length===t.embeds.length&&this.attachments.length===t.attachments.length;return n&&e&&(n=this.mentions.everyone===t.mentions.everyone&&this.createdTimestamp===new Date(e.timestamp).getTime()&&this.editedTimestamp===new Date(e.edited_timestamp).getTime()),n}toString(){return this.content}_addReaction(t,e){const n=t.id?`${t.name}:${t.id}`:encodeURIComponent(t.name);let i;return this.reactions.has(n)?(i=this.reactions.get(n),i.me||(i.me=e.id===this.client.user.id)):(i=new o(this,t,0,e.id===this.client.user.id),this.reactions.set(n,i)),i.users.has(e.id)||i.users.set(e.id,e),i.count++,i}_removeReaction(t,e){const n=t.id?`${t.name}:${t.id}`:encodeURIComponent(t.name);if(this.reactions.has(n)){const t=this.reactions.get(n);if(t.users.has(e.id))return t.users.delete(e.id),t.count--,e.id===this.client.user.id&&(t.me=!1),t.count<=0&&this.reactions.delete(n),t}return null}_clearReactions(){this.reactions.clear()}}t.exports=f},function(t,e,n){const{RangeError:RangeError}=n(5);class i{constructor(t){this.bitfield="number"==typeof t?t:this.constructor.resolve(t)}has(t,e=!0){return t instanceof Array?t.every(t=>this.has(t,e)):(t=this.constructor.resolve(t),!!(e&&(this.bitfield&this.constructor.FLAGS.ADMINISTRATOR)>0)||(this.bitfield&t)===t)}missing(t,e=!0){return t.filter(t=>!this.has(t,e))}add(...t){let e=0;for(let n=0;nthis.resolve(t)).reduce((t,e)=>t|e,0);if("string"==typeof t&&(t=this.FLAGS[t]),"number"!=typeof t||t<1)throw new RangeError("PERMISSION_INVALID");return t}}i.FLAGS={CREATE_INSTANT_INVITE:1,KICK_MEMBERS:2,BAN_MEMBERS:4,ADMINISTRATOR:8,MANAGE_CHANNELS:16,MANAGE_GUILD:32,ADD_REACTIONS:64,VIEW_AUDIT_LOG:128,READ_MESSAGES:1024,SEND_MESSAGES:2048,SEND_TTS_MESSAGES:4096,MANAGE_MESSAGES:8192,EMBED_LINKS:16384,ATTACH_FILES:32768,READ_MESSAGE_HISTORY:65536,MENTION_EVERYONE:1<<17,USE_EXTERNAL_EMOJIS:1<<18,CONNECT:1<<20,SPEAK:1<<21,MUTE_MEMBERS:1<<22,DEAFEN_MEMBERS:1<<23,MOVE_MEMBERS:1<<24,USE_VAD:1<<25,CHANGE_NICKNAME:1<<26,MANAGE_NICKNAMES:1<<27,MANAGE_ROLES:1<<28,MANAGE_WEBHOOKS:1<<29,MANAGE_EMOJIS:1<<30},i.ALL=Object.values(i.FLAGS).reduce((t,e)=>t|e,0),i.DEFAULT=104324097,t.exports=i},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){class n{constructor(t={}){this.status=t.status||"offline",this.game=t.game?new i(t.game):null}update(t){this.status=t.status||this.status,this.game=t.game?new i(t.game):null}equals(t){return this===t||(t&&this.status===t.status&&this.game?this.game.equals(t.game):!t.game)}}class i{constructor(t){this.name=t.name,this.type=t.type,this.url=t.url||null}get streaming(){return 1===this.type}equals(t){return this===t||t&&this.name===t.name&&this.type===t.type&&this.url===t.url}}e.Presence=n,e.Game=i},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function s(t){return"number"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!s(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,a,c,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var l=new Error('Uncaught, unspecified "error" event. ('+e+")");throw l.context=e,l}if(n=this._events[t],o(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(r(n))for(a=Array.prototype.slice.call(arguments,1),u=n.slice(),s=u.length,c=0;c0&&this._events[t].length>s&&(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),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),s||(s=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var s=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,s,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,s=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(a=o;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){s=a;break}if(s<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";function i(t){if(!(this instanceof i))return new i(t);u.call(this,t),l.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",s)}function s(){this.allowHalfOpen||this._writableState.ended||a(r,this)}function r(t){t.end()}var o=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=i;var a=n(37),c=n(24);c.inherits=n(13);var u=n(61),l=n(39);c.inherits(i,u);for(var h=o(l.prototype),p=0;pthis)}}t.exports=r},function(t,e,n){const i=n(27),s=n(0),r=n(14).Presence,o=n(195),a=n(8),c=n(7);class u extends c{constructor(t,e){super(t),this._patch(e)}_patch(t){super._patch(),this.id=t.id,this.username=t.username,this.discriminator=t.discriminator,this.avatar=t.avatar,this.bot=Boolean(t.bot),this.lastMessageID=null,this.lastMessage=null}patch(t){for(const e of["id","username","discriminator","avatar","bot"])void 0!==t[e]&&(this[e]=t[e]);t.token&&(this.client.token=t.token)}get createdTimestamp(){return a.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get presence(){if(this.client.presences.has(this.id))return this.client.presences.get(this.id);for(const t of this.client.guilds.values())if(t.presences.has(this.id))return t.presences.get(this.id);return new r}avatarURL({format:format,size:size}={}){return this.avatar?("number"==typeof format&&(size=format,format="default"),s.Endpoints.CDN(this.client.options.http.cdn).Avatar(this.id,this.avatar,format,size)):null}get defaultAvatarURL(){return s.Endpoints.CDN(this.client.options.http.cdn).DefaultAvatar(this.discriminator%5)}displayAvatarURL(t){return this.avatarURL(t)||this.defaultAvatarURL}get tag(){return`${this.username}#${this.discriminator}`}get note(){return this.client.user.notes.get(this.id)||null}typingIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)}typingSinceIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)?new Date(t._typing.get(this.id).since):null}typingDurationIn(t){return t=this.client.resolver.resolveChannel(t),t._typing.has(this.id)?t._typing.get(this.id).elapsedTime:-1}get dmChannel(){return this.client.channels.filter(t=>"dm"===t.type).find(t=>t.recipient.id===this.id)}createDM(){return this.dmChannel?Promise.resolve(this.dmChannel):this.client.api.users(this.client.user.id).channels.post({data:{recipient_id:this.id}}).then(t=>this.client.actions.ChannelCreate.handle(t).channel)}deleteDM(){return this.dmChannel?this.client.api.channels(this.dmChannel.id).delete().then(t=>this.client.actions.ChannelDelete.handle(t).channel):Promise.reject(new Error("No DM Channel exists!"))}fetchProfile(){return this.client.api.users(this.id).profile.get().then(t=>new o(t))}setNote(t){return this.client.api.users("@me").notes(this.id).put({data:{note:t}}).then(()=>this)}equals(t){return t&&this.id===t.id&&this.username===t.username&&this.discriminator===t.discriminator&&this.avatar===t.avatar&&this.bot===Boolean(t.bot)}toString(){return`<@${this.id}>`}send(){}}i.applyToClass(u),t.exports=u},function(t,e,n){const i=n(0),s=n(3),r=n(8),o=n(7);class a extends o{constructor(t,e){super(t.client),this.guild=t,this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.requiresColons=t.require_colons,this.managed=t.managed,this._roles=t.roles}get createdTimestamp(){return r.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get roles(){const t=new s;for(const e of this._roles)this.guild.roles.has(e)&&t.set(e,this.guild.roles.get(e));return t}get url(){return i.Endpoints.CDN(this.client.options.http.cdn).Emoji(this.id)}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}edit(t,e){return this.client.api.guilds(this.guild.id).emojis(this.id).patch({data:{name:t.name,roles:t.roles?t.roles.map(t=>t.id?t.id:t):[]},reason:e}).then(()=>this)}setName(t){return this.edit({name:t})}addRestrictedRole(t){return this.addRestrictedRoles([t])}addRestrictedRoles(t){const e=new s(this.roles);for(const n of t)this.guild.roles.has(n.id)&&e.set(n.id,n);return this.edit({roles:e})}removeRestrictedRole(t){return this.removeRestrictedRoles([t])}removeRestrictedRoles(t){const e=new s(this.roles);for(const n of t)e.has(n.id)&&e.delete(n.id);return this.edit({roles:e})}toString(){return this.requiresColons?`<:${this.name}:${this.id}>`:this.name}equals(t){return t instanceof a?t.id===this.id&&t.name===this.name&&t.managed===this.managed&&t.requiresColons===this.requiresColons:t.id===this.id&&t.name===this.name}}t.exports=a},function(t,e,n){const i=n(36),s=n(18),r=n(22),o=n(19),a=n(29),c=n(48),u=n(23),l=n(14).Presence,h=n(21),p=n(75),d=n(0),f=n(3),m=n(4),g=n(8),v=n(11),E=n(76),_=n(190),b=n(191),w=n(7),{Error:Error,TypeError:TypeError}=n(5);class y extends w{constructor(t,e){super(t),this.members=new f,this.channels=new b(this),this.roles=new f,this.presences=new f,e&&(e.unavailable?(this.available=!1,this.id=e.id):(this._patch(e),e.channels||(this.available=!1)))}_patch(t){if(super._patch(t),this.name=t.name,this.icon=t.icon,this.splash=t.splash,this.region=t.region,this.memberCount=t.member_count||this.memberCount,this.large=Boolean("large"in t?t.large:this.large),this.features=t.features,this.applicationID=t.application_id,this.afkTimeout=t.afk_timeout,this.afkChannelID=t.afk_channel_id,this.embedEnabled=t.embed_enabled,this.verificationLevel=t.verification_level,this.explicitContentFilter=t.explicit_content_filter,this.joinedTimestamp=t.joined_at?new Date(t.joined_at).getTime():this.joinedTimestamp,this.id=t.id,this.available=!t.unavailable,this.features=t.features||this.features||[],t.members){this.members.clear();for(const e of t.members)this._addMember(e,!1)}if(t.owner_id&&(this.ownerID=t.owner_id),t.channels){this.channels.clear();for(const e of t.channels)this.client.channels.create(e,this)}if(t.roles){this.roles.clear();for(const e of t.roles){const t=new r(this,e);this.roles.set(t.id,t)}}if(t.presences)for(const e of t.presences)this._setPresence(e.user.id,e);if(this._rawVoiceStates=new f,t.voice_states)for(const e of t.voice_states){this._rawVoiceStates.set(e.user_id,e);const t=this.members.get(e.user_id);t&&(t.serverMute=e.mute,t.serverDeaf=e.deaf,t.selfMute=e.self_mute,t.selfDeaf=e.self_deaf,t.voiceSessionID=e.session_id,t.voiceChannelID=e.channel_id,this.channels.get(e.channel_id).members.set(t.user.id,t))}if(this.emojis)this.client.actions.GuildEmojisUpdate.handle({guild_id:this.id,emojis:t.emojis});else{this.emojis=new _(this);for(const e of t.emojis)this.emojis.create(e)}}get createdTimestamp(){return g.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get joinedAt(){return new Date(this.joinedTimestamp)}iconURL(t,e){return this.icon?("number"==typeof t&&(e=t,t="default"),d.Endpoints.CDN(this.client.options.http.cdn).Icon(this.id,this.icon,t,e)):null}get nameAcronym(){return this.name.replace(/\w+/g,t=>t[0]).replace(/\s/g,"")}get splashURL(){return this.splash?d.Endpoints.CDN(this.client.options.http.cdn).Splash(this.id,this.splash):null}get owner(){return this.members.get(this.ownerID)}get voiceConnection(){return this.client.browser?null:this.client.voice.connections.get(this.id)||null}get defaultChannel(){return this.channels.get(this.id)}get position(){return this.client.user.bot?null:this.client.user.settings.guildPositions?this.client.user.settings.guildPositions.indexOf(this.id):null}get defaultRole(){return this.roles.get(this.id)}get me(){return this.members.get(this.client.user.id)}get _sortedRoles(){return this._sortPositionWithID(this.roles)}member(t){return this.client.resolver.resolveGuildMember(this,t)}fetchBans(){return this.client.api.guilds(this.id).bans.get().then(t=>t.reduce((t,e)=>{t.set(e.user.id,{reason:e.reason,user:this.client.users.create(e.user)});return t},new f))}fetchInvites(){return this.client.api.guilds(this.id).invites.get().then(t=>{const e=new f;for(const n of t){const t=new a(this.client,n);e.set(t.code,t)}return e})}fetchWebhooks(){return this.client.api.guilds(this.id).webhooks.get().then(t=>{const e=new f;for(const n of t)e.set(n.id,new u(this.client,n));return e})}fetchVoiceRegions(){return this.client.api.guilds(this.id).regions.get().then(t=>{const e=new f;for(const n of t)e.set(n.id,new p(n));return e})}fetchAuditLogs(t={}){return t.before&&t.before instanceof c.Entry&&(t.before=t.before.id),t.after&&t.after instanceof c.Entry&&(t.after=t.after.id),"string"==typeof t.type&&(t.type=c.Actions[t.type]),this.client.api.guilds(this.id)["audit-logs"].get({query:{before:t.before,after:t.after,limit:t.limit,user_id:this.client.resolver.resolveUserID(t.user),action_type:t.type}}).then(t=>c.build(this,t))}addMember(t,e){if(this.members.has(t.id))return Promise.resolve(this.members.get(t.id));if(e.access_token=e.accessToken,e.roles){const t=e.roles;(t instanceof f||t instanceof Array&&t[0]instanceof r)&&(e.roles=t.map(t=>t.id))}return this.client.api.guilds(this.id).members(t.id).put({data:e}).then(t=>this.client.actions.GuildMemberGet.handle(this,t).member)}fetchMember(t,e=!0){return t=this.client.resolver.resolveUser(t),t?this.members.has(t.id)?Promise.resolve(this.members.get(t.id)):this.client.api.guilds(this.id).members(t.id).get().then(t=>e?this.client.actions.GuildMemberGet.handle(this,t).member:new h(this,t)):Promise.reject(new Error("User is not cached. Use Client.fetchUser first."))}fetchMembers(t="",e=0){return new Promise((n,i)=>{if(this.memberCount===this.members.size)return void n(new f);this.client.ws.send({op:d.OPCodes.REQUEST_GUILD_MEMBERS,d:{guild_id:this.id,query:t,limit:e}});const s=new f;const r=(i,o)=>{if(o.id!==this.id)return;for(const t of i.values())s.set(t.user.id,t);(this.memberCount===this.members.size||(t||e)&&i.size<1e3)&&(this.client.removeListener(d.Events.GUILD_MEMBERS_CHUNK,r),n(s))};this.client.on(d.Events.GUILD_MEMBERS_CHUNK,r);this.client.setTimeout(()=>{this.client.removeListener(d.Events.GUILD_MEMBERS_CHUNK,r);i(new Error("GUILD_MEMBERS_NOT_RECEIVED"))},12e4)})}search(t={}){return E.search(this,t)}edit(t,e){const n={};return t.name&&(n.name=t.name),t.region&&(n.region=t.region),void 0!==t.verificationLevel&&(n.verification_level=Number(t.verificationLevel)),t.afkChannel&&(n.afk_channel_id=this.client.resolver.resolveChannel(t.afkChannel).id),t.afkTimeout&&(n.afk_timeout=Number(t.afkTimeout)),t.icon&&(n.icon=this.client.resolver.resolveBase64(t.icon)),t.owner&&(n.owner_id=this.client.resolver.resolveUser(t.owner).id),t.splash&&(n.splash=this.client.resolver.resolveBase64(t.splash)),void 0!==t.explicitContentFilter&&(n.explicit_content_filter=Number(t.explicitContentFilter)),this.client.api.guilds(this.id).patch({data:n,reason:e}).then(t=>this.client.actions.GuildUpdate.handle(t).updated)}setExplicitContentFilter(t){return this.edit({explicitContentFilter:t})}setName(t){return this.edit({name:t})}setRegion(t){return this.edit({region:t})}setVerificationLevel(t){return this.edit({verificationLevel:t})}setAFKChannel(t){return this.edit({afkChannel:t})}setAFKTimeout(t){return this.edit({afkTimeout:t})}setIcon(t){return this.edit({icon:t})}setOwner(t){return this.edit({owner:t})}setSplash(t){return this.edit({splash:t})}setPosition(t,e){return this.client.user.bot?Promise.reject(new Error("Setting guild position is only available for user accounts")):this.client.user.settings.setGuildPosition(this,t,e)}acknowledge(){return this.client.api.guilds(this.id).ack.post({data:{token:this.client.rest._ackToken}}).then(t=>{t.token&&(this.client.rest._ackToken=t.token);return this})}allowDMs(t){const e=this.client.user.settings;return t?e.removeRestrictedGuild(this):e.addRestrictedGuild(this)}ban(t,e={days:0}){e.days&&(e["delete-message-days"]=e.days);const n=this.client.resolver.resolveUserID(t);return n?this.client.api.guilds(this.id).bans(n).put({query:e}).then(()=>{if(t instanceof h)return t;const e=this.client.resolver.resolveUser(n);if(e){const t=this.client.resolver.resolveGuildMember(this,e);return t||e}return n}):Promise.reject(new Error("Couldn't resolve the user ID to ban."))}unban(t,e){const n=this.client.resolver.resolveUserID(t);if(!n)throw new Error("BAN_RESOLVE_ID");return this.client.api.guilds(this.id).bans(n).delete({reason:e}).then(()=>t)}pruneMembers({days:days=7,dry:dry=!1,reason:reason}={}){if("number"!=typeof days)throw new TypeError("PRUNE_DAYS_TYPE");return this.client.api.guilds(this.id).prune[dry?"get":"post"]({query:{days:days},reason:reason}).then(t=>t.pruned)}sync(){this.client.user.bot||this.client.syncGuilds([this])}createChannel(t,e,{overwrites:overwrites,reason:reason}={}){return(overwrites instanceof f||overwrites instanceof Array)&&(overwrites=overwrites.map(t=>({allow:t.allow||t._allowed,deny:t.deny||t._denied,type:t.type,id:t.id}))),this.client.api.guilds(this.id).channels.post({data:{name:t,type:e,permission_overwrites:overwrites},reason:reason}).then(t=>this.client.actions.ChannelCreate.handle(t).channel)}setChannelPositions(t){const e=new Array(t.length);for(let n=0;nthis.client.actions.GuildChannelsPositionUpdate.handle({guild_id:this.id,channels:t}).guild)}createRole({data:data={},reason:reason}={}){return data.color&&(data.color=m.resolveColor(data.color)),data.permissions&&(data.permissions=v.resolve(data.permissions)),this.client.api.guilds(this.id).roles.post({data:data,reason:reason}).then(t=>this.client.actions.GuildRoleCreate.handle({guild_id:this.id,role:t}).role)}createEmoji(t,e,n){if("string"==typeof t&&t.startsWith("data:")){const i={image:t,name:e};return n&&(i.roles=n.map(t=>t.id?t.id:t)),this.client.api.guilds(this.id).emojis.post({data:i}).then(t=>this.client.actions.GuildEmojiCreate.handle(this,t).emoji)}return this.client.resolver.resolveBuffer(t).then(t=>{const i=this.client.resolver.resolveBase64(t);return this.createEmoji(i,e,n)})}deleteEmoji(t){return t instanceof o||(t=this.emojis.get(t)),this.client.api.guilds(this.id).emojis(this.id).delete().then(()=>this.client.actions.GuildEmojiDelete.handle(t).data)}leave(){return this.ownerID===this.client.user.id?Promise.reject(new Error("Guild is owned by the client.")):this.client.api.users("@me").guilds(this.id).delete().then(()=>this.client.actions.GuildDelete.handle({id:this.id}).guild)}delete(){return this.client.api.guilds(this.id).delete().then(()=>this.client.actions.GuildDelete.handle({id:this.id}).guild)}equals(t){let e=t&&this.id===t.id&&this.available===!t.unavailable&&this.splash===t.splash&&this.region===t.region&&this.name===t.name&&this.memberCount===t.member_count&&this.large===t.large&&this.icon===t.icon&&m.arraysEqual(this.features,t.features)&&this.ownerID===t.owner_id&&this.verificationLevel===t.verification_level&&this.embedEnabled===t.embed_enabled;return e&&(this.embedChannel?this.embedChannel.id!==t.embed_channel_id&&(e=!1):t.embed_channel_id&&(e=!1)),e}toString(){return this.name}_addMember(t,e=!0){const n=this.members.has(t.user.id);t.user instanceof s||(t.user=this.client.users.create(t.user)),t.joined_at=t.joined_at||0;const i=new h(this,t);if(this.members.set(i.id,i),this._rawVoiceStates&&this._rawVoiceStates.has(i.user.id)){const t=this._rawVoiceStates.get(i.user.id);i.serverMute=t.mute,i.serverDeaf=t.deaf,i.selfMute=t.self_mute,i.selfDeaf=t.self_deaf,i.voiceSessionID=t.session_id,i.voiceChannelID=t.channel_id,this.client.channels.has(t.channel_id)?this.client.channels.get(t.channel_id).members.set(i.user.id,i):this.client.emit("warn",`Member ${i.id} added in guild ${this.id} with an uncached voice channel`)}return this.client.ws.connection.status===d.Status.READY&&e&&!n&&this.client.emit(d.Events.GUILD_MEMBER_ADD,i),i}_updateMember(t,e){const n=m.cloneObject(t);e.roles&&(t._roles=e.roles),void 0!==e.nick&&(t.nickname=e.nick);const i=t.nickname!==n.nickname||!m.arraysEqual(t._roles,n._roles);return this.client.ws.connection.status===d.Status.READY&&i&&this.client.emit(d.Events.GUILD_MEMBER_UPDATE,n,t),{old:n,mem:t}}_removeMember(t){this.members.delete(t.id)}_memberSpeakUpdate(t,e){const n=this.members.get(t);n&&n.speaking!==e&&(n.speaking=e,this.client.emit(d.Events.GUILD_MEMBER_SPEAKING,n,e))}_setPresence(t,e){if(this.presences.get(t))return void this.presences.get(t).update(e);this.presences.set(t,new l(e))}setRolePosition(t,e,n=!1){if("string"==typeof t&&!(t=this.roles.get(t)))return Promise.reject(new Error("Supplied role is not a role or snowflake."));if(e=Number(e),isNaN(e))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedRoles.array();return m.moveElementInArray(i,t,e,n),i=i.map((t,e)=>({id:t.id,position:e})),this.client.api.guilds(this.id).roles.patch({data:i}).then(()=>this.client.actions.GuildRolesPositionUpdate.handle({guild_id:this.id,roles:i}).guild)}setChannelPosition(t,e,n=!1){if("string"==typeof t&&!(t=this.channels.get(t)))return Promise.reject(new Error("Supplied channel is not a channel or snowflake."));if(e=Number(e),isNaN(e))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedChannels(t.type).array();return m.moveElementInArray(i,t,e,n),i=i.map((t,e)=>({id:t.id,position:e})),this.client.api.guilds(this.id).channels.patch({data:i}).then(()=>this.client.actions.GuildChannelsPositionUpdate.handle({guild_id:this.id,roles:i}).guild)}_sortedChannels(t){return this._sortPositionWithID(this.channels.filter(e=>"voice"===t&&"voice"===e.type||("voice"!==t&&"voice"!==e.type||t===e.type)))}_sortPositionWithID(t){return t.sort((t,e)=>t.position!==e.position?t.position-e.position:i.fromString(t.id).sub(i.fromString(e.id)).toNumber())}}t.exports=y},function(t,e,n){const i=n(27),s=n(22),r=n(11),o=n(3),a=n(14).Presence,c=n(7),{Error:Error}=n(5);class u extends c{constructor(t,e){super(t.client),this.guild=t,this.user={},this._roles=[],e&&this._patch(e),this.lastMessageID=null,this.lastMessage=null}_patch(t){super._patch(t),this.serverDeaf=t.deaf,this.serverMute=t.mute,this.selfMute=t.self_mute,this.selfDeaf=t.self_deaf,this.voiceSessionID=t.session_id,this.voiceChannelID=t.channel_id,this.speaking=!1,this.nickname=t.nick||null,this.joinedTimestamp=new Date(t.joined_at).getTime(),this.user=t.user,this._roles=t.roles}get joinedAt(){return new Date(this.joinedTimestamp)}get presence(){return this.frozenPresence||this.guild.presences.get(this.id)||new a}get roles(){const t=new o,e=this.guild.roles.get(this.guild.id);e&&t.set(e.id,e);for(const e of this._roles){const n=this.guild.roles.get(e);n&&t.set(n.id,n)}return t}get highestRole(){return this.roles.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t)}get colorRole(){const t=this.roles.filter(t=>t.color);return t.size?t.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t):null}get displayColor(){const t=this.colorRole;return t&&t.color||0}get displayHexColor(){const t=this.colorRole;return t&&t.hexColor||"#000000"}get hoistRole(){const t=this.roles.filter(t=>t.hoist);return t.size?t.reduce((t,e)=>!t||e.comparePositionTo(t)>0?e:t):null}get mute(){return this.selfMute||this.serverMute}get deaf(){return this.selfDeaf||this.serverDeaf}get voiceChannel(){return this.guild.channels.get(this.voiceChannelID)}get id(){return this.user.id}get displayName(){return this.nickname||this.user.username}get permissions(){if(this.user.id===this.guild.ownerID)return new r(r.ALL);let t=0;const e=this.roles;for(const n of e.values())t|=n.permissions;return new r(t)}get kickable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const t=this.guild.member(this.client.user);return!!t.permissions.has(r.FLAGS.KICK_MEMBERS)&&t.highestRole.comparePositionTo(this.highestRole)>0}get bannable(){if(this.user.id===this.guild.ownerID)return!1;if(this.user.id===this.client.user.id)return!1;const t=this.guild.member(this.client.user);return!!t.permissions.has(r.FLAGS.BAN_MEMBERS)&&t.highestRole.comparePositionTo(this.highestRole)>0}permissionsIn(t){if(!(t=this.client.resolver.resolveChannel(t))||!t.guild)throw new Error("GUILD_CHANNEL_RESOLVE");return t.permissionsFor(this)}hasPermission(t,e=!1,n,i){return void 0===n&&(n=!e),void 0===i&&(i=!e),!(!i||this.user.id!==this.guild.ownerID)||this.roles.some(e=>e.hasPermission(t,void 0,n))}missingPermissions(t,e=!1){return t.missing(t,e)}edit(t,e){t.channel&&(t.channel_id=this.client.resolver.resolveChannel(t.channel).id,t.channel=null),t.roles&&(t.roles=t.roles.map(t=>t instanceof s?t.id:t));let n=this.client.api.guilds(this.guild.id);if(this.user.id===this.client.user.id){const e=Object.keys(t);n=1===e.length&&"nick"===e[0]?n.members("@me").nick:n.members(this.id)}else n=n.members(this.id);return n.patch({data:t,reason:e}).then(t=>this.guild._updateMember(this,t).mem)}setMute(t){return this.edit({mute:t})}setDeaf(t){return this.edit({deaf:t})}setVoiceChannel(t){return this.edit({channel:t})}setRoles(t){return this.edit({roles:t})}addRole(t){return t instanceof s||(t=this.guild.roles.get(t)),t?this._roles.includes(t.id)?Promise.resolve(this):this.client.api.guilds(this.guild.id).members(this.user.id).roles(t.id).put().then(()=>this):Promise.reject(new TypeError("Supplied parameter was neither a Role nor a Snowflake."))}addRoles(t){let e;if(t instanceof o){e=this._roles.slice();for(const n of t.values())e.push(n.id?n.id:n)}else e=this._roles.concat(t.map(t=>t.id?t.id:t));return this.edit({roles:e})}removeRole(t){return t instanceof s||(t=this.guild.roles.get(t)),t?this.client.api.guilds(this.guild.id).members(this.user.id).roles(t.id).delete().then(()=>this):Promise.reject(new TypeError("Supplied parameter was neither a Role nor a Snowflake."))}removeRoles(t){const e=this._roles.slice();if(t instanceof o)for(const n of t.values()){const t=e.indexOf(n.id);t>=0&&e.splice(t,1)}else for(const n of t){const t=e.indexOf(n instanceof s?n.id:n);t>=0&&e.splice(t,1)}return this.edit({roles:e})}setNickname(t){return this.edit({nick:t})}createDM(){return this.user.createDM()}deleteDM(){return this.user.deleteDM()}kick(t){return this.client.api.guilds(this.guild.id).members(this.user.id).delete({reason:t}).then(()=>this.client.actions.GuildMemberRemove.handle({guild_id:this.guild.id,user:this.user}).member)}ban(t){return this.guild.ban(this,t)}toString(){return`<@${this.nickname?"!":""}${this.user.id}>`}send(){}}i.applyToClass(u),t.exports=u},function(t,e,n){const i=n(8),s=n(11),r=n(4),o=n(7);class a extends o{constructor(t,e){super(t.client),this.guild=t,e&&this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.color=t.color,this.hoist=t.hoist,this.position=t.position,this.permissions=t.permissions,this.managed=t.managed,this.mentionable=t.mentionable}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let t=this.color.toString(16);for(;t.length<6;)t=`0${t}`;return`#${t}`}get members(){return this.guild.members.filter(t=>t.roles.has(this.id))}get editable(){if(this.managed)return!1;const t=this.guild.member(this.client.user);return!!t.permissions.has(s.FLAGS.MANAGE_ROLES)&&t.highestRole.comparePositionTo(this)>0}get calculatedPosition(){const t=this.guild._sortedRoles;return t.array().indexOf(t.get(this.id))}serialize(){return new s(this.permissions).serialize()}hasPermission(t,e=!1,n){return new s(this.permissions).has(t,void 0!==n?n:!e)}comparePositionTo(t){return this.constructor.comparePositions(this,t)}edit(t,e){return t.permissions?t.permissions=s.resolve(t.permissions):t.permissions=this.permissions,this.client.api.guilds(this.guild.id).roles(this.id).patch({data:{name:t.name||this.name,position:void 0!==t.position?t.position:this.position,color:r.resolveColor(t.color||this.color),hoist:void 0!==t.hoist?t.hoist:this.hoist,mentionable:void 0!==t.mentionable?t.mentionable:this.mentionable},reason:e}).then(t=>this.client.actions.GuildRoleUpdate.handle({role:t,guild_id:this.guild.id}).updated)}setName(t){return this.edit({name:t})}setColor(t){return this.edit({color:t})}setHoist(t){return this.edit({hoist:t})}setPosition(t,e){return this.guild.setRolePosition(this,t,e).then(()=>this)}setPermissions(t){return this.edit({permissions:t})}setMentionable(t){return this.edit({mentionable:t})}delete(t){return this.client.api.guilds(this.guild.id).roles(this.id).delete({reason:t}).then(()=>this.client.actions.GuildRoleDelete.handle({guild_id:this.guild.id,role_id:this.id}).role)}equals(t){return t&&this.id===t.id&&this.name===t.name&&this.color===t.color&&this.hoist===t.hoist&&this.position===t.position&&this.permissions===t.permissions&&this.managed===t.managed}toString(){return this.id===this.guild.id?"@everyone":`<@&${this.id}>`}static comparePositions(t,e){return t.position===e.position?e.id-t.id:t.position-e.position}}t.exports=a},function(t,e,n){const i=n(31),s=n(4);class r{constructor(t,e,n){t?(Object.defineProperty(this,"client",{value:t}),e&&this._patch(e)):(this.id=e,this.token=n,Object.defineProperty(this,"client",{value:this}))}_patch(t){this.name=t.name,this.token=t.token,this.avatar=t.avatar,this.id=t.id,this.guildID=t.guild_id,this.channelID=t.channel_id,t.user?this.owner=this.client.users?this.client.users.get(t.user.id):t.user:this.owner=null}send(t,e){if(e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),e.username||(e.username=this.name),e.avatarURL&&(e.avatar_url=e.avatarURL,e.avatarURL=null),void 0!==t&&(t=s.resolveString(t)),t&&(e.disableEveryone||void 0===e.disableEveryone&&this.client.options.disableEveryone)&&(t=t.replace(/@(everyone|here)/g,"@​$1")),e.content=t,e.file&&(e.files?e.files.push(e.file):e.files=[e.file]),e.files){for(let t=0;tthis.client.resolver.resolveBuffer(t.attachment).then(e=>{t.file=e;return t}))).then(t=>this.client.api.webhooks(this.id,this.token).post({data:e,query:{wait:!0},files:t,auth:!1}))}return this.client.api.webhooks(this.id,this.token).post({data:e,query:{wait:!0},auth:!1}).then(t=>{if(!this.client.channels)return t;const e=n(10);return new e(this.client.channels.get(t.channel_id,t,this.client))})}sendSlackMessage(t){return this.client.api.webhooks(this.id,this.token).slack.post({query:{wait:!0},auth:!1,data:t}).then(t=>{if(!this.client.channels)return t;const e=n(10);return new e(this.client.channels.get(t.channel_id,t,this.client))})}edit({name:name=this.name,avatar:avatar},t){return avatar&&"string"==typeof avatar&&!avatar.startsWith("data:")?this.client.resolver.resolveBuffer(avatar).then(e=>{const n=this.client.resolver.resolveBase64(e);return this.edit({name:name,avatar:n},t)}):this.client.api.webhooks(this.id,this.token).patch({data:{name:name,avatar:avatar},reason:t}).then(t=>{this.name=t.name;this.avatar=t.avatar;return this})}delete(t){return this.client.api.webhooks(this.id,this.token).delete({reason:t})}}t.exports=r},function(t,e,n){(function(t){function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===g(t)}function i(t){return"boolean"==typeof t}function s(t){return null===t}function r(t){return null==t}function o(t){return"number"==typeof t}function a(t){return"string"==typeof t}function c(t){return"symbol"==typeof t}function u(t){return void 0===t}function l(t){return"[object RegExp]"===g(t)}function h(t){return"object"==typeof t&&null!==t}function p(t){return"[object Date]"===g(t)}function d(t){return"[object Error]"===g(t)||t instanceof Error}function f(t){return"function"==typeof t}function m(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function g(t){return Object.prototype.toString.call(t)}e.isArray=n,e.isBoolean=i,e.isNull=s,e.isNullOrUndefined=r,e.isNumber=o,e.isString=a,e.isSymbol=c,e.isUndefined=u,e.isRegExp=l,e.isObject=h,e.isDate=p,e.isError=d,e.isFunction=f,e.isPrimitive=m,e.isBuffer=t.isBuffer}).call(e,n(6).Buffer)},function(t,e,n){e=t.exports=n(61),e.Stream=e,e.Readable=e,e.Writable=n(39),e.Duplex=n(16),e.Transform=n(62),e.PassThrough=n(92)},function(t,e,n){const i=n(3);class s extends i{constructor(t,e){super(e),Object.defineProperty(this,"client",{value:t,enumerable:!1,writable:!1})}create(){}remove(){}}t.exports=s},function(t,e,n){const i=n(31),s=n(50),r=n(76),o=n(3),a=n(8),{Error:Error,RangeError:RangeError,TypeError:TypeError}=n(5);class c{constructor(){this.messages=new o,this.lastMessageID=null,this.lastMessage=null}send(t,e){if(e||"object"!=typeof t||t instanceof Array?e||(e={}):(e=t,t=""),e.content||(e.content=t),e.embed&&e.embed.file&&(e.file=e.embed.file),e.file&&(e.files?e.files.push(e.file):e.files=[e.file]),e.files){for(let t=0;tthis.client.resolver.resolveBuffer(t.attachment).then(e=>{t.file=e;return t}))).then(t=>{e.files=t;return r.sendMessage(this,e)})}return r.sendMessage(this,e)}fetchMessage(t){const e=n(10);return this.client.user.bot?this.client.api.channels(this.id).messages(t).get().then(t=>{const n=t instanceof e?t:new e(this,t,this.client);this._cacheMessage(n);return n}):this.fetchMessages({limit:1,around:t}).then(e=>{const n=e.get(t);if(!n)throw new Error("MESSAGE_MISSING");return n})}fetchMessages(t={}){const e=n(10);return this.client.api.channels(this.id).messages.get({query:t}).then(t=>{const n=new o;for(const i of t){const t=new e(this,i,this.client);n.set(i.id,t),this._cacheMessage(t)}return n})}fetchPinnedMessages(){const t=n(10);return this.client.api.channels(this.id).pins.get().then(e=>{const n=new o;for(const i of e){const e=new t(this,i,this.client);n.set(i.id,e),this._cacheMessage(e)}return n})}search(t={}){return r.search(this,t)}startTyping(t){if(void 0!==t&&t<1)throw new RangeError("TYPING_COUNT");if(this.client.user._typing.has(this.id)){const e=this.client.user._typing.get(this.id);e.count=t||e.count+1}else{const e=this.client.api.channels(this.id).typing;this.client.user._typing.set(this.id,{count:t||1,interval:this.client.setInterval(()=>{e.post()},9e3)}),e.post()}}stopTyping(t=!1){if(this.client.user._typing.has(this.id)){const e=this.client.user._typing.get(this.id);e.count--,(e.count<=0||t)&&(this.client.clearInterval(e.interval),this.client.user._typing.delete(this.id))}}get typing(){return this.client.user._typing.has(this.id)}get typingCount(){return this.client.user._typing.has(this.id)?this.client.user._typing.get(this.id).count:0}createMessageCollector(t,e={}){return new s(this,t,e)}awaitMessages(t,e={}){return new Promise((n,i)=>{const s=this.createMessageCollector(t,e);s.once("end",(t,s)=>{e.errors&&e.errors.includes(s)?i(t):n(t)})})}bulkDelete(t,e=!1){if(!isNaN(t))return this.fetchMessages({limit:t}).then(t=>this.bulkDelete(t,e));if(t instanceof Array||t instanceof o){let n=t instanceof o?t.keyArray():t.map(t=>t.id);return e&&(n=n.filter(t=>Date.now()-a.deconstruct(t).date.getTime()<12096e5)),this.client.api.channels(this.id).messages()["bulk-delete"].post({data:{messages:n}}).then(()=>this.client.actions.MessageDeleteBulk.handle({channel_id:this.id,ids:n}).messages)}throw new TypeError("MESSAGE_BULK_DELETE_TYPE")}acknowledge(){return this.lastMessageID?this.client.api.channels(this.id).messages(this.lastMessageID).ack.post({data:{token:this.client.rest._ackToken}}).then(t=>{t.token&&(this.client.rest._ackToken=t.token);return this}):Promise.resolve(this)}_cacheMessage(t){const e=this.client.options.messageCacheMaxSize;return 0===e?null:(this.messages.size>=e&&e>0&&this.messages.delete(this.messages.firstKey()),this.messages.set(t.id,t),t)}}e.applyToClass=((t,e=!1,n=[])=>{const i=["send"];e&&i.push("_cacheMessage","acknowledge","fetchMessages","fetchMessage","search","bulkDelete","startTyping","stopTyping","typing","typingCount","fetchPinnedMessages","createMessageCollector","awaitMessages");for(const e of i)n.includes(e)||Object.defineProperty(t.prototype,e,Object.getOwnPropertyDescriptor(c.prototype,e))})},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n"},function(t,e,n){const i=n(54),s=n(55),r=n(0),o=n(7);class a extends o{constructor(t,e){super(t),this._patch(e)}_patch(t){this.guild=this.client.guilds.get(t.guild.id)||new i(this.client,t.guild),this.code=t.code,this.presenceCount=t.approximate_presence_count,this.memberCount=t.approximate_member_count,this.textChannelCount=t.guild.text_channel_count,this.voiceChannelCount=t.guild.voice_channel_count,this.temporary=t.temporary,this.maxAge=t.max_age,this.uses=t.uses,this.maxUses=t.max_uses,t.inviter&&(this.inviter=this.client.users.create(t.inviter)),this.channel=this.client.channels.get(t.channel.id)||new s(this.client,t.channel),this.createdTimestamp=new Date(t.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.invite(this.code)}delete(t){return this.client.api.invites(this.code).delete({reason:t}).then(()=>this)}toString(){return this.url}}t.exports=a},function(t,e,n){const i=n(8),s=n(0),r=n(7);class o extends r{constructor(t,e){super(t),this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.description=t.description,this.icon=t.icon,this.rpcOrigins=t.rpc_origins,this.redirectURIs=t.redirect_uris,this.botRequireCodeGrant=t.bot_require_code_grant,this.botPublic=t.bot_public,this.rpcApplicationState=t.rpc_application_state,this.bot=t.bot,this.flags=t.flags,this.secret=t.secret,t.owner&&(this.owner=this.client.users.create(t.owner))}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}iconURL(t,e){return this.icon?("number"==typeof t&&(e=t,t="default"),s.Endpoints.CDN(this.client.options.http.cdn).AppIcon(this.id,this.icon,t,e)):null}resetSecret(){return this.client.api.oauth2.applications(this.id).reset.post().then(t=>new o(this.client,t))}resetToken(){return this.client.api.oauth2.applications(this.id).bot().reset.post().then(t=>new o(this.client,Object.assign({},this,{bot:t})))}toString(){return this.name}}t.exports=o},function(t,e,n){(function(t){function n(t,e){for(var n=0,i=t.length-1;i>=0;i--){var s=t[i];"."===s?t.splice(i,1):".."===s?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,s="/"===o.charAt(0))}return e=n(i(e.split("/"),function(t){return!!t}),!s).join("/"),(s?"/":"")+e||"."},e.normalize=function(t){var s=e.isAbsolute(t),r="/"===o(t,-1);return t=n(i(t.split("/"),function(t){return!!t}),!s).join("/"),t||s||(t="."),t&&r&&(t+="/"),(s?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var s=i(t.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),a=o,c=0;c[t.id,t.nick]))),this.recipients||(this.recipients=new r),t.recipients)for(const e of t.recipients){const t=this.client.users.create(e);this.recipients.set(t.id,t)}this.lastMessageID=t.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(t){const e=t&&this.id===t.id&&this.name===t.name&&this.icon===t.icon&&this.ownerID===t.ownerID;return e?this.recipients.equals(t.recipients):e}addUser(t,e){const n=this.client.resolver.resolveUserID(t),i=this.client.user.bot?{nick:e,access_token:t}:{recipient:n};return this.client.api.channels(this.id).recipients(n).put({data:i}).then(()=>this)}toString(){return this.name}send(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createMessageCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),t.exports=o},function(t,e,n){const i=n(17),s=n(22),r=n(29),o=n(56),a=n(11),c=n(3);class u extends i{constructor(t,e){super(t.client,e),this.guild=t}_patch(t){if(super._patch(t),this.name=t.name,this.position=t.position,this.permissionOverwrites=new c,t.permission_overwrites)for(const e of t.permission_overwrites)this.permissionOverwrites.set(e.id,new o(this,e))}get calculatedPosition(){const t=this.guild._sortedChannels(this.type);return t.array().indexOf(t.get(this.id))}permissionsFor(t){if(!(t=this.client.resolver.resolveGuildMember(this.guild,t)))return null;if(t.id===this.guild.ownerID)return new a(a.ALL);let e=0;const n=t.roles;for(const t of n.values())e|=t.permissions;const i=this.overwritesFor(t,!0,n);i.everyone&&(e&=~i.everyone._denied,e|=i.everyone._allowed);let s=0;for(const t of i.roles)e&=~t._denied,s|=t._allowed;return e|=s,i.member&&(e&=~i.member._denied,e|=i.member._allowed),Boolean(e&a.FLAGS.ADMINISTRATOR)&&(e=a.ALL),new a(e)}overwritesFor(t,e=!1,n=null){if(e||(t=this.client.resolver.resolveGuildMember(this.guild,t)),!t)return[];n=n||t.roles;const i=[];let s,r;for(const e of this.permissionOverwrites.values())e.id===this.guild.id?r=e:n.has(e.id)?i.push(e):e.id===t.id&&(s=e);return{everyone:r,roles:i,member:s}}overwritePermissions(t,e,n){const i={allow:0,deny:0};if(t instanceof s)i.type="role";else if(this.guild.roles.has(t))t=this.guild.roles.get(t),i.type="role";else if(t=this.client.resolver.resolveUser(t),i.type="member",!t)return Promise.reject(new TypeError("Supplied parameter was neither a User nor a Role."));i.id=t.id;const r=this.permissionOverwrites.get(t.id);r&&(i.allow=r._allowed,i.deny=r._denied);for(const t in e)!0===e[t]?(i.allow|=a.FLAGS[t]||0,i.deny&=~(a.FLAGS[t]||0)):!1===e[t]?(i.allow&=~(a.FLAGS[t]||0),i.deny|=a.FLAGS[t]||0):null===e[t]&&(i.allow&=~(a.FLAGS[t]||0),i.deny&=~(a.FLAGS[t]||0));return this.client.api.channels(this.id).permissions(i.id).put({data:i,reason:n}).then(()=>this)}edit(t,e){return this.client.api.channels(this.id).patch({data:{name:(t.name||this.name).trim(),topic:t.topic||this.topic,position:t.position||this.position,bitrate:t.bitrate||this.bitrate,user_limit:t.userLimit||this.userLimit},reason:e}).then(t=>this.client.actions.ChannelUpdate.handle(t).updated)}setName(t){return this.edit({name:t})}setPosition(t,e){return this.guild.setChannelPosition(this,t,e).then(()=>this)}setTopic(t){return this.edit({topic:t})}createInvite({temporary:temporary=!1,maxAge:maxAge=86400,maxUses:maxUses=0,reason:reason}={}){return this.client.api.channels(this.id).invites.post({data:{temporary:temporary,max_age:maxAge,max_uses:maxUses},reason:reason}).then(t=>new r(this.client,t))}clone(t=this.name,e=!0,n=!0){return this.guild.createChannel(t,this.type,{overwrites:e?this.permissionOverwrites:[]}).then(t=>n?t.setTopic(this.topic):t)}equals(t){let e=t&&this.id===t.id&&this.type===t.type&&this.topic===t.topic&&this.position===t.position&&this.name===t.name;return e&&(e=this.permissionOverwrites&&t.permissionOverwrites?this.permissionOverwrites.equals(t.permissionOverwrites):!this.permissionOverwrites&&!t.permissionOverwrites),e}get deletable(){return this.id!==this.guild.id&&this.permissionsFor(this.client.user).has(a.FLAGS.MANAGE_CHANNELS)}delete(t){return this.client.api.channels(this.id).delete({reason:t}).then(()=>this)}toString(){return`<#${this.id}>`}}t.exports=u},function(t,e){class n{constructor(t,e,n){this.reaction=t,this.name=e,this.id=n}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}toString(){return this.id?`<:${this.name}:${this.id}>`:this.name}}t.exports=n},function(t,e,n){const i=n(3),s=n(15).EventEmitter;class r extends s{constructor(t,e,n={}){super(),Object.defineProperty(this,"client",{value:t}),this.filter=e,this.options=n,this.collected=new i,this.ended=!1,this._timeout=null,this.listener=this._handle.bind(this),n.time&&(this._timeout=this.client.setTimeout(()=>this.stop("time"),n.time))}_handle(...t){const e=this.handle(...t);if(e&&this.filter(...t)){this.collected.set(e.key,e.value),this.emit("collect",e.value,this);const n=this.postCheck(...t);n&&this.stop(n)}}get next(){return new Promise((t,e)=>{if(this.ended)return void e(this.collected);const n=()=>{this.removeListener("collect",i);this.removeListener("end",s)};const i=e=>{n();t(e)};const s=()=>{n();e(this.collected)};this.on("collect",i);this.on("end",s)})}stop(t="user"){this.ended||(this._timeout&&this.client.clearTimeout(this._timeout),this.ended=!0,this.cleanup(),this.emit("end",this.collected,t))}handle(){}postCheck(){}cleanup(){}}t.exports=r},function(t,e,n){var i,s,r;/** * @license long.js (c) 2013 Daniel Wirtz * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details */ -!function(n,o){s=[],i=o,void 0!==(r="function"==typeof i?i.apply(e,s):i)&&(t.exports=r)}(0,function(){"use strict";function t(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function e(t){return!0===(t&&t.__isLong__)}function n(t,e){var n,i,r;return e?(t>>>=0,(r=0<=t&&t<256)&&(i=c[t])?i:(n=s(t,(0|t)<0?-1:0,!0),r&&(c[t]=n),n)):(t|=0,(r=-128<=t&&t<128)&&(i=a[t])?i:(n=s(t,t<0?-1:0,!1),r&&(a[t]=n),n))}function i(t,e){if(isNaN(t)||!isFinite(t))return e?m:f;if(e){if(t<0)return m;if(t>=h)return b}else{if(t<=-p)return w;if(t+1>=p)return _}return t<0?i(-t,e).neg():s(t%l|0,t/l|0,e)}function s(e,n,i){return new t(e,n,i)}function r(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return f;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return r(t.substring(1),e,n).neg();for(var o=i(u(n,8)),a=f,c=0;c>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},y.toString=function(t){if((t=t||10)<2||36>>0,h=l.toString(t);if(o=c,o.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<=0},y.isOdd=function(){return 1==(1&this.low)},y.isEven=function(){return 0==(1&this.low)},y.equals=function(t){return e(t)||(t=o(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},y.eq=y.equals,y.notEquals=function(t){return!this.eq(t)},y.neq=y.notEquals,y.lessThan=function(t){return this.comp(t)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(t){return this.comp(t)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(t){return this.comp(t)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(t){return this.comp(t)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(t){if(e(t)||(t=o(t)),this.eq(t))return 0;var n=this.isNegative(),i=t.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(g)},y.neg=y.negate,y.add=function(t){e(t)||(t=o(t));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,c=t.high>>>16,u=65535&t.high,l=t.low>>>16,h=65535&t.low,p=0,d=0,f=0,m=0;return m+=a+h,f+=m>>>16,m&=65535,f+=r+l,d+=f>>>16,f&=65535,d+=i+u,p+=d>>>16,d&=65535,p+=n+c,p&=65535,s(f<<16|m,p<<16|d,this.unsigned)},y.subtract=function(t){return e(t)||(t=o(t)),this.add(t.neg())},y.sub=y.subtract,y.multiply=function(t){if(this.isZero())return f;if(e(t)||(t=o(t)),t.isZero())return f;if(this.eq(w))return t.isOdd()?w:f;if(t.eq(w))return this.isOdd()?w:f;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(d)&&t.lt(d))return i(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,c=65535&this.low,u=t.high>>>16,l=65535&t.high,h=t.low>>>16,p=65535&t.low,m=0,g=0,v=0,E=0;return E+=c*p,v+=E>>>16,E&=65535,v+=a*p,g+=v>>>16,v&=65535,v+=c*h,g+=v>>>16,v&=65535,g+=r*p,m+=g>>>16,g&=65535,g+=a*h,m+=g>>>16,g&=65535,g+=c*l,m+=g>>>16,g&=65535,m+=n*p+r*h+a*l+c*u,m&=65535,s(v<<16|E,m<<16|g,this.unsigned)},y.mul=y.multiply,y.divide=function(t){if(e(t)||(t=o(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:f;var n,s,r;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return v;r=m}else{if(this.eq(w)){if(t.eq(g)||t.eq(E))return w;if(t.eq(w))return g;return n=this.shr(1).div(t).shl(1),n.eq(f)?t.isNegative()?g:E:(s=this.sub(t.mul(n)),r=n.add(s.div(t)))}if(t.eq(w))return this.unsigned?m:f;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();r=f}for(s=this;s.gte(t);){n=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),l=i(n),h=l.mul(t);h.isNegative()||h.gt(s);)n-=c,l=i(n,this.unsigned),h=l.mul(t);l.isZero()&&(l=g),r=r.add(l),s=s.sub(h)}return r},y.div=y.divide,y.modulo=function(t){return e(t)||(t=o(t)),this.sub(this.div(t).mul(t))},y.mod=y.modulo,y.not=function(){return s(~this.low,~this.high,this.unsigned)},y.and=function(t){return e(t)||(t=o(t)),s(this.low&t.low,this.high&t.high,this.unsigned)},y.or=function(t){return e(t)||(t=o(t)),s(this.low|t.low,this.high|t.high,this.unsigned)},y.xor=function(t){return e(t)||(t=o(t)),s(this.low^t.low,this.high^t.high,this.unsigned)},y.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?s(this.low<>>32-t,this.unsigned):s(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):s(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0===(t&=63))return this;var n=this.high;if(t<32){return s(this.low>>>t|n<<32-t,n>>>t,this.unsigned)}return 32===t?s(n,0,this.unsigned):s(n>>>t-32,0,this.unsigned)},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},y.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},y.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})},function(t,e,n){"use strict";(function(e){function n(t,n,i,s){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var r,o,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,i)});case 4:return e.nextTick(function(){t.call(null,n,i,s)});default:for(r=new Array(a-1),o=0;o-1?i:T;a.WritableState=o;var R=n(24);R.inherits=n(13);var D={deprecate:n(109)},I=n(63),k=n(40).Buffer;R.inherits(a,I),o.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(o.prototype,"buffer",{get:D.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}();var M;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(t){return!!M.call(this,t)||t&&t._writableState instanceof o}})):M=function(t){return t instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(t,e,n){var i=this._writableState,r=!1,o=k.isBuffer(t);return"function"==typeof e&&(n=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=s),i.ended?c(this,n):(o||u(this,i,t,n))&&(i.pendingcb++,r=h(this,i,o,t,e,n)),r},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||E(this,t))},a.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},a.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(t,e,n){var i=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||y(this,i,n)}}).call(e,n(9),n(106).setImmediate)},function(t,e,n){t.exports=n(6)},function(t,e,n){const i=n(100);t.exports=i},function(t,e,n){(function(t,i){function s(t,n){var i={seen:[],stylize:o};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),m(n)?i.showHidden=n:n&&e._extend(i,n),w(i.showHidden)&&(i.showHidden=!1),w(i.depth)&&(i.depth=2),w(i.colors)&&(i.colors=!1),w(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=r),c(i,t,i.depth)}function r(t,e){var n=s.styles[e];return n?"["+s.colors[n][0]+"m"+t+"["+s.colors[n][1]+"m":t}function o(t,e){return t}function a(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function c(t,n,i){if(t.customInspect&&n&&S(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var s=n.inspect(i,t);return _(s)||(s=c(t,s,i)),s}var r=u(t,n);if(r)return r;var o=Object.keys(n),m=a(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(n)),T(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(n);if(0===o.length){if(S(n)){var g=n.name?": "+n.name:"";return t.stylize("[Function"+g+"]","special")}if(y(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(A(n))return t.stylize(Date.prototype.toString.call(n),"date");if(T(n))return l(n)}var v="",E=!1,b=["{","}"];if(f(n)&&(E=!0,b=["[","]"]),S(n)){v=" [Function"+(n.name?": "+n.name:"")+"]"}if(y(n)&&(v=" "+RegExp.prototype.toString.call(n)),A(n)&&(v=" "+Date.prototype.toUTCString.call(n)),T(n)&&(v=" "+l(n)),0===o.length&&(!E||0==n.length))return b[0]+v+b[1];if(i<0)return y(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var w;return w=E?h(t,n,i,m,o):o.map(function(e){return p(t,n,i,m,e,E)}),t.seen.pop(),d(w,v,b)}function u(t,e){if(w(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return E(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,n,i,s){for(var r=[],o=0,a=e.length;o-1&&(a=r?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),w(o)){if(r&&s.match(/^\d+$/))return a;o=JSON.stringify(""+s),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function d(t,e,n){var i=0;return t.reduce(function(t,e){return i++,e.indexOf("\n")>=0&&i++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function f(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return null==t}function E(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function w(t){return void 0===t}function y(t){return x(t)&&"[object RegExp]"===D(t)}function x(t){return"object"==typeof t&&null!==t}function A(t){return x(t)&&"[object Date]"===D(t)}function T(t){return x(t)&&("[object Error]"===D(t)||t instanceof Error)}function S(t){return"function"==typeof t}function R(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function D(t){return Object.prototype.toString.call(t)}function I(t){return t<10?"0"+t.toString(10):t.toString(10)}function k(){var t=new Date,e=[I(t.getHours()),I(t.getMinutes()),I(t.getSeconds())].join(":");return[t.getDate(),C[t.getMonth()],e].join(" ")}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.format=function(t){if(!_(t)){for(var e=[],n=0;n=r)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}}),a=i[n];n",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{long:"^3.2.0","prism-media":"^0.0.1",snekfetch:"^3.1.0",tweetnacl:"^1.0.0",ws:"^3.0.0"},peerDependencies:{bufferutil:"^3.0.0",erlpack:"hammerandchisel/erlpack","node-opus":"^0.2.5",opusscript:"^0.0.3",sodium:"^2.0.1","libsodium-wrappers":"^0.5.1",uws:"^0.14.1"},devDependencies:{"@types/node":"^7.0.0","discord.js-docgen":"hydrabolt/discord.js-docgen",eslint:"^3.19.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony-v2.8.22","uglifyjs-webpack-plugin":"^0.4.3",webpack:"^2.2.0"},engines:{node:">=8.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,"prism-media":!1,opusscript:!1,"node-opus":!1,tweetnacl:!1,sodium:!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/Secretbox.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/util/VolumeInterface.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceBroadcast.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(t,e,n){(function(e){const i=n(18),s=n(3),r=n(46),o=n(0),a=n(4),c=n(20),u=n(10),l=n(32),{TypeError:TypeError}=n(5);class h extends i{_patch(t){super._patch(t),this.verified=t.verified,this.email=t.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s,this.premium="boolean"==typeof t.premium?t.premium:null,this.mfaEnabled="boolean"==typeof t.mfa_enabled?t.mfa_enabled:null,this.mobile="boolean"==typeof t.mobile?t.mobile:null,t.user_settings&&(this.settings=new r(this,t.user_settings))}edit(t,e){const n={};return n.username=t.username||this.username,n.avatar=this.client.resolver.resolveBase64(t.avatar),this.bot||(n.email=t.email||this.email,n.password=e,t.new_password&&(n.new_password=t.newPassword)),this.client.api.users("@me").patch({data:t}).then(t=>this.client.actions.UserUpdate.handle(t).updated)}setUsername(t,e){return this.edit({username:t},e)}setEmail(t,e){return this.edit({email:t},e)}setPassword(t,e){return this.edit({password:t},e)}setAvatar(t){return"string"==typeof t&&t.startsWith("data:")?this.edit({avatar:t}):this.client.resolver.resolveBuffer(t||e.alloc(0)).then(t=>this.edit({avatar:this.client.resolver.resolveBase64(t)||null}))}setPresence(t){return new Promise(e=>{let n=this.localPresence.status||this.presence.status;let i=this.localPresence.game;let s=this.localPresence.afk||this.presence.afk;!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url});if(t.status){if("string"!=typeof t.status)throw new TypeError("STATUS_TYPE");this.bot?n=t.status:(this.settings.update(o.UserSettingsMap.status,t.status),n="invisible")}t.game?(i=t.game,i.url&&(i.type=1)):void 0!==t.game&&(i=null);void 0!==t.afk&&(s=t.afk);s=Boolean(s);this.localPresence={status:n,game:i,afk:s};this.localPresence.since=0;this.localPresence.game=this.localPresence.game||null;this.client.ws.send({op:3,d:this.localPresence});this.client._setPresence(this.id,this.localPresence);e(this)})}setStatus(t){return this.setPresence({status:t})}setGame(t,e){return t?this.setPresence({game:{name:t,url:e}}):this.setPresence({game:null})}setAFK(t){return this.setPresence({afk:t})}fetchMentions(t={}){return t.guild instanceof c&&(t.guild=t.guild.id),a.mergeDefault({limit:25,roles:!0,everyone:!0,guild:null},t),this.client.api.users("@me").mentions.get({query:t}).then(t=>t.map(t=>new u(this.client.channels.get(t.channel_id),t,this.client)))}createGuild(t,{region:region,icon:icon=null}={}){return!icon||"string"==typeof icon&&icon.startsWith("data:")?new Promise((e,n)=>this.client.api.guilds.post({data:{name:t,region:region,icon:icon}}).then(t=>{if(this.client.guilds.has(t.id))return e(this.client.guilds.get(t.id));const n=s=>{s.id===t.id&&(this.client.removeListener(o.Events.GUILD_CREATE,n),this.client.clearTimeout(i),e(s))};this.client.on(o.Events.GUILD_CREATE,n);const i=this.client.setTimeout(()=>{this.client.removeListener(o.Events.GUILD_CREATE,n);e(this.client.guilds.create(t))},1e4);return},n)):this.client.resolver.resolveBuffer(icon).then(e=>this.createGuild(t,{region:region,icon:this.client.resolver.resolveBase64(e)||null}))}createGroupDM(t){const e=this.bot?{access_tokens:t.map(t=>t.accessToken),nicks:t.reduce((t,e)=>{e.nick&&(t[e.user?e.user.id:e.id]=e.nick);return t},{})}:{recipients:t.map(t=>this.client.resolver.resolveUserID(t))};return this.client.api.users("@me").channels.post({data:e}).then(t=>new l(this.client,t))}}t.exports=h}).call(e,n(6).Buffer)},function(t,e,n){const i=n(0),s=n(4);class r{constructor(t,e){this.user=t,this.patch(e)}patch(t){for(const[e,n]of Object.entries(i.UserSettingsMap))t.hasOwnProperty(e)&&("function"==typeof n?this[n.name]=n(t[e]):this[n]=t[e])}update(t,e){return this.user.client.api.users("@me").settings.patch({data:{[t]:e}})}setGuildPosition(t,e,n){const i=Object.assign([],this.guildPositions);return s.moveElementInArray(i,t.id,e,n),this.update("guild_positions",i).then(()=>t)}addRestrictedGuild(t){const e=Object.assign([],this.restrictedGuilds);return e.includes(t.id)?Promise.reject(new Error("Guild is already restricted")):(e.push(t.id),this.update("restricted_guilds",e).then(()=>t))}removeRestrictedGuild(t){const e=Object.assign([],this.restrictedGuilds),n=e.indexOf(t.id);return n<0?Promise.reject(new Error("Guild is not restricted")):(e.splice(n,1),this.update("restricted_guilds",e).then(()=>t))}}t.exports=r},function(t,e,n){const i=n(17),s=n(26),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="dm",this.messages=new r,this._typing=new Map}_patch(t){super._patch(t),this.recipient=this.client.users.create(t.recipients[0]),this.lastMessageID=t.last_message_id}toString(){return this.recipient.toString()}send(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createMessageCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),t.exports=o},function(t,e,n){const i=n(3),s=n(8),r={GUILD:"GUILD",CHANNEL:"CHANNEL",USER:"USER",ROLE:"ROLE",INVITE:"INVITE",WEBHOOK:"WEBHOOK",EMOJI:"EMOJI",MESSAGE:"MESSAGE",UNKNOWN:"UNKNOWN"},o={GUILD_UPDATE:1,CHANNEL_CREATE:10,CHANNEL_UPDATE:11,CHANNEL_DELETE:12,CHANNEL_OVERWRITE_CREATE:13,CHANNEL_OVERWRITE_UPDATE:14,CHANNEL_OVERWRITE_DELETE:15,MEMBER_KICK:20,MEMBER_PRUNE:21,MEMBER_BAN_ADD:22,MEMBER_BAN_REMOVE:23,MEMBER_UPDATE:24,MEMBER_ROLE_UPDATE:25,ROLE_CREATE:30,ROLE_UPDATE:31,ROLE_DELETE:32,INVITE_CREATE:40,INVITE_UPDATE:41,INVITE_DELETE:42,WEBHOOK_CREATE:50,WEBHOOK_UPDATE:51,WEBHOOK_DELETE:52,EMOJI_CREATE:60,EMOJI_UPDATE:61,EMOJI_DELETE:62,MESSAGE_DELETE:72};class a{constructor(t,e){if(e.users)for(const n of e.users)t.client.users.create(n);this.entries=new i;for(const n of e.audit_log_entries){const e=new c(t,n);this.entries.set(e.id,e)}}static build(...t){const e=new a(...t);return Promise.all(e.entries.map(t=>t.target)).then(()=>e)}static targetType(t){return t<10?r.GUILD:t<20?r.CHANNEL:t<30?r.USER:t<40?r.ROLE:t<50?r.INVITE:t<60?r.WEBHOOK:t<70?r.EMOJI:t<80?r.MESSAGE:r.UNKNOWN}static actionType(t){return[o.CHANNEL_CREATE,o.CHANNEL_OVERWRITE_CREATE,o.MEMBER_BAN_REMOVE,o.ROLE_CREATE,o.INVITE_CREATE,o.WEBHOOK_CREATE,o.EMOJI_CREATE].includes(t)?"CREATE":[o.CHANNEL_DELETE,o.CHANNEL_OVERWRITE_DELETE,o.MEMBER_KICK,o.MEMBER_PRUNE,o.MEMBER_BAN_ADD,o.ROLE_DELETE,o.INVITE_DELETE,o.WEBHOOK_DELETE,o.EMOJI_DELETE,o.MESSAGE_DELETE].includes(t)?"DELETE":[o.GUILD_UPDATE,o.CHANNEL_UPDATE,o.CHANNEL_OVERWRITE_UPDATE,o.MEMBER_UPDATE,o.MEMBER_ROLE_UPDATE,o.ROLE_UPDATE,o.INVITE_UPDATE,o.WEBHOOK_UPDATE,o.EMOJI_UPDATE].includes(t)?"UPDATE":"ALL"}}class c{constructor(t,e){const n=a.targetType(e.action_type);if(this.targetType=n,this.actionType=a.actionType(e.action_type),this.action=Object.keys(o).find(t=>o[t]===e.action_type),this.reason=e.reason||null,this.executor=t.client.users.get(e.user_id),this.changes=e.changes?e.changes.map(t=>({key:t.key,old:t.old_value,new:t.new_value})):null,this.id=e.id,this.extra=null,e.options)if(e.action_type===o.MEMBER_PRUNE)this.extra={removed:e.options.members_removed,days:e.options.delete_member_days};else if(e.action_type===o.MESSAGE_DELETE)this.extra={count:e.options.count,channel:t.channels.get(e.options.channel_id)};else switch(e.options.type){case"member":this.extra=t.members.get(e.options.id),this.extra||(this.extra={id:e.options.id});break;case"role":this.extra=t.roles.get(e.options.id),this.extra||(this.extra={id:e.options.id,name:e.options.role_name})}if(n===r.UNKNOWN)this.target=e.target_id;else if([r.USER,r.GUILD].includes(n))this.target=t.client[`${n.toLowerCase()}s`].get(e.target_id);else if(n===r.WEBHOOK)this.target=t.fetchWebhooks().then(t=>{this.target=t.find(t=>t.id===e.target_id);return this.target});else if(n===r.INVITE){const e=this.changes.find(t=>"code"===t.key);this.target=t.fetchInvites().then(t=>{this.target=t.find(t=>t.code===(e.new_value||e.old_value));return this.target})}else this.target=n===r.MESSAGE?t.client.users.get(e.target_id):t[`${n.toLowerCase()}s`].get(e.target_id)}get createdTimestamp(){return s.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}}a.Actions=o,a.Targets=r,a.Entry=c,t.exports=a},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.message=t,this.setup(e)}setup(t){this.id=t.id,this.filename=t.filename,this.filesize=t.size,this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}t.exports=n},function(t,e,n){const i=n(35);class s extends i{constructor(t,e,n={}){super(t.client,e,n),this.channel=t,this.received=0,this.client.on("message",this.listener)}handle(t){return t.channel.id!==this.channel.id?null:(this.received++,{key:t.id,value:t})}postCheck(){return this.options.max&&this.collected.size>=this.options.max?"limit":this.options.maxProcessed&&this.received===this.options.maxProcessed?"processedLimit":null}cleanup(){this.client.removeListener("message",this.listener)}}t.exports=s},function(t,e,n){const i=n(4),{RangeError:RangeError}=n(5);class s{constructor(t){this.setup(t)}setup(t){this.type=t.type,this.title=t.title||null,this.description=t.description||null,this.url=t.url||null,this.color=t.color||null,this.timestamp=new Date(t.timestamp)||null,this.fields=t.fields||null,this.thumbnail=t.thumbnail?{url:t.thumbnail.url||null,proxyURL:t.thumbnail.proxy_url,height:t.height,width:t.width}:null,this.image=t.image?{url:t.image.url||null,proxyURL:t.image.proxy_url,height:t.height,width:t.width}:null,this.video=t.video?{url:t.video.url||null,height:t.video.height,width:t.video.width}:null,this.author=t.author?{name:t.author.name||null,url:t.author.url||null,iconURL:t.author.iconURL||t.author.icon_url||null,proxyIconURL:t.author.proxyIconUrl||t.author.proxy_icon_url||null}:null,this.provider=t.provider?{name:t.provider.name,url:t.provider.url}:null,this.footer=t.footer?{text:t.footer.text||null,iconURL:t.footer.iconURL||t.footer.icon_url||null,proxyIconURL:t.footer.proxyIconURL||t.footer.proxy_icon_url||null}:null}get createdAt(){return new Date(this.timestamp)}get hexColor(){let t=this.color.toString(16);for(;t.length<6;)t=`0${t}`;return`#${t}`}addField(t,e,n=!1){if(this.fields.length>=25)throw new RangeError("EMBED_FIELD_COUNT");if(t=i.resolveString(t),!String(t)||t.length>256)throw new RangeError("EMBED_FIELD_NAME");if(e=i.resolveString(e),!String(t)||e.length>1024)throw new RangeError("EMBED_FIELD_VALUE");return this.fields.push({name:t,value:e,inline:n}),this}attachFile(t){if(this.file)throw new RangeError("EMBED_FILE_LIMIT");return this.file=t,this}setAuthor(t,e,n){return this.author={name:i.resolveString(t),iconURL:e,url:n},this}setColor(t){return this.color=i.resolveColor(t),this}setDescription(t){if(t=i.resolveString(t),t.length>2048)throw new RangeError("EMBED_DESCRIPTION");return this.description=t,this}setFooter(t,e){if(t=i.resolveString(t),t.length>2048)throw new RangeError("EMBED_FOOTER_TEXT");return this.footer={text:t,iconURL:e},this}setImage(t){return this.image={url:t},this}setThumbnail(t){return this.thumbnail={url:t},this}setTimestamp(t=new Date){return this.timestamp=t,this}setTitle(t){if(t=i.resolveString(t),t.length>256)throw new RangeError("EMBED_TITLE");return this.title=t,this}setURL(t){return this.url=t,this}}t.exports=s},function(t,e,n){const i=n(3);class s{constructor(t,e,n,s){if(this.everyone=Boolean(s),e)if(e instanceof i)this.users=new i(e);else{this.users=new i;for(const n of e){let e=t.client.users.create(n);this.users.set(e.id,e)}}else this.users=new i;if(n)if(n instanceof i)this.roles=new i(n);else{this.roles=new i;for(const e of n){const n=t.channel.guild.roles.get(e);n&&this.roles.set(n.id,n)}}else this.roles=new i;this._content=t.content,this._client=t.client,this._guild=t.channel.guild,this._members=null,this._channels=null}get members(){return this._members?this._members:this._guild?(this._members=new i,this.users.forEach(t=>{const e=this._guild.member(t);e&&this._members.set(e.user.id,e)}),this._members):null}get channels(){if(this._channels)return this._channels;this._channels=new i;let t;for(;null!==(t=this.constructor.CHANNELS_PATTERN.exec(this._content));){const e=this._client.channels.get(t[1]);e&&this._channels.set(e.id,e)}return this._channels}}s.EVERYONE_PATTERN=/@(everyone|here)/g,s.USERS_PATTERN=/<@!?[0-9]+>/g,s.ROLES_PATTERN=/<@&[0-9]+>/g,s.CHANNELS_PATTERN=/<#([0-9]+)>/g,t.exports=s},function(t,e,n){const i=n(3),s=n(19),r=n(34);class o{constructor(t,e,n,s){this.message=t,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,e.name,e.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const t=this.message.client.emojis;if(t.has(this._emoji.id)){const e=t.get(this._emoji.id);return this._emoji=e,e}}return this._emoji}remove(t=this.message.client.user){const e=this.message.client.resolver.resolveUserID(t);return e?this.message.client.api.channels(this.message.channel.id).messages(this.message.id).reactions(this.emoji.identifier)[e===this.message.client.user.id?"@me":e].delete().then(()=>this.message.client.actions.MessageReactionRemove.handle({user_id:e,message_id:this.message.id,emoji:this.emoji,channel_id:this.message.channel.id}).reaction):Promise.reject(new Error("Couldn't resolve the user ID to remove from the reaction."))}fetchUsers(t=100){const e=this.message;return e.client.api.channels(e.channel.id).messages(e.id).reactions(this.emoji.identifier).get({query:{limit:t}}).then(t=>{this.users=new i;for(const n of t){const t=e.client.users.create(n);this.users.set(t.id,t)}this.count=this.users.size;return this.users})}}t.exports=o},function(t,e,n){const i=n(7);class s extends i{constructor(t,e){super(t),this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.icon=t.icon,this.splash=t.splash}}t.exports=s},function(t,e,n){const i=n(0),s=n(7);class r extends s{constructor(t,e){super(t),this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.type=i.ChannelTypes.TEXT===t.type?"text":"voice"}}t.exports=r},function(t,e,n){const i=n(11);class s{constructor(t,e){Object.defineProperty(this,"channel",{value:t}),e&&this._patch(e)}_patch(t){this.id=t.id,this.type=t.type,this._denied=t.deny,this._allowed=t.allow,this.denied=new i(this._denied),this.allowed=new i(this._allowed)}delete(t){return this.channel.client.api.channels(this.channel.id).permissions(this.id).delete({reason:t}).then(()=>this)}}t.exports=s},function(t,e,n){const i=n(35),s=n(3);class r extends i{constructor(t,e,n={}){super(t.client,e,n),this.message=t,this.users=new s,this.total=0,this.client.on("messageReactionAdd",this.listener)}handle(t){return t.message.id!==this.message.id?null:{key:t.emoji.id||t.emoji.name,value:t}}postCheck(t,e){return this.users.set(e.id,e),this.options.max&&++this.total>=this.options.max?"limit":this.options.maxEmojis&&this.collected.size>=this.options.maxEmojis?"emojiLimit":this.options.maxUsers&&this.users.size>=this.options.maxUsers?"userLimit":null}cleanup(){this.client.removeListener("messageReactionAdd",this.listener)}}t.exports=r},function(t,e,n){const i=n(33),s=n(23),r=n(26),o=n(3);class a extends i{constructor(t,e){super(t,e),this.type="text",this.messages=new o,this._typing=new Map}_patch(t){super._patch(t),this.topic=t.topic,this.lastMessageID=t.last_message_id}get members(){const t=new o;for(const e of this.guild.members.values())this.permissionsFor(e).has("READ_MESSAGES")&&t.set(e.id,e);return t}get nsfw(){return/^nsfw(-|$)/.test(this.name)}fetchWebhooks(){return this.client.api.channels(this.id).webhooks.get().then(t=>{const e=new o;for(const n of t)e.set(n.id,new s(this.client,n));return e})}createWebhook(t,e){return"string"==typeof e&&e.startsWith("data:")?this.client.api.channels(this.id).webhooks.post({data:{name:t,avatar:e}}).then(t=>new s(this.client,t)):this.client.resolver.resolveBuffer(e).then(e=>this.createWebhook(t,this.client.resolver.resolveBase64(e)||null))}send(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createMessageCollector(){}awaitMessages(){}bulkDelete(){}acknowledge(){}_cacheMessage(){}}r.applyToClass(a,!0),t.exports=a},function(t,e,n){const i=n(33),s=n(3);class r extends i{constructor(t,e){super(t,e),this.members=new s,this.type="voice"}_patch(t){super._patch(t),this.bitrate=t.bitrate,this.userLimit=t.user_limit}get connection(){const t=this.guild.voiceConnection;return t&&t.channel.id===this.id?t:null}get full(){return this.userLimit>0&&this.members.size>=this.userLimit}get joinable(){return!this.client.browser&&(!!this.permissionsFor(this.client.user).has("CONNECT")&&!(this.full&&!this.permissionsFor(this.client.user).has("MOVE_MEMBERS")))}get speakable(){return this.permissionsFor(this.client.user).has("SPEAK")}setBitrate(t){return this.edit({bitrate:t})}setUserLimit(t){return this.edit({userLimit:t})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const t=this.client.voice.connections.get(this.guild.id);t&&t.channel.id===this.id&&t.disconnect()}}}t.exports=r},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";(function(e){function i(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?k(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}function s(t,e){D=D||n(16),t=t||{},this.objectMode=!!t.objectMode,e instanceof D&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=new j,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(P||(P=n(68).StringDecoder),this.decoder=new P(t.encoding),this.encoding=t.encoding)}function r(t){if(D=D||n(16),!(this instanceof r))return new r(t);this._readableState=new s(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),N.call(this)}function o(t,e,n,i,s){var r=l(e,n);if(r)t.emit("error",r);else if(null===n)e.reading=!1,h(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!s){var o=new Error("stream.push() after EOF");t.emit("error",o)}else if(e.endEmitted&&s){var c=new Error("stream.unshift() after end event");t.emit("error",c)}else{var u;!e.decoder||s||i||(n=e.decoder.write(n),u=!e.objectMode&&0===n.length),s||(e.reading=!1),u||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,s?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&p(t))),f(t,e)}else s||(e.reading=!1);return a(e)}function a(t){return!t.ended&&(t.needReadable||t.length=B?t=B:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function u(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=c(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function l(t,e){var n=null;return L.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,p(t)}}function p(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(U("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?I(d,t):d(t))}function d(t){U("emit readable"),t.emit("readable"),b(t)}function f(t,e){e.readingMore||(e.readingMore=!0,I(m,t,e))}function m(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=y(t,e.buffer,e.decoder),n}function y(t,e,n){var i;return tr.length?r.length:t;if(o===r.length?s+=r:s+=r.slice(0,t),0===(t-=o)){o===r.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=r.slice(o));break}++i}return e.length-=i,s}function A(t,e){var n=L.allocUnsafe(t),i=e.head,s=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var r=i.data,o=t>r.length?r.length:t;if(r.copy(n,n.length-t,0,o),0===(t-=o)){o===r.length?(++s,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=r.slice(o));break}++s}return e.length-=s,n}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,I(S,e,t))}function S(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var n=0,i=t.length;n=e.highWaterMark||e.ended))return U("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):p(this),null;if(0===(t=u(t,e))&&e.ended)return 0===e.length&&T(this),null;var i=e.needReadable;U("need readable",i),(0===e.length||e.length-t0?w(t,e):null,null===s?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&T(this)),null!==s&&this.emit("data",s),s},r.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},r.prototype.pipe=function(t,n){function s(t){U("onunpipe"),t===p&&o()}function r(){U("onend"),t.end()}function o(){U("cleanup"),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("drain",v),t.removeListener("error",c),t.removeListener("unpipe",s),p.removeListener("end",r),p.removeListener("end",h),p.removeListener("data",a),E=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){U("ondata"),_=!1,!1!==t.write(e)||_||((1===d.pipesCount&&d.pipes===t||d.pipesCount>1&&-1!==R(d.pipes,t))&&!E&&(U("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,_=!0),p.pause())}function c(e){U("onerror",e),h(),t.removeListener("error",c),0===M(t,"error")&&t.emit("error",e)}function u(){t.removeListener("finish",l),h()}function l(){U("onfinish"),t.removeListener("close",u),h()}function h(){U("unpipe"),p.unpipe(t)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,U("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||!1!==n.end)&&t!==e.stdout&&t!==e.stderr,m=f?r:h;d.endEmitted?I(m):p.once("end",m),t.on("unpipe",s);var v=g(p);t.on("drain",v);var E=!1,_=!1;return p.on("data",a),i(t,"error",c),t.once("close",u),t.once("finish",l),t.emit("pipe",p),d.flowing||(U("pipe resume"),p.resume()),t},r.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],E={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=n(38);i.prototype.parse=function(t,e,n){if(!u.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),s=-1!==i&&i127?M+="x":M+=k[N];if(!M.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var C=D.slice(0,x),O=D.slice(x+1),U=k.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);U&&(C.push(U[1]),O.unshift(U[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=C.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=c.toASCII(this.hostname));var P=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+P,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!E[d])for(var x=0,I=m.length;x0)&&n.host.split("@");T&&(n.auth=T.shift(),n.host=n.hostname=T.shift())}return n.search=t.search,n.query=t.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=x.slice(-1)[0],R=(n.host||t.host||x.length>1)&&("."===S||".."===S)||""===S,D=0,I=x.length;I>=0;I--)S=x[I],"."===S?x.splice(I,1):".."===S?(x.splice(I,1),D++):D&&(x.splice(I,1),D--);if(!w&&!y)for(;D--;D)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),R&&"/"!==x.join("/").substr(-1)&&x.push("");var k=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(A){n.hostname=n.host=k?"":x.length?x.shift():"";var T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");T&&(n.auth=T.shift(),n.host=n.hostname=T.shift())}return w=w||n.host&&x.length,w&&!k&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var t=this.host,e=h.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,n){function i(t){if(t&&!c(t))throw new Error("Unknown encoding: "+t)}function s(t){return t.toString(this.encoding)}function r(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function o(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var a=n(6).Buffer,c=a.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=e.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),i(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=s)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var s=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,s),s-=this.charReceived),e+=t.toString(this.encoding,0,s);var s=e.length-1,i=e.charCodeAt(s);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),t.copy(this.charBuffer,0,0,r),e.substring(0,s)}return e},u.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},u.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,i=this.charBuffer,s=this.encoding;e+=i.slice(0,n).toString(s)}return e}},function(t,e,n){(function(e){const i=n(30),s=n(43),r=n(41),o=n(4),a=n(18),c=n(10),u=n(20),l=n(17),h=n(21),p=n(19),d=n(34),{Error:Error,TypeError:TypeError}=n(5);class f{constructor(t){this.client=t}resolveUser(t){return t instanceof a?t:"string"==typeof t?this.client.users.get(t)||null:t instanceof h?t.user:t instanceof c?t.author:t instanceof u?t.owner:null}resolveUserID(t){return t instanceof a||t instanceof h?t.id:"string"==typeof t?t||null:t instanceof c?t.author.id:t instanceof u?t.ownerID:null}resolveGuild(t){return t instanceof u?t:"string"==typeof t?this.client.guilds.get(t)||null:null}resolveGuildMember(t,e){return e instanceof h?e:(t=this.resolveGuild(t),e=this.resolveUser(e),t&&e?t.members.get(e.id)||null:null)}resolveChannel(t){return t instanceof l?t:"string"==typeof t?this.client.channels.get(t)||null:t instanceof c?t.channel:t instanceof u?t.channels.get(t.id)||null:null}resolveChannelID(t){return t instanceof l?t.id:"string"==typeof t?t:t instanceof c?t.channel.id:t instanceof u?t.defaultChannel.id:null}resolveInviteCode(t){const e=/discord(?:app\.com\/invite|\.gg)\/([\w-]{2,255})/i,n=e.exec(t);return n&&n[1]?n[1]:t}resolveBase64(t){return t instanceof e?`data:image/jpg;base64,${t.toString("base64")}`:t}resolveBuffer(t){return t instanceof e?Promise.resolve(t):this.client.browser&&t instanceof ArrayBuffer?Promise.resolve(o.convertToBuffer(t)):"string"==typeof t?new Promise((n,o)=>{if(/^https?:\/\//.test(t))r.get(t).end((t,i)=>{if(t)return o(t);if(!(i.body instanceof e))return o(new TypeError("REQ_BODY_TYPE"));return n(i.body)});else{const e=i.resolve(t);s.stat(e,(t,i)=>{if(t)return o(t);if(!i||!i.isFile())return o(new Error("FILE_NOT_FOUND",e));s.readFile(e,(t,e)=>{t?o(t):n(e)});return null})}}):Promise.reject(new TypeError("REQ_RESOURCE_TYPE"))}resolveEmojiIdentifier(t){return t instanceof p||t instanceof d?t.identifier:"string"==typeof t?this.client.emojis.has(t)?this.client.emojis.get(t).identifier:t.includes("%")?t:encodeURIComponent(t):null}}t.exports=f}).call(e,n(6).Buffer)},function(t,e){class n extends Error{constructor(t){super();const e=t.errors?` -${this.constructor.flattenErrors(t.errors).join("\n")}`:"";this.name="DiscordAPIError",this.message=`${t.message}${e}`,this.code=t.code}static flattenErrors(t,e=""){let n=[];for(const[i,s]of Object.entries(t)){const t=e?isNaN(i)?`${e}.${i}`:`${e}[${i}]`:i;s._errors?n.push(`${t}: ${s._errors.map(t=>t.message).join(" ")}`):s.code||s.message?n.push(`${s.code?`${s.code}: `:""}${s.message}`.trim()):n=n.concat(this.flattenErrors(s,t))}return n}}t.exports=n},function(t,e,n){const i=n(148),s=n(147),r=n(146),o=n(144),a=n(145),{Error:Error}=n(5);class c{constructor(t){this.client=t,this.handlers={},this.userAgentManager=new i(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1,this.api=a(this)}destroy(){for(const t in this.handlers)this.handlers[t].destroy()}push(t,e){return new Promise((n,i)=>{t.push({request:e,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return s;case"burst":return r;default:throw new Error("RATELIMIT_INVALID_METHOD")}}request(t,e,n={}){const i=new o(this,t,e,n);if(!this.handlers[i.route]){const t=this.getRequestHandler();this.handlers[i.route]=new t(this,i.route)}return this.push(this.handlers[i.route],i)}}t.exports=c},function(t,e){class n{constructor(t){this.restManager=t,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(t){this.restManager.globallyRateLimited=t}push(t){this.queue.push(t)}handle(){}destroy(){this.queue=[]}}t.exports=n},function(t,e,n){(function(e){const i="browser"===n(27).platform(),s=n(15),r=n(0),o=n(43),a=n(150),c=function(){try{const t=n(201);return t.pack?t:null}catch(t){return null}}(),u=function(){if(i)return window.WebSocket;try{return n(202)}catch(t){return n(203)}}();class l extends s{constructor(t,e){super(),this.manager=t,this.client=t.client,this.ws=null,this.sequence=-1,this.status=r.Status.IDLE,this.packetManager=new a(this),this.lastPingTimestamp=0,this.ratelimit={queue:[],remaining:120,resetTime:-1},this.connect(e),this.disabledEvents={},this.closeSequence=0,this.expectingClose=!1;for(const t of this.client.options.disabledEvents)this.disabledEvents[t]=!0}triggerReady(){if(this.status===r.Status.READY)return void this.debug("Tried to mark self as ready, but already ready");this.status=r.Status.READY,this.client.emit(r.Events.READY),this.packetManager.handleQueue()}checkIfReady(){if(this.status===r.Status.READY||this.status===r.Status.NEARLY)return!1;let t=0;for(const e of this.client.guilds.values())e.available||t++;if(0===t){if(this.status=r.Status.NEARLY,!this.client.options.fetchAllMembers)return this.triggerReady();const t=this.client.guilds.map(t=>t.fetchMembers());Promise.all(t).then(()=>this.triggerReady()).catch(t=>{this.debug(`Failed to fetch all members before ready! ${t}`);this.triggerReady()})}return!0}debug(t){return t instanceof Error&&(t=t.stack),this.manager.debug(`[connection] ${t}`)}unpack(t){return t instanceof ArrayBuffer&&(t=e.from(new Uint8Array(t))),c&&"string"!=typeof t?c.unpack(t):(t instanceof e&&(t=o.inflateSync(t).toString()),JSON.parse(t))}pack(t){return c?c.pack(t):JSON.stringify(t)}processQueue(){if(0!==this.ratelimit.remaining&&0!==this.ratelimit.queue.length)for(120===this.ratelimit.remaining&&(this.ratelimit.resetTimer=setTimeout(()=>{this.ratelimit.remaining=120;this.processQueue()},12e4));this.ratelimit.remaining>0;){const t=this.ratelimit.queue.shift();if(!t)return;this._send(t),this.ratelimit.remaining--}}_send(t){if(!this.ws||this.ws.readyState!==u.OPEN)return void this.debug(`Tried to send packet ${t} but no WebSocket is available!`);this.ws.send(this.pack(t))}send(t){if(!this.ws||this.ws.readyState!==u.OPEN)return void this.debug(`Tried to send packet ${t} but no WebSocket is available!`);this.ratelimit.queue.push(t),this.processQueue()}connect(t=this.gateway,e=0,n=!1){if(e)return this.client.setTimeout(()=>this.connect(t,0,n),e);if(this.ws&&!n)return this.debug("WebSocket connection already exists"),!1;if("string"!=typeof t)return this.debug(`Tried to connect to an invalid gateway: ${t}`),!1;this.expectingClose=!1,this.gateway=t,this.debug(`Connecting to ${t}`);const s=this.ws=new u(t);return i&&(s.binaryType="arraybuffer"),s.onmessage=this.onMessage.bind(this),s.onopen=this.onOpen.bind(this),s.onerror=this.onError.bind(this),s.onclose=this.onClose.bind(this),this.status=r.Status.CONNECTING,!0}destroy(){const t=this.ws;return t?(this.heartbeat(-1),this.expectingClose=!0,t.close(1e3),this.packetManager.handleQueue(),this.ws=null,this.status=r.Status.DISCONNECTED,!0):(this.debug("Attempted to destroy WebSocket but no connection exists!"),!1)}onMessage(t){let e;try{e=this.unpack(t.data)}catch(t){this.emit("debug",t)}return this.onPacket(e)}setSequence(t){this.sequence=t>this.sequence?t:this.sequence}onPacket(t){if(!t)return this.debug("Received null packet"),!1;switch(this.client.emit("raw",t),t.op){case r.OPCodes.HELLO:return this.heartbeat(t.d.heartbeat_interval);case r.OPCodes.RECONNECT:return this.reconnect();case r.OPCodes.INVALID_SESSION:return t.d||(this.sessionID=null),this.sequence=-1,this.debug("Session invalidated -- will identify with a new session"),this.identify(t.d?2500:0);case r.OPCodes.HEARTBEAT_ACK:return this.ackHeartbeat();case r.OPCodes.HEARTBEAT:return this.heartbeat();default:return this.packetManager.handle(t)}}onOpen(t){t&&t.target&&t.target.url&&(this.gateway=t.target.url),this.debug(`Connected to gateway ${this.gateway}`),this.identify()}reconnect(){this.debug("Attemping to reconnect in 5500ms..."),this.client.emit(r.Events.RECONNECTING),this.connect(this.gateway,5500,!0)}onError(t){if(t&&"uWs client connection error"===t.message)return void this.reconnect();this.client.emit(r.Events.ERROR,t)}onClose(t){if(this.debug(`${this.expectingClose?"Client":"Server"} closed the WebSocket connection: ${t.code}`),this.closeSequence=this.sequence,this.emit("close",t),this.heartbeat(-1),1e3===t.code?this.expectingClose:r.WSCodes[t.code])return this.expectingClose=!1,this.client.emit(r.Events.DISCONNECT,t),this.debug(r.WSCodes[t.code]),void this.destroy();this.expectingClose=!1,this.reconnect()}ackHeartbeat(){this.debug(`Heartbeat acknowledged, latency of ${Date.now()-this.lastPingTimestamp}ms`),this.client._pong(this.lastPingTimestamp)}heartbeat(t){if(!isNaN(t))return void(-1===t?(this.debug("Clearing heartbeat interval"),this.client.clearInterval(this.heartbeatInterval),this.heartbeatInterval=null):(this.debug(`Setting a heartbeat interval for ${t}ms`),this.heartbeatInterval=this.client.setInterval(()=>this.heartbeat(),t)));this.debug("Sending a heartbeat"),this.lastPingTimestamp=Date.now(),this.send({op:r.OPCodes.HEARTBEAT,d:this.sequence})}identify(t){return t?this.client.setTimeout(this.identify.apply(this),t):this.sessionID?this.identifyResume():this.identifyNew()}identifyNew(){if(!this.client.token)return void this.debug("No token available to identify a new session with");const t=Object.assign({token:this.client.token},this.client.options.ws),{shardId:shardId,shardCount:shardCount}=this.client.options;shardCount>0&&(t.shard=[Number(shardId),Number(shardCount)]),this.debug("Identifying as a new session"),this.send({op:r.OPCodes.IDENTIFY,d:t})}identifyResume(){if(!this.sessionID)return this.debug("Warning: wanted to resume but session ID not available; identifying as a new session instead"),this.identifyNew();this.debug(`Attempting to resume session ${this.sessionID}`);const t={token:this.client.token,session_id:this.sessionID,seq:this.sequence};return this.send({op:r.OPCodes.RESUME,d:t})}}l.ENCODING=c?"etf":"json",l.WebSocket=u,t.exports=l}).call(e,n(6).Buffer)},function(t,e,n){function i(t){return class e extends t{constructor(t,...n){super(s(t,n)),this[o]=t,Error.captureStackTrace&&Error.captureStackTrace(this,e)}get name(){return`${super.name} [${this[o]}]`}get code(){return this[o]}}}function s(t,e){c.strictEqual(typeof t,"string");const n=a.get(t);c(n,`An invalid error message key was used: ${t}.`);let i=u.format;if("function"==typeof n)i=n;else{if(void 0===e||0===e.length)return n;e.unshift(n)}return String(i(...e))}function r(t,e){a.set(t,"function"==typeof e?e:String(e))}const o=Symbol("code"),a=new Map,c=n(83),u=n(42);t.exports={register:r,Error:i(Error),TypeError:i(TypeError),RangeError:i(RangeError)}},function(t,e){class n{constructor(t){this.id=t.id,this.name=t.name,this.vip=t.vip,this.deprecated=t.deprecated,this.optimal=t.optimal,this.custom=t.custom,this.sampleHostname=t.sample_hostname}}t.exports=n},function(t,e,n){t.exports={search:n(195),sendMessage:n(196)}},function(module,exports,__webpack_require__){(function(process){const os=__webpack_require__(27),EventEmitter=__webpack_require__(15).EventEmitter,Constants=__webpack_require__(0),Permissions=__webpack_require__(11),Util=__webpack_require__(4),RESTManager=__webpack_require__(71),ClientManager=__webpack_require__(114),ClientDataResolver=__webpack_require__(69),ClientVoiceManager=__webpack_require__(199),WebSocketManager=__webpack_require__(149),ActionsManager=__webpack_require__(115),Collection=__webpack_require__(3),Presence=__webpack_require__(14).Presence,VoiceRegion=__webpack_require__(75),Webhook=__webpack_require__(23),Invite=__webpack_require__(28),OAuth2Application=__webpack_require__(29),ShardClientUtil=__webpack_require__(198),VoiceBroadcast=__webpack_require__(200),UserStore=__webpack_require__(192),ChannelStore=__webpack_require__(189),GuildStore=__webpack_require__(191),{Error:Error,TypeError:TypeError,RangeError:RangeError}=__webpack_require__(5);class Client extends EventEmitter{constructor(t={}){super(),!t.shardId&&"SHARD_ID"in process.env&&(t.shardId=Number(process.env.SHARD_ID)),!t.shardCount&&"SHARD_COUNT"in process.env&&(t.shardCount=Number(process.env.SHARD_COUNT)),this.options=Util.mergeDefault(Constants.DefaultOptions,t),this._validateOptions(),this.rest=new RESTManager(this),this.api=this.rest.api,this.manager=new ClientManager(this),this.ws=new WebSocketManager(this),this.resolver=new ClientDataResolver(this),this.actions=new ActionsManager(this),this.voice=this.browser?null:new ClientVoiceManager(this),this.shard=process.send?ShardClientUtil.singleton(this):null,this.users=new UserStore(this),this.guilds=new GuildStore(this),this.channels=new ChannelStore(this),this.presences=new Collection,Object.defineProperty(this,"token",{writable:!0}),!this.token&&"CLIENT_TOKEN"in process.env?this.token=process.env.CLIENT_TOKEN:this.token=null,this.user=null,this.readyAt=null,this.broadcasts=[],this.pings=[],this._timeouts=new Set,this._intervals=new Set,this.options.messageSweepInterval>0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get _pingTimestamp(){return this.ws.connection?this.ws.connection.lastPingTimestamp:0}get status(){return this.ws.connection.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get ping(){return this.pings.reduce((t,e)=>t+e,0)/this.pings.length}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const t=new Collection;for(const e of this.guilds.values())for(const n of e.emojis.values())t.set(n.id,n);return t}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"browser"===os.platform()}createVoiceBroadcast(){const t=new VoiceBroadcast(this);return this.broadcasts.push(t),t}login(t){return new Promise((e,n)=>{if("string"!=typeof t)throw new Error("TOKEN_INVALID");t=t.replace(/^Bot\s*/i,"");this.manager.connectToWebSocket(t,e,n)})}destroy(){for(const t of this._timeouts)clearTimeout(t);for(const t of this._intervals)clearInterval(t);return this._timeouts.clear(),this._intervals.clear(),this.manager.destroy()}syncGuilds(t=this.guilds){this.user.bot||this.ws.send({op:12,d:t instanceof Collection?t.keyArray():t.map(t=>t.id)})}fetchInvite(t){const e=this.resolver.resolveInviteCode(t);return this.api.invites(e).get({query:{with_counts:!0}}).then(t=>new Invite(this,t))}fetchWebhook(t,e){return this.api.webhooks(t,e).get().then(t=>new Webhook(this,t))}fetchVoiceRegions(){return this.api.voice.regions.get().then(t=>{const e=new Collection;for(const n of t)e.set(n.id,new VoiceRegion(n));return e})}sweepMessages(t=this.options.messageCacheLifetime){if("number"!=typeof t||isNaN(t))throw new TypeError("CLIENT_INVALID_OPTION","Lifetime","a number");if(t<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const e=1e3*t,n=Date.now();let i=0,s=0;for(const t of this.channels.values())if(t.messages){i++;for(const i of t.messages.values())n-(i.editedTimestamp||i.createdTimestamp)>e&&(t.messages.delete(i.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${t} seconds in ${i} text-based channels`),s}fetchApplication(t="@me"){return this.api.oauth2.applications(t).get().then(t=>new OAuth2Application(this,t))}generateInvite(t){return t?t instanceof Array&&(t=Permissions.resolve(t)):t=0,this.fetchApplication().then(e=>`https://discordapp.com/oauth2/authorize?client_id=${e.id}&permissions=${t}&scope=bot`)}setTimeout(t,e,...n){const i=setTimeout(()=>{t(...n);this._timeouts.delete(i)},e);return this._timeouts.add(i),i}clearTimeout(t){clearTimeout(t),this._timeouts.delete(t)}setInterval(t,e,...n){const i=setInterval(t,e,...n);return this._intervals.add(i),i}clearInterval(t){clearInterval(t),this._intervals.delete(t)}_pong(t){this.pings.unshift(Date.now()-t),this.pings.length>3&&(this.pings.length=3),this.ws.lastHeartbeatAck=!0}_setPresence(t,e){if(this.presences.has(t))return void this.presences.get(t).update(e);this.presences.set(t,new Presence(e))}_eval(script){return eval(script)}_validateOptions(t=this.options){if("number"!=typeof t.shardCount||isNaN(t.shardCount))throw new TypeError("CLIENT_INVALID_OPTION","shardCount","a number");if("number"!=typeof t.shardId||isNaN(t.shardId))throw new TypeError("CLIENT_INVALID_OPTION","shardId","a number");if(t.shardCount<0)throw new RangeError("CLIENT_INVALID_OPTION","shardCount","at least 0");if(t.shardId<0)throw new RangeError("CLIENT_INVALID_OPTION","shardId","at least 0");if(0!==t.shardId&&t.shardId>=t.shardCount)throw new RangeError("CLIENT_INVALID_OPTION","shardId","less than shardCount");if("number"!=typeof t.messageCacheMaxSize||isNaN(t.messageCacheMaxSize))throw new TypeError("CLIENT_INVALID_OPTION","messageCacheMaxSize","a number");if("number"!=typeof t.messageCacheLifetime||isNaN(t.messageCacheLifetime))throw new TypeError("CLIENT_INVALID_OPTION","The messageCacheLifetime","a number");if("number"!=typeof t.messageSweepInterval||isNaN(t.messageSweepInterval))throw new TypeError("CLIENT_INVALID_OPTION","messageSweepInterval","a number");if("boolean"!=typeof t.fetchAllMembers)throw new TypeError("CLIENT_INVALID_OPTION","fetchAllMembers","a boolean");if("boolean"!=typeof t.disableEveryone)throw new TypeError("CLIENT_INVALID_OPTION","disableEveryone","a boolean");if("number"!=typeof t.restWsBridgeTimeout||isNaN(t.restWsBridgeTimeout))throw new TypeError("CLIENT_INVALID_OPTION","restWsBridgeTimeout","a number");if("boolean"!=typeof t.internalSharding)throw new TypeError("CLIENT_INVALID_OPTION","internalSharding","a boolean");if(!(t.disabledEvents instanceof Array))throw new TypeError("CLIENT_INVALID_OPTION","disabledEvents","an Array")}}module.exports=Client}).call(exports,__webpack_require__(9))},function(t,e,n){const i=n(23),s=n(71),r=n(69),o=n(0),a=n(4);class c extends i{constructor(t,e,n){super(null,t,e),this.options=a.mergeDefault(o.DefaultOptions,n),this.rest=new s(this),this.api=this.rest.api,this.resolver=new r(this),this._timeouts=new Set,this._intervals=new Set}setTimeout(t,e,...n){const i=setTimeout(()=>{t(...n);this._timeouts.delete(i)},e);return this._timeouts.add(i),i}clearTimeout(t){clearTimeout(t),this._timeouts.delete(t)}setInterval(t,e,...n){const i=setInterval(t,e,...n);return this._intervals.add(i),i}clearInterval(t){clearInterval(t),this._intervals.delete(t)}destroy(){for(const t of this._timeouts)clearTimeout(t);for(const t of this._intervals)clearInterval(t);this._timeouts.clear(),this._intervals.clear()}}t.exports=c},function(t,e,n){const i=n(4);class s{constructor(t={}){this.title=t.title,this.description=t.description,this.url=t.url,this.color=t.color,this.author=t.author,this.timestamp=t.timestamp,this.fields=t.fields||[],this.thumbnail=t.thumbnail,this.image=t.image,this.footer=t.footer,this.file=t.file}setTitle(t){if(t=i.resolveString(t),t.length>256)throw new RangeError("RichEmbed titles may not exceed 256 characters.");return this.title=t,this}setDescription(t){if(t=i.resolveString(t),t.length>2048)throw new RangeError("RichEmbed descriptions may not exceed 2048 characters.");return this.description=t,this}setURL(t){return this.url=t,this}setColor(t){return this.color=i.resolveColor(t),this}setAuthor(t,e,n){return this.author={name:i.resolveString(t),icon_url:e,url:n},this}setTimestamp(t=new Date){return this.timestamp=t,this}addField(t,e,n=!1){if(this.fields.length>=25)throw new RangeError("RichEmbeds may not exceed 25 fields.");if(t=i.resolveString(t),t.length>256)throw new RangeError("RichEmbed field names may not exceed 256 characters.");if(!/\S/.test(t))throw new RangeError("RichEmbed field names may not be empty.");if(e=i.resolveString(e),e.length>1024)throw new RangeError("RichEmbed field values may not exceed 1024 characters.");if(!/\S/.test(e))throw new RangeError("RichEmbed field values may not be empty.");return this.fields.push({name:t,value:e,inline:n}),this}addBlankField(t=!1){return this.addField("​","​",t)}setThumbnail(t){return this.thumbnail={url:t},this}setImage(t){return this.image={url:t},this}setFooter(t,e){if(t=i.resolveString(t),t.length>2048)throw new RangeError("RichEmbed footer text may not exceed 2048 characters.");return this.footer={text:t,icon_url:e},this}attachFile(t){if(this.file)throw new RangeError("You may not upload more than one file at once.");return this.file=t,this}}t.exports=s},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";(function(e){/*! +!function(n,o){s=[],i=o,void 0!==(r="function"==typeof i?i.apply(e,s):i)&&(t.exports=r)}(0,function(){"use strict";function t(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function e(t){return!0===(t&&t.__isLong__)}function n(t,e){var n,i,r;return e?(t>>>=0,(r=0<=t&&t<256)&&(i=c[t])?i:(n=s(t,(0|t)<0?-1:0,!0),r&&(c[t]=n),n)):(t|=0,(r=-128<=t&&t<128)&&(i=a[t])?i:(n=s(t,t<0?-1:0,!1),r&&(a[t]=n),n))}function i(t,e){if(isNaN(t)||!isFinite(t))return e?m:f;if(e){if(t<0)return m;if(t>=h)return b}else{if(t<=-p)return w;if(t+1>=p)return _}return t<0?i(-t,e).neg():s(t%l|0,t/l|0,e)}function s(e,n,i){return new t(e,n,i)}function r(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return f;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return r(t.substring(1),e,n).neg();for(var o=i(u(n,8)),a=f,c=0;c>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},y.toString=function(t){if((t=t||10)<2||36>>0,h=l.toString(t);if(o=c,o.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<=0},y.isOdd=function(){return 1==(1&this.low)},y.isEven=function(){return 0==(1&this.low)},y.equals=function(t){return e(t)||(t=o(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},y.eq=y.equals,y.notEquals=function(t){return!this.eq(t)},y.neq=y.notEquals,y.lessThan=function(t){return this.comp(t)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(t){return this.comp(t)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(t){return this.comp(t)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(t){return this.comp(t)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(t){if(e(t)||(t=o(t)),this.eq(t))return 0;var n=this.isNegative(),i=t.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(g)},y.neg=y.negate,y.add=function(t){e(t)||(t=o(t));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,c=t.high>>>16,u=65535&t.high,l=t.low>>>16,h=65535&t.low,p=0,d=0,f=0,m=0;return m+=a+h,f+=m>>>16,m&=65535,f+=r+l,d+=f>>>16,f&=65535,d+=i+u,p+=d>>>16,d&=65535,p+=n+c,p&=65535,s(f<<16|m,p<<16|d,this.unsigned)},y.subtract=function(t){return e(t)||(t=o(t)),this.add(t.neg())},y.sub=y.subtract,y.multiply=function(t){if(this.isZero())return f;if(e(t)||(t=o(t)),t.isZero())return f;if(this.eq(w))return t.isOdd()?w:f;if(t.eq(w))return this.isOdd()?w:f;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(d)&&t.lt(d))return i(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,c=65535&this.low,u=t.high>>>16,l=65535&t.high,h=t.low>>>16,p=65535&t.low,m=0,g=0,v=0,E=0;return E+=c*p,v+=E>>>16,E&=65535,v+=a*p,g+=v>>>16,v&=65535,v+=c*h,g+=v>>>16,v&=65535,g+=r*p,m+=g>>>16,g&=65535,g+=a*h,m+=g>>>16,g&=65535,g+=c*l,m+=g>>>16,g&=65535,m+=n*p+r*h+a*l+c*u,m&=65535,s(v<<16|E,m<<16|g,this.unsigned)},y.mul=y.multiply,y.divide=function(t){if(e(t)||(t=o(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:f;var n,s,r;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return v;r=m}else{if(this.eq(w)){if(t.eq(g)||t.eq(E))return w;if(t.eq(w))return g;return n=this.shr(1).div(t).shl(1),n.eq(f)?t.isNegative()?g:E:(s=this.sub(t.mul(n)),r=n.add(s.div(t)))}if(t.eq(w))return this.unsigned?m:f;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();r=f}for(s=this;s.gte(t);){n=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),l=i(n),h=l.mul(t);h.isNegative()||h.gt(s);)n-=c,l=i(n,this.unsigned),h=l.mul(t);l.isZero()&&(l=g),r=r.add(l),s=s.sub(h)}return r},y.div=y.divide,y.modulo=function(t){return e(t)||(t=o(t)),this.sub(this.div(t).mul(t))},y.mod=y.modulo,y.not=function(){return s(~this.low,~this.high,this.unsigned)},y.and=function(t){return e(t)||(t=o(t)),s(this.low&t.low,this.high&t.high,this.unsigned)},y.or=function(t){return e(t)||(t=o(t)),s(this.low|t.low,this.high|t.high,this.unsigned)},y.xor=function(t){return e(t)||(t=o(t)),s(this.low^t.low,this.high^t.high,this.unsigned)},y.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?s(this.low<>>32-t,this.unsigned):s(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):s(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0===(t&=63))return this;var n=this.high;if(t<32){return s(this.low>>>t|n<<32-t,n>>>t,this.unsigned)}return 32===t?s(n,0,this.unsigned):s(n>>>t-32,0,this.unsigned)},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},y.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},y.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})},function(t,e,n){"use strict";(function(e){function n(t,n,i,s){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var r,o,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,i)});case 4:return e.nextTick(function(){t.call(null,n,i,s)});default:for(r=new Array(a-1),o=0;o-1?i:T;a.WritableState=o;var R=n(24);R.inherits=n(13);var D={deprecate:n(109)},I=n(63),k=n(40).Buffer;R.inherits(a,I),o.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(o.prototype,"buffer",{get:D.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}();var M;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(t){return!!M.call(this,t)||t&&t._writableState instanceof o}})):M=function(t){return t instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(t,e,n){var i=this._writableState,r=!1,o=k.isBuffer(t);return"function"==typeof e&&(n=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=s),i.ended?c(this,n):(o||u(this,i,t,n))&&(i.pendingcb++,r=h(this,i,o,t,e,n)),r},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||E(this,t))},a.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},a.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(t,e,n){var i=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||y(this,i,n)}}).call(e,n(9),n(106).setImmediate)},function(t,e,n){t.exports=n(6)},function(t,e,n){const i=n(100);t.exports=i},function(t,e,n){(function(t,i){function s(t,n){var i={seen:[],stylize:o};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),m(n)?i.showHidden=n:n&&e._extend(i,n),w(i.showHidden)&&(i.showHidden=!1),w(i.depth)&&(i.depth=2),w(i.colors)&&(i.colors=!1),w(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=r),c(i,t,i.depth)}function r(t,e){var n=s.styles[e];return n?"["+s.colors[n][0]+"m"+t+"["+s.colors[n][1]+"m":t}function o(t,e){return t}function a(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function c(t,n,i){if(t.customInspect&&n&&S(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var s=n.inspect(i,t);return _(s)||(s=c(t,s,i)),s}var r=u(t,n);if(r)return r;var o=Object.keys(n),m=a(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(n)),T(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(n);if(0===o.length){if(S(n)){var g=n.name?": "+n.name:"";return t.stylize("[Function"+g+"]","special")}if(y(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(A(n))return t.stylize(Date.prototype.toString.call(n),"date");if(T(n))return l(n)}var v="",E=!1,b=["{","}"];if(f(n)&&(E=!0,b=["[","]"]),S(n)){v=" [Function"+(n.name?": "+n.name:"")+"]"}if(y(n)&&(v=" "+RegExp.prototype.toString.call(n)),A(n)&&(v=" "+Date.prototype.toUTCString.call(n)),T(n)&&(v=" "+l(n)),0===o.length&&(!E||0==n.length))return b[0]+v+b[1];if(i<0)return y(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var w;return w=E?h(t,n,i,m,o):o.map(function(e){return p(t,n,i,m,e,E)}),t.seen.pop(),d(w,v,b)}function u(t,e){if(w(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return E(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,n,i,s){for(var r=[],o=0,a=e.length;o-1&&(a=r?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),w(o)){if(r&&s.match(/^\d+$/))return a;o=JSON.stringify(""+s),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function d(t,e,n){var i=0;return t.reduce(function(t,e){return i++,e.indexOf("\n")>=0&&i++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function f(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return null==t}function E(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function w(t){return void 0===t}function y(t){return x(t)&&"[object RegExp]"===D(t)}function x(t){return"object"==typeof t&&null!==t}function A(t){return x(t)&&"[object Date]"===D(t)}function T(t){return x(t)&&("[object Error]"===D(t)||t instanceof Error)}function S(t){return"function"==typeof t}function R(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function D(t){return Object.prototype.toString.call(t)}function I(t){return t<10?"0"+t.toString(10):t.toString(10)}function k(){var t=new Date,e=[I(t.getHours()),I(t.getMinutes()),I(t.getSeconds())].join(":");return[t.getDate(),C[t.getMonth()],e].join(" ")}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.format=function(t){if(!_(t)){for(var e=[],n=0;n=r)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}}),a=i[n];n",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{long:"^3.2.0","prism-media":"^0.0.1",snekfetch:"^3.1.0",tweetnacl:"^1.0.0",ws:"^3.0.0"},peerDependencies:{bufferutil:"^3.0.0",erlpack:"hammerandchisel/erlpack","node-opus":"^0.2.5",opusscript:"^0.0.3",sodium:"^2.0.1","libsodium-wrappers":"^0.5.1",uws:"^0.14.1"},devDependencies:{"@types/node":"^7.0.0","discord.js-docgen":"hydrabolt/discord.js-docgen",eslint:"^3.19.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony-v2.8.22","uglifyjs-webpack-plugin":"^0.4.3",webpack:"^2.2.0"},engines:{node:">=8.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,"prism-media":!1,opusscript:!1,"node-opus":!1,tweetnacl:!1,sodium:!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/Secretbox.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/util/VolumeInterface.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceBroadcast.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(t,e,n){(function(e){const i=n(18),s=n(3),r=n(46),o=n(0),a=n(4),c=n(20),u=n(10),l=n(32),{TypeError:TypeError}=n(5);class h extends i{_patch(t){super._patch(t),this.verified=t.verified,this.email=t.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s,this.premium="boolean"==typeof t.premium?t.premium:null,this.mfaEnabled="boolean"==typeof t.mfa_enabled?t.mfa_enabled:null,this.mobile="boolean"==typeof t.mobile?t.mobile:null,t.user_settings&&(this.settings=new r(this,t.user_settings))}edit(t,e){const n={};return n.username=t.username||this.username,n.avatar=this.client.resolver.resolveBase64(t.avatar),this.bot||(n.email=t.email||this.email,n.password=e,t.new_password&&(n.new_password=t.newPassword)),this.client.api.users("@me").patch({data:t}).then(t=>this.client.actions.UserUpdate.handle(t).updated)}setUsername(t,e){return this.edit({username:t},e)}setEmail(t,e){return this.edit({email:t},e)}setPassword(t,e){return this.edit({password:t},e)}setAvatar(t){return"string"==typeof t&&t.startsWith("data:")?this.edit({avatar:t}):this.client.resolver.resolveBuffer(t||e.alloc(0)).then(t=>this.edit({avatar:this.client.resolver.resolveBase64(t)||null}))}setPresence(t){return new Promise(e=>{let n=this.localPresence.status||this.presence.status;let i=this.localPresence.game;let s=this.localPresence.afk||this.presence.afk;!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url});if(t.status){if("string"!=typeof t.status)throw new TypeError("STATUS_TYPE");this.bot?n=t.status:(this.settings.update(o.UserSettingsMap.status,t.status),n="invisible")}t.game?(i=t.game,i.url&&(i.type=1)):void 0!==t.game&&(i=null);void 0!==t.afk&&(s=t.afk);s=Boolean(s);this.localPresence={status:n,game:i,afk:s};this.localPresence.since=0;this.localPresence.game=this.localPresence.game||null;this.client.ws.send({op:3,d:this.localPresence});this.client._setPresence(this.id,this.localPresence);e(this)})}setStatus(t){return this.setPresence({status:t})}setGame(t,e){return t?this.setPresence({game:{name:t,url:e}}):this.setPresence({game:null})}setAFK(t){return this.setPresence({afk:t})}fetchMentions(t={}){return t.guild instanceof c&&(t.guild=t.guild.id),a.mergeDefault({limit:25,roles:!0,everyone:!0,guild:null},t),this.client.api.users("@me").mentions.get({query:t}).then(t=>t.map(t=>new u(this.client.channels.get(t.channel_id),t,this.client)))}createGuild(t,{region:region,icon:icon=null}={}){return!icon||"string"==typeof icon&&icon.startsWith("data:")?new Promise((e,n)=>this.client.api.guilds.post({data:{name:t,region:region,icon:icon}}).then(t=>{if(this.client.guilds.has(t.id))return e(this.client.guilds.get(t.id));const n=s=>{s.id===t.id&&(this.client.removeListener(o.Events.GUILD_CREATE,n),this.client.clearTimeout(i),e(s))};this.client.on(o.Events.GUILD_CREATE,n);const i=this.client.setTimeout(()=>{this.client.removeListener(o.Events.GUILD_CREATE,n);e(this.client.guilds.create(t))},1e4);return},n)):this.client.resolver.resolveBuffer(icon).then(e=>this.createGuild(t,{region:region,icon:this.client.resolver.resolveBase64(e)||null}))}createGroupDM(t){const e=this.bot?{access_tokens:t.map(t=>t.accessToken),nicks:t.reduce((t,e)=>{e.nick&&(t[e.user?e.user.id:e.id]=e.nick);return t},{})}:{recipients:t.map(t=>this.client.resolver.resolveUserID(t))};return this.client.api.users("@me").channels.post({data:e}).then(t=>new l(this.client,t))}}t.exports=h}).call(e,n(6).Buffer)},function(t,e,n){const i=n(0),s=n(4);class r{constructor(t,e){this.user=t,this.patch(e)}patch(t){for(const[e,n]of Object.entries(i.UserSettingsMap))t.hasOwnProperty(e)&&("function"==typeof n?this[n.name]=n(t[e]):this[n]=t[e])}update(t,e){return this.user.client.api.users("@me").settings.patch({data:{[t]:e}})}setGuildPosition(t,e,n){const i=Object.assign([],this.guildPositions);return s.moveElementInArray(i,t.id,e,n),this.update("guild_positions",i).then(()=>t)}addRestrictedGuild(t){const e=Object.assign([],this.restrictedGuilds);return e.includes(t.id)?Promise.reject(new Error("Guild is already restricted")):(e.push(t.id),this.update("restricted_guilds",e).then(()=>t))}removeRestrictedGuild(t){const e=Object.assign([],this.restrictedGuilds),n=e.indexOf(t.id);return n<0?Promise.reject(new Error("Guild is not restricted")):(e.splice(n,1),this.update("restricted_guilds",e).then(()=>t))}}t.exports=r},function(t,e,n){const i=n(17),s=n(27),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="dm",this.messages=new r,this._typing=new Map}_patch(t){super._patch(t),this.recipient=this.client.users.create(t.recipients[0]),this.lastMessageID=t.last_message_id}toString(){return this.recipient.toString()}send(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createMessageCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),t.exports=o},function(t,e,n){const i=n(3),s=n(8),r={GUILD:"GUILD",CHANNEL:"CHANNEL",USER:"USER",ROLE:"ROLE",INVITE:"INVITE",WEBHOOK:"WEBHOOK",EMOJI:"EMOJI",MESSAGE:"MESSAGE",UNKNOWN:"UNKNOWN"},o={GUILD_UPDATE:1,CHANNEL_CREATE:10,CHANNEL_UPDATE:11,CHANNEL_DELETE:12,CHANNEL_OVERWRITE_CREATE:13,CHANNEL_OVERWRITE_UPDATE:14,CHANNEL_OVERWRITE_DELETE:15,MEMBER_KICK:20,MEMBER_PRUNE:21,MEMBER_BAN_ADD:22,MEMBER_BAN_REMOVE:23,MEMBER_UPDATE:24,MEMBER_ROLE_UPDATE:25,ROLE_CREATE:30,ROLE_UPDATE:31,ROLE_DELETE:32,INVITE_CREATE:40,INVITE_UPDATE:41,INVITE_DELETE:42,WEBHOOK_CREATE:50,WEBHOOK_UPDATE:51,WEBHOOK_DELETE:52,EMOJI_CREATE:60,EMOJI_UPDATE:61,EMOJI_DELETE:62,MESSAGE_DELETE:72};class a{constructor(t,e){if(e.users)for(const n of e.users)t.client.users.create(n);this.entries=new i;for(const n of e.audit_log_entries){const e=new c(t,n);this.entries.set(e.id,e)}}static build(...t){const e=new a(...t);return Promise.all(e.entries.map(t=>t.target)).then(()=>e)}static targetType(t){return t<10?r.GUILD:t<20?r.CHANNEL:t<30?r.USER:t<40?r.ROLE:t<50?r.INVITE:t<60?r.WEBHOOK:t<70?r.EMOJI:t<80?r.MESSAGE:r.UNKNOWN}static actionType(t){return[o.CHANNEL_CREATE,o.CHANNEL_OVERWRITE_CREATE,o.MEMBER_BAN_REMOVE,o.ROLE_CREATE,o.INVITE_CREATE,o.WEBHOOK_CREATE,o.EMOJI_CREATE].includes(t)?"CREATE":[o.CHANNEL_DELETE,o.CHANNEL_OVERWRITE_DELETE,o.MEMBER_KICK,o.MEMBER_PRUNE,o.MEMBER_BAN_ADD,o.ROLE_DELETE,o.INVITE_DELETE,o.WEBHOOK_DELETE,o.EMOJI_DELETE,o.MESSAGE_DELETE].includes(t)?"DELETE":[o.GUILD_UPDATE,o.CHANNEL_UPDATE,o.CHANNEL_OVERWRITE_UPDATE,o.MEMBER_UPDATE,o.MEMBER_ROLE_UPDATE,o.ROLE_UPDATE,o.INVITE_UPDATE,o.WEBHOOK_UPDATE,o.EMOJI_UPDATE].includes(t)?"UPDATE":"ALL"}}class c{constructor(t,e){const n=a.targetType(e.action_type);if(this.targetType=n,this.actionType=a.actionType(e.action_type),this.action=Object.keys(o).find(t=>o[t]===e.action_type),this.reason=e.reason||null,this.executor=t.client.users.get(e.user_id),this.changes=e.changes?e.changes.map(t=>({key:t.key,old:t.old_value,new:t.new_value})):null,this.id=e.id,this.extra=null,e.options)if(e.action_type===o.MEMBER_PRUNE)this.extra={removed:e.options.members_removed,days:e.options.delete_member_days};else if(e.action_type===o.MESSAGE_DELETE)this.extra={count:e.options.count,channel:t.channels.get(e.options.channel_id)};else switch(e.options.type){case"member":this.extra=t.members.get(e.options.id),this.extra||(this.extra={id:e.options.id});break;case"role":this.extra=t.roles.get(e.options.id),this.extra||(this.extra={id:e.options.id,name:e.options.role_name})}if(n===r.UNKNOWN)this.target=e.target_id;else if([r.USER,r.GUILD].includes(n))this.target=t.client[`${n.toLowerCase()}s`].get(e.target_id);else if(n===r.WEBHOOK)this.target=t.fetchWebhooks().then(t=>{this.target=t.find(t=>t.id===e.target_id);return this.target});else if(n===r.INVITE){const e=this.changes.find(t=>"code"===t.key);this.target=t.fetchInvites().then(t=>{this.target=t.find(t=>t.code===(e.new_value||e.old_value));return this.target})}else this.target=n===r.MESSAGE?t.client.users.get(e.target_id):t[`${n.toLowerCase()}s`].get(e.target_id)}get createdTimestamp(){return s.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}}a.Actions=o,a.Targets=r,a.Entry=c,t.exports=a},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.message=t,this.setup(e)}setup(t){this.id=t.id,this.filename=t.filename,this.filesize=t.size,this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}t.exports=n},function(t,e,n){const i=n(35);class s extends i{constructor(t,e,n={}){super(t.client,e,n),this.channel=t,this.received=0,this.client.on("message",this.listener)}handle(t){return t.channel.id!==this.channel.id?null:(this.received++,{key:t.id,value:t})}postCheck(){return this.options.max&&this.collected.size>=this.options.max?"limit":this.options.maxProcessed&&this.received===this.options.maxProcessed?"processedLimit":null}cleanup(){this.client.removeListener("message",this.listener)}}t.exports=s},function(t,e,n){const i=n(4),{RangeError:RangeError}=n(5);class s{constructor(t){this.setup(t)}setup(t){this.type=t.type,this.title=t.title||null,this.description=t.description||null,this.url=t.url||null,this.color=t.color||null,this.timestamp=new Date(t.timestamp)||null,this.fields=t.fields||null,this.thumbnail=t.thumbnail?{url:t.thumbnail.url||null,proxyURL:t.thumbnail.proxy_url,height:t.height,width:t.width}:null,this.image=t.image?{url:t.image.url||null,proxyURL:t.image.proxy_url,height:t.height,width:t.width}:null,this.video=t.video?{url:t.video.url||null,height:t.video.height,width:t.video.width}:null,this.author=t.author?{name:t.author.name||null,url:t.author.url||null,iconURL:t.author.iconURL||t.author.icon_url||null,proxyIconURL:t.author.proxyIconUrl||t.author.proxy_icon_url||null}:null,this.provider=t.provider?{name:t.provider.name,url:t.provider.url}:null,this.footer=t.footer?{text:t.footer.text||null,iconURL:t.footer.iconURL||t.footer.icon_url||null,proxyIconURL:t.footer.proxyIconURL||t.footer.proxy_icon_url||null}:null}get createdAt(){return new Date(this.timestamp)}get hexColor(){let t=this.color.toString(16);for(;t.length<6;)t=`0${t}`;return`#${t}`}addField(t,e,n=!1){if(this.fields.length>=25)throw new RangeError("EMBED_FIELD_COUNT");if(t=i.resolveString(t),!String(t)||t.length>256)throw new RangeError("EMBED_FIELD_NAME");if(e=i.resolveString(e),!String(t)||e.length>1024)throw new RangeError("EMBED_FIELD_VALUE");return this.fields.push({name:t,value:e,inline:n}),this}attachFile(t){if(this.file)throw new RangeError("EMBED_FILE_LIMIT");return this.file=t,this}setAuthor(t,e,n){return this.author={name:i.resolveString(t),iconURL:e,url:n},this}setColor(t){return this.color=i.resolveColor(t),this}setDescription(t){if(t=i.resolveString(t),t.length>2048)throw new RangeError("EMBED_DESCRIPTION");return this.description=t,this}setFooter(t,e){if(t=i.resolveString(t),t.length>2048)throw new RangeError("EMBED_FOOTER_TEXT");return this.footer={text:t,iconURL:e},this}setImage(t){return this.image={url:t},this}setThumbnail(t){return this.thumbnail={url:t},this}setTimestamp(t=new Date){return this.timestamp=t,this}setTitle(t){if(t=i.resolveString(t),t.length>256)throw new RangeError("EMBED_TITLE");return this.title=t,this}setURL(t){return this.url=t,this}}t.exports=s},function(t,e,n){const i=n(3);class s{constructor(t,e,n,s){if(this.everyone=Boolean(s),e)if(e instanceof i)this.users=new i(e);else{this.users=new i;for(const n of e){let e=t.client.users.create(n);this.users.set(e.id,e)}}else this.users=new i;if(n)if(n instanceof i)this.roles=new i(n);else{this.roles=new i;for(const e of n){const n=t.channel.guild.roles.get(e);n&&this.roles.set(n.id,n)}}else this.roles=new i;this._content=t.content,this._client=t.client,this._guild=t.channel.guild,this._members=null,this._channels=null}get members(){return this._members?this._members:this._guild?(this._members=new i,this.users.forEach(t=>{const e=this._guild.member(t);e&&this._members.set(e.user.id,e)}),this._members):null}get channels(){if(this._channels)return this._channels;this._channels=new i;let t;for(;null!==(t=this.constructor.CHANNELS_PATTERN.exec(this._content));){const e=this._client.channels.get(t[1]);e&&this._channels.set(e.id,e)}return this._channels}}s.EVERYONE_PATTERN=/@(everyone|here)/g,s.USERS_PATTERN=/<@!?[0-9]+>/g,s.ROLES_PATTERN=/<@&[0-9]+>/g,s.CHANNELS_PATTERN=/<#([0-9]+)>/g,t.exports=s},function(t,e,n){const i=n(3),s=n(19),r=n(34);class o{constructor(t,e,n,s){this.message=t,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,e.name,e.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const t=this.message.client.emojis;if(t.has(this._emoji.id)){const e=t.get(this._emoji.id);return this._emoji=e,e}}return this._emoji}remove(t=this.message.client.user){const e=this.message.client.resolver.resolveUserID(t);return e?this.message.client.api.channels(this.message.channel.id).messages(this.message.id).reactions(this.emoji.identifier)[e===this.message.client.user.id?"@me":e].delete().then(()=>this.message.client.actions.MessageReactionRemove.handle({user_id:e,message_id:this.message.id,emoji:this.emoji,channel_id:this.message.channel.id}).reaction):Promise.reject(new Error("Couldn't resolve the user ID to remove from the reaction."))}fetchUsers(t=100){const e=this.message;return e.client.api.channels(e.channel.id).messages(e.id).reactions(this.emoji.identifier).get({query:{limit:t}}).then(t=>{this.users=new i;for(const n of t){const t=e.client.users.create(n);this.users.set(t.id,t)}this.count=this.users.size;return this.users})}}t.exports=o},function(t,e,n){const i=n(7);class s extends i{constructor(t,e){super(t),this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.icon=t.icon,this.splash=t.splash}}t.exports=s},function(t,e,n){const i=n(0),s=n(7);class r extends s{constructor(t,e){super(t),this._patch(e)}_patch(t){super._patch(t),this.id=t.id,this.name=t.name,this.type=i.ChannelTypes.TEXT===t.type?"text":"voice"}}t.exports=r},function(t,e,n){const i=n(11);class s{constructor(t,e){Object.defineProperty(this,"channel",{value:t}),e&&this._patch(e)}_patch(t){this.id=t.id,this.type=t.type,this._denied=t.deny,this._allowed=t.allow,this.denied=new i(this._denied),this.allowed=new i(this._allowed)}delete(t){return this.channel.client.api.channels(this.channel.id).permissions(this.id).delete({reason:t}).then(()=>this)}}t.exports=s},function(t,e,n){const i=n(35),s=n(3);class r extends i{constructor(t,e,n={}){super(t.client,e,n),this.message=t,this.users=new s,this.total=0,this.client.on("messageReactionAdd",this.listener)}handle(t){return t.message.id!==this.message.id?null:{key:t.emoji.id||t.emoji.name,value:t}}postCheck(t,e){return this.users.set(e.id,e),this.options.max&&++this.total>=this.options.max?"limit":this.options.maxEmojis&&this.collected.size>=this.options.maxEmojis?"emojiLimit":this.options.maxUsers&&this.users.size>=this.options.maxUsers?"userLimit":null}cleanup(){this.client.removeListener("messageReactionAdd",this.listener)}}t.exports=r},function(t,e,n){const i=n(33),s=n(23),r=n(27),o=n(3);class a extends i{constructor(t,e){super(t,e),this.type="text",this.messages=new o,this._typing=new Map}_patch(t){super._patch(t),this.topic=t.topic,this.lastMessageID=t.last_message_id}get members(){const t=new o;for(const e of this.guild.members.values())this.permissionsFor(e).has("READ_MESSAGES")&&t.set(e.id,e);return t}get nsfw(){return/^nsfw(-|$)/.test(this.name)}fetchWebhooks(){return this.client.api.channels(this.id).webhooks.get().then(t=>{const e=new o;for(const n of t)e.set(n.id,new s(this.client,n));return e})}createWebhook(t,e){return"string"==typeof e&&e.startsWith("data:")?this.client.api.channels(this.id).webhooks.post({data:{name:t,avatar:e}}).then(t=>new s(this.client,t)):this.client.resolver.resolveBuffer(e).then(e=>this.createWebhook(t,this.client.resolver.resolveBase64(e)||null))}send(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createMessageCollector(){}awaitMessages(){}bulkDelete(){}acknowledge(){}_cacheMessage(){}}r.applyToClass(a,!0),t.exports=a},function(t,e,n){const i=n(33),s=n(3);class r extends i{constructor(t,e){super(t,e),this.members=new s,this.type="voice"}_patch(t){super._patch(t),this.bitrate=t.bitrate,this.userLimit=t.user_limit}get connection(){const t=this.guild.voiceConnection;return t&&t.channel.id===this.id?t:null}get full(){return this.userLimit>0&&this.members.size>=this.userLimit}get joinable(){return!this.client.browser&&(!!this.permissionsFor(this.client.user).has("CONNECT")&&!(this.full&&!this.permissionsFor(this.client.user).has("MOVE_MEMBERS")))}get speakable(){return this.permissionsFor(this.client.user).has("SPEAK")}setBitrate(t){return this.edit({bitrate:t})}setUserLimit(t){return this.edit({userLimit:t})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const t=this.client.voice.connections.get(this.guild.id);t&&t.channel.id===this.id&&t.disconnect()}}}t.exports=r},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";(function(e){function i(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?k(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}function s(t,e){D=D||n(16),t=t||{},this.objectMode=!!t.objectMode,e instanceof D&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=new j,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(P||(P=n(68).StringDecoder),this.decoder=new P(t.encoding),this.encoding=t.encoding)}function r(t){if(D=D||n(16),!(this instanceof r))return new r(t);this._readableState=new s(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),N.call(this)}function o(t,e,n,i,s){var r=l(e,n);if(r)t.emit("error",r);else if(null===n)e.reading=!1,h(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!s){var o=new Error("stream.push() after EOF");t.emit("error",o)}else if(e.endEmitted&&s){var c=new Error("stream.unshift() after end event");t.emit("error",c)}else{var u;!e.decoder||s||i||(n=e.decoder.write(n),u=!e.objectMode&&0===n.length),s||(e.reading=!1),u||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,s?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&p(t))),f(t,e)}else s||(e.reading=!1);return a(e)}function a(t){return!t.ended&&(t.needReadable||t.length=B?t=B:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function u(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=c(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function l(t,e){var n=null;return L.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,p(t)}}function p(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(U("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?I(d,t):d(t))}function d(t){U("emit readable"),t.emit("readable"),b(t)}function f(t,e){e.readingMore||(e.readingMore=!0,I(m,t,e))}function m(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=y(t,e.buffer,e.decoder),n}function y(t,e,n){var i;return tr.length?r.length:t;if(o===r.length?s+=r:s+=r.slice(0,t),0===(t-=o)){o===r.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=r.slice(o));break}++i}return e.length-=i,s}function A(t,e){var n=L.allocUnsafe(t),i=e.head,s=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var r=i.data,o=t>r.length?r.length:t;if(r.copy(n,n.length-t,0,o),0===(t-=o)){o===r.length?(++s,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=r.slice(o));break}++s}return e.length-=s,n}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,I(S,e,t))}function S(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var n=0,i=t.length;n=e.highWaterMark||e.ended))return U("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):p(this),null;if(0===(t=u(t,e))&&e.ended)return 0===e.length&&T(this),null;var i=e.needReadable;U("need readable",i),(0===e.length||e.length-t0?w(t,e):null,null===s?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&T(this)),null!==s&&this.emit("data",s),s},r.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},r.prototype.pipe=function(t,n){function s(t){U("onunpipe"),t===p&&o()}function r(){U("onend"),t.end()}function o(){U("cleanup"),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("drain",v),t.removeListener("error",c),t.removeListener("unpipe",s),p.removeListener("end",r),p.removeListener("end",h),p.removeListener("data",a),E=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){U("ondata"),_=!1,!1!==t.write(e)||_||((1===d.pipesCount&&d.pipes===t||d.pipesCount>1&&-1!==R(d.pipes,t))&&!E&&(U("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,_=!0),p.pause())}function c(e){U("onerror",e),h(),t.removeListener("error",c),0===M(t,"error")&&t.emit("error",e)}function u(){t.removeListener("finish",l),h()}function l(){U("onfinish"),t.removeListener("close",u),h()}function h(){U("unpipe"),p.unpipe(t)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,U("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||!1!==n.end)&&t!==e.stdout&&t!==e.stderr,m=f?r:h;d.endEmitted?I(m):p.once("end",m),t.on("unpipe",s);var v=g(p);t.on("drain",v);var E=!1,_=!1;return p.on("data",a),i(t,"error",c),t.once("close",u),t.once("finish",l),t.emit("pipe",p),d.flowing||(U("pipe resume"),p.resume()),t},r.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],E={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=n(38);i.prototype.parse=function(t,e,n){if(!u.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),s=-1!==i&&i127?M+="x":M+=k[N];if(!M.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var C=D.slice(0,x),O=D.slice(x+1),U=k.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);U&&(C.push(U[1]),O.unshift(U[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=C.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=c.toASCII(this.hostname));var P=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+P,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!E[d])for(var x=0,I=m.length;x0)&&n.host.split("@");T&&(n.auth=T.shift(),n.host=n.hostname=T.shift())}return n.search=t.search,n.query=t.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=x.slice(-1)[0],R=(n.host||t.host||x.length>1)&&("."===S||".."===S)||""===S,D=0,I=x.length;I>=0;I--)S=x[I],"."===S?x.splice(I,1):".."===S?(x.splice(I,1),D++):D&&(x.splice(I,1),D--);if(!w&&!y)for(;D--;D)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),R&&"/"!==x.join("/").substr(-1)&&x.push("");var k=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(A){n.hostname=n.host=k?"":x.length?x.shift():"";var T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");T&&(n.auth=T.shift(),n.host=n.hostname=T.shift())}return w=w||n.host&&x.length,w&&!k&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var t=this.host,e=h.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,n){function i(t){if(t&&!c(t))throw new Error("Unknown encoding: "+t)}function s(t){return t.toString(this.encoding)}function r(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function o(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var a=n(6).Buffer,c=a.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=e.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),i(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=s)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var s=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,s),s-=this.charReceived),e+=t.toString(this.encoding,0,s);var s=e.length-1,i=e.charCodeAt(s);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),t.copy(this.charBuffer,0,0,r),e.substring(0,s)}return e},u.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},u.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,i=this.charBuffer,s=this.encoding;e+=i.slice(0,n).toString(s)}return e}},function(t,e,n){(function(e){const i=n(31),s=n(43),r=n(41),o=n(4),a=n(18),c=n(10),u=n(20),l=n(17),h=n(21),p=n(19),d=n(34),{Error:Error,TypeError:TypeError}=n(5);class f{constructor(t){this.client=t}resolveUser(t){return t instanceof a?t:"string"==typeof t?this.client.users.get(t)||null:t instanceof h?t.user:t instanceof c?t.author:t instanceof u?t.owner:null}resolveUserID(t){return t instanceof a||t instanceof h?t.id:"string"==typeof t?t||null:t instanceof c?t.author.id:t instanceof u?t.ownerID:null}resolveGuild(t){return t instanceof u?t:"string"==typeof t?this.client.guilds.get(t)||null:null}resolveGuildMember(t,e){return e instanceof h?e:(t=this.resolveGuild(t),e=this.resolveUser(e),t&&e?t.members.get(e.id)||null:null)}resolveChannel(t){return t instanceof l?t:"string"==typeof t?this.client.channels.get(t)||null:t instanceof c?t.channel:t instanceof u?t.channels.get(t.id)||null:null}resolveChannelID(t){return t instanceof l?t.id:"string"==typeof t?t:t instanceof c?t.channel.id:t instanceof u?t.defaultChannel.id:null}resolveInviteCode(t){const e=/discord(?:app\.com\/invite|\.gg)\/([\w-]{2,255})/i,n=e.exec(t);return n&&n[1]?n[1]:t}resolveBase64(t){return t instanceof e?`data:image/jpg;base64,${t.toString("base64")}`:t}resolveBuffer(t){return t instanceof e?Promise.resolve(t):this.client.browser&&t instanceof ArrayBuffer?Promise.resolve(o.convertToBuffer(t)):"string"==typeof t?new Promise((n,o)=>{if(/^https?:\/\//.test(t))r.get(t).end((t,i)=>{if(t)return o(t);if(!(i.body instanceof e))return o(new TypeError("REQ_BODY_TYPE"));return n(i.body)});else{const e=i.resolve(t);s.stat(e,(t,i)=>{if(t)return o(t);if(!i||!i.isFile())return o(new Error("FILE_NOT_FOUND",e));s.readFile(e,(t,e)=>{t?o(t):n(e)});return null})}}):Promise.reject(new TypeError("REQ_RESOURCE_TYPE"))}resolveEmojiIdentifier(t){return t instanceof p||t instanceof d?t.identifier:"string"==typeof t?this.client.emojis.has(t)?this.client.emojis.get(t).identifier:t.includes("%")?t:encodeURIComponent(t):null}}t.exports=f}).call(e,n(6).Buffer)},function(t,e){class n extends Error{constructor(t){super();const e=t.errors?` +${this.constructor.flattenErrors(t.errors).join("\n")}`:"";this.name="DiscordAPIError",this.message=`${t.message}${e}`,this.code=t.code}static flattenErrors(t,e=""){let n=[];for(const[i,s]of Object.entries(t)){const t=e?isNaN(i)?`${e}.${i}`:`${e}[${i}]`:i;s._errors?n.push(`${t}: ${s._errors.map(t=>t.message).join(" ")}`):s.code||s.message?n.push(`${s.code?`${s.code}: `:""}${s.message}`.trim()):n=n.concat(this.flattenErrors(s,t))}return n}}t.exports=n},function(t,e,n){const i=n(148),s=n(147),r=n(146),o=n(144),a=n(145),{Error:Error}=n(5);class c{constructor(t){this.client=t,this.handlers={},this.userAgentManager=new i(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1,this.api=a(this)}destroy(){for(const t in this.handlers)this.handlers[t].destroy()}push(t,e){return new Promise((n,i)=>{t.push({request:e,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return s;case"burst":return r;default:throw new Error("RATELIMIT_INVALID_METHOD")}}request(t,e,n={}){const i=new o(this,t,e,n);if(!this.handlers[i.route]){const t=this.getRequestHandler();this.handlers[i.route]=new t(this,i.route)}return this.push(this.handlers[i.route],i)}}t.exports=c},function(t,e){class n{constructor(t){this.restManager=t,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(t){this.restManager.globallyRateLimited=t}push(t){this.queue.push(t)}handle(){}destroy(){this.queue=[]}}t.exports=n},function(t,e,n){(function(e){const i="browser"===n(28).platform(),s=n(15),r=n(0),o=n(43),a=n(150),c=function(){try{const t=n(202);return t.pack?t:null}catch(t){return null}}(),u=function(){if(i)return window.WebSocket;try{return n(203)}catch(t){return n(204)}}();class l extends s{constructor(t,e){super(),this.manager=t,this.client=t.client,this.ws=null,this.sequence=-1,this.status=r.Status.IDLE,this.packetManager=new a(this),this.lastPingTimestamp=0,this.ratelimit={queue:[],remaining:120,resetTime:-1},this.connect(e),this.disabledEvents={},this.closeSequence=0,this.expectingClose=!1;for(const t of this.client.options.disabledEvents)this.disabledEvents[t]=!0}triggerReady(){if(this.status===r.Status.READY)return void this.debug("Tried to mark self as ready, but already ready");this.status=r.Status.READY,this.client.emit(r.Events.READY),this.packetManager.handleQueue()}checkIfReady(){if(this.status===r.Status.READY||this.status===r.Status.NEARLY)return!1;let t=0;for(const e of this.client.guilds.values())e.available||t++;if(0===t){if(this.status=r.Status.NEARLY,!this.client.options.fetchAllMembers)return this.triggerReady();const t=this.client.guilds.map(t=>t.fetchMembers());Promise.all(t).then(()=>this.triggerReady()).catch(t=>{this.debug(`Failed to fetch all members before ready! ${t}`);this.triggerReady()})}return!0}debug(t){return t instanceof Error&&(t=t.stack),this.manager.debug(`[connection] ${t}`)}unpack(t){return t instanceof ArrayBuffer&&(t=e.from(new Uint8Array(t))),c&&"string"!=typeof t?c.unpack(t):(t instanceof e&&(t=o.inflateSync(t).toString()),JSON.parse(t))}pack(t){return c?c.pack(t):JSON.stringify(t)}processQueue(){if(0!==this.ratelimit.remaining&&0!==this.ratelimit.queue.length)for(120===this.ratelimit.remaining&&(this.ratelimit.resetTimer=setTimeout(()=>{this.ratelimit.remaining=120;this.processQueue()},12e4));this.ratelimit.remaining>0;){const t=this.ratelimit.queue.shift();if(!t)return;this._send(t),this.ratelimit.remaining--}}_send(t){if(!this.ws||this.ws.readyState!==u.OPEN)return void this.debug(`Tried to send packet ${t} but no WebSocket is available!`);this.ws.send(this.pack(t))}send(t){if(!this.ws||this.ws.readyState!==u.OPEN)return void this.debug(`Tried to send packet ${t} but no WebSocket is available!`);this.ratelimit.queue.push(t),this.processQueue()}connect(t=this.gateway,e=0,n=!1){if(e)return this.client.setTimeout(()=>this.connect(t,0,n),e);if(this.ws&&!n)return this.debug("WebSocket connection already exists"),!1;if("string"!=typeof t)return this.debug(`Tried to connect to an invalid gateway: ${t}`),!1;this.expectingClose=!1,this.gateway=t,this.debug(`Connecting to ${t}`);const s=this.ws=new u(t);return i&&(s.binaryType="arraybuffer"),s.onmessage=this.onMessage.bind(this),s.onopen=this.onOpen.bind(this),s.onerror=this.onError.bind(this),s.onclose=this.onClose.bind(this),this.status=r.Status.CONNECTING,!0}destroy(){const t=this.ws;return t?(this.heartbeat(-1),this.expectingClose=!0,t.close(1e3),this.packetManager.handleQueue(),this.ws=null,this.status=r.Status.DISCONNECTED,!0):(this.debug("Attempted to destroy WebSocket but no connection exists!"),!1)}onMessage(t){let e;try{e=this.unpack(t.data)}catch(t){this.emit("debug",t)}return this.onPacket(e)}setSequence(t){this.sequence=t>this.sequence?t:this.sequence}onPacket(t){if(!t)return this.debug("Received null packet"),!1;switch(this.client.emit("raw",t),t.op){case r.OPCodes.HELLO:return this.heartbeat(t.d.heartbeat_interval);case r.OPCodes.RECONNECT:return this.reconnect();case r.OPCodes.INVALID_SESSION:return t.d||(this.sessionID=null),this.sequence=-1,this.debug("Session invalidated -- will identify with a new session"),this.identify(t.d?2500:0);case r.OPCodes.HEARTBEAT_ACK:return this.ackHeartbeat();case r.OPCodes.HEARTBEAT:return this.heartbeat();default:return this.packetManager.handle(t)}}onOpen(t){t&&t.target&&t.target.url&&(this.gateway=t.target.url),this.debug(`Connected to gateway ${this.gateway}`),this.identify()}reconnect(){this.debug("Attemping to reconnect in 5500ms..."),this.client.emit(r.Events.RECONNECTING),this.connect(this.gateway,5500,!0)}onError(t){if(t&&"uWs client connection error"===t.message)return void this.reconnect();this.client.emit(r.Events.ERROR,t)}onClose(t){if(this.debug(`${this.expectingClose?"Client":"Server"} closed the WebSocket connection: ${t.code}`),this.closeSequence=this.sequence,this.emit("close",t),this.heartbeat(-1),1e3===t.code?this.expectingClose:r.WSCodes[t.code])return this.expectingClose=!1,this.client.emit(r.Events.DISCONNECT,t),this.debug(r.WSCodes[t.code]),void this.destroy();this.expectingClose=!1,this.reconnect()}ackHeartbeat(){this.debug(`Heartbeat acknowledged, latency of ${Date.now()-this.lastPingTimestamp}ms`),this.client._pong(this.lastPingTimestamp)}heartbeat(t){if(!isNaN(t))return void(-1===t?(this.debug("Clearing heartbeat interval"),this.client.clearInterval(this.heartbeatInterval),this.heartbeatInterval=null):(this.debug(`Setting a heartbeat interval for ${t}ms`),this.heartbeatInterval=this.client.setInterval(()=>this.heartbeat(),t)));this.debug("Sending a heartbeat"),this.lastPingTimestamp=Date.now(),this.send({op:r.OPCodes.HEARTBEAT,d:this.sequence})}identify(t){return t?this.client.setTimeout(this.identify.apply(this),t):this.sessionID?this.identifyResume():this.identifyNew()}identifyNew(){if(!this.client.token)return void this.debug("No token available to identify a new session with");const t=Object.assign({token:this.client.token},this.client.options.ws),{shardId:shardId,shardCount:shardCount}=this.client.options;shardCount>0&&(t.shard=[Number(shardId),Number(shardCount)]),this.debug("Identifying as a new session"),this.send({op:r.OPCodes.IDENTIFY,d:t})}identifyResume(){if(!this.sessionID)return this.debug("Warning: wanted to resume but session ID not available; identifying as a new session instead"),this.identifyNew();this.debug(`Attempting to resume session ${this.sessionID}`);const t={token:this.client.token,session_id:this.sessionID,seq:this.sequence};return this.send({op:r.OPCodes.RESUME,d:t})}}l.ENCODING=c?"etf":"json",l.WebSocket=u,t.exports=l}).call(e,n(6).Buffer)},function(t,e,n){function i(t){return class e extends t{constructor(t,...n){super(s(t,n)),this[o]=t,Error.captureStackTrace&&Error.captureStackTrace(this,e)}get name(){return`${super.name} [${this[o]}]`}get code(){return this[o]}}}function s(t,e){c.strictEqual(typeof t,"string");const n=a.get(t);c(n,`An invalid error message key was used: ${t}.`);let i=u.format;if("function"==typeof n)i=n;else{if(void 0===e||0===e.length)return n;e.unshift(n)}return String(i(...e))}function r(t,e){a.set(t,"function"==typeof e?e:String(e))}const o=Symbol("code"),a=new Map,c=n(83),u=n(42);t.exports={register:r,Error:i(Error),TypeError:i(TypeError),RangeError:i(RangeError)}},function(t,e){class n{constructor(t){this.id=t.id,this.name=t.name,this.vip=t.vip,this.deprecated=t.deprecated,this.optimal=t.optimal,this.custom=t.custom,this.sampleHostname=t.sample_hostname}}t.exports=n},function(t,e,n){t.exports={search:n(196),sendMessage:n(197)}},function(module,exports,__webpack_require__){(function(process){const os=__webpack_require__(28),EventEmitter=__webpack_require__(15).EventEmitter,Constants=__webpack_require__(0),Permissions=__webpack_require__(11),Util=__webpack_require__(4),RESTManager=__webpack_require__(71),ClientManager=__webpack_require__(114),ClientDataResolver=__webpack_require__(69),ClientVoiceManager=__webpack_require__(200),WebSocketManager=__webpack_require__(149),ActionsManager=__webpack_require__(115),Collection=__webpack_require__(3),Presence=__webpack_require__(14).Presence,VoiceRegion=__webpack_require__(75),Webhook=__webpack_require__(23),Invite=__webpack_require__(29),OAuth2Application=__webpack_require__(30),ShardClientUtil=__webpack_require__(199),VoiceBroadcast=__webpack_require__(201),UserStore=__webpack_require__(193),ChannelStore=__webpack_require__(189),GuildStore=__webpack_require__(192),{Error:Error,TypeError:TypeError,RangeError:RangeError}=__webpack_require__(5);class Client extends EventEmitter{constructor(t={}){super(),!t.shardId&&"SHARD_ID"in process.env&&(t.shardId=Number(process.env.SHARD_ID)),!t.shardCount&&"SHARD_COUNT"in process.env&&(t.shardCount=Number(process.env.SHARD_COUNT)),this.options=Util.mergeDefault(Constants.DefaultOptions,t),this._validateOptions(),this.rest=new RESTManager(this),this.api=this.rest.api,this.manager=new ClientManager(this),this.ws=new WebSocketManager(this),this.resolver=new ClientDataResolver(this),this.actions=new ActionsManager(this),this.voice=this.browser?null:new ClientVoiceManager(this),this.shard=process.send?ShardClientUtil.singleton(this):null,this.users=new UserStore(this),this.guilds=new GuildStore(this),this.channels=new ChannelStore(this),this.presences=new Collection,Object.defineProperty(this,"token",{writable:!0}),!this.token&&"CLIENT_TOKEN"in process.env?this.token=process.env.CLIENT_TOKEN:this.token=null,this.user=null,this.readyAt=null,this.broadcasts=[],this.pings=[],this._timeouts=new Set,this._intervals=new Set,this.options.messageSweepInterval>0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get _pingTimestamp(){return this.ws.connection?this.ws.connection.lastPingTimestamp:0}get status(){return this.ws.connection.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get ping(){return this.pings.reduce((t,e)=>t+e,0)/this.pings.length}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const t=new Collection;for(const e of this.guilds.values())for(const n of e.emojis.values())t.set(n.id,n);return t}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"browser"===os.platform()}createVoiceBroadcast(){const t=new VoiceBroadcast(this);return this.broadcasts.push(t),t}login(t){return new Promise((e,n)=>{if("string"!=typeof t)throw new Error("TOKEN_INVALID");t=t.replace(/^Bot\s*/i,"");this.manager.connectToWebSocket(t,e,n)})}destroy(){for(const t of this._timeouts)clearTimeout(t);for(const t of this._intervals)clearInterval(t);return this._timeouts.clear(),this._intervals.clear(),this.manager.destroy()}syncGuilds(t=this.guilds){this.user.bot||this.ws.send({op:12,d:t instanceof Collection?t.keyArray():t.map(t=>t.id)})}fetchInvite(t){const e=this.resolver.resolveInviteCode(t);return this.api.invites(e).get({query:{with_counts:!0}}).then(t=>new Invite(this,t))}fetchWebhook(t,e){return this.api.webhooks(t,e).get().then(t=>new Webhook(this,t))}fetchVoiceRegions(){return this.api.voice.regions.get().then(t=>{const e=new Collection;for(const n of t)e.set(n.id,new VoiceRegion(n));return e})}sweepMessages(t=this.options.messageCacheLifetime){if("number"!=typeof t||isNaN(t))throw new TypeError("CLIENT_INVALID_OPTION","Lifetime","a number");if(t<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const e=1e3*t,n=Date.now();let i=0,s=0;for(const t of this.channels.values())if(t.messages){i++;for(const i of t.messages.values())n-(i.editedTimestamp||i.createdTimestamp)>e&&(t.messages.delete(i.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${t} seconds in ${i} text-based channels`),s}fetchApplication(t="@me"){return this.api.oauth2.applications(t).get().then(t=>new OAuth2Application(this,t))}generateInvite(t){return t?t instanceof Array&&(t=Permissions.resolve(t)):t=0,this.fetchApplication().then(e=>`https://discordapp.com/oauth2/authorize?client_id=${e.id}&permissions=${t}&scope=bot`)}setTimeout(t,e,...n){const i=setTimeout(()=>{t(...n);this._timeouts.delete(i)},e);return this._timeouts.add(i),i}clearTimeout(t){clearTimeout(t),this._timeouts.delete(t)}setInterval(t,e,...n){const i=setInterval(t,e,...n);return this._intervals.add(i),i}clearInterval(t){clearInterval(t),this._intervals.delete(t)}_pong(t){this.pings.unshift(Date.now()-t),this.pings.length>3&&(this.pings.length=3),this.ws.lastHeartbeatAck=!0}_setPresence(t,e){if(this.presences.has(t))return void this.presences.get(t).update(e);this.presences.set(t,new Presence(e))}_eval(script){return eval(script)}_validateOptions(t=this.options){if("number"!=typeof t.shardCount||isNaN(t.shardCount))throw new TypeError("CLIENT_INVALID_OPTION","shardCount","a number");if("number"!=typeof t.shardId||isNaN(t.shardId))throw new TypeError("CLIENT_INVALID_OPTION","shardId","a number");if(t.shardCount<0)throw new RangeError("CLIENT_INVALID_OPTION","shardCount","at least 0");if(t.shardId<0)throw new RangeError("CLIENT_INVALID_OPTION","shardId","at least 0");if(0!==t.shardId&&t.shardId>=t.shardCount)throw new RangeError("CLIENT_INVALID_OPTION","shardId","less than shardCount");if("number"!=typeof t.messageCacheMaxSize||isNaN(t.messageCacheMaxSize))throw new TypeError("CLIENT_INVALID_OPTION","messageCacheMaxSize","a number");if("number"!=typeof t.messageCacheLifetime||isNaN(t.messageCacheLifetime))throw new TypeError("CLIENT_INVALID_OPTION","The messageCacheLifetime","a number");if("number"!=typeof t.messageSweepInterval||isNaN(t.messageSweepInterval))throw new TypeError("CLIENT_INVALID_OPTION","messageSweepInterval","a number");if("boolean"!=typeof t.fetchAllMembers)throw new TypeError("CLIENT_INVALID_OPTION","fetchAllMembers","a boolean");if("boolean"!=typeof t.disableEveryone)throw new TypeError("CLIENT_INVALID_OPTION","disableEveryone","a boolean");if("number"!=typeof t.restWsBridgeTimeout||isNaN(t.restWsBridgeTimeout))throw new TypeError("CLIENT_INVALID_OPTION","restWsBridgeTimeout","a number");if("boolean"!=typeof t.internalSharding)throw new TypeError("CLIENT_INVALID_OPTION","internalSharding","a boolean");if(!(t.disabledEvents instanceof Array))throw new TypeError("CLIENT_INVALID_OPTION","disabledEvents","an Array")}}module.exports=Client}).call(exports,__webpack_require__(9))},function(t,e,n){const i=n(23),s=n(71),r=n(69),o=n(0),a=n(4);class c extends i{constructor(t,e,n){super(null,t,e),this.options=a.mergeDefault(o.DefaultOptions,n),this.rest=new s(this),this.api=this.rest.api,this.resolver=new r(this),this._timeouts=new Set,this._intervals=new Set}setTimeout(t,e,...n){const i=setTimeout(()=>{t(...n);this._timeouts.delete(i)},e);return this._timeouts.add(i),i}clearTimeout(t){clearTimeout(t),this._timeouts.delete(t)}setInterval(t,e,...n){const i=setInterval(t,e,...n);return this._intervals.add(i),i}clearInterval(t){clearInterval(t),this._intervals.delete(t)}destroy(){for(const t of this._timeouts)clearTimeout(t);for(const t of this._intervals)clearInterval(t);this._timeouts.clear(),this._intervals.clear()}}t.exports=c},function(t,e,n){const i=n(4);class s{constructor(t={}){this.title=t.title,this.description=t.description,this.url=t.url,this.color=t.color,this.author=t.author,this.timestamp=t.timestamp,this.fields=t.fields||[],this.thumbnail=t.thumbnail,this.image=t.image,this.footer=t.footer,this.file=t.file}setTitle(t){if(t=i.resolveString(t),t.length>256)throw new RangeError("RichEmbed titles may not exceed 256 characters.");return this.title=t,this}setDescription(t){if(t=i.resolveString(t),t.length>2048)throw new RangeError("RichEmbed descriptions may not exceed 2048 characters.");return this.description=t,this}setURL(t){return this.url=t,this}setColor(t){return this.color=i.resolveColor(t),this}setAuthor(t,e,n){return this.author={name:i.resolveString(t),icon_url:e,url:n},this}setTimestamp(t=new Date){return this.timestamp=t,this}addField(t,e,n=!1){if(this.fields.length>=25)throw new RangeError("RichEmbeds may not exceed 25 fields.");if(t=i.resolveString(t),t.length>256)throw new RangeError("RichEmbed field names may not exceed 256 characters.");if(!/\S/.test(t))throw new RangeError("RichEmbed field names may not be empty.");if(e=i.resolveString(e),e.length>1024)throw new RangeError("RichEmbed field values may not exceed 1024 characters.");if(!/\S/.test(e))throw new RangeError("RichEmbed field values may not be empty.");return this.fields.push({name:t,value:e,inline:n}),this}addBlankField(t=!1){return this.addField("​","​",t)}setThumbnail(t){return this.thumbnail={url:t},this}setImage(t){return this.image={url:t},this}setFooter(t,e){if(t=i.resolveString(t),t.length>2048)throw new RangeError("RichEmbed footer text may not exceed 2048 characters.");return this.footer={text:t,icon_url:e},this}attachFile(t){if(this.file)throw new RangeError("You may not upload more than one file at once.");return this.file=t,this}}t.exports=s},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";(function(e){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -function i(t,e){if(t===e)return 0;for(var n=t.length,i=e.length,s=0,r=Math.min(n,i);s=0;a--)if(c[a]!==u[a])return!1;for(a=c.length-1;a>=0;a--)if(o=c[a],!d(t[o],e[o],n,i))return!1;return!0}function g(t,e,n){d(t,e,!0)&&h(t,e,n,"notDeepStrictEqual",g)}function v(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function E(t){var e;try{t()}catch(t){e=t}return e}function _(t,e,n,i){var s;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(i=n,n=null),s=E(e),i=(n&&n.name?" ("+n.name+").":".")+(i?" "+i:"."),t&&!s&&h(s,n,"Missing expected exception"+i);var r="string"==typeof i,o=!t&&b.isError(s),a=!t&&s&&!n;if((o&&r&&v(s,n)||a)&&h(s,n,"Got unwanted exception"+i),t&&s&&n&&!v(s,n)||!t&&s)throw s}var b=n(42),w=Object.prototype.hasOwnProperty,y=Array.prototype.slice,x=function(){return"foo"===function(){}.name}(),A=t.exports=p,T=/\s*function\s+([^\(\s]*)\s*/;A.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=l(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var i=n.stack,s=a(e),r=i.indexOf("\n"+s);if(r>=0){var o=i.indexOf("\n",r+1);i=i.substring(o+1)}this.stack=i}}},b.inherits(A.AssertionError,Error),A.fail=h,A.ok=p,A.equal=function(t,e,n){t!=e&&h(t,e,n,"==",A.equal)},A.notEqual=function(t,e,n){t==e&&h(t,e,n,"!=",A.notEqual)},A.deepEqual=function(t,e,n){d(t,e,!1)||h(t,e,n,"deepEqual",A.deepEqual)},A.deepStrictEqual=function(t,e,n){d(t,e,!0)||h(t,e,n,"deepStrictEqual",A.deepStrictEqual)},A.notDeepEqual=function(t,e,n){d(t,e,!1)&&h(t,e,n,"notDeepEqual",A.notDeepEqual)},A.notDeepStrictEqual=g,A.strictEqual=function(t,e,n){t!==e&&h(t,e,n,"===",A.strictEqual)},A.notStrictEqual=function(t,e,n){t===e&&h(t,e,n,"!==",A.notStrictEqual)},A.throws=function(t,e,n){_(!0,t,e,n)},A.doesNotThrow=function(t,e,n){_(!1,t,e,n)},A.ifError=function(t){if(t)throw t};var S=Object.keys||function(t){var e=[];for(var n in t)w.call(t,n)&&e.push(n);return e}}).call(e,n(12))},function(t,e,n){"use strict";function i(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function s(t){return 3*t.length/4-i(t)}function r(t){var e,n,s,r,o,a,c=t.length;o=i(t),a=new h(3*c/4-o),s=o>0?c-4:c;var u=0;for(e=0,n=0;e>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===o?(r=l[t.charCodeAt(e)]<<2|l[t.charCodeAt(e+1)]>>4,a[u++]=255&r):1===o&&(r=l[t.charCodeAt(e)]<<10|l[t.charCodeAt(e+1)]<<4|l[t.charCodeAt(e+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,n){for(var i,s=[],r=e;rc?c:o+16383));return 1===i?(e=t[n-1],s+=u[e>>2],s+=u[e<<4&63],s+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],s+=u[e>>10],s+=u[e>>4&63],s+=u[e<<2&63],s+="="),r.push(s),r.join("")}e.byteLength=s,e.toByteArray=r,e.fromByteArray=c;for(var u=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=p.length;d>1,l=-7,h=n?s-1:0,p=n?-1:1,d=t[e+h];for(h+=p,r=d&(1<<-l)-1,d>>=-l,l+=a;l>0;r=256*r+t[e+h],h+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=i;l>0;o=256*o+t[e+h],h+=p,l-=8);if(0===r)r=1-u;else{if(r===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),r-=u}return(d?-1:1)*o*Math.pow(2,r-i)},e.write=function(t,e,n,i,s,r){var o,a,c,u=8*r-s-1,l=(1<>1,p=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:r-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),e+=o+h>=1?p/c:p*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*c-1)*Math.pow(2,s),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;t[n+d]=255&a,d+=f,a/=256,s-=8);for(o=o<0;t[n+d]=255&o,d+=f,o/=256,u-=8);t[n+d-f]|=128*m}},function(t,e,n){(function(t,i){var s;!function(r){function o(t){throw new RangeError(N[t])}function a(t,e){for(var n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function c(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),t=t.replace(M,"."),i+a(t.split("."),e).join(".")}function u(t){for(var e,n,i=[],s=0,r=t.length;s=55296&&e<=56319&&s65535&&(t-=65536,e+=O(t>>>10&1023|55296),t=56320|1023&t),e+=O(t)}).join("")}function h(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:w}function p(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function d(t,e,n){var i=0;for(t=n?C(t/T):t>>1,t+=C(t/e);t>L*x>>1;i+=w)t=C(t/L);return C(i+(L+1)*t/(t+A))}function f(t){var e,n,i,s,r,a,c,u,p,f,m=[],g=t.length,v=0,E=R,_=S;for(n=t.lastIndexOf(D),n<0&&(n=0),i=0;i=128&&o("not-basic"),m.push(t.charCodeAt(i));for(s=n>0?n+1:0;s=g&&o("invalid-input"),u=h(t.charCodeAt(s++)),(u>=w||u>C((b-v)/a))&&o("overflow"),v+=u*a,p=c<=_?y:c>=_+x?x:c-_,!(uC(b/f)&&o("overflow"),a*=f;e=m.length+1,_=d(v-r,e,0==r),C(v/e)>b-E&&o("overflow"),E+=C(v/e),v%=e,m.splice(v++,0,E)}return l(m)}function m(t){var e,n,i,s,r,a,c,l,h,f,m,g,v,E,_,A=[];for(t=u(t),g=t.length,e=R,n=0,r=S,a=0;a=e&&mC((b-n)/v)&&o("overflow"),n+=(c-e)*v,e=c,a=0;ab&&o("overflow"),m==e){for(l=n,h=w;f=h<=r?y:h>=r+x?x:h-r,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=w-y,C=Math.floor,O=String.fromCharCode;_={version:"1.4.1",ucs2:{decode:u,encode:l},decode:f,encode:m,toASCII:v,toUnicode:g},void 0!==(s=function(){return _}.call(e,n,e,t))&&(t.exports=s)}()}).call(e,n(112)(t),n(12))},function(t,e,n){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,r){e=e||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;t=t.split(e);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var c=t.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(l=f.substr(0,m),h=f.substr(m+1)):(l=f,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),i(o,p)?s(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";function i(t,e){if(t.map)return t.map(e);for(var n=[],i=0;i0?this.tail.next=e:this.head=e,this.tail=e,++this.length},i.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},i.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},i.prototype.concat=function(t){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var e=s.allocUnsafe(t>>>0),n=this.head,i=0;n;)n.data.copy(e,i),i+=n.data.length,n=n.next;return e}},function(t,e,n){t.exports=n(25).PassThrough},function(t,e,n){t.exports=n(25).Transform},function(t,e,n){t.exports=n(39)},function(t,e,n){(function(t,e){!function(t,n){"use strict";function i(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0;a--)if(c[a]!==u[a])return!1;for(a=c.length-1;a>=0;a--)if(o=c[a],!d(t[o],e[o],n,i))return!1;return!0}function g(t,e,n){d(t,e,!0)&&h(t,e,n,"notDeepStrictEqual",g)}function v(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function E(t){var e;try{t()}catch(t){e=t}return e}function _(t,e,n,i){var s;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(i=n,n=null),s=E(e),i=(n&&n.name?" ("+n.name+").":".")+(i?" "+i:"."),t&&!s&&h(s,n,"Missing expected exception"+i);var r="string"==typeof i,o=!t&&b.isError(s),a=!t&&s&&!n;if((o&&r&&v(s,n)||a)&&h(s,n,"Got unwanted exception"+i),t&&s&&n&&!v(s,n)||!t&&s)throw s}var b=n(42),w=Object.prototype.hasOwnProperty,y=Array.prototype.slice,x=function(){return"foo"===function(){}.name}(),A=t.exports=p,T=/\s*function\s+([^\(\s]*)\s*/;A.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=l(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var i=n.stack,s=a(e),r=i.indexOf("\n"+s);if(r>=0){var o=i.indexOf("\n",r+1);i=i.substring(o+1)}this.stack=i}}},b.inherits(A.AssertionError,Error),A.fail=h,A.ok=p,A.equal=function(t,e,n){t!=e&&h(t,e,n,"==",A.equal)},A.notEqual=function(t,e,n){t==e&&h(t,e,n,"!=",A.notEqual)},A.deepEqual=function(t,e,n){d(t,e,!1)||h(t,e,n,"deepEqual",A.deepEqual)},A.deepStrictEqual=function(t,e,n){d(t,e,!0)||h(t,e,n,"deepStrictEqual",A.deepStrictEqual)},A.notDeepEqual=function(t,e,n){d(t,e,!1)&&h(t,e,n,"notDeepEqual",A.notDeepEqual)},A.notDeepStrictEqual=g,A.strictEqual=function(t,e,n){t!==e&&h(t,e,n,"===",A.strictEqual)},A.notStrictEqual=function(t,e,n){t===e&&h(t,e,n,"!==",A.notStrictEqual)},A.throws=function(t,e,n){_(!0,t,e,n)},A.doesNotThrow=function(t,e,n){_(!1,t,e,n)},A.ifError=function(t){if(t)throw t};var S=Object.keys||function(t){var e=[];for(var n in t)w.call(t,n)&&e.push(n);return e}}).call(e,n(12))},function(t,e,n){"use strict";function i(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function s(t){return 3*t.length/4-i(t)}function r(t){var e,n,s,r,o,a,c=t.length;o=i(t),a=new h(3*c/4-o),s=o>0?c-4:c;var u=0;for(e=0,n=0;e>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===o?(r=l[t.charCodeAt(e)]<<2|l[t.charCodeAt(e+1)]>>4,a[u++]=255&r):1===o&&(r=l[t.charCodeAt(e)]<<10|l[t.charCodeAt(e+1)]<<4|l[t.charCodeAt(e+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,n){for(var i,s=[],r=e;rc?c:o+16383));return 1===i?(e=t[n-1],s+=u[e>>2],s+=u[e<<4&63],s+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],s+=u[e>>10],s+=u[e>>4&63],s+=u[e<<2&63],s+="="),r.push(s),r.join("")}e.byteLength=s,e.toByteArray=r,e.fromByteArray=c;for(var u=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=p.length;d>1,l=-7,h=n?s-1:0,p=n?-1:1,d=t[e+h];for(h+=p,r=d&(1<<-l)-1,d>>=-l,l+=a;l>0;r=256*r+t[e+h],h+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=i;l>0;o=256*o+t[e+h],h+=p,l-=8);if(0===r)r=1-u;else{if(r===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),r-=u}return(d?-1:1)*o*Math.pow(2,r-i)},e.write=function(t,e,n,i,s,r){var o,a,c,u=8*r-s-1,l=(1<>1,p=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:r-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),e+=o+h>=1?p/c:p*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*c-1)*Math.pow(2,s),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;t[n+d]=255&a,d+=f,a/=256,s-=8);for(o=o<0;t[n+d]=255&o,d+=f,o/=256,u-=8);t[n+d-f]|=128*m}},function(t,e,n){(function(t,i){var s;!function(r){function o(t){throw new RangeError(N[t])}function a(t,e){for(var n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function c(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),t=t.replace(M,"."),i+a(t.split("."),e).join(".")}function u(t){for(var e,n,i=[],s=0,r=t.length;s=55296&&e<=56319&&s65535&&(t-=65536,e+=O(t>>>10&1023|55296),t=56320|1023&t),e+=O(t)}).join("")}function h(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:w}function p(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function d(t,e,n){var i=0;for(t=n?C(t/T):t>>1,t+=C(t/e);t>L*x>>1;i+=w)t=C(t/L);return C(i+(L+1)*t/(t+A))}function f(t){var e,n,i,s,r,a,c,u,p,f,m=[],g=t.length,v=0,E=R,_=S;for(n=t.lastIndexOf(D),n<0&&(n=0),i=0;i=128&&o("not-basic"),m.push(t.charCodeAt(i));for(s=n>0?n+1:0;s=g&&o("invalid-input"),u=h(t.charCodeAt(s++)),(u>=w||u>C((b-v)/a))&&o("overflow"),v+=u*a,p=c<=_?y:c>=_+x?x:c-_,!(uC(b/f)&&o("overflow"),a*=f;e=m.length+1,_=d(v-r,e,0==r),C(v/e)>b-E&&o("overflow"),E+=C(v/e),v%=e,m.splice(v++,0,E)}return l(m)}function m(t){var e,n,i,s,r,a,c,l,h,f,m,g,v,E,_,A=[];for(t=u(t),g=t.length,e=R,n=0,r=S,a=0;a=e&&mC((b-n)/v)&&o("overflow"),n+=(c-e)*v,e=c,a=0;ab&&o("overflow"),m==e){for(l=n,h=w;f=h<=r?y:h>=r+x?x:h-r,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=w-y,C=Math.floor,O=String.fromCharCode;_={version:"1.4.1",ucs2:{decode:u,encode:l},decode:f,encode:m,toASCII:v,toUnicode:g},void 0!==(s=function(){return _}.call(e,n,e,t))&&(t.exports=s)}()}).call(e,n(112)(t),n(12))},function(t,e,n){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,r){e=e||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;t=t.split(e);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var c=t.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(l=f.substr(0,m),h=f.substr(m+1)):(l=f,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),i(o,p)?s(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";function i(t,e){if(t.map)return t.map(e);for(var n=[],i=0;i0?this.tail.next=e:this.head=e,this.tail=e,++this.length},i.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},i.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},i.prototype.concat=function(t){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var e=s.allocUnsafe(t>>>0),n=this.head,i=0;n;)n.data.copy(e,i),i+=n.data.length,n=n.next;return e}},function(t,e,n){t.exports=n(25).PassThrough},function(t,e,n){t.exports=n(25).Transform},function(t,e,n){t.exports=n(39)},function(t,e,n){(function(t,e){!function(t,n){"use strict";function i(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n{const a=this.request;const u=t=>{t||(t=new Error("Unknown error occured"));t.request=a;n(t)};a.on("abort",u);a.on("aborted",u);a.on("error",u);a.on("response",u=>{const h=new l.PassThrough;this._shouldUnzip(u)?u.pipe(s.createUnzip({flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH})).pipe(h):u.pipe(h);let d=[];h.on("data",t=>{this.push(t)||this.pause();d.push(t)});h.on("end",()=>{this.push(null);const s=e.concat(d);if(this._shouldRedirect(u)){let e=this.request.method;[301,302].includes(u.statusCode)?("HEAD"!==e&&(e="GET"),this.data=null):303===u.statusCode&&(e="GET");const n={};if(this.request._headerNames)for(const t of Object.keys(this.request._headerNames))"host"!==t.toLowerCase()&&(n[this.request._headerNames[t]]=this.request._headers[t]);else for(const t of Object.keys(this.request._headers))if("host"!==t.toLowerCase()){const e=this.request._headers[t];n[e.name]=e.value}const s=/^https?:\/\//i.test(u.headers.location)?u.headers.location:c.resolve(i(a),u.headers.location);return void t(new p(e,s,{data:this.data,headers:n}))}const l={request:this.request,body:s,text:s.toString(),ok:u.statusCode>=200&&u.statusCode<300,headers:u.headers,status:u.statusCode,statusText:u.statusText||o.STATUS_CODES[u.statusCode]};const h=u.headers["content-type"];if(h)if(h.includes("application/json"))try{l.body=JSON.parse(l.text)}catch(t){}else h.includes("application/x-www-form-urlencoded")&&(l.body=r.parse(l.text));if(l.ok)t(l);else{const t=new Error(`${l.status} ${l.statusText}`.trim());Object.assign(t,l),n(t)}})});this._addFinalHeaders();this.request.query&&(this.request.path=`${this.request.path}?${r.stringify(this.request.query)}`);a.end(this.data?this.data.end?this.data.end():this.data:null)}).then(t,n)}catch(t){return this.then(null,t)}end(t){return this.then(e=>t?t(null,e):e,e=>t?t(e,e.status?e:null):e)}_read(){this.resume(),this._response||this.catch(t=>this.emit("error",t))}_shouldUnzip(t){return 204!==t.statusCode&&304!==t.statusCode&&("0"!==t.headers["content-length"]&&/^\s*(?:deflate|gzip)\s*$/.test(t.headers["content-encoding"]))}_shouldRedirect(t){return[301,302,303,307,308].includes(t.statusCode)}_getFormData(){return this._formData||(this._formData=new h),this._formData}_addFinalHeaders(){this.request&&(this._getHeader("user-agent")||this.set("User-Agent",`snekfetch/${p.version} (${u.repository.url.replace(/\.?git/,"")})`),"HEAD"!==this.request.method&&this.set("Accept-Encoding","gzip, deflate"))}get _response(){return this.request.res||this.request._response||null}_getHeader(t){try{return this.request.getHeader(t)}catch(t){return null}}}p.version=u.version,p.METHODS=o.METHODS.concat("BREW");for(const t of p.METHODS)p["M-SEARCH"===t?"msearch":t.toLowerCase()]=(e=>new p(t,e));t.exports=p}).call(e,n(6).Buffer)},function(t,e,n){function i(t){return r[t]||r.bin}function s(t){return o(t)||r.bin}const r=n(103),o=n(102);t.exports={buffer:s,lookup:i}},function(t,e){function n(t){const e=new Uint8Array(t);if(!(e&&e.length>1))return null;if(255===e[0]&&216===e[1]&&255===e[2])return{ext:"jpg",mime:"image/jpeg"};if(137===e[0]&&80===e[1]&&78===e[2]&&71===e[3])return{ext:"png",mime:"image/png"};if(71===e[0]&&73===e[1]&&70===e[2])return{ext:"gif",mime:"image/gif"};if(87===e[8]&&69===e[9]&&66===e[10]&&80===e[11])return{ext:"webp",mime:"image/webp"};if(70===e[0]&&76===e[1]&&73===e[2]&&70===e[3])return{ext:"flif",mime:"image/flif"};if((73===e[0]&&73===e[1]&&42===e[2]&&0===e[3]||77===e[0]&&77===e[1]&&0===e[2]&&42===e[3])&&67===e[8]&&82===e[9])return{ext:"cr2",mime:"image/x-canon-cr2"};if(73===e[0]&&73===e[1]&&42===e[2]&&0===e[3]||77===e[0]&&77===e[1]&&0===e[2]&&42===e[3])return{ext:"tif",mime:"image/tiff"};if(66===e[0]&&77===e[1])return{ext:"bmp",mime:"image/bmp"};if(73===e[0]&&73===e[1]&&188===e[2])return{ext:"jxr",mime:"image/vnd.ms-photo"};if(56===e[0]&&66===e[1]&&80===e[2]&&83===e[3])return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(80===e[0]&&75===e[1]&&3===e[2]&&4===e[3]&&109===e[30]&&105===e[31]&&109===e[32]&&101===e[33]&&116===e[34]&&121===e[35]&&112===e[36]&&101===e[37]&&97===e[38]&&112===e[39]&&112===e[40]&&108===e[41]&&105===e[42]&&99===e[43]&&97===e[44]&&116===e[45]&&105===e[46]&&111===e[47]&&110===e[48]&&47===e[49]&&101===e[50]&&112===e[51]&&117===e[52]&&98===e[53]&&43===e[54]&&122===e[55]&&105===e[56]&&112===e[57])return{ext:"epub",mime:"application/epub+zip"};if(80===e[0]&&75===e[1]&&3===e[2]&&4===e[3]&&77===e[30]&&69===e[31]&&84===e[32]&&65===e[33]&&45===e[34]&&73===e[35]&&78===e[36]&&70===e[37]&&47===e[38]&&109===e[39]&&111===e[40]&&122===e[41]&&105===e[42]&&108===e[43]&&108===e[44]&&97===e[45]&&46===e[46]&&114===e[47]&&115===e[48]&&97===e[49])return{ext:"xpi",mime:"application/x-xpinstall"};if(!(80!==e[0]||75!==e[1]||3!==e[2]&&5!==e[2]&&7!==e[2]||4!==e[3]&&6!==e[3]&&8!==e[3]))return{ext:"zip",mime:"application/zip"};if(117===e[257]&&115===e[258]&&116===e[259]&&97===e[260]&&114===e[261])return{ext:"tar",mime:"application/x-tar"};if(82===e[0]&&97===e[1]&&114===e[2]&&33===e[3]&&26===e[4]&&7===e[5]&&(0===e[6]||1===e[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(31===e[0]&&139===e[1]&&8===e[2])return{ext:"gz",mime:"application/gzip"};if(66===e[0]&&90===e[1]&&104===e[2])return{ext:"bz2",mime:"application/x-bzip2"};if(55===e[0]&&122===e[1]&&188===e[2]&&175===e[3]&&39===e[4]&&28===e[5])return{ext:"7z",mime:"application/x-7z-compressed"};if(120===e[0]&&1===e[1])return{ext:"dmg",mime:"application/x-apple-diskimage"};if(0===e[0]&&0===e[1]&&0===e[2]&&(24===e[3]||32===e[3])&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]||51===e[0]&&103===e[1]&&112===e[2]&&53===e[3]||0===e[0]&&0===e[1]&&0===e[2]&&28===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&109===e[8]&&112===e[9]&&52===e[10]&&50===e[11]&&109===e[16]&&112===e[17]&&52===e[18]&&49===e[19]&&109===e[20]&&112===e[21]&&52===e[22]&&50===e[23]&&105===e[24]&&115===e[25]&&111===e[26]&&109===e[27]||0===e[0]&&0===e[1]&&0===e[2]&&28===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&105===e[8]&&115===e[9]&&111===e[10]&&109===e[11]||0===e[0]&&0===e[1]&&0===e[2]&&28===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&109===e[8]&&112===e[9]&&52===e[10]&&50===e[11]&&0===e[12]&&0===e[13]&&0===e[14]&&0===e[15])return{ext:"mp4",mime:"video/mp4"};if(0===e[0]&&0===e[1]&&0===e[2]&&28===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&77===e[8]&&52===e[9]&&86===e[10])return{ext:"m4v",mime:"video/x-m4v"};if(77===e[0]&&84===e[1]&&104===e[2]&&100===e[3])return{ext:"mid",mime:"audio/midi"};if(26===e[0]&&69===e[1]&&223===e[2]&&163===e[3]){const t=e.subarray(4,4100),n=t.findIndex((t,e,n)=>66===n[e]&&130===n[e+1]);if(n>=0){const e=n+3,i=n=>Array.from(n).every((n,i)=>t[e+i]===n.charCodeAt(0));if(i("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(i("webm"))return{ext:"webm",mime:"video/webm"}}}return 0===e[0]&&0===e[1]&&0===e[2]&&20===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]?{ext:"mov",mime:"video/quicktime"}:82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]&&65===e[8]&&86===e[9]&&73===e[10]?{ext:"avi",mime:"video/x-msvideo"}:48===e[0]&&38===e[1]&&178===e[2]&&117===e[3]&&142===e[4]&&102===e[5]&&207===e[6]&&17===e[7]&&166===e[8]&&217===e[9]?{ext:"wmv",mime:"video/x-ms-wmv"}:0===e[0]&&0===e[1]&&1===e[2]&&"b"===e[3].toString(16)[0]?{ext:"mpg",mime:"video/mpeg"}:73===e[0]&&68===e[1]&&51===e[2]||255===e[0]&&251===e[1]?{ext:"mp3",mime:"audio/mpeg"}:102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&77===e[8]&&52===e[9]&&65===e[10]||77===e[0]&&52===e[1]&&65===e[2]&&32===e[3]?{ext:"m4a",mime:"audio/m4a"}:79===e[28]&&112===e[29]&&117===e[30]&&115===e[31]&&72===e[32]&&101===e[33]&&97===e[34]&&100===e[35]?{ext:"opus",mime:"audio/opus"}:79===e[0]&&103===e[1]&&103===e[2]&&83===e[3]?{ext:"ogg",mime:"audio/ogg"}:102===e[0]&&76===e[1]&&97===e[2]&&67===e[3]?{ext:"flac",mime:"audio/x-flac"}:82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]&&87===e[8]&&65===e[9]&&86===e[10]&&69===e[11]?{ext:"wav",mime:"audio/x-wav"}:35===e[0]&&33===e[1]&&65===e[2]&&77===e[3]&&82===e[4]&&10===e[5]?{ext:"amr",mime:"audio/amr"}:37===e[0]&&80===e[1]&&68===e[2]&&70===e[3]?{ext:"pdf",mime:"application/pdf"}:77===e[0]&&90===e[1]?{ext:"exe",mime:"application/x-msdownload"}:67!==e[0]&&70!==e[0]||87!==e[1]||83!==e[2]?123===e[0]&&92===e[1]&&114===e[2]&&116===e[3]&&102===e[4]?{ext:"rtf",mime:"application/rtf"}:119===e[0]&&79===e[1]&&70===e[2]&&70===e[3]&&(0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]||79===e[4]&&84===e[5]&&84===e[6]&&79===e[7])?{ext:"woff",mime:"application/font-woff"}:119===e[0]&&79===e[1]&&70===e[2]&&50===e[3]&&(0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]||79===e[4]&&84===e[5]&&84===e[6]&&79===e[7])?{ext:"woff2",mime:"application/font-woff"}:76===e[34]&&80===e[35]&&(0===e[8]&&0===e[9]&&1===e[10]||1===e[8]&&0===e[9]&&2===e[10]||2===e[8]&&0===e[9]&&2===e[10])?{ext:"eot",mime:"application/octet-stream"}:0===e[0]&&1===e[1]&&0===e[2]&&0===e[3]&&0===e[4]?{ext:"ttf",mime:"application/font-sfnt"}:79===e[0]&&84===e[1]&&84===e[2]&&79===e[3]&&0===e[4]?{ext:"otf",mime:"application/font-sfnt"}:0===e[0]&&0===e[1]&&1===e[2]&&0===e[3]?{ext:"ico",mime:"image/x-icon"}:70===e[0]&&76===e[1]&&86===e[2]&&1===e[3]?{ext:"flv",mime:"video/x-flv"}:37===e[0]&&33===e[1]?{ext:"ps",mime:"application/postscript"}:253===e[0]&&55===e[1]&&122===e[2]&&88===e[3]&&90===e[4]&&0===e[5]?{ext:"xz",mime:"application/x-xz"}:83===e[0]&&81===e[1]&&76===e[2]&&105===e[3]?{ext:"sqlite",mime:"application/x-sqlite3"}:78===e[0]&&69===e[1]&&83===e[2]&&26===e[3]?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:67===e[0]&&114===e[1]&&50===e[2]&&52===e[3]?{ext:"crx",mime:"application/x-google-chrome-extension"}:77===e[0]&&83===e[1]&&67===e[2]&&70===e[3]||73===e[0]&&83===e[1]&&99===e[2]&&40===e[3]?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:33===e[0]&&60===e[1]&&97===e[2]&&114===e[3]&&99===e[4]&&104===e[5]&&62===e[6]&&10===e[7]&&100===e[8]&&101===e[9]&&98===e[10]&&105===e[11]&&97===e[12]&&110===e[13]&&45===e[14]&&98===e[15]&&105===e[16]&&110===e[17]&&97===e[18]&&114===e[19]&&121===e[20]?{ext:"deb",mime:"application/x-deb"}:33===e[0]&&60===e[1]&&97===e[2]&&114===e[3]&&99===e[4]&&104===e[5]&&62===e[6]?{ext:"ar",mime:"application/x-unix-archive"}:237===e[0]&&171===e[1]&&238===e[2]&&219===e[3]?{ext:"rpm",mime:"application/x-rpm"}:31===e[0]&&160===e[1]||31===e[0]&&157===e[1]?{ext:"Z",mime:"application/x-compress"}:76===e[0]&&90===e[1]&&73===e[2]&&80===e[3]?{ext:"lz",mime:"application/x-lzip"}:208===e[0]&&207===e[1]&&17===e[2]&&224===e[3]&&161===e[4]&&177===e[5]&&26===e[6]&&225===e[7]?{ext:"msi",mime:"application/x-msi"}:6===e[0]&&14===e[1]&&43===e[2]&&52===e[3]&&2===e[4]&&5===e[5]&&1===e[6]&&1===e[7]&&13===e[8]&&1===e[9]&&2===e[10]&&1===e[11]&&1===e[12]&&2===e[13]?{ext:"mxf",mime:"application/mxf"}:null:{ext:"swf",mime:"application/x-shockwave-flash"}}t.exports=n},function(t,e){t.exports={123:"application/vnd.lotus-1-2-3",ez:"application/andrew-inset",aw:"application/applixware",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",bdoc:"application/x-bdoc",ccxml:"application/ccxml+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cu:"application/cu-seeme",mpd:"application/dash+xml",davmount:"application/davmount+xml",dbk:"application/docbook+xml",dssc:"application/dssc+der",xdssc:"application/dssc+xml",ecma:"application/ecmascript",emma:"application/emma+xml",epub:"application/epub+zip",exi:"application/exi",pfr:"application/font-tdpfr",woff:"application/font-woff",woff2:"application/font-woff2",geojson:"application/geo+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gxf:"application/gxf",stk:"application/hyperstudio",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",jar:"application/java-archive",war:"application/java-archive",ear:"application/java-archive",ser:"application/java-serialized-object",class:"application/java-vm",js:"application/javascript",json:"application/json",map:"application/json",json5:"application/json5",jsonml:"application/jsonml+json",jsonld:"application/ld+json",lostxml:"application/lost+xml",hqx:"application/mac-binhex40",cpt:"application/mac-compactpro",mads:"application/mads+xml",webmanifest:"application/manifest+json",mrc:"application/marc",mrcx:"application/marcxml+xml",ma:"application/mathematica",nb:"application/mathematica",mb:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mscml:"application/mediaservercontrol+xml",metalink:"application/metalink+xml",meta4:"application/metalink4+xml",mets:"application/mets+xml",mods:"application/mods+xml",m21:"application/mp21",mp21:"application/mp21",mp4s:"application/mp4",m4p:"application/mp4",doc:"application/msword",dot:"application/msword",mxf:"application/mxf",bin:"application/octet-stream",dms:"application/octet-stream",lrf:"application/octet-stream",mar:"application/octet-stream",so:"application/octet-stream",dist:"application/octet-stream",distz:"application/octet-stream",pkg:"application/octet-stream",bpk:"application/octet-stream",dump:"application/octet-stream",elc:"application/octet-stream",deploy:"application/octet-stream",exe:"application/x-msdownload",dll:"application/x-msdownload",deb:"application/x-debian-package",dmg:"application/x-apple-diskimage",iso:"application/x-iso9660-image",img:"application/octet-stream",msi:"application/x-msdownload",msp:"application/octet-stream",msm:"application/octet-stream",buffer:"application/octet-stream",oda:"application/oda",opf:"application/oebps-package+xml",ogx:"application/ogg",omdoc:"application/omdoc+xml",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",oxps:"application/oxps",xer:"application/patch-ops-error+xml",pdf:"application/pdf",pgp:"application/pgp-encrypted",asc:"application/pgp-signature",sig:"application/pgp-signature",prf:"application/pics-rules",p10:"application/pkcs10",p7m:"application/pkcs7-mime",p7c:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",ac:"application/pkix-attr-cert",cer:"application/pkix-cert",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",pki:"application/pkixcmp",pls:"application/pls+xml",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",cww:"application/prs.cww",pskcxml:"application/pskc+xml",rdf:"application/rdf+xml",rif:"application/reginfo+xml",rnc:"application/relax-ng-compact-syntax",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rs:"application/rls-services+xml",gbr:"application/rpki-ghostbusters",mft:"application/rpki-manifest",roa:"application/rpki-roa",rsd:"application/rsd+xml",rss:"application/rss+xml",rtf:"text/rtf",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",sdp:"application/sdp",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",shf:"application/shf+xml",smi:"application/smil+xml",smil:"application/smil+xml",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",sru:"application/sru+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",tfi:"application/thraud+xml",tsd:"application/timestamped-data",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap",pwn:"application/vnd.3m.post-it-notes",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",acutc:"application/vnd.acucorp",air:"application/vnd.adobe.air-application-installer-package+zip",fcdt:"application/vnd.adobe.formscentral.fcdt",fxp:"application/vnd.adobe.fxp",fxpl:"application/vnd.adobe.fxp",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",acc:"application/vnd.americandynamics.acc",ami:"application/vnd.amiga.ami",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",mpkg:"application/vnd.apple.installer+xml",m3u8:"application/vnd.apple.mpegurl",pkpass:"application/vnd.apple.pkpass",swi:"application/vnd.aristanetworks.swi",iota:"application/vnd.astraea-software.iota",aep:"application/vnd.audiograph",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",rep:"application/vnd.businessobjects",cdxml:"application/vnd.chemdraw+xml",mmd:"application/vnd.chipnuts.karaoke-mmd",cdy:"application/vnd.cinderella",cla:"application/vnd.claymore",rp9:"application/vnd.cloanto.rp9",c4g:"application/vnd.clonk.c4group",c4d:"application/vnd.clonk.c4group",c4f:"application/vnd.clonk.c4group",c4p:"application/vnd.clonk.c4group",c4u:"application/vnd.clonk.c4group",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",csp:"application/vnd.commonspace",cdbcmsg:"application/vnd.contact.cmsg",cmc:"application/vnd.cosmocaller",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",pml:"application/vnd.ctc-posml",ppd:"application/vnd.cups-ppd",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",dart:"application/vnd.dart",rdz:"application/vnd.data-vision.rdz",uvf:"application/vnd.dece.data",uvvf:"application/vnd.dece.data",uvd:"application/vnd.dece.data",uvvd:"application/vnd.dece.data",uvt:"application/vnd.dece.ttml+xml",uvvt:"application/vnd.dece.ttml+xml",uvx:"application/vnd.dece.unspecified",uvvx:"application/vnd.dece.unspecified",uvz:"application/vnd.dece.zip",uvvz:"application/vnd.dece.zip",fe_launch:"application/vnd.denovo.fcselayout-link",dna:"application/vnd.dna",mlp:"application/vnd.dolby.mlp",dpg:"application/vnd.dpgraph",dfac:"application/vnd.dreamfactory",kpxx:"application/vnd.ds-keypoint",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",geo:"application/vnd.dynageo",mag:"application/vnd.ecowin.chart",nml:"application/vnd.enliven",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",qam:"application/vnd.epson.quickanime",slt:"application/vnd.epson.salt",ssf:"application/vnd.epson.ssf",es3:"application/vnd.eszigno3+xml",et3:"application/vnd.eszigno3+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fdf:"application/vnd.fdf",mseed:"application/vnd.fdsn.mseed",seed:"application/vnd.fdsn.seed",dataless:"application/vnd.fdsn.seed",gph:"application/vnd.flographit",ftc:"application/vnd.fluxtime.clip",fm:"application/vnd.framemaker",frame:"application/vnd.framemaker",maker:"application/vnd.framemaker",book:"application/vnd.framemaker",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",fsc:"application/vnd.fsc.weblaunch",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",fzs:"application/vnd.fuzzysheet",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gex:"application/vnd.geometry-explorer",gre:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gmx:"application/vnd.gmx",gdoc:"application/vnd.google-apps.document",gslides:"application/vnd.google-apps.presentation",gsheet:"application/vnd.google-apps.spreadsheet",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gqs:"application/vnd.grafeq",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",hal:"application/vnd.hal+xml",zmm:"application/vnd.handheld-entertainment+xml",hbci:"application/vnd.hbci",les:"application/vnd.hhe.lesson-player",hpgl:"application/vnd.hp-hpgl",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",pclxl:"application/vnd.hp-pclxl","sfd-hdstx":"application/vnd.hydrostatix.sof-data",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",listafp:"application/vnd.ibm.modcap",list3820:"application/vnd.ibm.modcap",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",icc:"application/vnd.iccprofile",icm:"application/vnd.iccprofile",igl:"application/vnd.igloader",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",igm:"application/vnd.insors.igm",xpw:"application/vnd.intercon.formnet",xpx:"application/vnd.intercon.formnet",i2g:"application/vnd.intergeo",qbo:"application/vnd.intu.qbo",qfx:"application/vnd.intu.qfx",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",xpr:"application/vnd.is-xpr",fcs:"application/vnd.isac.fcs",jam:"application/vnd.jam",rms:"application/vnd.jcp.javame.midlet-rms",jisp:"application/vnd.jisp",joda:"application/vnd.joost.joda-archive",ktz:"application/vnd.kahootz",ktr:"application/vnd.kahootz",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",kpt:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",kwt:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",knp:"application/vnd.kinar",skp:"application/vnd.koan",skd:"application/vnd.koan",skt:"application/vnd.koan",skm:"application/vnd.koan",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",portpkg:"application/vnd.macports.portpkg",mcd:"application/vnd.mcd",mc1:"application/vnd.medcalcdata",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",mif:"application/vnd.mif",daf:"application/vnd.mobius.daf",dis:"application/vnd.mobius.dis",mbk:"application/vnd.mobius.mbk",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",plc:"application/vnd.mobius.plc",txf:"application/vnd.mobius.txf",mpn:"application/vnd.mophun.application",mpc:"application/vnd.mophun.certificate",xul:"application/vnd.mozilla.xul+xml",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",xls:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xla:"application/vnd.ms-excel",xlc:"application/vnd.ms-excel",xlt:"application/vnd.ms-excel",xlw:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",eot:"application/vnd.ms-fontobject",chm:"application/vnd.ms-htmlhelp",ims:"application/vnd.ms-ims",lrm:"application/vnd.ms-lrm",thmx:"application/vnd.ms-officetheme",cat:"application/vnd.ms-pki.seccat",stl:"application/vnd.ms-pki.stl",ppt:"application/vnd.ms-powerpoint",pps:"application/vnd.ms-powerpoint",pot:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",mpt:"application/vnd.ms-project",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wps:"application/vnd.ms-works",wks:"application/vnd.ms-works",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wpl:"application/vnd.ms-wpl",xps:"application/vnd.ms-xpsdocument",mseq:"application/vnd.mseq",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",taglet:"application/vnd.mynfc",nlu:"application/vnd.neurolanguage.nlu",ntf:"application/vnd.nitf",nitf:"application/vnd.nitf",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",oth:"application/vnd.oasis.opendocument.text-web",xo:"application/vnd.olpc-sugar",dd2:"application/vnd.oma.dd2+xml",oxt:"application/vnd.openofficeorg.extension",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",mgp:"application/vnd.osgeo.mapguide.package",dp:"application/vnd.osgi.dp",esa:"application/vnd.osgi.subsystem",pdb:"application/x-pilot",pqa:"application/vnd.palm",oprc:"application/vnd.palm",paw:"application/vnd.pawaafile",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",efif:"application/vnd.picsel",wg:"application/vnd.pmi.widget",plf:"application/vnd.pocketlearn",pbd:"application/vnd.powerbuilder6",box:"application/vnd.previewsystems.box",mgz:"application/vnd.proteus.magazine",qps:"application/vnd.publishare-delta-tree",ptid:"application/vnd.pvi.ptid1",qxd:"application/vnd.quark.quarkxpress",qxt:"application/vnd.quark.quarkxpress",qwd:"application/vnd.quark.quarkxpress",qwt:"application/vnd.quark.quarkxpress",qxl:"application/vnd.quark.quarkxpress",qxb:"application/vnd.quark.quarkxpress",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",cryptonote:"application/vnd.rig.cryptonote",cod:"application/vnd.rim.cod",rm:"application/vnd.rn-realmedia",rmvb:"application/vnd.rn-realmedia-vbr",link66:"application/vnd.route66.link66+xml",st:"application/vnd.sailingtracker.track",see:"application/vnd.seemail",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",twd:"application/vnd.simtech-mindmapper",twds:"application/vnd.simtech-mindmapper",mmf:"application/vnd.smaf",teacher:"application/vnd.smart.teacher",sdkm:"application/vnd.solent.sdkm+xml",sdkd:"application/vnd.solent.sdkm+xml",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",vor:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",smzip:"application/vnd.stepmania.package",sm:"application/vnd.stepmania.stepchart",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",sus:"application/vnd.sus-calendar",susp:"application/vnd.sus-calendar",svd:"application/vnd.svd",sis:"application/vnd.symbian.install",sisx:"application/vnd.symbian.install",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",tao:"application/vnd.tao.intent-module-archive",pcap:"application/vnd.tcpdump.pcap",cap:"application/vnd.tcpdump.pcap",dmp:"application/vnd.tcpdump.pcap",tmo:"application/vnd.tmobile-livetv",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",tra:"application/vnd.trueapp",ufd:"application/vnd.ufdl",ufdl:"application/vnd.ufdl",utz:"application/vnd.uiq.theme",umj:"application/vnd.umajin",unityweb:"application/vnd.unity",uoml:"application/vnd.uoml+xml",vcx:"application/vnd.vcx",vsd:"application/vnd.visio",vst:"application/vnd.visio",vss:"application/vnd.visio",vsw:"application/vnd.visio",vis:"application/vnd.visionary",vsf:"application/vnd.vsf",wbxml:"application/vnd.wap.wbxml",wmlc:"application/vnd.wap.wmlc",wmlsc:"application/vnd.wap.wmlscriptc",wtb:"application/vnd.webturbo",nbp:"application/vnd.wolfram.player",wpd:"application/vnd.wordperfect",wqd:"application/vnd.wqd",stf:"application/vnd.wt.stf",xar:"application/vnd.xara",xfdl:"application/vnd.xfdl",hvd:"application/vnd.yamaha.hv-dic",hvs:"application/vnd.yamaha.hv-script",hvp:"application/vnd.yamaha.hv-voice",osf:"application/vnd.yamaha.openscoreformat",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",saf:"application/vnd.yamaha.smaf-audio",spf:"application/vnd.yamaha.smaf-phrase",cmp:"application/vnd.yellowriver-custom-menu",zir:"application/vnd.zul",zirz:"application/vnd.zul",zaz:"application/vnd.zzazz.deck+xml",vxml:"application/voicexml+xml",wgt:"application/widget",hlp:"application/winhlp",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",aab:"application/x-authorware-bin",x32:"application/x-authorware-bin",u32:"application/x-authorware-bin",vox:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",bcpio:"application/x-bcpio",torrent:"application/x-bittorrent",blb:"application/x-blorb",blorb:"application/x-blorb",bz:"application/x-bzip",bz2:"application/x-bzip2",boz:"application/x-bzip2",cbr:"application/x-cbr",cba:"application/x-cbr",cbt:"application/x-cbr",cbz:"application/x-cbr",cb7:"application/x-cbr",vcd:"application/x-cdlink",cfs:"application/x-cfs-compressed",chat:"application/x-chat",pgn:"application/x-chess-pgn",crx:"application/x-chrome-extension",cco:"application/x-cocoa",nsc:"application/x-conference",cpio:"application/x-cpio",csh:"application/x-csh",udeb:"application/x-debian-package",dgc:"application/x-dgc-compressed",dir:"application/x-director",dcr:"application/x-director",dxr:"application/x-director",cst:"application/x-director",cct:"application/x-director",cxt:"application/x-director",w3d:"application/x-director",fgd:"application/x-director",swa:"application/x-director",wad:"application/x-doom",ncx:"application/x-dtbncx+xml",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",dvi:"application/x-dvi",evy:"application/x-envoy",eva:"application/x-eva",bdf:"application/x-font-bdf",gsf:"application/x-font-ghostscript",psf:"application/x-font-linux-psf",otf:"font/opentype",pcf:"application/x-font-pcf",snf:"application/x-font-snf",ttf:"application/x-font-ttf",ttc:"application/x-font-ttf",pfa:"application/x-font-type1",pfb:"application/x-font-type1",pfm:"application/x-font-type1",afm:"application/x-font-type1",arc:"application/x-freearc",spl:"application/x-futuresplash",gca:"application/x-gca-compressed",ulx:"application/x-glulx",gnumeric:"application/x-gnumeric",gramps:"application/x-gramps-xml",gtar:"application/x-gtar",hdf:"application/x-hdf",php:"application/x-httpd-php",install:"application/x-install-instructions",jardiff:"application/x-java-archive-diff",jnlp:"application/x-java-jnlp-file",latex:"application/x-latex",luac:"application/x-lua-bytecode",lzh:"application/x-lzh-compressed",lha:"application/x-lzh-compressed",run:"application/x-makeself",mie:"application/x-mie",prc:"application/x-pilot",mobi:"application/x-mobipocket-ebook",application:"application/x-ms-application",lnk:"application/x-ms-shortcut",wmd:"application/x-ms-wmd",wmz:"application/x-msmetafile",xbap:"application/x-ms-xbap",mdb:"application/x-msaccess",obd:"application/x-msbinder",crd:"application/x-mscardfile",clp:"application/x-msclip",com:"application/x-msdownload",bat:"application/x-msdownload",mvb:"application/x-msmediaview",m13:"application/x-msmediaview",m14:"application/x-msmediaview",wmf:"application/x-msmetafile",emf:"application/x-msmetafile",emz:"application/x-msmetafile",mny:"application/x-msmoney",pub:"application/x-mspublisher",scd:"application/x-msschedule",trm:"application/x-msterminal",wri:"application/x-mswrite",nc:"application/x-netcdf",cdf:"application/x-netcdf",pac:"application/x-ns-proxy-autoconfig",nzb:"application/x-nzb",pl:"application/x-perl",pm:"application/x-perl",p12:"application/x-pkcs12",pfx:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",spc:"application/x-pkcs7-certificates",p7r:"application/x-pkcs7-certreqresp",rar:"application/x-rar-compressed",rpm:"application/x-redhat-package-manager",ris:"application/x-research-info-systems",sea:"application/x-sea",sh:"application/x-sh",shar:"application/x-shar",swf:"application/x-shockwave-flash",xap:"application/x-silverlight-app",sql:"application/x-sql",sit:"application/x-stuffit",sitx:"application/x-stuffitx",srt:"application/x-subrip",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",t3:"application/x-t3vm-image",gam:"application/x-tads",tar:"application/x-tar",tcl:"application/x-tcl",tk:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",texinfo:"application/x-texinfo",texi:"application/x-texinfo",obj:"application/x-tgif",ustar:"application/x-ustar",src:"application/x-wais-source",webapp:"application/x-web-app-manifest+json",der:"application/x-x509-ca-cert",crt:"application/x-x509-ca-cert",pem:"application/x-x509-ca-cert",fig:"application/x-xfig",xlf:"application/x-xliff+xml",xpi:"application/x-xpinstall",xz:"application/x-xz",z1:"application/x-zmachine",z2:"application/x-zmachine",z3:"application/x-zmachine",z4:"application/x-zmachine",z5:"application/x-zmachine",z6:"application/x-zmachine",z7:"application/x-zmachine",z8:"application/x-zmachine",xaml:"application/xaml+xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xhtml:"application/xhtml+xml",xht:"application/xhtml+xml",xml:"text/xml",xsl:"application/xml",xsd:"application/xml",rng:"application/xml",dtd:"application/xml-dtd",xop:"application/xop+xml",xpl:"application/xproc+xml",xslt:"application/xslt+xml",xspf:"application/xspf+xml",mxml:"application/xv+xml",xhvml:"application/xv+xml",xvml:"application/xv+xml",xvm:"application/xv+xml",yang:"application/yang",yin:"application/yin+xml",zip:"application/zip","3gpp":"video/3gpp",adp:"audio/adpcm",au:"audio/basic",snd:"audio/basic",mid:"audio/midi",midi:"audio/midi",kar:"audio/midi",rmi:"audio/midi",mp3:"audio/mpeg",m4a:"audio/x-m4a",mp4a:"audio/mp4",mpga:"audio/mpeg",mp2:"audio/mpeg",mp2a:"audio/mpeg",m2a:"audio/mpeg",m3a:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",spx:"audio/ogg",s3m:"audio/s3m",sil:"audio/silk",uva:"audio/vnd.dece.audio",uvva:"audio/vnd.dece.audio",eol:"audio/vnd.digital-winds",dra:"audio/vnd.dra",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",lvp:"audio/vnd.lucent.voice",pya:"audio/vnd.ms-playready.media.pya",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",rip:"audio/vnd.rip",wav:"audio/x-wav",weba:"audio/webm",aac:"audio/x-aac",aif:"audio/x-aiff",aiff:"audio/x-aiff",aifc:"audio/x-aiff",caf:"audio/x-caf",flac:"audio/x-flac",mka:"audio/x-matroska",m3u:"audio/x-mpegurl",wax:"audio/x-ms-wax",wma:"audio/x-ms-wma",ram:"audio/x-pn-realaudio",ra:"audio/x-realaudio",rmp:"audio/x-pn-realaudio-plugin",xm:"audio/xm",cdx:"chemical/x-cdx",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cml:"chemical/x-cml",csml:"chemical/x-csml",xyz:"chemical/x-xyz",bmp:"image/x-ms-bmp",cgm:"image/cgm",g3:"image/g3fax",gif:"image/gif",ief:"image/ief",jpeg:"image/jpeg",jpg:"image/jpeg",jpe:"image/jpeg",ktx:"image/ktx",png:"image/png",btif:"image/prs.btif",sgi:"image/sgi",svg:"image/svg+xml",svgz:"image/svg+xml",tiff:"image/tiff",tif:"image/tiff",psd:"image/vnd.adobe.photoshop",uvi:"image/vnd.dece.graphic",uvvi:"image/vnd.dece.graphic",uvg:"image/vnd.dece.graphic",uvvg:"image/vnd.dece.graphic",djvu:"image/vnd.djvu",djv:"image/vnd.djvu",sub:"text/vnd.dvb.subtitle",dwg:"image/vnd.dwg",dxf:"image/vnd.dxf",fbs:"image/vnd.fastbidsheet",fpx:"image/vnd.fpx",fst:"image/vnd.fst",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",mdi:"image/vnd.ms-modi",wdp:"image/vnd.ms-photo",npx:"image/vnd.net-fpx",wbmp:"image/vnd.wap.wbmp",xif:"image/vnd.xiff",webp:"image/webp","3ds":"image/x-3ds",ras:"image/x-cmu-raster",cmx:"image/x-cmx",fh:"image/x-freehand",fhc:"image/x-freehand",fh4:"image/x-freehand",fh5:"image/x-freehand",fh7:"image/x-freehand",ico:"image/x-icon",jng:"image/x-jng",sid:"image/x-mrsid-image",pcx:"image/x-pcx",pic:"image/x-pict",pct:"image/x-pict",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pgm:"image/x-portable-graymap",ppm:"image/x-portable-pixmap",rgb:"image/x-rgb",tga:"image/x-tga",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",eml:"message/rfc822",mime:"message/rfc822",igs:"model/iges",iges:"model/iges",msh:"model/mesh",mesh:"model/mesh",silo:"model/mesh",dae:"model/vnd.collada+xml",dwf:"model/vnd.dwf",gdl:"model/vnd.gdl",gtw:"model/vnd.gtw",mts:"model/vnd.mts",vtu:"model/vnd.vtu",wrl:"model/vrml",vrml:"model/vrml",x3db:"model/x3d+binary",x3dbz:"model/x3d+binary",x3dv:"model/x3d+vrml",x3dvz:"model/x3d+vrml",x3d:"model/x3d+xml",x3dz:"model/x3d+xml",appcache:"text/cache-manifest",manifest:"text/cache-manifest",ics:"text/calendar",ifb:"text/calendar",coffee:"text/coffeescript",litcoffee:"text/coffeescript",css:"text/css",csv:"text/csv",hjson:"text/hjson",html:"text/html",htm:"text/html",shtml:"text/html",jade:"text/jade",jsx:"text/jsx",less:"text/less",mml:"text/mathml",n3:"text/n3",txt:"text/plain",text:"text/plain",conf:"text/plain",def:"text/plain",list:"text/plain",log:"text/plain",in:"text/plain",ini:"text/plain",dsc:"text/prs.lines.tag",rtx:"text/richtext",sgml:"text/sgml",sgm:"text/sgml",slim:"text/slim",slm:"text/slim",stylus:"text/stylus",styl:"text/stylus",tsv:"text/tab-separated-values",t:"text/troff",tr:"text/troff",roff:"text/troff",man:"text/troff",me:"text/troff",ms:"text/troff",ttl:"text/turtle",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",fly:"text/vnd.fly",flx:"text/vnd.fmi.flexstor",gv:"text/vnd.graphviz","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",jad:"text/vnd.sun.j2me.app-descriptor",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",vtt:"text/vtt",s:"text/x-asm",asm:"text/x-asm",c:"text/x-c",cc:"text/x-c",cxx:"text/x-c",cpp:"text/x-c",h:"text/x-c",hh:"text/x-c",dic:"text/x-c",htc:"text/x-component",f:"text/x-fortran",for:"text/x-fortran",f77:"text/x-fortran",f90:"text/x-fortran",hbs:"text/x-handlebars-template",java:"text/x-java-source",lua:"text/x-lua",markdown:"text/x-markdown",md:"text/x-markdown",mkd:"text/x-markdown",nfo:"text/x-nfo",opml:"text/x-opml",p:"text/x-pascal",pas:"text/x-pascal",pde:"text/x-processing",sass:"text/x-sass",scss:"text/x-scss",etx:"text/x-setext",sfv:"text/x-sfv",ymp:"text/x-suse-ymp",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",yaml:"text/yaml",yml:"text/yaml","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",jpgv:"video/jpeg",jpm:"video/jpm",jpgm:"video/jpm",mj2:"video/mj2",mjp2:"video/mj2",ts:"video/mp2t",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg",ogv:"video/ogg",qt:"video/quicktime",mov:"video/quicktime",uvh:"video/vnd.dece.hd",uvvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvvm:"video/vnd.dece.mobile",uvp:"video/vnd.dece.pd",uvvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",uvvv:"video/vnd.dece.video",dvb:"video/vnd.dvb.file",fvt:"video/vnd.fvt",mxu:"video/vnd.mpegurl",m4u:"video/vnd.mpegurl",pyv:"video/vnd.ms-playready.media.pyv",uvu:"video/vnd.uvvu.mp4",uvvu:"video/vnd.uvvu.mp4",viv:"video/vnd.vivo",webm:"video/webm",f4v:"video/x-f4v",fli:"video/x-fli",flv:"video/x-flv",m4v:"video/x-m4v",mkv:"video/x-matroska",mk3d:"video/x-matroska",mks:"video/x-matroska",mng:"video/x-mng",asf:"video/x-ms-asf",asx:"video/x-ms-asf",vob:"video/x-ms-vob",wm:"video/x-ms-wm",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wvx:"video/x-ms-wvx",avi:"video/x-msvideo",movie:"video/x-sgi-movie",smv:"video/x-smv",ice:"x-conference/x-cooltalk"}},function(t,e,n){(function(e,i,s){function r(t,e){return a.fetch&&e?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&t?"arraybuffer":a.vbArray&&t?"text:vbarray":"text"}function o(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}var a=n(66),c=n(13),u=n(105),l=n(25),h=n(107),p=u.IncomingMessage,d=u.readyStates,f=t.exports=function(t){var n=this;l.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+new e(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){n.setHeader(e,t.headers[e])});var i,s=!0;if("disable-fetch"===t.mode||"timeout"in t)s=!1,i=!0;else if("prefer-streaming"===t.mode)i=!1;else if("allow-wrong-content-type"===t.mode)i=!a.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");i=!0}n._mode=r(i,s),n.on("finish",function(){n._onFinish()})};c(f,l.Writable),f.prototype.setHeader=function(t,e){var n=this,i=t.toLowerCase();-1===m.indexOf(i)&&(n._headers[i]={name:t,value:e})},f.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},f.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},f.prototype._onFinish=function(){var t=this;if(!t._destroyed){var n=t._opts,r=t._headers,o=null;"GET"!==n.method&&"HEAD"!==n.method&&(o=a.blobConstructor?new i.Blob(t._body.map(function(t){return h(t)}),{type:(r["content-type"]||{}).value||""}):e.concat(t._body).toString());var c=[];if(Object.keys(r).forEach(function(t){var e=r[t].name,n=r[t].value;Array.isArray(n)?n.forEach(function(t){c.push([e,t])}):c.push([e,n])}),"fetch"===t._mode)i.fetch(t._opts.url,{method:t._opts.method,headers:c,body:o||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin"}).then(function(e){t._fetchResponse=e,t._connect()},function(e){t.emit("error",e)});else{var u=t._xhr=new i.XMLHttpRequest;try{u.open(t._opts.method,t._opts.url,!0)}catch(e){return void s.nextTick(function(){t.emit("error",e)})}"responseType"in u&&(u.responseType=t._mode.split(":")[0]),"withCredentials"in u&&(u.withCredentials=!!n.withCredentials),"text"===t._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"timeout"in n&&(u.timeout=n.timeout,u.ontimeout=function(){t.emit("timeout")}),c.forEach(function(t){u.setRequestHeader(t[0],t[1])}),t._response=null,u.onreadystatechange=function(){switch(u.readyState){case d.LOADING:case d.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(u.onprogress=function(){t._onXHRProgress()}),u.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{u.send(o)}catch(e){return void s.nextTick(function(){t.emit("error",e)})}}}},f.prototype._onXHRProgress=function(){var t=this;o(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress())},f.prototype._connect=function(){var t=this;t._destroyed||(t._response=new p(t._xhr,t._fetchResponse,t._mode),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},f.prototype._write=function(t,e,n){this._body.push(t),n()},f.prototype.abort=f.prototype.destroy=function(){var t=this;t._destroyed=!0,t._response&&(t._response._destroyed=!0),t._xhr&&t._xhr.abort()},f.prototype.end=function(t,e,n){var i=this;"function"==typeof t&&(n=t,t=void 0),l.Writable.prototype.end.call(i,t,e,n)},f.prototype.flushHeaders=function(){},f.prototype.setTimeout=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var m=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(e,n(6).Buffer,n(12),n(9))},function(t,e,n){(function(t,i,s){var r=n(66),o=n(13),a=n(25),c=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(e,n,s){function o(){u.read().then(function(t){if(!c._destroyed){if(t.done)return void c.push(null);c.push(new i(t.value)),o()}}).catch(function(t){c.emit("error",t)})}var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){t.nextTick(function(){c.emit("close")})}),"fetch"===s){c._fetchResponse=n,c.url=n.url,c.statusCode=n.status,c.statusMessage=n.statusText,n.headers.forEach(function(t,e){c.headers[e.toLowerCase()]=t,c.rawHeaders.push(e,t)});var u=n.body.getReader();o()}else{c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText;if(e.getAllResponseHeaders().split(/\r?\n/).forEach(function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var n=e[1].toLowerCase();"set-cookie"===n?(void 0===c.headers[n]&&(c.headers[n]=[]),c.headers[n].push(e[2])):void 0!==c.headers[n]?c.headers[n]+=", "+e[2]:c.headers[n]=e[2],c.rawHeaders.push(e[1],e[2])}}),c._charset="x-user-defined",!r.overrideMimeType){var l=c.rawHeaders["mime-type"];if(l){var h=l.match(/;\s*charset=([^;])(;|$)/);h&&(c._charset=h[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};o(u,a.Readable),u.prototype._read=function(){},u.prototype._onXHRProgress=function(){var t=this,e=t._xhr,n=null;switch(t._mode){case"text:vbarray":if(e.readyState!==c.DONE)break;try{n=new s.VBArray(e.responseBody).toArray()}catch(t){}if(null!==n){t.push(new i(n));break}case"text":try{n=e.responseText}catch(e){t._mode="text:vbarray";break}if(n.length>t._pos){var r=n.substr(t._pos);if("x-user-defined"===t._charset){for(var o=new i(r.length),a=0;at._pos&&(t.push(new i(new Uint8Array(u.result.slice(t._pos)))),t._pos=u.result.byteLength)},u.onload=function(){t.push(null)},u.readAsArrayBuffer(n)}t._xhr.readyState===c.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(e,n(9),n(6).Buffer,n(12))},function(t,e,n){function i(t,e){this._id=t,this._clearFn=e}var s=Function.prototype.apply;e.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(97),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,n){var i=n(6).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(i.isBuffer(t)){for(var e=new Uint8Array(t.length),n=t.length,s=0;sn(new Error("INVALID_TOKEN")),3e5);this.client.api.gateway.get().then(o=>{const a=i.DefaultOptions.ws.version;const c=`${o.url}/?v=${a}&encoding=${s.ENCODING}`;this.client.emit(i.Events.DEBUG,`Using gateway ${c}`);this.client.ws.connect(c);this.client.ws.connection.once("close",t=>{4004===t.code&&n(new Error("TOKEN_INVALID"));4010===t.code&&n(new Error("SHARDING_INVALID"));4011===t.code&&n(new Error("SHARDING_REQUIRED"))});this.client.once(i.Events.READY,()=>{e(t);this.client.clearTimeout(r)})},n)}destroy(){return this.client.ws.destroy(),this.client.rest.destroy(),this.client.user?this.client.user.bot?(this.client.token=null,Promise.resolve()):this.client.api.logout.post().then(()=>{this.client.token=null}):Promise.resolve()}}t.exports=r},function(t,e,n){class i{constructor(t){this.client=t,this.register(n(134)),this.register(n(135)),this.register(n(136)),this.register(n(140)),this.register(n(137)),this.register(n(138)),this.register(n(139)),this.register(n(116)),this.register(n(117)),this.register(n(118)),this.register(n(121)),this.register(n(133)),this.register(n(126)),this.register(n(127)),this.register(n(119)),this.register(n(128)),this.register(n(129)),this.register(n(130)),this.register(n(141)),this.register(n(143)),this.register(n(142)),this.register(n(132)),this.register(n(122)),this.register(n(123)),this.register(n(124)),this.register(n(125)),this.register(n(131)),this.register(n(120))}register(t){this[t.name.replace(/Action$/,"")]=new t(this.client)}}t.exports=i},function(t,e,n){const i=n(2);class s extends i{handle(t){return{channel:this.client.channels.create(t)}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.channels.get(t.id);return n?(e.channels.remove(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)):n=this.deleted.get(t.id)||null,{channel:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.channels.get(t.id);if(n){const i=n._update(t);return e.emit(s.Events.CHANNEL_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id),i=e.users.create(t.user);n&&i&&e.emit(s.Events.GUILD_BAN_REMOVE,n,i)}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n)for(const e of t.channels){const t=n.channels.get(e.id);t&&(t.position=e.position)}return{guild:n}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.guilds.get(t.id);if(n){for(const t of n.channels.values())"text"===t.type&&t.stopTyping(!0);if(n.available&&t.unavailable)return n.available=!1,e.emit(s.Events.GUILD_UNAVAILABLE,n),{guild:null};e.guilds.delete(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)}else n=this.deleted.get(t.id)||null;return{guild:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t,e){return{emoji:t.emojis.create(e)}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){return t.guild.emojis.remove(t.id),{emoji:t}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t,e){const n=t._update(e);return this.client.emit(s.Events.GUILD_EMOJI_UPDATE,n,t),{emoji:t}}}t.exports=r},function(t,e,n){function i(t){const e=new Map;for(const n of t)e.set(...n);return e}const s=n(2);class r extends s{handle(t){const e=this.client.guilds.get(t.guild_id);if(e&&e.emojis){const n=i(e.emojis.entries());for(const i of t.emojis){const t=e.emojis.get(i.id);t?(n.delete(i.id),t.equals(i,!0)||this.client.actions.GuildEmojiUpdate.handle(t,i)):this.client.actions.GuildEmojiCreate.handle(e,i)}for(const t of n.values())this.client.actions.GuildEmojiDelete.handle(t)}}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t,e){return{member:t._addMember(e,!1)}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);let i=null;return n&&(i=n.members.get(t.user.id),i?(n.memberCount--,n._removeMember(i),this.deleted.set(n.id+t.user.id,i),e.status===s.Status.READY&&e.emit(s.Events.GUILD_MEMBER_REMOVE,i),this.scheduleForDeletion(n.id,t.user.id)):i=this.deleted.get(n.id+t.user.id)||null),{guild:n,member:i}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(22);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);let i;if(n){const o=n.roles.has(t.role.id);i=new r(n,t.role),n.roles.set(i.id,i),o||e.emit(s.Events.GUILD_ROLE_CREATE,i)}return{role:i}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);let i;return n&&(i=n.roles.get(t.role_id),i?(n.roles.delete(t.role_id),this.deleted.set(n.id+t.role_id,i),this.scheduleForDeletion(n.id,t.role_id),e.emit(s.Events.GUILD_ROLE_DELETE,i)):i=this.deleted.get(n.id+t.role_id)||null),{role:i}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){let i=null;const r=n.roles.get(t.role.id);return r&&(i=r._update(t.role),e.emit(s.Events.GUILD_ROLE_UPDATE,i,r)),{old:i,updated:r}}return{old:null,updated:null}}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n)for(const e of t.roles){const t=n.roles.get(e.id);t&&(t.position=e.position)}return{guild:n}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){if(t.presences)for(const e of t.presences)n._setPresence(e.user.id,e);if(t.members)for(const e of t.members){const t=n.members.get(e.user.id);t?n._updateMember(t,e):n._addMember(e,!1)}"large"in t&&(n.large=t.large)}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){const i=n._update(t);return e.emit(s.Events.GUILD_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=r},function(t,e,n){const i=n(2),s=n(10);class r extends i{handle(t){const e=this.client,n=e.channels.get((t instanceof Array?t[0]:t).channel_id),i=e.users.get((t instanceof Array?t[0]:t).author.id);if(n){const r=n.guild?n.guild.member(i):null;if(t instanceof Array){const o=new Array(t.length);for(let i=0;ithis.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(3),r=n(0);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id),i=t.ids,o=new s;for(const t of i){const e=n.messages.get(t);e&&o.set(e.id,e)}return o.size>0&&e.emit(r.Events.MESSAGE_BULK_DELETE,o),{messages:o}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._addReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_ADD,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._removeReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_REMOVE,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.channels.get(t.channel_id);if(!e||"voice"===e.type)return!1;const n=e.messages.get(t.message_id);return!!n&&(n._clearReactions(),this.client.emit(s.Events.MESSAGE_REACTION_REMOVE_ALL,n),{message:n})}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id);if(n){const i=n.messages.get(t.id);return i?(i.patch(t),e.emit(s.Events.MESSAGE_UPDATE,i._edits[0],i),{old:i._edits[0],updated:i}):{old:i,updated:i}}return{old:null,updated:null}}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t){return{user:this.client.users.create(t)}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.user.notes.get(t.id),i=t.note.length?t.note:null;return e.user.notes.set(t.id,i),e.emit(s.Events.USER_NOTE_UPDATE,t.id,n,i),{old:n,updated:i}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client;if(e.user){if(e.user.equals(t))return{old:e.user,updated:e.user};const n=r.cloneObject(e.user);return e.user.patch(t),e.emit(s.Events.USER_UPDATE,n,e.user),{old:n,updated:e.user}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(38),s=n(41),{Error:Error}=n(5);class r{constructor(t,e,n,i){this.rest=t,this.client=t.client,this.method=e,this.path=n.toString(),this.route=this.getRoute(this.path),this.options=i}getRoute(t){let e=t.split("?")[0];if(e.includes("/channels/")||e.includes("/guilds/")){const t=e.includes("/channels/")?e.indexOf("/channels/"):e.indexOf("/guilds/"),n=e.substring(t).split("/")[2];e=e.replace(/(\d{8,})/g,":id").replace(":id",n)}return e}getAuth(){if(this.client.token&&this.client.user&&this.client.user.bot)return`Bot ${this.client.token}`;if(this.client.token)return this.client.token;throw new Error("TOKEN_MISSING")}gen(){const t=`${this.client.options.http.host}/api/v${this.client.options.http.version}`;if(this.options.query){const t=(i.stringify(this.options.query).match(/[^=&?]+=[^=&?]+/g)||[]).join("&");this.path+=`?${t}`}const e=s[this.method](`${t}${this.path}`);if(!1!==this.options.auth&&e.set("Authorization",this.getAuth()),this.options.reason&&e.set("X-Audit-Log-Reason",encodeURIComponent(this.options.reason)),this.rest.client.browser||e.set("User-Agent",this.rest.userAgentManager.userAgent),this.options.files){for(const t of this.options.files)t&&t.file&&e.attach(t.name,t.file,t.name);void 0!==this.options.data&&e.attach("payload_json",JSON.stringify(this.options.data))}else void 0!==this.options.data&&e.send(this.options.data);return e}}t.exports=r},function(t,e,n){const i=n(42),s=["get","post","delete","patch","put"],r=["channels","users","guilds","members","bans","emojis","pins","permissions","reactions","webhooks","messages","notes","roles","applications","invites","bot"],o=["toString","valueOf","inspect",Symbol.toPrimitive,i.inspect.custom];t.exports=(t=>{const e={get(n,i){function a(...t){n=n.concat(i);for(const e of t)null!==e&&void 0!==e&&(n=n.concat(e));return new Proxy(n,e)}if(o.includes(i))return()=>n.join("/");if(r.includes(i)){const e=()=>`${n.join("/")}/${i}`;for(const t of o)a[t]=e;for(const e of s)a[e]=(s=>t.request(e,`${n.join("/")}/${i}`,s));return a}return s.includes(i)?e=>t.request(i,n.join("/"),e):new Proxy(n.concat(i),e)}};return new Proxy([""],e)})},function(t,e,n){const i=n(72),s=n(70);class r extends i{constructor(t,e){super(t,e),this.client=t.client,this.limit=1/0,this.resetTime=null,this.remaining=1,this.timeDifference=0,this.resetTimeout=null}push(t){super.push(t),this.handle()}execute(t){t&&t.request.gen().end((e,n)=>{n&&n.headers&&(this.limit=Number(n.headers["x-ratelimit-limit"]),this.resetTime=1e3*Number(n.headers["x-ratelimit-reset"]),this.remaining=Number(n.headers["x-ratelimit-remaining"]),this.timeDifference=Date.now()-new Date(n.headers.date).getTime());if(e)if(429===e.status){if(this.queue.unshift(t),n.headers["x-ratelimit-global"]&&(this.globalLimit=!0),this.resetTimeout)return;this.resetTimeout=this.client.setTimeout(()=>{this.remaining=this.limit;this.globalLimit=!1;this.handle();this.resetTimeout=null},Number(n.headers["retry-after"])+this.client.options.restTimeOffset)}else t.reject(400===e.status?new s(n.body):e),this.handle();else{this.globalLimit=!1;const e=n&&n.body?n.body:{};t.resolve(e),this.handle()}})}handle(){super.handle(),this.remaining<=0||0===this.queue.length||this.globalLimit||(this.execute(this.queue.shift()),this.remaining--,this.handle())}}t.exports=r},function(t,e,n){const i=n(72),s=n(70);class r extends i{constructor(t,e){super(t,e),this.endpoint=e,this.timeDifference=0,this.busy=!1}push(t){super.push(t),this.handle()}execute(t){return this.busy=!0,new Promise(e=>{t.request.gen().end((n,i)=>{i&&i.headers&&(this.requestLimit=Number(i.headers["x-ratelimit-limit"]),this.requestResetTime=1e3*Number(i.headers["x-ratelimit-reset"]),this.requestRemaining=Number(i.headers["x-ratelimit-remaining"]),this.timeDifference=Date.now()-new Date(i.headers.date).getTime());if(n)429===n.status?(this.queue.unshift(t),this.restManager.client.setTimeout(()=>{this.globalLimit=!1;e()},Number(i.headers["retry-after"])+this.restManager.client.options.restTimeOffset),i.headers["x-ratelimit-global"]&&(this.globalLimit=!0)):(t.reject(n.status>=400&&n.status<500?new s(i.body):n),e(n));else{this.globalLimit=!1;const n=i&&i.body?i.body:{};t.resolve(n),0===this.requestRemaining?this.restManager.client.setTimeout(()=>e(n),this.requestResetTime-Date.now()+this.timeDifference+this.restManager.client.options.restTimeOffset):e(n)}})})}handle(){super.handle(),this.busy||0===this.remaining||0===this.queue.length||this.globalLimit||this.execute(this.queue.shift()).then(()=>{this.busy=!1;this.handle()})}}t.exports=r},function(t,e,n){(function(e){const i=n(0);class s{constructor(){this.build(this.constructor.DEFAULT)}set({url:url,version:version}={}){this.build({url:url||this.constructor.DFEAULT.url,version:version||this.constructor.DEFAULT.version})}build(t){this.userAgent=`DiscordBot (${t.url}, ${t.version}) Node.js/${e.version}`}}s.DEFAULT={url:i.Package.homepage.split("#")[0],version:i.Package.version},t.exports=s}).call(e,n(9))},function(t,e,n){const i=n(15).EventEmitter,s=n(0),r=n(73);class o extends i{constructor(t){super(),this.client=t,this.connection=null}heartbeat(){return this.connection?this.connection.heartbeat():this.debug("No connection to heartbeat")}debug(t){return this.client.emit("debug",`[ws] ${t}`)}destroy(){return this.connection?this.connection.destroy():(this.debug("Attempted to destroy WebSocket but no connection exists!"),!1)}send(t){if(!this.connection)return void this.debug("No connection to websocket");this.connection.send(t)}connect(t){if(!this.connection)return this.connection=new r(this,t),!0;switch(this.connection.status){case s.Status.IDLE:case s.Status.DISCONNECTED:return this.connection.connect(t,5500),!0;default:return this.debug(`Couldn't connect to ${t} as the websocket is at state ${this.connection.status}`),!1}}}t.exports=o},function(t,e,n){const i=n(0),s=[i.WSEvents.READY,i.WSEvents.RESUMED,i.WSEvents.GUILD_CREATE,i.WSEvents.GUILD_DELETE,i.WSEvents.GUILD_MEMBERS_CHUNK,i.WSEvents.GUILD_MEMBER_ADD,i.WSEvents.GUILD_MEMBER_REMOVE];class r{constructor(t){this.ws=t,this.handlers={},this.queue=[],this.register(i.WSEvents.READY,n(177)),this.register(i.WSEvents.RESUMED,n(180)),this.register(i.WSEvents.GUILD_CREATE,n(157)),this.register(i.WSEvents.GUILD_DELETE,n(158)),this.register(i.WSEvents.GUILD_UPDATE,n(168)),this.register(i.WSEvents.GUILD_BAN_ADD,n(155)),this.register(i.WSEvents.GUILD_BAN_REMOVE,n(156)),this.register(i.WSEvents.GUILD_MEMBER_ADD,n(160)),this.register(i.WSEvents.GUILD_MEMBER_REMOVE,n(161)),this.register(i.WSEvents.GUILD_MEMBER_UPDATE,n(162)),this.register(i.WSEvents.GUILD_ROLE_CREATE,n(164)),this.register(i.WSEvents.GUILD_ROLE_DELETE,n(165)),this.register(i.WSEvents.GUILD_ROLE_UPDATE,n(166)),this.register(i.WSEvents.GUILD_EMOJIS_UPDATE,n(159)),this.register(i.WSEvents.GUILD_MEMBERS_CHUNK,n(163)),this.register(i.WSEvents.CHANNEL_CREATE,n(151)),this.register(i.WSEvents.CHANNEL_DELETE,n(152)),this.register(i.WSEvents.CHANNEL_UPDATE,n(154)),this.register(i.WSEvents.CHANNEL_PINS_UPDATE,n(153)),this.register(i.WSEvents.PRESENCE_UPDATE,n(176)),this.register(i.WSEvents.USER_UPDATE,n(184)),this.register(i.WSEvents.USER_NOTE_UPDATE,n(182)),this.register(i.WSEvents.USER_SETTINGS_UPDATE,n(183)),this.register(i.WSEvents.VOICE_STATE_UPDATE,n(186)),this.register(i.WSEvents.TYPING_START,n(181)),this.register(i.WSEvents.MESSAGE_CREATE,n(169)),this.register(i.WSEvents.MESSAGE_DELETE,n(170)),this.register(i.WSEvents.MESSAGE_UPDATE,n(175)),this.register(i.WSEvents.MESSAGE_DELETE_BULK,n(171)),this.register(i.WSEvents.VOICE_SERVER_UPDATE,n(185)),this.register(i.WSEvents.GUILD_SYNC,n(167)),this.register(i.WSEvents.RELATIONSHIP_ADD,n(178)),this.register(i.WSEvents.RELATIONSHIP_REMOVE,n(179)),this.register(i.WSEvents.MESSAGE_REACTION_ADD,n(172)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE,n(173)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE_ALL,n(174))}get client(){return this.ws.client}register(t,e){this.handlers[t]=new e(this)}handleQueue(){this.queue.forEach((t,e)=>{this.handle(this.queue[e],!0);this.queue.splice(e,1)})}handle(t,e=!1){return t.op===i.OPCodes.HEARTBEAT_ACK?(this.ws.client._pong(this.ws.client._pingTimestamp),this.ws.lastHeartbeatAck=!0,this.ws.client.emit("debug","Heartbeat acknowledged")):t.op===i.OPCodes.HEARTBEAT&&(this.client.ws.send({op:i.OPCodes.HEARTBEAT,d:this.client.ws.sequence}),this.ws.client.emit("debug","Received gateway heartbeat")),this.ws.status===i.Status.RECONNECTING&&(this.ws.reconnecting=!1,this.ws.checkIfReady()),this.ws.setSequence(t.s),void 0===this.ws.disabledEvents[t.t]&&(this.ws.status!==i.Status.READY&&-1===s.indexOf(t.t)?(this.queue.push(t),!1):(!e&&this.queue.length>0&&this.handleQueue(),!!this.handlers[t.t]&&this.handlers[t.t].handle(t)))}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.ChannelCreate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.ChannelDelete.handle(n);i.channel&&e.emit(s.Events.CHANNEL_DELETE,i.channel)}}t.exports=r},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.channels.get(n.channel_id),r=new Date(n.last_pin_timestamp);i&&r&&e.emit(s.Events.CHANNEL_PINS_UPDATE,i,r)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.ChannelUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id),r=e.users.get(n.user.id);i&&r&&e.emit(s.Events.GUILD_BAN_ADD,i,r)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildBanRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.id);i?i.available||n.unavailable||(i._patch(n),this.packetManager.ws.checkIfReady()):e.guilds.create(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.GuildDelete.handle(n);i.guild&&e.emit(s.Events.GUILD_DELETE,i.guild)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildEmojisUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);i&&(i.memberCount++,i._addMember(n))}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildMemberRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);if(i){const t=i.members.get(n.user.id);t&&i._updateMember(t,n)}}}t.exports=s},function(t,e,n){const i=n(1),s=n(0),r=n(3);class o extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);if(i){const t=new r;for(const e of n.members)t.set(e.id,i._addMember(e,!1));e.emit(s.Events.GUILD_MEMBERS_CHUNK,t,i),e.ws.lastHeartbeatAck=!0}}}t.exports=o},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleCreate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleDelete.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildSync.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.MessageCreate.handle(n);i.message&&e.emit(s.Events.MESSAGE_CREATE,i.message)}}t.exports=r},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.MessageDelete.handle(n);i.message&&e.emit(s.Events.MESSAGE_DELETE,i.message)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageDeleteBulk.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionAdd.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionRemoveAll.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(t){const e=this.packetManager.client,n=t.d;let i=e.users.get(n.user.id);const o=e.guilds.get(n.guild_id);if(!i){if(!n.user.username)return;i=e.users.create(n.user)}const a=r.cloneObject(i);if(i.patch(n.user),i.equals(a)||e.emit(s.Events.USER_UPDATE,a,i),o){let t=o.members.get(i.id);if(t||"offline"===n.status||(t=o._addMember({user:i,roles:n.roles,deaf:!1,mute:!1},!1),e.emit(s.Events.GUILD_MEMBER_AVAILABLE,t)),t){if(0===e.listenerCount(s.Events.PRESENCE_UPDATE))return void o._setPresence(i.id,n);const a=r.cloneObject(t);t.presence&&(a.frozenPresence=r.cloneObject(t.presence)),o._setPresence(i.id,n),e.emit(s.Events.PRESENCE_UPDATE,a,t)}else o._setPresence(i.id,n)}}}t.exports=o},function(t,e,n){const i=n(1),s=n(45);class r extends i{handle(t){const e=this.packetManager.client,n=t.d;e.ws.heartbeat(),n.user.user_settings=n.user_settings;const i=new s(e,n.user);e.user=i,e.readyAt=new Date,e.users.set(i.id,i);for(const t of n.guilds)e.guilds.create(t);for(const t of n.private_channels)e.channels.create(t);for(const t of n.relationships){const n=e.users.create(t.user);1===t.type?e.user.friends.set(n.id,n):2===t.type&&e.user.blocked.set(n.id,n)}n.presences=n.presences||[];for(const t of n.presences)e.users.create(t.user),e._setPresence(t.user.id,t);if(n.notes)for(const t in n.notes){let i=n.notes[t];i.length||(i=null),e.user.notes.set(t,i)}!e.user.bot&&e.options.sync&&e.setInterval(e.syncGuilds.bind(e),3e4),e.users.has("1")||e.users.create({id:"1",username:"Clyde",discriminator:"0000",avatar:"https://discordapp.com/assets/f78426a064bc9dd24847519259bc42af.png",bot:!0,status:"online",game:null,verified:!0});const r=e.setTimeout(()=>{e.ws.connection.triggerReady()},1200*n.guilds.length);e.setMaxListeners(n.guilds.length+10),e.once("ready",()=>{e.syncGuilds();e.setMaxListeners(10);e.clearTimeout(r)});const o=this.packetManager.ws;o.sessionID=n.session_id,o._trace=n._trace,e.emit("debug",`READY ${o._trace.join(" -> ")} ${o.sessionID}`),o.checkIfReady()}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;1===n.type?e.fetchUser(n.id).then(t=>{e.user.friends.set(t.id,t)}):2===n.type&&e.fetchUser(n.id).then(t=>{e.user.blocked.set(t.id,t)})}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;2===n.type?e.user.blocked.has(n.id)&&e.user.blocked.delete(n.id):1===n.type&&e.user.friends.has(n.id)&&e.user.friends.delete(n.id)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=e.ws.connection;n._trace=t.d._trace,n.status=s.Status.READY,this.packetManager.handleQueue();const i=n.sequence-n.closeSequence;n.debug(`RESUMED ${n._trace.join(" -> ")} | replayed ${i} events.`),e.emit("resume",i),n.heartbeat()}}t.exports=r},function(t,e,n){function i(t,e){return t.client.setTimeout(()=>{t.client.emit(r.Events.TYPING_STOP,t,e,t._typing.get(e.id));t._typing.delete(e.id)},6e3)}const s=n(1),r=n(0);class o extends s{handle(t){const e=this.packetManager.client,n=t.d,s=e.channels.get(n.channel_id),o=e.users.get(n.user_id),c=new Date(1e3*n.timestamp);if(s&&o){if("voice"===s.type)return void e.emit(r.Events.WARN,`Discord sent a typing packet to voice channel ${s.id}`);if(s._typing.has(o.id)){const t=s._typing.get(o.id);t.lastTimestamp=c,t.resetTimeout(i(s,o))}else s._typing.set(o.id,new a(e,c,c,i(s,o))),e.emit(r.Events.TYPING_START,s,o)}}}class a{constructor(t,e,n,i){this.client=t,this.since=e,this.lastTimestamp=n,this._timeout=i}resetTimeout(t){this.client.clearTimeout(this._timeout),this._timeout=t}get elapsedTime(){return Date.now()-this.since}}t.exports=o},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.UserNoteUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client;e.user.settings.patch(t.d),e.emit(s.Events.USER_SETTINGS_UPDATE,e.user.settings)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.UserUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.emit("self.voiceServer",n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);if(i){const t=i.members.get(n.user_id);if(t){const i=r.cloneObject(t);t.voiceChannel&&t.voiceChannel.id!==n.channel_id&&t.voiceChannel.members.delete(i.id),n.channel_id||(t.speaking=null),t.user.id===e.user.id&&n.channel_id&&e.emit("self.voiceStateUpdate",n);const o=e.channels.get(n.channel_id);o&&o.members.set(t.user.id,t),t.serverMute=n.mute,t.serverDeaf=n.deaf,t.selfMute=n.self_mute,t.selfDeaf=n.self_deaf,t.voiceSessionID=n.session_id,t.voiceChannelID=n.channel_id,e.emit(s.Events.VOICE_STATE_UPDATE,i,t)}}}}t.exports=o},function(t,e,n){const{register:register}=n(74),i={CLIENT_INVALID_OPTION:(t,e)=>`The ${t} option must be ${e}`,TOKEN_INVALID:"An invalid token was provided.",TOKEN_MISSING:"Request to use token, but token was unavailable to the client.",FEATURE_BOT_ONLY:"Only bot accounts are able to make use of this feature.",FEATURE_USER_ONLY:"Only user accounts are able to make use of this feature.",WS_BAD_MESSAGE:"A bad message was received from the websocket; either bad compression, or not JSON.",WS_CONNECTION_EXISTS:"There is already an existing WebSocket connection.",WS_NOT_OPEN:(t="data")=>`Websocket not open to send ${t}`,PERMISSIONS_INVALID:"Invalid permission string or number.",PERMISSIONS_INVALID_FLAG:"Invalid bitfield flag string or number",RATELIMIT_INVALID_METHOD:"Unknown rate limiting method.",SHARDING_INVALID:"Invalid shard settings were provided.",SHARDING_REQUIRED:"This session would have handled too many guilds - Sharding is required.",SHARDING_CHILD_CONNECTION:"Failed to send message to shard's process.",SHARDING_PARENT_CONNECTION:"Failed to send message to master process.",SHARDING_NO_SHARDS:"No shards have been spawned",SHARDING_IN_PROCESS:"Shards are still being spawned",SHARDING_ALREADY_SPAWNED:t=>`Already spawned ${t} shards`,COLOR_RANGE:"Color must be within the range 0 - 16777215 (0xFFFFFF).",COLOR_CONVERT:"Unable to convert color to a number.",EMBED_FIELD_COUNT:"MessageEmbeds may not exceed 25 fields.",EMBED_FIELD_NAME:"MessageEmbed field names may not exceed 256 characters or be empty.",EMBED_FIELD_VALUE:"MessageEmbed field values may not exceed 1024 characters or be empty.",EMBED_FILE_LIMIT:"You may not upload more than one file at once.",EMBED_DESCRIPTION:"MessageEmbed descriptions may not exceed 2048 characters.",EMBED_FOOTER_TEXT:"MessageEmbed footer text may not exceed 2048 characters.",EMBED_TITLE:"MessageEmbed titles may not exceed 256 characters.",FILE_NOT_FOUND:t=>`File could not be found: ${t}`,USER_STATUS:"User status must be a string",SHARD_MESSAGE_FAILED:"Failed to send message to master process.",VOICE_INVALID_HEARTBEAT:"Tried to set voice heartbeat but no valid interval was specified.",VOICE_USER_MISSING:"Couldn't resolve the user to create stream.",VOICE_STREAM_EXISTS:"There is already an existing stream for that user.",VOICE_JOIN_CHANNEL:(t=!1)=>`You do not have permission to join this voice channel${t?"; it is full.":"."}`,OPUS_ENGINE_MISSING:"Couldn't find an Opus engine.",UDP_SEND_FAIL:"Tried to send a UDP packet, but there is no socket available.",UDP_ADDRESS_MALFORMED:"Malformed UDP address or port.",UDP_CONNECTION_EXISTS:"There is already an existing UDP connection.",REQ_BODY_TYPE:"The response body isn't a Buffer.",REQ_RESOURCE_TYPE:"The resource must be a string or Buffer.",IMAGE_FORMAT:t=>`Invalid image format: ${t}`,IMAGE_SIZE:t=>`Invalid image size: ${t}`,MESSAGE_MISSING:"Message not found",MESSAGE_BULK_DELETE_TYPE:"The messages must be an Array, Collection, or number.",MESSAGE_NONCE_TYPE:"Message nonce must fit in an unsigned 64-bit integer.",TYPING_COUNT:"Count must be at least 1",SPLIT_MAX_LEN:"Message exceeds the max length and contains no split characters.",BAN_RESOLVE_ID:"Couldn't resolve the user ID to unban.",PRUNE_DAYS_TYPE:"Days must be a number",SEARCH_CHANNEL_TYPE:"Target must be a TextChannel, DMChannel, GroupDMChannel, or Guild.",MESSAGE_SPLIT_MISSING:"Message exceeds the max length and contains no split characters.",GUILD_CHANNEL_RESOLVE:"Could not resolve channel to a guild channel.",GUILD_MEMBERS_NOT_RECEIVED:"Members didn't arrive in time.",EMOJI_TYPE:"Emoji must be a string or Emoji/ReactionEmoji"};for(const[t,e]of Object.entries(i))register(t,e)},function(t,e,n){const i=n(4);t.exports={Client:n(77),Shard:n(80),ShardClientUtil:n(81),ShardingManager:n(82),WebhookClient:n(78),Collection:n(3),Constants:n(0),EvaluatedPermissions:n(11),Permissions:n(11),Snowflake:n(8),SnowflakeUtil:n(8),Util:i,util:i,version:n(44).version,escapeMarkdown:i.escapeMarkdown,fetchRecommendedShards:i.fetchRecommendedShards,splitMessage:i.splitMessage,Channel:n(17),ClientUser:n(45),ClientUserSettings:n(46),Collector:n(35),DMChannel:n(47),Emoji:n(19),Game:n(14).Game,GroupDMChannel:n(32),Guild:n(20),GuildAuditLogs:n(48),GuildChannel:n(33),GuildMember:n(21),Invite:n(28),Message:n(10),MessageAttachment:n(49),MessageCollector:n(50),MessageEmbed:n(51),MessageMentions:n(52),MessageReaction:n(53),OAuth2Application:n(29),ClientOAuth2Application:n(29),PartialGuild:n(54),PartialGuildChannel:n(55),PermissionOverwrites:n(56),Presence:n(14).Presence,ReactionEmoji:n(34),ReactionCollector:n(57),RichEmbed:n(79),Role:n(22),TextChannel:n(58),User:n(18),VoiceChannel:n(59),Webhook:n(23)},"browser"===n(27).platform()&&(window.Discord=t.exports)},function(t,e,n){const i=n(31),s=n(47),r=n(32),o=n(58),a=n(59),c=n(0);class u extends i{create(t,e,n=!0){super.create();const i=this.get(t.id);if(i)return i;let u;switch(t.type){case c.ChannelTypes.DM:u=new s(this.client,t);break;case c.ChannelTypes.GROUP_DM:u=new r(this.client,t);break;default:const n=t.type===c.ChannelTypes.TEXT?o:a;if(!(e=e||this.client.guilds.get(t.guild_id)))return this.client.emit("debug",`Failed to find guild for channel ${t.id}`),null;u=new n(e,t),e.channels.set(u.id,u)}return this.set(u.id,u),u&&n&&this.client.emit(c.Events.CHANNEL_CREATE,u),u}remove(t){super.remove();const e=this.get(t);e.guild&&e.guild.channels.delete(t),this.delete(t)}}t.exports=u},function(t,e,n){const i=n(31),s=n(19),r=n(0);class o extends i{constructor(t,e){super(t.client,e),this.guild=t}create(t,e=!0){super.create();const n=this.guild,i=n.emojis.get(t.id);if(i)return i;const o=new s(n,t);return n.emojis.set(o.id,o),e&&o&&this.client.emit(r.Events.GUILD_EMOJI_CREATE,o),o}remove(t,e=!0){super.remove();const n=this.get(t);this.delete(t),e&&n&&this.client.emit(r.Events.GUILD_EMOJI_DELETE,n)}}t.exports=o},function(t,e,n){const i=n(31),s=n(20),r=n(0);class o extends i{create(t,e){super.create();const n=this.get(t.id);if(n)return n;void 0===e&&(e=this.client.ws.connection.status===r.Status.READY);const i=new s(this.client,t);return this.set(i.id,i),e&&(this.client.options.fetchAllMembers?i.fetchMembers().then(()=>{this.client.emit(r.Events.GUILD_CREATE,i)}):this.client.emit(r.Events.GUILD_CREATE,i)),i}remove(t,e){super.remove(),void 0===e&&(e=this.client.ws.connection.status===r.Status.READY);const n=this.get(t);this.delete(t),e&&n&&this.client.emit(r.Events.GUILD_DELETE,n)}}t.exports=o},function(t,e,n){const i=n(31),s=n(18);class r extends i{create(t){super.create();const e=this.get(t.id);if(e)return e;const n=new s(this.client,t);return this.set(n.id,n),n}remove(t){super.remove(),this.delete(t)}fetch(t,e=!0){const n=this.get(t);return n?Promise.resolve(n):this.client.api.users(t).get().then(t=>e?this.create(t):new s(this.client,t))}}t.exports=r},function(t,e){class n{constructor(t,e){this.user=t,this._patch(e)}_patch(t){super._patch(t),this.type=t.type,this.name=t.name,this.id=t.id,this.revoked=t.revoked,this.integrations=t.integrations}}t.exports=n},function(t,e,n){const i=n(3),s=n(193),r=n(7);class o extends r{constructor(t,e){super(t.client),this.user=t,this.mutualGuilds=new i,this.connections=new i,this._patch(e)}setup(t){super._patch(t),this.premium=t.premium,this.premiumSince=t.premium_since?new Date(t.premium_since):null;for(const e of t.mutual_guilds)this.client.guilds.has(e.id)&&this.mutualGuilds.set(e.id,this.client.guilds.get(e.id));for(const e of t.connected_accounts)this.connections.set(e.id,new s(this.user,e))}}t.exports=o},function(t,e,n){const i=n(36),{TypeError:TypeError}=n(5);t.exports=function(t,e){if("string"==typeof e&&(e={content:e}),e.before&&(e.before instanceof Date||(e.before=new Date(e.before)),e.maxID=i.fromNumber(e.before.getTime()-14200704e5).shiftLeft(22).toString()),e.after&&(e.after instanceof Date||(e.after=new Date(e.after)),e.minID=i.fromNumber(e.after.getTime()-14200704e5).shiftLeft(22).toString()),e.during){e.during instanceof Date||(e.during=new Date(e.during));const t=e.during.getTime()-14200704e5;e.minID=i.fromNumber(t).shiftLeft(22).toString(),e.maxID=i.fromNumber(t+864e5).shiftLeft(22).toString()}e.channel&&(e.channel=t.client.resolver.resolveChannelID(e.channel)),e.author&&(e.author=t.client.resolver.resolveUserID(e.author)),e.mentions&&(e.mentions=t.client.resolver.resolveUserID(e.options.mentions)),e.sortOrder&&(e.sortOrder={ascending:"asc",descending:"desc"}[e.sortOrder]||e.sortOrder),e={content:e.content,max_id:e.maxID,min_id:e.minID,has:e.has,channel_id:e.channel,author_id:e.author,author_type:e.authorType,context_size:e.contextSize,sort_by:e.sortBy,sort_order:e.sortOrder,limit:e.limit,offset:e.offset,mentions:e.mentions,mentions_everyone:e.mentionsEveryone,link_hostname:e.linkHostname,embed_provider:e.embedProvider,embed_type:e.embedType,attachment_filename:e.attachmentFilename,attachment_extension:e.attachmentExtension,include_nsfw:e.nsfw};const s=n(17),r=n(20),o=n(10);if(!(t instanceof s||t instanceof r))throw new TypeError("SEARCH_CHANNEL_TYPE");return t.client.api[t instanceof s?"channels":"guilds"](t.id).messages().search.get({query:e}).then(e=>{const n=e.messages.map(e=>e.map(e=>new o(t.client.channels.get(e.channel_id),e,t.client)));return{total:e.total_results,results:n}})}},function(t,e,n){const i=n(4),{RangeError:RangeError}=n(5);t.exports=function(t,e){const s=n(18),r=n(21);if(t instanceof s||t instanceof r)return t.createDM().then(t=>t.send(e));let{content:content,nonce:nonce,reply:reply,code:code,disableEveryone:disableEveryone,tts:tts,embed:embed,files:files,split:split}=e;if(void 0!==nonce&&(nonce=parseInt(nonce),isNaN(nonce)||nonce<0))throw new RangeError("MESSAGE_NONCE_TYPE");if(content&&(content=i.resolveString(content),split&&"object"!=typeof split&&(split={}),void 0===code||"boolean"==typeof code&&!0!==code||(content=i.escapeMarkdown(content,!0),content=`\`\`\`${"boolean"!=typeof code?code||"":""} +--${this.boundary}--`)]),this.buffer}}t.exports=r}).call(e,n(6).Buffer)},function(t,e,n){(function(e){function i(t){return c.format({protocol:t.connection.encrypted?"https:":"http:",hostname:t.getHeader("host"),pathname:t.path.split("?")[0],query:t.query})}n(64);const s=n(43),r=n(38),o=n(65),a=n(86),c=n(67),u=n(98),l=n(64),h=n(99);class p extends l.Readable{constructor(t,e,n={headers:{},data:null}){super();const i=c.parse(e);i.method=t.toUpperCase(),i.headers=n.headers,this.data=n.data,this.request=("https:"===i.protocol?a:o).request(i)}query(t,e){if(this._response)throw new Error("Cannot modify query after being sent!");return this.request.query||(this.request.query={}),null!==t&&"object"==typeof t?this.request.query=Object.assign(this.request.query,t):this.request.query[t]=e,this}set(t,e){if(this._response)throw new Error("Cannot modify headers after being sent!");if(null!==t&&"object"==typeof t)for(const e of Object.keys(t))this.set(e,t[e]);else this.request.setHeader(t,e);return this}attach(t,e,n){if(this._response)throw new Error("Cannot modify data after being sent!");const i=this._getFormData();return this.set("Content-Type",`multipart/form-data; boundary=${i.boundary}`),i.append(t,e,n),this.data=i,this}send(t){if(this._response)throw new Error("Cannot modify data after being sent!");if(null!==t&&"object"==typeof t){const e=this._getHeader("content-type");let n;e?e.includes("json")?n=JSON.stringify:e.includes("urlencoded")&&(n=r.stringify):(this.set("Content-Type","application/json"),n=JSON.stringify),this.data=n(t)}else this.data=t;return this}then(t,n){return new Promise((t,n)=>{const a=this.request;const u=t=>{t||(t=new Error("Unknown error occured"));t.request=a;n(t)};a.on("abort",u);a.on("aborted",u);a.on("error",u);a.on("response",u=>{const h=new l.PassThrough;this._shouldUnzip(u)?u.pipe(s.createUnzip({flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH})).pipe(h):u.pipe(h);let d=[];h.on("data",t=>{this.push(t)||this.pause();d.push(t)});h.on("end",()=>{this.push(null);const s=e.concat(d);if(this._shouldRedirect(u)){let e=this.request.method;[301,302].includes(u.statusCode)?("HEAD"!==e&&(e="GET"),this.data=null):303===u.statusCode&&(e="GET");const n={};if(this.request._headerNames)for(const t of Object.keys(this.request._headerNames))"host"!==t.toLowerCase()&&(n[this.request._headerNames[t]]=this.request._headers[t]);else for(const t of Object.keys(this.request._headers))if("host"!==t.toLowerCase()){const e=this.request._headers[t];n[e.name]=e.value}const s=/^https?:\/\//i.test(u.headers.location)?u.headers.location:c.resolve(i(a),u.headers.location);return void t(new p(e,s,{data:this.data,headers:n}))}const l={request:this.request,body:s,text:s.toString(),ok:u.statusCode>=200&&u.statusCode<300,headers:u.headers,status:u.statusCode,statusText:u.statusText||o.STATUS_CODES[u.statusCode]};const h=u.headers["content-type"];if(h)if(h.includes("application/json"))try{l.body=JSON.parse(l.text)}catch(t){}else h.includes("application/x-www-form-urlencoded")&&(l.body=r.parse(l.text));if(l.ok)t(l);else{const t=new Error(`${l.status} ${l.statusText}`.trim());Object.assign(t,l),n(t)}})});this._addFinalHeaders();this.request.query&&(this.request.path=`${this.request.path}?${r.stringify(this.request.query)}`);a.end(this.data?this.data.end?this.data.end():this.data:null)}).then(t,n)}catch(t){return this.then(null,t)}end(t){return this.then(e=>t?t(null,e):e,e=>t?t(e,e.status?e:null):e)}_read(){this.resume(),this._response||this.catch(t=>this.emit("error",t))}_shouldUnzip(t){return 204!==t.statusCode&&304!==t.statusCode&&("0"!==t.headers["content-length"]&&/^\s*(?:deflate|gzip)\s*$/.test(t.headers["content-encoding"]))}_shouldRedirect(t){return[301,302,303,307,308].includes(t.statusCode)}_getFormData(){return this._formData||(this._formData=new h),this._formData}_addFinalHeaders(){this.request&&(this._getHeader("user-agent")||this.set("User-Agent",`snekfetch/${p.version} (${u.repository.url.replace(/\.?git/,"")})`),"HEAD"!==this.request.method&&this.set("Accept-Encoding","gzip, deflate"))}get _response(){return this.request.res||this.request._response||null}_getHeader(t){try{return this.request.getHeader(t)}catch(t){return null}}}p.version=u.version,p.METHODS=o.METHODS.concat("BREW");for(const t of p.METHODS)p["M-SEARCH"===t?"msearch":t.toLowerCase()]=(e=>new p(t,e));t.exports=p}).call(e,n(6).Buffer)},function(t,e,n){function i(t){return r[t]||r.bin}function s(t){return o(t)||r.bin}const r=n(103),o=n(102);t.exports={buffer:s,lookup:i}},function(t,e){function n(t){const e=new Uint8Array(t);if(!(e&&e.length>1))return null;if(255===e[0]&&216===e[1]&&255===e[2])return{ext:"jpg",mime:"image/jpeg"};if(137===e[0]&&80===e[1]&&78===e[2]&&71===e[3])return{ext:"png",mime:"image/png"};if(71===e[0]&&73===e[1]&&70===e[2])return{ext:"gif",mime:"image/gif"};if(87===e[8]&&69===e[9]&&66===e[10]&&80===e[11])return{ext:"webp",mime:"image/webp"};if(70===e[0]&&76===e[1]&&73===e[2]&&70===e[3])return{ext:"flif",mime:"image/flif"};if((73===e[0]&&73===e[1]&&42===e[2]&&0===e[3]||77===e[0]&&77===e[1]&&0===e[2]&&42===e[3])&&67===e[8]&&82===e[9])return{ext:"cr2",mime:"image/x-canon-cr2"};if(73===e[0]&&73===e[1]&&42===e[2]&&0===e[3]||77===e[0]&&77===e[1]&&0===e[2]&&42===e[3])return{ext:"tif",mime:"image/tiff"};if(66===e[0]&&77===e[1])return{ext:"bmp",mime:"image/bmp"};if(73===e[0]&&73===e[1]&&188===e[2])return{ext:"jxr",mime:"image/vnd.ms-photo"};if(56===e[0]&&66===e[1]&&80===e[2]&&83===e[3])return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(80===e[0]&&75===e[1]&&3===e[2]&&4===e[3]&&109===e[30]&&105===e[31]&&109===e[32]&&101===e[33]&&116===e[34]&&121===e[35]&&112===e[36]&&101===e[37]&&97===e[38]&&112===e[39]&&112===e[40]&&108===e[41]&&105===e[42]&&99===e[43]&&97===e[44]&&116===e[45]&&105===e[46]&&111===e[47]&&110===e[48]&&47===e[49]&&101===e[50]&&112===e[51]&&117===e[52]&&98===e[53]&&43===e[54]&&122===e[55]&&105===e[56]&&112===e[57])return{ext:"epub",mime:"application/epub+zip"};if(80===e[0]&&75===e[1]&&3===e[2]&&4===e[3]&&77===e[30]&&69===e[31]&&84===e[32]&&65===e[33]&&45===e[34]&&73===e[35]&&78===e[36]&&70===e[37]&&47===e[38]&&109===e[39]&&111===e[40]&&122===e[41]&&105===e[42]&&108===e[43]&&108===e[44]&&97===e[45]&&46===e[46]&&114===e[47]&&115===e[48]&&97===e[49])return{ext:"xpi",mime:"application/x-xpinstall"};if(!(80!==e[0]||75!==e[1]||3!==e[2]&&5!==e[2]&&7!==e[2]||4!==e[3]&&6!==e[3]&&8!==e[3]))return{ext:"zip",mime:"application/zip"};if(117===e[257]&&115===e[258]&&116===e[259]&&97===e[260]&&114===e[261])return{ext:"tar",mime:"application/x-tar"};if(82===e[0]&&97===e[1]&&114===e[2]&&33===e[3]&&26===e[4]&&7===e[5]&&(0===e[6]||1===e[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(31===e[0]&&139===e[1]&&8===e[2])return{ext:"gz",mime:"application/gzip"};if(66===e[0]&&90===e[1]&&104===e[2])return{ext:"bz2",mime:"application/x-bzip2"};if(55===e[0]&&122===e[1]&&188===e[2]&&175===e[3]&&39===e[4]&&28===e[5])return{ext:"7z",mime:"application/x-7z-compressed"};if(120===e[0]&&1===e[1])return{ext:"dmg",mime:"application/x-apple-diskimage"};if(0===e[0]&&0===e[1]&&0===e[2]&&(24===e[3]||32===e[3])&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]||51===e[0]&&103===e[1]&&112===e[2]&&53===e[3]||0===e[0]&&0===e[1]&&0===e[2]&&28===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&109===e[8]&&112===e[9]&&52===e[10]&&50===e[11]&&109===e[16]&&112===e[17]&&52===e[18]&&49===e[19]&&109===e[20]&&112===e[21]&&52===e[22]&&50===e[23]&&105===e[24]&&115===e[25]&&111===e[26]&&109===e[27]||0===e[0]&&0===e[1]&&0===e[2]&&28===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&105===e[8]&&115===e[9]&&111===e[10]&&109===e[11]||0===e[0]&&0===e[1]&&0===e[2]&&28===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&109===e[8]&&112===e[9]&&52===e[10]&&50===e[11]&&0===e[12]&&0===e[13]&&0===e[14]&&0===e[15])return{ext:"mp4",mime:"video/mp4"};if(0===e[0]&&0===e[1]&&0===e[2]&&28===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&77===e[8]&&52===e[9]&&86===e[10])return{ext:"m4v",mime:"video/x-m4v"};if(77===e[0]&&84===e[1]&&104===e[2]&&100===e[3])return{ext:"mid",mime:"audio/midi"};if(26===e[0]&&69===e[1]&&223===e[2]&&163===e[3]){const t=e.subarray(4,4100),n=t.findIndex((t,e,n)=>66===n[e]&&130===n[e+1]);if(n>=0){const e=n+3,i=n=>Array.from(n).every((n,i)=>t[e+i]===n.charCodeAt(0));if(i("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(i("webm"))return{ext:"webm",mime:"video/webm"}}}return 0===e[0]&&0===e[1]&&0===e[2]&&20===e[3]&&102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]?{ext:"mov",mime:"video/quicktime"}:82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]&&65===e[8]&&86===e[9]&&73===e[10]?{ext:"avi",mime:"video/x-msvideo"}:48===e[0]&&38===e[1]&&178===e[2]&&117===e[3]&&142===e[4]&&102===e[5]&&207===e[6]&&17===e[7]&&166===e[8]&&217===e[9]?{ext:"wmv",mime:"video/x-ms-wmv"}:0===e[0]&&0===e[1]&&1===e[2]&&"b"===e[3].toString(16)[0]?{ext:"mpg",mime:"video/mpeg"}:73===e[0]&&68===e[1]&&51===e[2]||255===e[0]&&251===e[1]?{ext:"mp3",mime:"audio/mpeg"}:102===e[4]&&116===e[5]&&121===e[6]&&112===e[7]&&77===e[8]&&52===e[9]&&65===e[10]||77===e[0]&&52===e[1]&&65===e[2]&&32===e[3]?{ext:"m4a",mime:"audio/m4a"}:79===e[28]&&112===e[29]&&117===e[30]&&115===e[31]&&72===e[32]&&101===e[33]&&97===e[34]&&100===e[35]?{ext:"opus",mime:"audio/opus"}:79===e[0]&&103===e[1]&&103===e[2]&&83===e[3]?{ext:"ogg",mime:"audio/ogg"}:102===e[0]&&76===e[1]&&97===e[2]&&67===e[3]?{ext:"flac",mime:"audio/x-flac"}:82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]&&87===e[8]&&65===e[9]&&86===e[10]&&69===e[11]?{ext:"wav",mime:"audio/x-wav"}:35===e[0]&&33===e[1]&&65===e[2]&&77===e[3]&&82===e[4]&&10===e[5]?{ext:"amr",mime:"audio/amr"}:37===e[0]&&80===e[1]&&68===e[2]&&70===e[3]?{ext:"pdf",mime:"application/pdf"}:77===e[0]&&90===e[1]?{ext:"exe",mime:"application/x-msdownload"}:67!==e[0]&&70!==e[0]||87!==e[1]||83!==e[2]?123===e[0]&&92===e[1]&&114===e[2]&&116===e[3]&&102===e[4]?{ext:"rtf",mime:"application/rtf"}:119===e[0]&&79===e[1]&&70===e[2]&&70===e[3]&&(0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]||79===e[4]&&84===e[5]&&84===e[6]&&79===e[7])?{ext:"woff",mime:"application/font-woff"}:119===e[0]&&79===e[1]&&70===e[2]&&50===e[3]&&(0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]||79===e[4]&&84===e[5]&&84===e[6]&&79===e[7])?{ext:"woff2",mime:"application/font-woff"}:76===e[34]&&80===e[35]&&(0===e[8]&&0===e[9]&&1===e[10]||1===e[8]&&0===e[9]&&2===e[10]||2===e[8]&&0===e[9]&&2===e[10])?{ext:"eot",mime:"application/octet-stream"}:0===e[0]&&1===e[1]&&0===e[2]&&0===e[3]&&0===e[4]?{ext:"ttf",mime:"application/font-sfnt"}:79===e[0]&&84===e[1]&&84===e[2]&&79===e[3]&&0===e[4]?{ext:"otf",mime:"application/font-sfnt"}:0===e[0]&&0===e[1]&&1===e[2]&&0===e[3]?{ext:"ico",mime:"image/x-icon"}:70===e[0]&&76===e[1]&&86===e[2]&&1===e[3]?{ext:"flv",mime:"video/x-flv"}:37===e[0]&&33===e[1]?{ext:"ps",mime:"application/postscript"}:253===e[0]&&55===e[1]&&122===e[2]&&88===e[3]&&90===e[4]&&0===e[5]?{ext:"xz",mime:"application/x-xz"}:83===e[0]&&81===e[1]&&76===e[2]&&105===e[3]?{ext:"sqlite",mime:"application/x-sqlite3"}:78===e[0]&&69===e[1]&&83===e[2]&&26===e[3]?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:67===e[0]&&114===e[1]&&50===e[2]&&52===e[3]?{ext:"crx",mime:"application/x-google-chrome-extension"}:77===e[0]&&83===e[1]&&67===e[2]&&70===e[3]||73===e[0]&&83===e[1]&&99===e[2]&&40===e[3]?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:33===e[0]&&60===e[1]&&97===e[2]&&114===e[3]&&99===e[4]&&104===e[5]&&62===e[6]&&10===e[7]&&100===e[8]&&101===e[9]&&98===e[10]&&105===e[11]&&97===e[12]&&110===e[13]&&45===e[14]&&98===e[15]&&105===e[16]&&110===e[17]&&97===e[18]&&114===e[19]&&121===e[20]?{ext:"deb",mime:"application/x-deb"}:33===e[0]&&60===e[1]&&97===e[2]&&114===e[3]&&99===e[4]&&104===e[5]&&62===e[6]?{ext:"ar",mime:"application/x-unix-archive"}:237===e[0]&&171===e[1]&&238===e[2]&&219===e[3]?{ext:"rpm",mime:"application/x-rpm"}:31===e[0]&&160===e[1]||31===e[0]&&157===e[1]?{ext:"Z",mime:"application/x-compress"}:76===e[0]&&90===e[1]&&73===e[2]&&80===e[3]?{ext:"lz",mime:"application/x-lzip"}:208===e[0]&&207===e[1]&&17===e[2]&&224===e[3]&&161===e[4]&&177===e[5]&&26===e[6]&&225===e[7]?{ext:"msi",mime:"application/x-msi"}:6===e[0]&&14===e[1]&&43===e[2]&&52===e[3]&&2===e[4]&&5===e[5]&&1===e[6]&&1===e[7]&&13===e[8]&&1===e[9]&&2===e[10]&&1===e[11]&&1===e[12]&&2===e[13]?{ext:"mxf",mime:"application/mxf"}:null:{ext:"swf",mime:"application/x-shockwave-flash"}}t.exports=n},function(t,e){t.exports={123:"application/vnd.lotus-1-2-3",ez:"application/andrew-inset",aw:"application/applixware",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",bdoc:"application/x-bdoc",ccxml:"application/ccxml+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cu:"application/cu-seeme",mpd:"application/dash+xml",davmount:"application/davmount+xml",dbk:"application/docbook+xml",dssc:"application/dssc+der",xdssc:"application/dssc+xml",ecma:"application/ecmascript",emma:"application/emma+xml",epub:"application/epub+zip",exi:"application/exi",pfr:"application/font-tdpfr",woff:"application/font-woff",woff2:"application/font-woff2",geojson:"application/geo+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gxf:"application/gxf",stk:"application/hyperstudio",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",jar:"application/java-archive",war:"application/java-archive",ear:"application/java-archive",ser:"application/java-serialized-object",class:"application/java-vm",js:"application/javascript",json:"application/json",map:"application/json",json5:"application/json5",jsonml:"application/jsonml+json",jsonld:"application/ld+json",lostxml:"application/lost+xml",hqx:"application/mac-binhex40",cpt:"application/mac-compactpro",mads:"application/mads+xml",webmanifest:"application/manifest+json",mrc:"application/marc",mrcx:"application/marcxml+xml",ma:"application/mathematica",nb:"application/mathematica",mb:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mscml:"application/mediaservercontrol+xml",metalink:"application/metalink+xml",meta4:"application/metalink4+xml",mets:"application/mets+xml",mods:"application/mods+xml",m21:"application/mp21",mp21:"application/mp21",mp4s:"application/mp4",m4p:"application/mp4",doc:"application/msword",dot:"application/msword",mxf:"application/mxf",bin:"application/octet-stream",dms:"application/octet-stream",lrf:"application/octet-stream",mar:"application/octet-stream",so:"application/octet-stream",dist:"application/octet-stream",distz:"application/octet-stream",pkg:"application/octet-stream",bpk:"application/octet-stream",dump:"application/octet-stream",elc:"application/octet-stream",deploy:"application/octet-stream",exe:"application/x-msdownload",dll:"application/x-msdownload",deb:"application/x-debian-package",dmg:"application/x-apple-diskimage",iso:"application/x-iso9660-image",img:"application/octet-stream",msi:"application/x-msdownload",msp:"application/octet-stream",msm:"application/octet-stream",buffer:"application/octet-stream",oda:"application/oda",opf:"application/oebps-package+xml",ogx:"application/ogg",omdoc:"application/omdoc+xml",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",oxps:"application/oxps",xer:"application/patch-ops-error+xml",pdf:"application/pdf",pgp:"application/pgp-encrypted",asc:"application/pgp-signature",sig:"application/pgp-signature",prf:"application/pics-rules",p10:"application/pkcs10",p7m:"application/pkcs7-mime",p7c:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",ac:"application/pkix-attr-cert",cer:"application/pkix-cert",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",pki:"application/pkixcmp",pls:"application/pls+xml",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",cww:"application/prs.cww",pskcxml:"application/pskc+xml",rdf:"application/rdf+xml",rif:"application/reginfo+xml",rnc:"application/relax-ng-compact-syntax",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rs:"application/rls-services+xml",gbr:"application/rpki-ghostbusters",mft:"application/rpki-manifest",roa:"application/rpki-roa",rsd:"application/rsd+xml",rss:"application/rss+xml",rtf:"text/rtf",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",sdp:"application/sdp",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",shf:"application/shf+xml",smi:"application/smil+xml",smil:"application/smil+xml",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",sru:"application/sru+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",tfi:"application/thraud+xml",tsd:"application/timestamped-data",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap",pwn:"application/vnd.3m.post-it-notes",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",acutc:"application/vnd.acucorp",air:"application/vnd.adobe.air-application-installer-package+zip",fcdt:"application/vnd.adobe.formscentral.fcdt",fxp:"application/vnd.adobe.fxp",fxpl:"application/vnd.adobe.fxp",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",acc:"application/vnd.americandynamics.acc",ami:"application/vnd.amiga.ami",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",mpkg:"application/vnd.apple.installer+xml",m3u8:"application/vnd.apple.mpegurl",pkpass:"application/vnd.apple.pkpass",swi:"application/vnd.aristanetworks.swi",iota:"application/vnd.astraea-software.iota",aep:"application/vnd.audiograph",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",rep:"application/vnd.businessobjects",cdxml:"application/vnd.chemdraw+xml",mmd:"application/vnd.chipnuts.karaoke-mmd",cdy:"application/vnd.cinderella",cla:"application/vnd.claymore",rp9:"application/vnd.cloanto.rp9",c4g:"application/vnd.clonk.c4group",c4d:"application/vnd.clonk.c4group",c4f:"application/vnd.clonk.c4group",c4p:"application/vnd.clonk.c4group",c4u:"application/vnd.clonk.c4group",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",csp:"application/vnd.commonspace",cdbcmsg:"application/vnd.contact.cmsg",cmc:"application/vnd.cosmocaller",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",pml:"application/vnd.ctc-posml",ppd:"application/vnd.cups-ppd",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",dart:"application/vnd.dart",rdz:"application/vnd.data-vision.rdz",uvf:"application/vnd.dece.data",uvvf:"application/vnd.dece.data",uvd:"application/vnd.dece.data",uvvd:"application/vnd.dece.data",uvt:"application/vnd.dece.ttml+xml",uvvt:"application/vnd.dece.ttml+xml",uvx:"application/vnd.dece.unspecified",uvvx:"application/vnd.dece.unspecified",uvz:"application/vnd.dece.zip",uvvz:"application/vnd.dece.zip",fe_launch:"application/vnd.denovo.fcselayout-link",dna:"application/vnd.dna",mlp:"application/vnd.dolby.mlp",dpg:"application/vnd.dpgraph",dfac:"application/vnd.dreamfactory",kpxx:"application/vnd.ds-keypoint",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",geo:"application/vnd.dynageo",mag:"application/vnd.ecowin.chart",nml:"application/vnd.enliven",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",qam:"application/vnd.epson.quickanime",slt:"application/vnd.epson.salt",ssf:"application/vnd.epson.ssf",es3:"application/vnd.eszigno3+xml",et3:"application/vnd.eszigno3+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fdf:"application/vnd.fdf",mseed:"application/vnd.fdsn.mseed",seed:"application/vnd.fdsn.seed",dataless:"application/vnd.fdsn.seed",gph:"application/vnd.flographit",ftc:"application/vnd.fluxtime.clip",fm:"application/vnd.framemaker",frame:"application/vnd.framemaker",maker:"application/vnd.framemaker",book:"application/vnd.framemaker",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",fsc:"application/vnd.fsc.weblaunch",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",fzs:"application/vnd.fuzzysheet",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gex:"application/vnd.geometry-explorer",gre:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gmx:"application/vnd.gmx",gdoc:"application/vnd.google-apps.document",gslides:"application/vnd.google-apps.presentation",gsheet:"application/vnd.google-apps.spreadsheet",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gqs:"application/vnd.grafeq",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",hal:"application/vnd.hal+xml",zmm:"application/vnd.handheld-entertainment+xml",hbci:"application/vnd.hbci",les:"application/vnd.hhe.lesson-player",hpgl:"application/vnd.hp-hpgl",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",pclxl:"application/vnd.hp-pclxl","sfd-hdstx":"application/vnd.hydrostatix.sof-data",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",listafp:"application/vnd.ibm.modcap",list3820:"application/vnd.ibm.modcap",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",icc:"application/vnd.iccprofile",icm:"application/vnd.iccprofile",igl:"application/vnd.igloader",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",igm:"application/vnd.insors.igm",xpw:"application/vnd.intercon.formnet",xpx:"application/vnd.intercon.formnet",i2g:"application/vnd.intergeo",qbo:"application/vnd.intu.qbo",qfx:"application/vnd.intu.qfx",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",xpr:"application/vnd.is-xpr",fcs:"application/vnd.isac.fcs",jam:"application/vnd.jam",rms:"application/vnd.jcp.javame.midlet-rms",jisp:"application/vnd.jisp",joda:"application/vnd.joost.joda-archive",ktz:"application/vnd.kahootz",ktr:"application/vnd.kahootz",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",kpt:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",kwt:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",knp:"application/vnd.kinar",skp:"application/vnd.koan",skd:"application/vnd.koan",skt:"application/vnd.koan",skm:"application/vnd.koan",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",portpkg:"application/vnd.macports.portpkg",mcd:"application/vnd.mcd",mc1:"application/vnd.medcalcdata",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",mif:"application/vnd.mif",daf:"application/vnd.mobius.daf",dis:"application/vnd.mobius.dis",mbk:"application/vnd.mobius.mbk",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",plc:"application/vnd.mobius.plc",txf:"application/vnd.mobius.txf",mpn:"application/vnd.mophun.application",mpc:"application/vnd.mophun.certificate",xul:"application/vnd.mozilla.xul+xml",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",xls:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xla:"application/vnd.ms-excel",xlc:"application/vnd.ms-excel",xlt:"application/vnd.ms-excel",xlw:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",eot:"application/vnd.ms-fontobject",chm:"application/vnd.ms-htmlhelp",ims:"application/vnd.ms-ims",lrm:"application/vnd.ms-lrm",thmx:"application/vnd.ms-officetheme",cat:"application/vnd.ms-pki.seccat",stl:"application/vnd.ms-pki.stl",ppt:"application/vnd.ms-powerpoint",pps:"application/vnd.ms-powerpoint",pot:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",mpt:"application/vnd.ms-project",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wps:"application/vnd.ms-works",wks:"application/vnd.ms-works",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wpl:"application/vnd.ms-wpl",xps:"application/vnd.ms-xpsdocument",mseq:"application/vnd.mseq",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",taglet:"application/vnd.mynfc",nlu:"application/vnd.neurolanguage.nlu",ntf:"application/vnd.nitf",nitf:"application/vnd.nitf",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",oth:"application/vnd.oasis.opendocument.text-web",xo:"application/vnd.olpc-sugar",dd2:"application/vnd.oma.dd2+xml",oxt:"application/vnd.openofficeorg.extension",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",mgp:"application/vnd.osgeo.mapguide.package",dp:"application/vnd.osgi.dp",esa:"application/vnd.osgi.subsystem",pdb:"application/x-pilot",pqa:"application/vnd.palm",oprc:"application/vnd.palm",paw:"application/vnd.pawaafile",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",efif:"application/vnd.picsel",wg:"application/vnd.pmi.widget",plf:"application/vnd.pocketlearn",pbd:"application/vnd.powerbuilder6",box:"application/vnd.previewsystems.box",mgz:"application/vnd.proteus.magazine",qps:"application/vnd.publishare-delta-tree",ptid:"application/vnd.pvi.ptid1",qxd:"application/vnd.quark.quarkxpress",qxt:"application/vnd.quark.quarkxpress",qwd:"application/vnd.quark.quarkxpress",qwt:"application/vnd.quark.quarkxpress",qxl:"application/vnd.quark.quarkxpress",qxb:"application/vnd.quark.quarkxpress",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",cryptonote:"application/vnd.rig.cryptonote",cod:"application/vnd.rim.cod",rm:"application/vnd.rn-realmedia",rmvb:"application/vnd.rn-realmedia-vbr",link66:"application/vnd.route66.link66+xml",st:"application/vnd.sailingtracker.track",see:"application/vnd.seemail",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",twd:"application/vnd.simtech-mindmapper",twds:"application/vnd.simtech-mindmapper",mmf:"application/vnd.smaf",teacher:"application/vnd.smart.teacher",sdkm:"application/vnd.solent.sdkm+xml",sdkd:"application/vnd.solent.sdkm+xml",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",vor:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",smzip:"application/vnd.stepmania.package",sm:"application/vnd.stepmania.stepchart",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",sus:"application/vnd.sus-calendar",susp:"application/vnd.sus-calendar",svd:"application/vnd.svd",sis:"application/vnd.symbian.install",sisx:"application/vnd.symbian.install",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",tao:"application/vnd.tao.intent-module-archive",pcap:"application/vnd.tcpdump.pcap",cap:"application/vnd.tcpdump.pcap",dmp:"application/vnd.tcpdump.pcap",tmo:"application/vnd.tmobile-livetv",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",tra:"application/vnd.trueapp",ufd:"application/vnd.ufdl",ufdl:"application/vnd.ufdl",utz:"application/vnd.uiq.theme",umj:"application/vnd.umajin",unityweb:"application/vnd.unity",uoml:"application/vnd.uoml+xml",vcx:"application/vnd.vcx",vsd:"application/vnd.visio",vst:"application/vnd.visio",vss:"application/vnd.visio",vsw:"application/vnd.visio",vis:"application/vnd.visionary",vsf:"application/vnd.vsf",wbxml:"application/vnd.wap.wbxml",wmlc:"application/vnd.wap.wmlc",wmlsc:"application/vnd.wap.wmlscriptc",wtb:"application/vnd.webturbo",nbp:"application/vnd.wolfram.player",wpd:"application/vnd.wordperfect",wqd:"application/vnd.wqd",stf:"application/vnd.wt.stf",xar:"application/vnd.xara",xfdl:"application/vnd.xfdl",hvd:"application/vnd.yamaha.hv-dic",hvs:"application/vnd.yamaha.hv-script",hvp:"application/vnd.yamaha.hv-voice",osf:"application/vnd.yamaha.openscoreformat",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",saf:"application/vnd.yamaha.smaf-audio",spf:"application/vnd.yamaha.smaf-phrase",cmp:"application/vnd.yellowriver-custom-menu",zir:"application/vnd.zul",zirz:"application/vnd.zul",zaz:"application/vnd.zzazz.deck+xml",vxml:"application/voicexml+xml",wgt:"application/widget",hlp:"application/winhlp",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",aab:"application/x-authorware-bin",x32:"application/x-authorware-bin",u32:"application/x-authorware-bin",vox:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",bcpio:"application/x-bcpio",torrent:"application/x-bittorrent",blb:"application/x-blorb",blorb:"application/x-blorb",bz:"application/x-bzip",bz2:"application/x-bzip2",boz:"application/x-bzip2",cbr:"application/x-cbr",cba:"application/x-cbr",cbt:"application/x-cbr",cbz:"application/x-cbr",cb7:"application/x-cbr",vcd:"application/x-cdlink",cfs:"application/x-cfs-compressed",chat:"application/x-chat",pgn:"application/x-chess-pgn",crx:"application/x-chrome-extension",cco:"application/x-cocoa",nsc:"application/x-conference",cpio:"application/x-cpio",csh:"application/x-csh",udeb:"application/x-debian-package",dgc:"application/x-dgc-compressed",dir:"application/x-director",dcr:"application/x-director",dxr:"application/x-director",cst:"application/x-director",cct:"application/x-director",cxt:"application/x-director",w3d:"application/x-director",fgd:"application/x-director",swa:"application/x-director",wad:"application/x-doom",ncx:"application/x-dtbncx+xml",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",dvi:"application/x-dvi",evy:"application/x-envoy",eva:"application/x-eva",bdf:"application/x-font-bdf",gsf:"application/x-font-ghostscript",psf:"application/x-font-linux-psf",otf:"font/opentype",pcf:"application/x-font-pcf",snf:"application/x-font-snf",ttf:"application/x-font-ttf",ttc:"application/x-font-ttf",pfa:"application/x-font-type1",pfb:"application/x-font-type1",pfm:"application/x-font-type1",afm:"application/x-font-type1",arc:"application/x-freearc",spl:"application/x-futuresplash",gca:"application/x-gca-compressed",ulx:"application/x-glulx",gnumeric:"application/x-gnumeric",gramps:"application/x-gramps-xml",gtar:"application/x-gtar",hdf:"application/x-hdf",php:"application/x-httpd-php",install:"application/x-install-instructions",jardiff:"application/x-java-archive-diff",jnlp:"application/x-java-jnlp-file",latex:"application/x-latex",luac:"application/x-lua-bytecode",lzh:"application/x-lzh-compressed",lha:"application/x-lzh-compressed",run:"application/x-makeself",mie:"application/x-mie",prc:"application/x-pilot",mobi:"application/x-mobipocket-ebook",application:"application/x-ms-application",lnk:"application/x-ms-shortcut",wmd:"application/x-ms-wmd",wmz:"application/x-msmetafile",xbap:"application/x-ms-xbap",mdb:"application/x-msaccess",obd:"application/x-msbinder",crd:"application/x-mscardfile",clp:"application/x-msclip",com:"application/x-msdownload",bat:"application/x-msdownload",mvb:"application/x-msmediaview",m13:"application/x-msmediaview",m14:"application/x-msmediaview",wmf:"application/x-msmetafile",emf:"application/x-msmetafile",emz:"application/x-msmetafile",mny:"application/x-msmoney",pub:"application/x-mspublisher",scd:"application/x-msschedule",trm:"application/x-msterminal",wri:"application/x-mswrite",nc:"application/x-netcdf",cdf:"application/x-netcdf",pac:"application/x-ns-proxy-autoconfig",nzb:"application/x-nzb",pl:"application/x-perl",pm:"application/x-perl",p12:"application/x-pkcs12",pfx:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",spc:"application/x-pkcs7-certificates",p7r:"application/x-pkcs7-certreqresp",rar:"application/x-rar-compressed",rpm:"application/x-redhat-package-manager",ris:"application/x-research-info-systems",sea:"application/x-sea",sh:"application/x-sh",shar:"application/x-shar",swf:"application/x-shockwave-flash",xap:"application/x-silverlight-app",sql:"application/x-sql",sit:"application/x-stuffit",sitx:"application/x-stuffitx",srt:"application/x-subrip",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",t3:"application/x-t3vm-image",gam:"application/x-tads",tar:"application/x-tar",tcl:"application/x-tcl",tk:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",texinfo:"application/x-texinfo",texi:"application/x-texinfo",obj:"application/x-tgif",ustar:"application/x-ustar",src:"application/x-wais-source",webapp:"application/x-web-app-manifest+json",der:"application/x-x509-ca-cert",crt:"application/x-x509-ca-cert",pem:"application/x-x509-ca-cert",fig:"application/x-xfig",xlf:"application/x-xliff+xml",xpi:"application/x-xpinstall",xz:"application/x-xz",z1:"application/x-zmachine",z2:"application/x-zmachine",z3:"application/x-zmachine",z4:"application/x-zmachine",z5:"application/x-zmachine",z6:"application/x-zmachine",z7:"application/x-zmachine",z8:"application/x-zmachine",xaml:"application/xaml+xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xhtml:"application/xhtml+xml",xht:"application/xhtml+xml",xml:"text/xml",xsl:"application/xml",xsd:"application/xml",rng:"application/xml",dtd:"application/xml-dtd",xop:"application/xop+xml",xpl:"application/xproc+xml",xslt:"application/xslt+xml",xspf:"application/xspf+xml",mxml:"application/xv+xml",xhvml:"application/xv+xml",xvml:"application/xv+xml",xvm:"application/xv+xml",yang:"application/yang",yin:"application/yin+xml",zip:"application/zip","3gpp":"video/3gpp",adp:"audio/adpcm",au:"audio/basic",snd:"audio/basic",mid:"audio/midi",midi:"audio/midi",kar:"audio/midi",rmi:"audio/midi",mp3:"audio/mpeg",m4a:"audio/x-m4a",mp4a:"audio/mp4",mpga:"audio/mpeg",mp2:"audio/mpeg",mp2a:"audio/mpeg",m2a:"audio/mpeg",m3a:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",spx:"audio/ogg",s3m:"audio/s3m",sil:"audio/silk",uva:"audio/vnd.dece.audio",uvva:"audio/vnd.dece.audio",eol:"audio/vnd.digital-winds",dra:"audio/vnd.dra",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",lvp:"audio/vnd.lucent.voice",pya:"audio/vnd.ms-playready.media.pya",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",rip:"audio/vnd.rip",wav:"audio/x-wav",weba:"audio/webm",aac:"audio/x-aac",aif:"audio/x-aiff",aiff:"audio/x-aiff",aifc:"audio/x-aiff",caf:"audio/x-caf",flac:"audio/x-flac",mka:"audio/x-matroska",m3u:"audio/x-mpegurl",wax:"audio/x-ms-wax",wma:"audio/x-ms-wma",ram:"audio/x-pn-realaudio",ra:"audio/x-realaudio",rmp:"audio/x-pn-realaudio-plugin",xm:"audio/xm",cdx:"chemical/x-cdx",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cml:"chemical/x-cml",csml:"chemical/x-csml",xyz:"chemical/x-xyz",bmp:"image/x-ms-bmp",cgm:"image/cgm",g3:"image/g3fax",gif:"image/gif",ief:"image/ief",jpeg:"image/jpeg",jpg:"image/jpeg",jpe:"image/jpeg",ktx:"image/ktx",png:"image/png",btif:"image/prs.btif",sgi:"image/sgi",svg:"image/svg+xml",svgz:"image/svg+xml",tiff:"image/tiff",tif:"image/tiff",psd:"image/vnd.adobe.photoshop",uvi:"image/vnd.dece.graphic",uvvi:"image/vnd.dece.graphic",uvg:"image/vnd.dece.graphic",uvvg:"image/vnd.dece.graphic",djvu:"image/vnd.djvu",djv:"image/vnd.djvu",sub:"text/vnd.dvb.subtitle",dwg:"image/vnd.dwg",dxf:"image/vnd.dxf",fbs:"image/vnd.fastbidsheet",fpx:"image/vnd.fpx",fst:"image/vnd.fst",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",mdi:"image/vnd.ms-modi",wdp:"image/vnd.ms-photo",npx:"image/vnd.net-fpx",wbmp:"image/vnd.wap.wbmp",xif:"image/vnd.xiff",webp:"image/webp","3ds":"image/x-3ds",ras:"image/x-cmu-raster",cmx:"image/x-cmx",fh:"image/x-freehand",fhc:"image/x-freehand",fh4:"image/x-freehand",fh5:"image/x-freehand",fh7:"image/x-freehand",ico:"image/x-icon",jng:"image/x-jng",sid:"image/x-mrsid-image",pcx:"image/x-pcx",pic:"image/x-pict",pct:"image/x-pict",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pgm:"image/x-portable-graymap",ppm:"image/x-portable-pixmap",rgb:"image/x-rgb",tga:"image/x-tga",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",eml:"message/rfc822",mime:"message/rfc822",igs:"model/iges",iges:"model/iges",msh:"model/mesh",mesh:"model/mesh",silo:"model/mesh",dae:"model/vnd.collada+xml",dwf:"model/vnd.dwf",gdl:"model/vnd.gdl",gtw:"model/vnd.gtw",mts:"model/vnd.mts",vtu:"model/vnd.vtu",wrl:"model/vrml",vrml:"model/vrml",x3db:"model/x3d+binary",x3dbz:"model/x3d+binary",x3dv:"model/x3d+vrml",x3dvz:"model/x3d+vrml",x3d:"model/x3d+xml",x3dz:"model/x3d+xml",appcache:"text/cache-manifest",manifest:"text/cache-manifest",ics:"text/calendar",ifb:"text/calendar",coffee:"text/coffeescript",litcoffee:"text/coffeescript",css:"text/css",csv:"text/csv",hjson:"text/hjson",html:"text/html",htm:"text/html",shtml:"text/html",jade:"text/jade",jsx:"text/jsx",less:"text/less",mml:"text/mathml",n3:"text/n3",txt:"text/plain",text:"text/plain",conf:"text/plain",def:"text/plain",list:"text/plain",log:"text/plain",in:"text/plain",ini:"text/plain",dsc:"text/prs.lines.tag",rtx:"text/richtext",sgml:"text/sgml",sgm:"text/sgml",slim:"text/slim",slm:"text/slim",stylus:"text/stylus",styl:"text/stylus",tsv:"text/tab-separated-values",t:"text/troff",tr:"text/troff",roff:"text/troff",man:"text/troff",me:"text/troff",ms:"text/troff",ttl:"text/turtle",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",fly:"text/vnd.fly",flx:"text/vnd.fmi.flexstor",gv:"text/vnd.graphviz","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",jad:"text/vnd.sun.j2me.app-descriptor",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",vtt:"text/vtt",s:"text/x-asm",asm:"text/x-asm",c:"text/x-c",cc:"text/x-c",cxx:"text/x-c",cpp:"text/x-c",h:"text/x-c",hh:"text/x-c",dic:"text/x-c",htc:"text/x-component",f:"text/x-fortran",for:"text/x-fortran",f77:"text/x-fortran",f90:"text/x-fortran",hbs:"text/x-handlebars-template",java:"text/x-java-source",lua:"text/x-lua",markdown:"text/x-markdown",md:"text/x-markdown",mkd:"text/x-markdown",nfo:"text/x-nfo",opml:"text/x-opml",p:"text/x-pascal",pas:"text/x-pascal",pde:"text/x-processing",sass:"text/x-sass",scss:"text/x-scss",etx:"text/x-setext",sfv:"text/x-sfv",ymp:"text/x-suse-ymp",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",yaml:"text/yaml",yml:"text/yaml","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",jpgv:"video/jpeg",jpm:"video/jpm",jpgm:"video/jpm",mj2:"video/mj2",mjp2:"video/mj2",ts:"video/mp2t",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg",ogv:"video/ogg",qt:"video/quicktime",mov:"video/quicktime",uvh:"video/vnd.dece.hd",uvvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvvm:"video/vnd.dece.mobile",uvp:"video/vnd.dece.pd",uvvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",uvvv:"video/vnd.dece.video",dvb:"video/vnd.dvb.file",fvt:"video/vnd.fvt",mxu:"video/vnd.mpegurl",m4u:"video/vnd.mpegurl",pyv:"video/vnd.ms-playready.media.pyv",uvu:"video/vnd.uvvu.mp4",uvvu:"video/vnd.uvvu.mp4",viv:"video/vnd.vivo",webm:"video/webm",f4v:"video/x-f4v",fli:"video/x-fli",flv:"video/x-flv",m4v:"video/x-m4v",mkv:"video/x-matroska",mk3d:"video/x-matroska",mks:"video/x-matroska",mng:"video/x-mng",asf:"video/x-ms-asf",asx:"video/x-ms-asf",vob:"video/x-ms-vob",wm:"video/x-ms-wm",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wvx:"video/x-ms-wvx",avi:"video/x-msvideo",movie:"video/x-sgi-movie",smv:"video/x-smv",ice:"x-conference/x-cooltalk"}},function(t,e,n){(function(e,i,s){function r(t,e){return a.fetch&&e?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&t?"arraybuffer":a.vbArray&&t?"text:vbarray":"text"}function o(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}var a=n(66),c=n(13),u=n(105),l=n(25),h=n(107),p=u.IncomingMessage,d=u.readyStates,f=t.exports=function(t){var n=this;l.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+new e(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){n.setHeader(e,t.headers[e])});var i,s=!0;if("disable-fetch"===t.mode||"timeout"in t)s=!1,i=!0;else if("prefer-streaming"===t.mode)i=!1;else if("allow-wrong-content-type"===t.mode)i=!a.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");i=!0}n._mode=r(i,s),n.on("finish",function(){n._onFinish()})};c(f,l.Writable),f.prototype.setHeader=function(t,e){var n=this,i=t.toLowerCase();-1===m.indexOf(i)&&(n._headers[i]={name:t,value:e})},f.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},f.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},f.prototype._onFinish=function(){var t=this;if(!t._destroyed){var n=t._opts,r=t._headers,o=null;"GET"!==n.method&&"HEAD"!==n.method&&(o=a.blobConstructor?new i.Blob(t._body.map(function(t){return h(t)}),{type:(r["content-type"]||{}).value||""}):e.concat(t._body).toString());var c=[];if(Object.keys(r).forEach(function(t){var e=r[t].name,n=r[t].value;Array.isArray(n)?n.forEach(function(t){c.push([e,t])}):c.push([e,n])}),"fetch"===t._mode)i.fetch(t._opts.url,{method:t._opts.method,headers:c,body:o||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin"}).then(function(e){t._fetchResponse=e,t._connect()},function(e){t.emit("error",e)});else{var u=t._xhr=new i.XMLHttpRequest;try{u.open(t._opts.method,t._opts.url,!0)}catch(e){return void s.nextTick(function(){t.emit("error",e)})}"responseType"in u&&(u.responseType=t._mode.split(":")[0]),"withCredentials"in u&&(u.withCredentials=!!n.withCredentials),"text"===t._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"timeout"in n&&(u.timeout=n.timeout,u.ontimeout=function(){t.emit("timeout")}),c.forEach(function(t){u.setRequestHeader(t[0],t[1])}),t._response=null,u.onreadystatechange=function(){switch(u.readyState){case d.LOADING:case d.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(u.onprogress=function(){t._onXHRProgress()}),u.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{u.send(o)}catch(e){return void s.nextTick(function(){t.emit("error",e)})}}}},f.prototype._onXHRProgress=function(){var t=this;o(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress())},f.prototype._connect=function(){var t=this;t._destroyed||(t._response=new p(t._xhr,t._fetchResponse,t._mode),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},f.prototype._write=function(t,e,n){this._body.push(t),n()},f.prototype.abort=f.prototype.destroy=function(){var t=this;t._destroyed=!0,t._response&&(t._response._destroyed=!0),t._xhr&&t._xhr.abort()},f.prototype.end=function(t,e,n){var i=this;"function"==typeof t&&(n=t,t=void 0),l.Writable.prototype.end.call(i,t,e,n)},f.prototype.flushHeaders=function(){},f.prototype.setTimeout=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var m=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(e,n(6).Buffer,n(12),n(9))},function(t,e,n){(function(t,i,s){var r=n(66),o=n(13),a=n(25),c=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(e,n,s){function o(){u.read().then(function(t){if(!c._destroyed){if(t.done)return void c.push(null);c.push(new i(t.value)),o()}}).catch(function(t){c.emit("error",t)})}var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){t.nextTick(function(){c.emit("close")})}),"fetch"===s){c._fetchResponse=n,c.url=n.url,c.statusCode=n.status,c.statusMessage=n.statusText,n.headers.forEach(function(t,e){c.headers[e.toLowerCase()]=t,c.rawHeaders.push(e,t)});var u=n.body.getReader();o()}else{c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText;if(e.getAllResponseHeaders().split(/\r?\n/).forEach(function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var n=e[1].toLowerCase();"set-cookie"===n?(void 0===c.headers[n]&&(c.headers[n]=[]),c.headers[n].push(e[2])):void 0!==c.headers[n]?c.headers[n]+=", "+e[2]:c.headers[n]=e[2],c.rawHeaders.push(e[1],e[2])}}),c._charset="x-user-defined",!r.overrideMimeType){var l=c.rawHeaders["mime-type"];if(l){var h=l.match(/;\s*charset=([^;])(;|$)/);h&&(c._charset=h[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};o(u,a.Readable),u.prototype._read=function(){},u.prototype._onXHRProgress=function(){var t=this,e=t._xhr,n=null;switch(t._mode){case"text:vbarray":if(e.readyState!==c.DONE)break;try{n=new s.VBArray(e.responseBody).toArray()}catch(t){}if(null!==n){t.push(new i(n));break}case"text":try{n=e.responseText}catch(e){t._mode="text:vbarray";break}if(n.length>t._pos){var r=n.substr(t._pos);if("x-user-defined"===t._charset){for(var o=new i(r.length),a=0;at._pos&&(t.push(new i(new Uint8Array(u.result.slice(t._pos)))),t._pos=u.result.byteLength)},u.onload=function(){t.push(null)},u.readAsArrayBuffer(n)}t._xhr.readyState===c.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(e,n(9),n(6).Buffer,n(12))},function(t,e,n){function i(t,e){this._id=t,this._clearFn=e}var s=Function.prototype.apply;e.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(97),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,n){var i=n(6).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(i.isBuffer(t)){for(var e=new Uint8Array(t.length),n=t.length,s=0;sn(new Error("INVALID_TOKEN")),3e5);this.client.api.gateway.get().then(o=>{const a=i.DefaultOptions.ws.version;const c=`${o.url}/?v=${a}&encoding=${s.ENCODING}`;this.client.emit(i.Events.DEBUG,`Using gateway ${c}`);this.client.ws.connect(c);this.client.ws.connection.once("close",t=>{4004===t.code&&n(new Error("TOKEN_INVALID"));4010===t.code&&n(new Error("SHARDING_INVALID"));4011===t.code&&n(new Error("SHARDING_REQUIRED"))});this.client.once(i.Events.READY,()=>{e(t);this.client.clearTimeout(r)})},n)}destroy(){return this.client.ws.destroy(),this.client.rest.destroy(),this.client.user?this.client.user.bot?(this.client.token=null,Promise.resolve()):this.client.api.logout.post().then(()=>{this.client.token=null}):Promise.resolve()}}t.exports=r},function(t,e,n){class i{constructor(t){this.client=t,this.register(n(134)),this.register(n(135)),this.register(n(136)),this.register(n(140)),this.register(n(137)),this.register(n(138)),this.register(n(139)),this.register(n(116)),this.register(n(117)),this.register(n(118)),this.register(n(121)),this.register(n(133)),this.register(n(126)),this.register(n(127)),this.register(n(119)),this.register(n(128)),this.register(n(129)),this.register(n(130)),this.register(n(141)),this.register(n(143)),this.register(n(142)),this.register(n(132)),this.register(n(122)),this.register(n(123)),this.register(n(124)),this.register(n(125)),this.register(n(131)),this.register(n(120))}register(t){this[t.name.replace(/Action$/,"")]=new t(this.client)}}t.exports=i},function(t,e,n){const i=n(2);class s extends i{handle(t){return{channel:this.client.channels.create(t)}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.channels.get(t.id);return n?(e.channels.remove(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)):n=this.deleted.get(t.id)||null,{channel:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.channels.get(t.id);if(n){const i=n._update(t);return e.emit(s.Events.CHANNEL_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id),i=e.users.create(t.user);n&&i&&e.emit(s.Events.GUILD_BAN_REMOVE,n,i)}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n)for(const e of t.channels){const t=n.channels.get(e.id);t&&(t.position=e.position)}return{guild:n}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.guilds.get(t.id);if(n){for(const t of n.channels.values())"text"===t.type&&t.stopTyping(!0);if(n.available&&t.unavailable)return n.available=!1,e.emit(s.Events.GUILD_UNAVAILABLE,n),{guild:null};e.guilds.delete(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)}else n=this.deleted.get(t.id)||null;return{guild:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t,e){return{emoji:t.emojis.create(e)}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){return t.guild.emojis.remove(t.id),{emoji:t}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t,e){const n=t._update(e);return this.client.emit(s.Events.GUILD_EMOJI_UPDATE,n,t),{emoji:t}}}t.exports=r},function(t,e,n){function i(t){const e=new Map;for(const n of t)e.set(...n);return e}const s=n(2);class r extends s{handle(t){const e=this.client.guilds.get(t.guild_id);if(e&&e.emojis){const n=i(e.emojis.entries());for(const i of t.emojis){const t=e.emojis.get(i.id);t?(n.delete(i.id),t.equals(i,!0)||this.client.actions.GuildEmojiUpdate.handle(t,i)):this.client.actions.GuildEmojiCreate.handle(e,i)}for(const t of n.values())this.client.actions.GuildEmojiDelete.handle(t)}}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t,e){return{member:t._addMember(e,!1)}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);let i=null;return n&&(i=n.members.get(t.user.id),i?(n.memberCount--,n._removeMember(i),this.deleted.set(n.id+t.user.id,i),e.status===s.Status.READY&&e.emit(s.Events.GUILD_MEMBER_REMOVE,i),this.scheduleForDeletion(n.id,t.user.id)):i=this.deleted.get(n.id+t.user.id)||null),{guild:n,member:i}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(22);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);let i;if(n){const o=n.roles.has(t.role.id);i=new r(n,t.role),n.roles.set(i.id,i),o||e.emit(s.Events.GUILD_ROLE_CREATE,i)}return{role:i}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);let i;return n&&(i=n.roles.get(t.role_id),i?(n.roles.delete(t.role_id),this.deleted.set(n.id+t.role_id,i),this.scheduleForDeletion(n.id,t.role_id),e.emit(s.Events.GUILD_ROLE_DELETE,i)):i=this.deleted.get(n.id+t.role_id)||null),{role:i}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){let i=null;const r=n.roles.get(t.role.id);return r&&(i=r._update(t.role),e.emit(s.Events.GUILD_ROLE_UPDATE,i,r)),{old:i,updated:r}}return{old:null,updated:null}}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n)for(const e of t.roles){const t=n.roles.get(e.id);t&&(t.position=e.position)}return{guild:n}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){if(t.presences)for(const e of t.presences)n._setPresence(e.user.id,e);if(t.members)for(const e of t.members){const t=n.members.get(e.user.id);t?n._updateMember(t,e):n._addMember(e,!1)}"large"in t&&(n.large=t.large)}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){const i=n._update(t);return e.emit(s.Events.GUILD_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=r},function(t,e,n){const i=n(2),s=n(10);class r extends i{handle(t){const e=this.client,n=e.channels.get((t instanceof Array?t[0]:t).channel_id),i=e.users.get((t instanceof Array?t[0]:t).author.id);if(n){const r=n.guild?n.guild.member(i):null;if(t instanceof Array){const o=new Array(t.length);for(let i=0;ithis.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(3),r=n(0);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id),i=t.ids,o=new s;for(const t of i){const e=n.messages.get(t);e&&o.set(e.id,e)}return o.size>0&&e.emit(r.Events.MESSAGE_BULK_DELETE,o),{messages:o}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._addReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_ADD,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._removeReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_REMOVE,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.channels.get(t.channel_id);if(!e||"voice"===e.type)return!1;const n=e.messages.get(t.message_id);return!!n&&(n._clearReactions(),this.client.emit(s.Events.MESSAGE_REACTION_REMOVE_ALL,n),{message:n})}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id);if(n){const i=n.messages.get(t.id);return i?(i.patch(t),e.emit(s.Events.MESSAGE_UPDATE,i._edits[0],i),{old:i._edits[0],updated:i}):{old:i,updated:i}}return{old:null,updated:null}}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t){return{user:this.client.users.create(t)}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.user.notes.get(t.id),i=t.note.length?t.note:null;return e.user.notes.set(t.id,i),e.emit(s.Events.USER_NOTE_UPDATE,t.id,n,i),{old:n,updated:i}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client;if(e.user){if(e.user.equals(t))return{old:e.user,updated:e.user};const n=r.cloneObject(e.user);return e.user.patch(t),e.emit(s.Events.USER_UPDATE,n,e.user),{old:n,updated:e.user}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(38),s=n(41),{Error:Error}=n(5);class r{constructor(t,e,n,i){this.rest=t,this.client=t.client,this.method=e,this.path=n.toString(),this.route=this.getRoute(this.path),this.options=i}getRoute(t){let e=t.split("?")[0];if(e.includes("/channels/")||e.includes("/guilds/")){const t=e.includes("/channels/")?e.indexOf("/channels/"):e.indexOf("/guilds/"),n=e.substring(t).split("/")[2];e=e.replace(/(\d{8,})/g,":id").replace(":id",n)}return e}getAuth(){if(this.client.token&&this.client.user&&this.client.user.bot)return`Bot ${this.client.token}`;if(this.client.token)return this.client.token;throw new Error("TOKEN_MISSING")}gen(){const t=`${this.client.options.http.host}/api/v${this.client.options.http.version}`;if(this.options.query){const t=(i.stringify(this.options.query).match(/[^=&?]+=[^=&?]+/g)||[]).join("&");this.path+=`?${t}`}const e=s[this.method](`${t}${this.path}`);if(!1!==this.options.auth&&e.set("Authorization",this.getAuth()),this.options.reason&&e.set("X-Audit-Log-Reason",encodeURIComponent(this.options.reason)),this.rest.client.browser||e.set("User-Agent",this.rest.userAgentManager.userAgent),this.options.files){for(const t of this.options.files)t&&t.file&&e.attach(t.name,t.file,t.name);void 0!==this.options.data&&e.attach("payload_json",JSON.stringify(this.options.data))}else void 0!==this.options.data&&e.send(this.options.data);return e}}t.exports=r},function(t,e,n){const i=n(42),s=["get","post","delete","patch","put"],r=["channels","users","guilds","members","bans","emojis","pins","permissions","reactions","webhooks","messages","notes","roles","applications","invites","bot"],o=["toString","valueOf","inspect",Symbol.toPrimitive,i.inspect.custom];t.exports=(t=>{const e={get(n,i){function a(...t){n=n.concat(i);for(const e of t)null!==e&&void 0!==e&&(n=n.concat(e));return new Proxy(n,e)}if(o.includes(i))return()=>n.join("/");if(r.includes(i)){const e=()=>`${n.join("/")}/${i}`;for(const t of o)a[t]=e;for(const e of s)a[e]=(s=>t.request(e,`${n.join("/")}/${i}`,s));return a}return s.includes(i)?e=>t.request(i,n.join("/"),e):new Proxy(n.concat(i),e)}};return new Proxy([""],e)})},function(t,e,n){const i=n(72),s=n(70);class r extends i{constructor(t,e){super(t,e),this.client=t.client,this.limit=1/0,this.resetTime=null,this.remaining=1,this.timeDifference=0,this.resetTimeout=null}push(t){super.push(t),this.handle()}execute(t){t&&t.request.gen().end((e,n)=>{n&&n.headers&&(this.limit=Number(n.headers["x-ratelimit-limit"]),this.resetTime=1e3*Number(n.headers["x-ratelimit-reset"]),this.remaining=Number(n.headers["x-ratelimit-remaining"]),this.timeDifference=Date.now()-new Date(n.headers.date).getTime());if(e)if(429===e.status){if(this.queue.unshift(t),n.headers["x-ratelimit-global"]&&(this.globalLimit=!0),this.resetTimeout)return;this.resetTimeout=this.client.setTimeout(()=>{this.remaining=this.limit;this.globalLimit=!1;this.handle();this.resetTimeout=null},Number(n.headers["retry-after"])+this.client.options.restTimeOffset)}else t.reject(400===e.status?new s(n.body):e),this.handle();else{this.globalLimit=!1;const e=n&&n.body?n.body:{};t.resolve(e),this.handle()}})}handle(){super.handle(),this.remaining<=0||0===this.queue.length||this.globalLimit||(this.execute(this.queue.shift()),this.remaining--,this.handle())}}t.exports=r},function(t,e,n){const i=n(72),s=n(70);class r extends i{constructor(t,e){super(t,e),this.endpoint=e,this.timeDifference=0,this.busy=!1}push(t){super.push(t),this.handle()}execute(t){return this.busy=!0,new Promise(e=>{t.request.gen().end((n,i)=>{i&&i.headers&&(this.requestLimit=Number(i.headers["x-ratelimit-limit"]),this.requestResetTime=1e3*Number(i.headers["x-ratelimit-reset"]),this.requestRemaining=Number(i.headers["x-ratelimit-remaining"]),this.timeDifference=Date.now()-new Date(i.headers.date).getTime());if(n)429===n.status?(this.queue.unshift(t),this.restManager.client.setTimeout(()=>{this.globalLimit=!1;e()},Number(i.headers["retry-after"])+this.restManager.client.options.restTimeOffset),i.headers["x-ratelimit-global"]&&(this.globalLimit=!0)):(t.reject(n.status>=400&&n.status<500?new s(i.body):n),e(n));else{this.globalLimit=!1;const n=i&&i.body?i.body:{};t.resolve(n),0===this.requestRemaining?this.restManager.client.setTimeout(()=>e(n),this.requestResetTime-Date.now()+this.timeDifference+this.restManager.client.options.restTimeOffset):e(n)}})})}handle(){super.handle(),this.busy||0===this.remaining||0===this.queue.length||this.globalLimit||this.execute(this.queue.shift()).then(()=>{this.busy=!1;this.handle()})}}t.exports=r},function(t,e,n){(function(e){const i=n(0);class s{constructor(){this.build(this.constructor.DEFAULT)}set({url:url,version:version}={}){this.build({url:url||this.constructor.DFEAULT.url,version:version||this.constructor.DEFAULT.version})}build(t){this.userAgent=`DiscordBot (${t.url}, ${t.version}) Node.js/${e.version}`}}s.DEFAULT={url:i.Package.homepage.split("#")[0],version:i.Package.version},t.exports=s}).call(e,n(9))},function(t,e,n){const i=n(15).EventEmitter,s=n(0),r=n(73);class o extends i{constructor(t){super(),this.client=t,this.connection=null}heartbeat(){return this.connection?this.connection.heartbeat():this.debug("No connection to heartbeat")}debug(t){return this.client.emit("debug",`[ws] ${t}`)}destroy(){return this.connection?this.connection.destroy():(this.debug("Attempted to destroy WebSocket but no connection exists!"),!1)}send(t){if(!this.connection)return void this.debug("No connection to websocket");this.connection.send(t)}connect(t){if(!this.connection)return this.connection=new r(this,t),!0;switch(this.connection.status){case s.Status.IDLE:case s.Status.DISCONNECTED:return this.connection.connect(t,5500),!0;default:return this.debug(`Couldn't connect to ${t} as the websocket is at state ${this.connection.status}`),!1}}}t.exports=o},function(t,e,n){const i=n(0),s=[i.WSEvents.READY,i.WSEvents.RESUMED,i.WSEvents.GUILD_CREATE,i.WSEvents.GUILD_DELETE,i.WSEvents.GUILD_MEMBERS_CHUNK,i.WSEvents.GUILD_MEMBER_ADD,i.WSEvents.GUILD_MEMBER_REMOVE];class r{constructor(t){this.ws=t,this.handlers={},this.queue=[],this.register(i.WSEvents.READY,n(177)),this.register(i.WSEvents.RESUMED,n(180)),this.register(i.WSEvents.GUILD_CREATE,n(157)),this.register(i.WSEvents.GUILD_DELETE,n(158)),this.register(i.WSEvents.GUILD_UPDATE,n(168)),this.register(i.WSEvents.GUILD_BAN_ADD,n(155)),this.register(i.WSEvents.GUILD_BAN_REMOVE,n(156)),this.register(i.WSEvents.GUILD_MEMBER_ADD,n(160)),this.register(i.WSEvents.GUILD_MEMBER_REMOVE,n(161)),this.register(i.WSEvents.GUILD_MEMBER_UPDATE,n(162)),this.register(i.WSEvents.GUILD_ROLE_CREATE,n(164)),this.register(i.WSEvents.GUILD_ROLE_DELETE,n(165)),this.register(i.WSEvents.GUILD_ROLE_UPDATE,n(166)),this.register(i.WSEvents.GUILD_EMOJIS_UPDATE,n(159)),this.register(i.WSEvents.GUILD_MEMBERS_CHUNK,n(163)),this.register(i.WSEvents.CHANNEL_CREATE,n(151)),this.register(i.WSEvents.CHANNEL_DELETE,n(152)),this.register(i.WSEvents.CHANNEL_UPDATE,n(154)),this.register(i.WSEvents.CHANNEL_PINS_UPDATE,n(153)),this.register(i.WSEvents.PRESENCE_UPDATE,n(176)),this.register(i.WSEvents.USER_UPDATE,n(184)),this.register(i.WSEvents.USER_NOTE_UPDATE,n(182)),this.register(i.WSEvents.USER_SETTINGS_UPDATE,n(183)),this.register(i.WSEvents.VOICE_STATE_UPDATE,n(186)),this.register(i.WSEvents.TYPING_START,n(181)),this.register(i.WSEvents.MESSAGE_CREATE,n(169)),this.register(i.WSEvents.MESSAGE_DELETE,n(170)),this.register(i.WSEvents.MESSAGE_UPDATE,n(175)),this.register(i.WSEvents.MESSAGE_DELETE_BULK,n(171)),this.register(i.WSEvents.VOICE_SERVER_UPDATE,n(185)),this.register(i.WSEvents.GUILD_SYNC,n(167)),this.register(i.WSEvents.RELATIONSHIP_ADD,n(178)),this.register(i.WSEvents.RELATIONSHIP_REMOVE,n(179)),this.register(i.WSEvents.MESSAGE_REACTION_ADD,n(172)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE,n(173)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE_ALL,n(174))}get client(){return this.ws.client}register(t,e){this.handlers[t]=new e(this)}handleQueue(){this.queue.forEach((t,e)=>{this.handle(this.queue[e],!0);this.queue.splice(e,1)})}handle(t,e=!1){return t.op===i.OPCodes.HEARTBEAT_ACK?(this.ws.client._pong(this.ws.client._pingTimestamp),this.ws.lastHeartbeatAck=!0,this.ws.client.emit("debug","Heartbeat acknowledged")):t.op===i.OPCodes.HEARTBEAT&&(this.client.ws.send({op:i.OPCodes.HEARTBEAT,d:this.client.ws.sequence}),this.ws.client.emit("debug","Received gateway heartbeat")),this.ws.status===i.Status.RECONNECTING&&(this.ws.reconnecting=!1,this.ws.checkIfReady()),this.ws.setSequence(t.s),void 0===this.ws.disabledEvents[t.t]&&(this.ws.status!==i.Status.READY&&-1===s.indexOf(t.t)?(this.queue.push(t),!1):(!e&&this.queue.length>0&&this.handleQueue(),!!this.handlers[t.t]&&this.handlers[t.t].handle(t)))}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.ChannelCreate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.ChannelDelete.handle(n);i.channel&&e.emit(s.Events.CHANNEL_DELETE,i.channel)}}t.exports=r},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.channels.get(n.channel_id),r=new Date(n.last_pin_timestamp);i&&r&&e.emit(s.Events.CHANNEL_PINS_UPDATE,i,r)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.ChannelUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id),r=e.users.get(n.user.id);i&&r&&e.emit(s.Events.GUILD_BAN_ADD,i,r)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildBanRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.id);i?i.available||n.unavailable||(i._patch(n),this.packetManager.ws.checkIfReady()):e.guilds.create(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.GuildDelete.handle(n);i.guild&&e.emit(s.Events.GUILD_DELETE,i.guild)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildEmojisUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);i&&(i.memberCount++,i._addMember(n))}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildMemberRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);if(i){const t=i.members.get(n.user.id);t&&i._updateMember(t,n)}}}t.exports=s},function(t,e,n){const i=n(1),s=n(0),r=n(3);class o extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);if(i){const t=new r;for(const e of n.members)t.set(e.id,i._addMember(e,!1));e.emit(s.Events.GUILD_MEMBERS_CHUNK,t,i),e.ws.lastHeartbeatAck=!0}}}t.exports=o},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleCreate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleDelete.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildSync.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.MessageCreate.handle(n);i.message&&e.emit(s.Events.MESSAGE_CREATE,i.message)}}t.exports=r},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.MessageDelete.handle(n);i.message&&e.emit(s.Events.MESSAGE_DELETE,i.message)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageDeleteBulk.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionAdd.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionRemoveAll.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(t){const e=this.packetManager.client,n=t.d;let i=e.users.get(n.user.id);const o=e.guilds.get(n.guild_id);if(!i){if(!n.user.username)return;i=e.users.create(n.user)}const a=r.cloneObject(i);if(i.patch(n.user),i.equals(a)||e.emit(s.Events.USER_UPDATE,a,i),o){let t=o.members.get(i.id);if(t||"offline"===n.status||(t=o._addMember({user:i,roles:n.roles,deaf:!1,mute:!1},!1),e.emit(s.Events.GUILD_MEMBER_AVAILABLE,t)),t){if(0===e.listenerCount(s.Events.PRESENCE_UPDATE))return void o._setPresence(i.id,n);const a=r.cloneObject(t);t.presence&&(a.frozenPresence=r.cloneObject(t.presence)),o._setPresence(i.id,n),e.emit(s.Events.PRESENCE_UPDATE,a,t)}else o._setPresence(i.id,n)}}}t.exports=o},function(t,e,n){const i=n(1),s=n(45);class r extends i{handle(t){const e=this.packetManager.client,n=t.d;e.ws.heartbeat(),n.user.user_settings=n.user_settings;const i=new s(e,n.user);e.user=i,e.readyAt=new Date,e.users.set(i.id,i);for(const t of n.guilds)e.guilds.create(t);for(const t of n.private_channels)e.channels.create(t);for(const t of n.relationships){const n=e.users.create(t.user);1===t.type?e.user.friends.set(n.id,n):2===t.type&&e.user.blocked.set(n.id,n)}n.presences=n.presences||[];for(const t of n.presences)e.users.create(t.user),e._setPresence(t.user.id,t);if(n.notes)for(const t in n.notes){let i=n.notes[t];i.length||(i=null),e.user.notes.set(t,i)}!e.user.bot&&e.options.sync&&e.setInterval(e.syncGuilds.bind(e),3e4),e.users.has("1")||e.users.create({id:"1",username:"Clyde",discriminator:"0000",avatar:"https://discordapp.com/assets/f78426a064bc9dd24847519259bc42af.png",bot:!0,status:"online",game:null,verified:!0});const r=e.setTimeout(()=>{e.ws.connection.triggerReady()},1200*n.guilds.length);e.setMaxListeners(n.guilds.length+10),e.once("ready",()=>{e.syncGuilds();e.setMaxListeners(10);e.clearTimeout(r)});const o=this.packetManager.ws;o.sessionID=n.session_id,o._trace=n._trace,e.emit("debug",`READY ${o._trace.join(" -> ")} ${o.sessionID}`),o.checkIfReady()}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;1===n.type?e.fetchUser(n.id).then(t=>{e.user.friends.set(t.id,t)}):2===n.type&&e.fetchUser(n.id).then(t=>{e.user.blocked.set(t.id,t)})}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;2===n.type?e.user.blocked.has(n.id)&&e.user.blocked.delete(n.id):1===n.type&&e.user.friends.has(n.id)&&e.user.friends.delete(n.id)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=e.ws.connection;n._trace=t.d._trace,n.status=s.Status.READY,this.packetManager.handleQueue();const i=n.sequence-n.closeSequence;n.debug(`RESUMED ${n._trace.join(" -> ")} | replayed ${i} events.`),e.emit("resume",i),n.heartbeat()}}t.exports=r},function(t,e,n){function i(t,e){return t.client.setTimeout(()=>{t.client.emit(r.Events.TYPING_STOP,t,e,t._typing.get(e.id));t._typing.delete(e.id)},6e3)}const s=n(1),r=n(0);class o extends s{handle(t){const e=this.packetManager.client,n=t.d,s=e.channels.get(n.channel_id),o=e.users.get(n.user_id),c=new Date(1e3*n.timestamp);if(s&&o){if("voice"===s.type)return void e.emit(r.Events.WARN,`Discord sent a typing packet to voice channel ${s.id}`);if(s._typing.has(o.id)){const t=s._typing.get(o.id);t.lastTimestamp=c,t.resetTimeout(i(s,o))}else s._typing.set(o.id,new a(e,c,c,i(s,o))),e.emit(r.Events.TYPING_START,s,o)}}}class a{constructor(t,e,n,i){this.client=t,this.since=e,this.lastTimestamp=n,this._timeout=i}resetTimeout(t){this.client.clearTimeout(this._timeout),this._timeout=t}get elapsedTime(){return Date.now()-this.since}}t.exports=o},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.UserNoteUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client;e.user.settings.patch(t.d),e.emit(s.Events.USER_SETTINGS_UPDATE,e.user.settings)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.UserUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.emit("self.voiceServer",n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);if(i){const t=i.members.get(n.user_id);if(t){const i=r.cloneObject(t);t.voiceChannel&&t.voiceChannel.id!==n.channel_id&&t.voiceChannel.members.delete(i.id),n.channel_id||(t.speaking=null),t.user.id===e.user.id&&n.channel_id&&e.emit("self.voiceStateUpdate",n);const o=e.channels.get(n.channel_id);o&&o.members.set(t.user.id,t),t.serverMute=n.mute,t.serverDeaf=n.deaf,t.selfMute=n.self_mute,t.selfDeaf=n.self_deaf,t.voiceSessionID=n.session_id,t.voiceChannelID=n.channel_id,e.emit(s.Events.VOICE_STATE_UPDATE,i,t)}}}}t.exports=o},function(t,e,n){const{register:register}=n(74),i={CLIENT_INVALID_OPTION:(t,e)=>`The ${t} option must be ${e}`,TOKEN_INVALID:"An invalid token was provided.",TOKEN_MISSING:"Request to use token, but token was unavailable to the client.",FEATURE_BOT_ONLY:"Only bot accounts are able to make use of this feature.",FEATURE_USER_ONLY:"Only user accounts are able to make use of this feature.",WS_BAD_MESSAGE:"A bad message was received from the websocket; either bad compression, or not JSON.",WS_CONNECTION_EXISTS:"There is already an existing WebSocket connection.",WS_NOT_OPEN:(t="data")=>`Websocket not open to send ${t}`,PERMISSIONS_INVALID:"Invalid permission string or number.",PERMISSIONS_INVALID_FLAG:"Invalid bitfield flag string or number",RATELIMIT_INVALID_METHOD:"Unknown rate limiting method.",SHARDING_INVALID:"Invalid shard settings were provided.",SHARDING_REQUIRED:"This session would have handled too many guilds - Sharding is required.",SHARDING_CHILD_CONNECTION:"Failed to send message to shard's process.",SHARDING_PARENT_CONNECTION:"Failed to send message to master process.",SHARDING_NO_SHARDS:"No shards have been spawned",SHARDING_IN_PROCESS:"Shards are still being spawned",SHARDING_ALREADY_SPAWNED:t=>`Already spawned ${t} shards`,COLOR_RANGE:"Color must be within the range 0 - 16777215 (0xFFFFFF).",COLOR_CONVERT:"Unable to convert color to a number.",EMBED_FIELD_COUNT:"MessageEmbeds may not exceed 25 fields.",EMBED_FIELD_NAME:"MessageEmbed field names may not exceed 256 characters or be empty.",EMBED_FIELD_VALUE:"MessageEmbed field values may not exceed 1024 characters or be empty.",EMBED_FILE_LIMIT:"You may not upload more than one file at once.",EMBED_DESCRIPTION:"MessageEmbed descriptions may not exceed 2048 characters.",EMBED_FOOTER_TEXT:"MessageEmbed footer text may not exceed 2048 characters.",EMBED_TITLE:"MessageEmbed titles may not exceed 256 characters.",FILE_NOT_FOUND:t=>`File could not be found: ${t}`,USER_STATUS:"User status must be a string",SHARD_MESSAGE_FAILED:"Failed to send message to master process.",VOICE_INVALID_HEARTBEAT:"Tried to set voice heartbeat but no valid interval was specified.",VOICE_USER_MISSING:"Couldn't resolve the user to create stream.",VOICE_STREAM_EXISTS:"There is already an existing stream for that user.",VOICE_JOIN_CHANNEL:(t=!1)=>`You do not have permission to join this voice channel${t?"; it is full.":"."}`,OPUS_ENGINE_MISSING:"Couldn't find an Opus engine.",UDP_SEND_FAIL:"Tried to send a UDP packet, but there is no socket available.",UDP_ADDRESS_MALFORMED:"Malformed UDP address or port.",UDP_CONNECTION_EXISTS:"There is already an existing UDP connection.",REQ_BODY_TYPE:"The response body isn't a Buffer.",REQ_RESOURCE_TYPE:"The resource must be a string or Buffer.",IMAGE_FORMAT:t=>`Invalid image format: ${t}`,IMAGE_SIZE:t=>`Invalid image size: ${t}`,MESSAGE_MISSING:"Message not found",MESSAGE_BULK_DELETE_TYPE:"The messages must be an Array, Collection, or number.",MESSAGE_NONCE_TYPE:"Message nonce must fit in an unsigned 64-bit integer.",TYPING_COUNT:"Count must be at least 1",SPLIT_MAX_LEN:"Message exceeds the max length and contains no split characters.",BAN_RESOLVE_ID:"Couldn't resolve the user ID to unban.",PRUNE_DAYS_TYPE:"Days must be a number",SEARCH_CHANNEL_TYPE:"Target must be a TextChannel, DMChannel, GroupDMChannel, or Guild.",MESSAGE_SPLIT_MISSING:"Message exceeds the max length and contains no split characters.",GUILD_CHANNEL_RESOLVE:"Could not resolve channel to a guild channel.",GUILD_MEMBERS_NOT_RECEIVED:"Members didn't arrive in time.",EMOJI_TYPE:"Emoji must be a string or Emoji/ReactionEmoji"};for(const[t,e]of Object.entries(i))register(t,e)},function(t,e,n){const i=n(4);t.exports={Client:n(77),Shard:n(80),ShardClientUtil:n(81),ShardingManager:n(82),WebhookClient:n(78),Collection:n(3),Constants:n(0),EvaluatedPermissions:n(11),Permissions:n(11),Snowflake:n(8),SnowflakeUtil:n(8),Util:i,util:i,version:n(44).version,escapeMarkdown:i.escapeMarkdown,fetchRecommendedShards:i.fetchRecommendedShards,splitMessage:i.splitMessage,Channel:n(17),ClientUser:n(45),ClientUserSettings:n(46),Collector:n(35),DMChannel:n(47),Emoji:n(19),Game:n(14).Game,GroupDMChannel:n(32),Guild:n(20),GuildAuditLogs:n(48),GuildChannel:n(33),GuildMember:n(21),Invite:n(29),Message:n(10),MessageAttachment:n(49),MessageCollector:n(50),MessageEmbed:n(51),MessageMentions:n(52),MessageReaction:n(53),OAuth2Application:n(30),ClientOAuth2Application:n(30),PartialGuild:n(54),PartialGuildChannel:n(55),PermissionOverwrites:n(56),Presence:n(14).Presence,ReactionEmoji:n(34),ReactionCollector:n(57),RichEmbed:n(79),Role:n(22),TextChannel:n(58),User:n(18),VoiceChannel:n(59),Webhook:n(23)},"browser"===n(28).platform()&&(window.Discord=t.exports)},function(t,e,n){const i=n(26),s=n(47),r=n(32),o=n(0);class a extends i{create(t,e,n=!0){super.create();const i=this.get(t.id);if(i)return i;let a;switch(t.type){case o.ChannelTypes.DM:a=new s(this.client,t);break;case o.ChannelTypes.GROUP_DM:a=new r(this.client,t);break;default:if(!(e=e||this.client.guilds.get(t.guild_id)))return this.client.emit("debug",`Failed to find guild for channel ${t.id}`),null;a=e.channels.create(t)}return this.set(a.id,a),a&&n&&this.client.emit(o.Events.CHANNEL_CREATE,a),a}remove(t){super.remove();const e=this.get(t);e.guild&&e.guild.channels.remove(t),this.delete(t)}}t.exports=a},function(t,e,n){const i=n(26),s=n(19),r=n(0);class o extends i{constructor(t,e){super(t.client,e),this.guild=t}create(t,e=!0){super.create();const n=this.guild,i=n.emojis.get(t.id);if(i)return i;const o=new s(n,t);return n.emojis.set(o.id,o),e&&o&&this.client.emit(r.Events.GUILD_EMOJI_CREATE,o),o}remove(t,e=!0){super.remove();const n=this.get(t);this.delete(t),e&&n&&this.client.emit(r.Events.GUILD_EMOJI_DELETE,n)}}t.exports=o},function(t,e,n){const i=n(26),s=n(58),r=n(59),o=n(0);class a extends i{constructor(t,e){super(t.client,e),this.guild=t}create(t){super.create();const e=this.get(t.id);if(e)return e;const n=t.type===o.ChannelTypes.TEXT?s:r,i=new n(this.guild,t);return this.set(i.id,i),i}remove(t){super.remove(),this.delete(t)}}t.exports=a},function(t,e,n){const i=n(26),s=n(20),r=n(0);class o extends i{create(t,e){super.create();const n=this.get(t.id);if(n)return n;void 0===e&&(e=this.client.ws.connection.status===r.Status.READY);const i=new s(this.client,t);return this.set(i.id,i),e&&(this.client.options.fetchAllMembers?i.fetchMembers().then(()=>{this.client.emit(r.Events.GUILD_CREATE,i)}):this.client.emit(r.Events.GUILD_CREATE,i)),i}remove(t,e){super.remove(),void 0===e&&(e=this.client.ws.connection.status===r.Status.READY);const n=this.get(t);this.delete(t),e&&n&&this.client.emit(r.Events.GUILD_DELETE,n)}}t.exports=o},function(t,e,n){const i=n(26),s=n(18);class r extends i{create(t){super.create();const e=this.get(t.id);if(e)return e;const n=new s(this.client,t);return this.set(n.id,n),n}remove(t){super.remove(),this.delete(t)}fetch(t,e=!0){const n=this.get(t);return n?Promise.resolve(n):this.client.api.users(t).get().then(t=>e?this.create(t):new s(this.client,t))}}t.exports=r},function(t,e){class n{constructor(t,e){this.user=t,this._patch(e)}_patch(t){super._patch(t),this.type=t.type,this.name=t.name,this.id=t.id,this.revoked=t.revoked,this.integrations=t.integrations}}t.exports=n},function(t,e,n){const i=n(3),s=n(194),r=n(7);class o extends r{constructor(t,e){super(t.client),this.user=t,this.mutualGuilds=new i,this.connections=new i,this._patch(e)}setup(t){super._patch(t),this.premium=t.premium,this.premiumSince=t.premium_since?new Date(t.premium_since):null;for(const e of t.mutual_guilds)this.client.guilds.has(e.id)&&this.mutualGuilds.set(e.id,this.client.guilds.get(e.id));for(const e of t.connected_accounts)this.connections.set(e.id,new s(this.user,e))}}t.exports=o},function(t,e,n){const i=n(36),{TypeError:TypeError}=n(5);t.exports=function(t,e){if("string"==typeof e&&(e={content:e}),e.before&&(e.before instanceof Date||(e.before=new Date(e.before)),e.maxID=i.fromNumber(e.before.getTime()-14200704e5).shiftLeft(22).toString()),e.after&&(e.after instanceof Date||(e.after=new Date(e.after)),e.minID=i.fromNumber(e.after.getTime()-14200704e5).shiftLeft(22).toString()),e.during){e.during instanceof Date||(e.during=new Date(e.during));const t=e.during.getTime()-14200704e5;e.minID=i.fromNumber(t).shiftLeft(22).toString(),e.maxID=i.fromNumber(t+864e5).shiftLeft(22).toString()}e.channel&&(e.channel=t.client.resolver.resolveChannelID(e.channel)),e.author&&(e.author=t.client.resolver.resolveUserID(e.author)),e.mentions&&(e.mentions=t.client.resolver.resolveUserID(e.options.mentions)),e.sortOrder&&(e.sortOrder={ascending:"asc",descending:"desc"}[e.sortOrder]||e.sortOrder),e={content:e.content,max_id:e.maxID,min_id:e.minID,has:e.has,channel_id:e.channel,author_id:e.author,author_type:e.authorType,context_size:e.contextSize,sort_by:e.sortBy,sort_order:e.sortOrder,limit:e.limit,offset:e.offset,mentions:e.mentions,mentions_everyone:e.mentionsEveryone,link_hostname:e.linkHostname,embed_provider:e.embedProvider,embed_type:e.embedType,attachment_filename:e.attachmentFilename,attachment_extension:e.attachmentExtension,include_nsfw:e.nsfw};const s=n(17),r=n(20),o=n(10);if(!(t instanceof s||t instanceof r))throw new TypeError("SEARCH_CHANNEL_TYPE");return t.client.api[t instanceof s?"channels":"guilds"](t.id).messages().search.get({query:e}).then(e=>{const n=e.messages.map(e=>e.map(e=>new o(t.client.channels.get(e.channel_id),e,t.client)));return{total:e.total_results,results:n}})}},function(t,e,n){const i=n(4),{RangeError:RangeError}=n(5);t.exports=function(t,e){const s=n(18),r=n(21);if(t instanceof s||t instanceof r)return t.createDM().then(t=>t.send(e));let{content:content,nonce:nonce,reply:reply,code:code,disableEveryone:disableEveryone,tts:tts,embed:embed,files:files,split:split}=e;if(void 0!==nonce&&(nonce=parseInt(nonce),isNaN(nonce)||nonce<0))throw new RangeError("MESSAGE_NONCE_TYPE");if(content&&(content=i.resolveString(content),split&&"object"!=typeof split&&(split={}),void 0===code||"boolean"==typeof code&&!0!==code||(content=i.escapeMarkdown(content,!0),content=`\`\`\`${"boolean"!=typeof code?code||"":""} ${content} \`\`\``,split&&(split.prepend=`\`\`\`${"boolean"!=typeof code?code||"":""} `,split.append="\n```")),(disableEveryone||void 0===disableEveryone&&t.client.options.disableEveryone)&&(content=content.replace(/@(everyone|here)/g,"@​$1")),split&&(content=i.splitMessage(content,split))),reply&&!(t instanceof s||t instanceof r)&&"dm"!==t.type){const e=t.client.resolver.resolveUserID(reply),n=`<@${reply instanceof r&&reply.nickname?"!":""}${e}>`;split&&(split.prepend=`${n}, ${split.prepend||""}`),content=`${n}${void 0!==content?`, ${content}`:""}`}return content instanceof Array?new Promise((e,n)=>{const i=[];!function s(){const r=content.length?{tts:tts}:{tts:tts,embed:embed,files:files};t.send(content.shift(),r).then(t=>{i.push(t);if(0===content.length)return e(i);return s()}).catch(n)}()}):t.client.api.channels(t.id).messages.post({data:{content:content,tts:tts,nonce:nonce,embed:embed},files:files}).then(e=>t.client.actions.MessageCreate.handle(e).message)}},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){}]); \ No newline at end of file