127?"x":B[O];if(!L.match(y)){var N=D.slice(0,x),j=D.slice(x+1),q=B.match(_);q&&(N.push(q[1]),j.unshift(q[2])),j.length&&(a="/"+j.join(".")+a),this.hostname=N.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=c.toASCII(this.hostname));var z=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+z,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!w[p])for(var x=0,P=b.length;x0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return n.search=e.search,n.query=e.query,h.isNull(n.pathname)&&h.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var M=w.slice(-1)[0],x=(n.host||e.host||w.length>1)&&("."===M||".."===M)||""===M,R=0,I=w.length;I>=0;I--)M=w[I],"."===M?w.splice(I,1):".."===M?(w.splice(I,1),R++):R&&(w.splice(I,1),R--);if(!y&&!_)for(;R--;R)w.unshift("..");!y||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),x&&"/"!==w.join("/").substr(-1)&&w.push("");var T=""===w[0]||w[0]&&"/"===w[0].charAt(0);if(k){n.hostname=n.host=T?"":w.length?w.shift():"";var A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return y=y||n.host&&w.length,y&&!T&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),h.isNull(n.pathname)&&h.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(const n in e){const i=e[n],r=t.indexOf(i);r&&t.splice(r,1)}return 0===t.length}},function(e,t){e.exports={name:"discord.js",version:"10.0.1",description:"A powerful library for interacting with the Discord API",main:"./src/index",scripts:{test:"eslint src && node docs/generator test",docs:"node docs/generator","test-docs":"node docs/generator test",lint:"eslint src","web-dist":"node ./node_modules/parallel-webpack/bin/run.js"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",dependencies:{superagent:"^3.0.0",tweetnacl:"^0.14.3",ws:"^1.1.1"},peerDependencies:{"node-opus":"^0.2.0",opusscript:"^0.0.1"},devDependencies:{bufferutil:"^1.2.1",eslint:"^3.10.0","jsdoc-to-markdown":"^2.0.0","json-loader":"^0.5.4","parallel-webpack":"^1.5.0","uglify-js":"github:mishoo/UglifyJS2#harmony","utf-8-validate":"^1.2.1",webpack:"2.1.0-beta.27",zlibjs:"github:imaya/zlib.js"},engines:{node:">=6.0.0"}}},function(e,t,n){(function(t){const i=n(13),r=n(23),s=n(135),o=n(136);class a{constructor(e,n,s=[]){this.manager=e,this.id=n,this.env=Object.assign({},t.env,{SHARD_ID:this.id,SHARD_COUNT:this.manager.totalShards,CLIENT_TOKEN:this.manager.token}),this.process=i.fork(r.resolve(this.manager.file),s,{env:this.env}),this.process.on("message",this._handleMessage.bind(this)),this.process.once("exit",()=>{this.manager.respawn&&this.manager.createShard(this.id)}),this._evals=new Map,this._fetches=new Map}send(e){return new Promise((t,n)=>{const i=this.process.send(e,e=>{e?n(e):t(this)});if(!i)throw new Error("Failed to send message to shard's process.")})}fetchClientValue(e){if(this._fetches.has(e))return this._fetches.get(e);const t=new Promise((t,n)=>{const i=n=>{n&&n._fetchProp===e&&(this.process.removeListener("message",i),this._fetches.delete(e),t(n._result))};this.process.on("message",i),this.send({_fetchProp:e}).catch(t=>{this.process.removeListener("message",i),this._fetches.delete(e),n(t)})});return this._fetches.set(e,t),t}eval(e){if(this._evals.has(e))return this._evals.get(e);const t=new Promise((t,n)=>{const i=r=>{r&&r._eval===e&&(this.process.removeListener("message",i),this._evals.delete(e),r._error?n(s(r._error)):t(r._result))};this.process.on("message",i),this.send({_eval:e}).catch(t=>{this.process.removeListener("message",i),this._evals.delete(e),n(t)})});return this._evals.set(e,t),t}_handleMessage(e){if(e){if(e._sFetchProp)return void this.manager.fetchClientValues(e._sFetchProp).then(t=>this.send({_sFetchProp:e._sFetchProp,_result:t}),t=>this.send({_sFetchProp:e._sFetchProp,_error:o(t)}));if(e._sEval)return void this.manager.broadcastEval(e._sEval).then(t=>this.send({_sEval:e._sEval,_result:t}),t=>this.send({_sEval:e._sEval,_error:o(t)}))}this.manager.emit("message",this,e)}}e.exports=a}).call(t,n(8))},function(e,t,n){(function(t){const i=n(135),r=n(136);class s{constructor(e){this.client=e,t.on("message",this._handleMessage.bind(this))}get id(){return this.client.options.shardId}get count(){return this.client.options.shardCount}send(e){return new Promise((n,i)=>{const r=t.send(e,e=>{e?i(e):n()});if(!r)throw new Error("Failed to send message to master process.")})}fetchClientValues(e){return new Promise((n,r)=>{const s=o=>{o&&o._sFetchProp===e&&(t.removeListener("message",s),o._error?r(i(o._error)):n(o._result))};t.on("message",s),this.send({_sFetchProp:e}).catch(e=>{t.removeListener("message",s),r(e)})})}broadcastEval(e){return new Promise((n,r)=>{const s=o=>{o&&o._sEval===e&&(t.removeListener("message",s),o._error?r(i(o._error)):n(o._result))};t.on("message",s),this.send({_sEval:e}).catch(e=>{t.removeListener("message",s),r(e)})})}_handleMessage(e){if(e)if(e._fetchProp){const t=e._fetchProp.split(".");let n=this.client;for(const i of t)n=n[i];this._respond("fetchProp",{_fetchProp:e._fetchProp,_result:n})}else if(e._eval)try{this._respond("eval",{_eval:e._eval,_result:this.client._eval(e._eval)})}catch(t){this._respond("eval",{_eval:e._eval,_error:r(t)})}}_respond(e,t){this.send(t).catch(t=>this.client.emit("error",`Error when sending ${e} response to master process: ${t}`))}static singleton(e){return this._singleton?e.emit("error","Multiple clients created in child process; only the first will handle sharding helpers."):this._singleton=new this(e),this._singleton}}e.exports=s}).call(t,n(8))},function(e,t,n){const i=n(14),r=n(76);class s extends r{setup(e){super.setup(e),this.flags=e.flags,this.owner=new i(this.client,e.owner)}}e.exports=s},function(e,t,n){const i=n(14),r=n(6);class s extends i{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new r,this.blocked=new r,this.notes=new r}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e){return this.client.rest.methods.updateCurrentUser({username:e})}setEmail(e){return this.client.rest.methods.updateCurrentUser({email:e})}setPassword(e){return this.client.rest.methods.updateCurrentUser({password:e})}setAvatar(e){return e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return this.setPresence({game:{name:e,url:t}})}setAFK(e){return this.setPresence({afk:e})}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,n=null){return n?n.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:n,region:t}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:e,icon:n,region:t})):this.client.rest.methods.createGuild({name:e,icon:n,region:t})}setPresence(e){return new Promise(t=>{let n=this.localPresence.status||this.presence.status,i=this.localPresence.game,r=this.localPresence.afk||this.presence.afk;if(!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url}),e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");n=e.status}e.game&&(i=e.game,i.url&&(i.type=1)),"undefined"!=typeof e.afk&&(r=e.afk),r=Boolean(r),this.localPresence={status:n,game:i,afk:r},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),t(this)})}}e.exports=s},function(e,t,n){const i=n(24),r=n(31),s=n(6);class o extends i{constructor(e,t){super(e,t),this.type="dm",this.messages=new s,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}r.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(24),r=n(31),s=n(6),o=n(63);class a extends i{constructor(e,t){super(e,t),this.type="group",this.messages=new s,this._typing=new Map}setup(e){if(super.setup(e),this.name=e.name,this.icon=e.icon,this.ownerID=e.owner_id,this.recipients||(this.recipients=new s),e.recipients)for(const t of e.recipients){const e=this.client.dataManager.newUser(t);this.recipients.set(e.id,e)}this.lastMessageID=e.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(e){const t=e&&this.id===e.id&&this.name===e.name&&this.icon===e.icon&&this.ownerID===e.ownerID;if(t){const t=this.recipients.keyArray(),n=e.recipients.keyArray();return o(t,n)}return t}toString(){return this.name}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}r.applyToClass(a,!0),e.exports=a},function(e,t,n){const i=n(77),r=n(78),s=n(1);class o{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new i(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new r(this.client,e.channel),this.createdTimestamp=new Date(e.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 s.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=o},function(e,t){class n{constructor(e,t){this.client=e.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=n},function(e,t,n){const i=n(5).EventEmitter,r=n(6);class s extends i{constructor(e,t,n={}){super(),this.channel=e,this.filter=t,this.options=n,this.ended=!1,this.collected=new r,this.listener=(e=>this.verify(e)),this.channel.client.on("message",this.listener),n.time&&this.channel.client.setTimeout(()=>this.stop("time"),n.time)}verify(e){return(!this.channel||this.channel.id===e.channel.id)&&(!!this.filter(e,this)&&(this.collected.set(e.id,e),this.emit("message",e,this),this.collected.size>=this.options.maxMatches?this.stop("matchesLimit"):this.options.max&&this.collected.size===this.options.max&&this.stop("limit"),!0))}get next(){return new Promise((e,t)=>{if(this.ended)return void t(this.collected);const n=()=>{this.removeListener("message",i),this.removeListener("end",r)},i=(...t)=>{n(),e(...t)},r=(...e)=>{n(),t(...e)};this.once("message",i),this.once("end",r)})}stop(e="user"){this.ended||(this.ended=!0,this.channel.client.removeListener("message",this.listener),this.emit("end",this.collected,e))}}e.exports=s},function(e,t){class n{constructor(e,t){this.client=e.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=e,this.setup(t)}setup(e){if(this.title=e.title,this.type=e.type,this.description=e.description,this.url=e.url,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new o(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new i(this,e.thumbnail):null,this.author=e.author?new s(this,e.author):null,this.provider=e.provider?new r(this,e.provider):null,this.footer=e.footer?new a(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}}class i{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconUrl=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}n.Thumbnail=i,n.Provider=r,n.Author=s,n.Field=o,n.Footer=a,e.exports=n},function(e,t,n){const i=n(6),r=n(25),s=n(48);class o{constructor(e,t,n,r){this.message=e,this.me=r,this.count=n||0,this.users=new i,this._emoji=new s(this,t.name,t.id)}get emoji(){if(this._emoji instanceof r)return this._emoji;if(this._emoji.id){const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message;return e=this.message.client.resolver.resolveUserID(e),e?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,e):Promise.reject("Couldn't resolve the user ID to remove from the reaction.")}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new i;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}return this.count=this.users.size,e})}}e.exports=o},function(e,t){class n{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins}get createdTimestamp(){return this.id/4194304+14200704e5}get createdAt(){return new Date(this.createdTimestamp)}toString(){return this.name}}e.exports=n},function(e,t){class n{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=n},function(e,t,n){const i=n(1);class r{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=i.ChannelTypes.text===e.type?"text":"voice"}}e.exports=r},function(e,t){class n{constructor(e,t){this.channel=e,t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.denyData=e.deny,this.allowData=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=n},function(e,t,n){const i=n(32),r=n(31),s=n(6);class o extends i{constructor(e,t){super(e,t),this.type="text",this.messages=new s,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new s;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(n=>{t.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>n(this.client.rest.methods.createWebhook(this,e,t)))})}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}r.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(32),r=n(6);class s extends i{constructor(e,t){super(e,t),this.members=new r,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get joinable(){return this.permissionsFor(this.client.user).hasPermission("CONNECT")}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.voice.joinChannel(this)}leave(){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}e.exports=s},function(e,t,n){const i=n(60),r=n(1).Endpoints.botGateway;e.exports=function(e){return new Promise((t,n)=>{if(!e)throw new Error("A token must be provided.");i.get(r).set("Authorization",`Bot ${e.replace(/^Bot\s*/i,"")}`).end((e,i)=>{e&&n(e),t(i.body.shards)})})}},function(e,t){e.exports=function(e,{maxLength=1950,char="\n",prepend="",append=""}={}){if(e.length<=maxLength)return e;const t=e.split(char);if(1===t.length)throw new Error("Message exceeds the max length and contains no split characters.");const n=[""];let i=0;for(let r=0;rmaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+t[r];return n}},function(e,t,n){function i(e,t){return o.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,void(this.length=e.length)):void this.error("Input not Buffer")}function r(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof r||(e=new r(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}var s=n(2),o=n(26).Reporter,a=n(0).Buffer;s(i,o),t.DecoderBuffer=i,i.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},i.prototype.restore=function(e){var t=new i(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),t},i.prototype.isEmpty=function(){return this.offset===this.length},i.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},i.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var n=new i(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},i.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=r,r.prototype.join=function(e,t){return e||(e=new a(this.length)),t||(t=0),0===this.length?e:(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,t),t+=n.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}},function(e,t,n){var i=t;i._reverse=function(e){var t={};return Object.keys(e).forEach(function(n){(0|n)==n&&(n|=0);var i=e[n];t[i]=n}),t},i.der=n(144)},function(e,t,n){function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new r,this.tree._init(e.body)}function r(e){h.Node.call(this,"der",e)}function s(e,t){var n=e.readUInt8(t);if(e.isError(n))return n;var i=u.tagClass[n>>6],r=0===(32&n);if(31===(31&n)){var s=n;for(n=0;128===(128&s);){if(s=e.readUInt8(t),e.isError(s))return s;n<<=7,n|=127&s}}else n&=31;var o=u.tag[n];return{cls:i,primitive:r,tag:n,tagStr:o}}function o(e,t,n){var i=e.readUInt8(n);if(e.isError(i))return i;if(!t&&128===i)return null;if(0===(128&i))return i;var r=127&i;if(r>=4)return e.error("length octect is too long");i=0;for(var s=0;s=31?i.error("Multi-octet tag encoding unsupported"):(t||(r|=32),r|=u.tagClassByName[n||"universal"]<<6)}var a=n(2),c=n(0).Buffer,h=n(36),f=h.base,u=h.constants.der;e.exports=i,i.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},a(r,f.Node),r.prototype._encodeComposite=function(e,t,n,i){var r=o(e,t,n,this.reporter);if(i.length<128){var s=new c(2);return s[0]=r,s[1]=i.length,this._createEncoderBuffer([s,i])}for(var a=1,h=i.length;h>=256;h>>=8)a++;var s=new c(2+a);s[0]=r,s[1]=128|a;for(var h=1+a,f=i.length;f>0;h--,f>>=8)s[h]=255&f;return this._createEncoderBuffer([s,i])},r.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var n=new c(2*e.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var r=0,i=0;i=128;s>>=7)r++}for(var o=new c(r),a=o.length-1,i=e.length-1;i>=0;i--){var s=e[i];for(o[a--]=127&s;(s>>=7)>0;)o[a--]=128|127&s}return this._createEncoderBuffer(o)},r.prototype._encodeTime=function(e,t){var n,i=new Date(e);return"gentime"===t?n=[s(i.getFullYear()),s(i.getUTCMonth()+1),s(i.getUTCDate()),s(i.getUTCHours()),s(i.getUTCMinutes()),s(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[s(i.getFullYear()%100),s(i.getUTCMonth()+1),s(i.getUTCDate()),s(i.getUTCHours()),s(i.getUTCMinutes()),s(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},r.prototype._encodeNull=function(){return this._createEncoderBuffer("")},r.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!c.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=new c(n)}if(c.isBuffer(e)){var i=e.length;0===e.length&&i++;var r=new c(i);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var i=1,s=e;s>=256;s>>=8)i++;for(var r=new Array(i),s=r.length-1;s>=0;s--)r[s]=255&e,e>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(new c(r))},r.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},r.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},r.prototype._skipDefault=function(e,t,n){var i,r=this._baseState;if(null===r.default)return!1;var s=e.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),s.length!==r.defaultBuffer.length)return!1;for(i=0;i>a%8,e._prev=i(e._prev,n?s:o);return h}function i(t,n){var i=t.length,r=-1,s=new e(t.length);for(t=e.concat([t,new e([n])]);++r>7;return s}t.encrypt=function(t,i,r){for(var s=i.length,o=new e(s),a=-1;++at.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+n.chunkSize);if(n.windowBits&&(n.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+n.windowBits);if(n.level&&(n.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+n.level);if(n.memLevel&&(n.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+n.memLevel);if(n.strategy&&n.strategy!=t.Z_FILTERED&&n.strategy!=t.Z_HUFFMAN_ONLY&&n.strategy!=t.Z_RLE&&n.strategy!=t.Z_FIXED&&n.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+n.strategy);if(n.dictionary&&!e.isBuffer(n.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new b.Zlib(i);var r=this;this._hadError=!1,this._binding.onerror=function(e,n){r._binding=null,r._hadError=!0;var i=new Error(e);i.errno=n,i.code=t.codes[n],r.emit("error",i)};var s=t.Z_DEFAULT_COMPRESSION;"number"==typeof n.level&&(s=n.level);var o=t.Z_DEFAULT_STRATEGY;"number"==typeof n.strategy&&(o=n.strategy),this._binding.init(n.windowBits||t.Z_DEFAULT_WINDOWBITS,s,n.memLevel||t.Z_DEFAULT_MEMLEVEL,o,n.dictionary),this._buffer=new e(this._chunkSize),this._offset=0,this._closed=!1,this._level=s,this._strategy=o,this.once("end",this.close)}var p=n(118),b=n(160),m=n(10),g=n(149).ok;b.Z_MIN_WINDOWBITS=8,b.Z_MAX_WINDOWBITS=15,b.Z_DEFAULT_WINDOWBITS=15,b.Z_MIN_CHUNK=64,b.Z_MAX_CHUNK=1/0,b.Z_DEFAULT_CHUNK=16384,b.Z_MIN_MEMLEVEL=1,b.Z_MAX_MEMLEVEL=9,b.Z_DEFAULT_MEMLEVEL=8,b.Z_MIN_LEVEL=-1,b.Z_MAX_LEVEL=9,b.Z_DEFAULT_LEVEL=b.Z_DEFAULT_COMPRESSION,Object.keys(b).forEach(function(e){e.match(/^Z/)&&(t[e]=b[e])}),t.codes={Z_OK:b.Z_OK,Z_STREAM_END:b.Z_STREAM_END,Z_NEED_DICT:b.Z_NEED_DICT,Z_ERRNO:b.Z_ERRNO,Z_STREAM_ERROR:b.Z_STREAM_ERROR,Z_DATA_ERROR:b.Z_DATA_ERROR,Z_MEM_ERROR:b.Z_MEM_ERROR,Z_BUF_ERROR:b.Z_BUF_ERROR,Z_VERSION_ERROR:b.Z_VERSION_ERROR},Object.keys(t.codes).forEach(function(e){t.codes[t.codes[e]]=e}),t.Deflate=o,t.Inflate=a,t.Gzip=c,t.Gunzip=h,t.DeflateRaw=f,t.InflateRaw=u,t.Unzip=d,t.createDeflate=function(e){return new o(e)},t.createInflate=function(e){return new a(e)},t.createDeflateRaw=function(e){return new f(e)},t.createInflateRaw=function(e){return new u(e)},t.createGzip=function(e){return new c(e)},t.createGunzip=function(e){return new h(e)},t.createUnzip=function(e){return new d(e)},t.deflate=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new o(t),e,n)},t.deflateSync=function(e,t){return s(new o(t),e)},t.gzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new c(t),e,n)},t.gzipSync=function(e,t){return s(new c(t),e)},t.deflateRaw=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new f(t),e,n)},t.deflateRawSync=function(e,t){return s(new f(t),e)},t.unzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new d(t),e,n)},t.unzipSync=function(e,t){return s(new d(t),e)},t.inflate=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new a(t),e,n)},t.inflateSync=function(e,t){return s(new a(t),e)},t.gunzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new h(t),e,n)},t.gunzipSync=function(e,t){return s(new h(t),e)},t.inflateRaw=function(e,t,n){return"function"==typeof t&&(n=t,t={}),r(new u(t),e,n)},t.inflateRawSync=function(e,t){return s(new u(t),e)},m.inherits(l,p),l.prototype.params=function(e,n,r){if(et.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(n!=t.Z_FILTERED&&n!=t.Z_HUFFMAN_ONLY&&n!=t.Z_RLE&&n!=t.Z_FIXED&&n!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==e||this._strategy!==n){var s=this;this.flush(b.Z_SYNC_FLUSH,function(){s._binding.params(e,n),s._hadError||(s._level=e,s._strategy=n,r&&r())})}else i.nextTick(r)},l.prototype.reset=function(){return this._binding.reset()},l.prototype._flush=function(t){this._transform(new e(0),"",t)},l.prototype.flush=function(t,n){var r=this._writableState;if(("function"==typeof t||void 0===t&&!n)&&(n=t,t=b.Z_FULL_FLUSH),r.ended)n&&i.nextTick(n);else if(r.ending)n&&this.once("end",n);else if(r.needDrain){var s=this;this.once("drain",function(){s.flush(n)})}else this._flushFlag=t,this.write(new e(0),"",n)},l.prototype.close=function(e){if(e&&i.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;i.nextTick(function(){t.emit("close")})}},l.prototype._transform=function(t,n,i){var r,s=this._writableState,o=s.ending||s.ended,a=o&&(!t||s.length===t.length);if(null===!t&&!e.isBuffer(t))return i(new Error("invalid input"));a?r=b.Z_FINISH:(r=this._flushFlag,t.length>=s.length&&(this._flushFlag=this._opts.flush||b.Z_NO_FLUSH));this._processChunk(t,r,i)},l.prototype._processChunk=function(t,n,i){function r(f,l){if(!c._hadError){var p=o-l;if(g(p>=0,"have should not go down"),p>0){var b=c._buffer.slice(c._offset,c._offset+p);c._offset+=p,h?c.push(b):(u.push(b),d+=b.length)}if((0===l||c._offset>=c._chunkSize)&&(o=c._chunkSize,c._offset=0,c._buffer=new e(c._chunkSize)),0===l){if(a+=s-f,s=f,!h)return!0;var m=c._binding.write(n,t,a,s,c._buffer,c._offset,c._chunkSize);return m.callback=r,void(m.buffer=t)}return!!h&&void i()}}var s=t&&t.length,o=this._chunkSize-this._offset,a=0,c=this,h="function"==typeof i;if(!h){var f,u=[],d=0;this.on("error",function(e){f=e});do var l=this._binding.writeSync(n,t,a,s,this._buffer,this._offset,o);while(!this._hadError&&r(l[0],l[1]));if(this._hadError)throw f;var p=e.concat(u,d);return this.close(),p}var b=this._binding.write(n,t,a,s,this._buffer,this._offset,o);b.buffer=t,b.callback=r},m.inherits(o,l),m.inherits(a,l),m.inherits(c,l),m.inherits(h,l),m.inherits(f,l),m.inherits(u,l),m.inherits(d,l)}).call(t,n(0).Buffer,n(8))},function(e,t,n){"use strict";function i(e,t){e[t>>5]|=128<>>9<<4)+14]=t;for(var n=1732584193,i=-271733879,r=-1732584194,f=271733878,u=0;u>16)+(t>>16)+(n>>16);return i<<16|65535&n}function f(e,t){return e<>>32-t}var u=n(165);e.exports=function(e){return u.hash(e,i,16)}},function(e,t,n){(function(t){function i(){this.init(),this._w=l,u.call(this,64,56)}function r(e,t,n){return n^e&(t^n)}function s(e,t,n){return e&t|n&(e|t)}function o(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function a(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function c(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function h(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var f=n(2),u=n(22),d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=new Array(64);f(i,u),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},i.prototype._update=function(e){for(var t=this._w,n=0|this._a,i=0|this._b,f=0|this._c,u=0|this._d,l=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=h(t[g-2])+t[g-7]+c(t[g-15])+t[g-16]|0;for(var v=0;v<64;++v){var y=m+a(l)+r(l,p,b)+d[v]+t[v]|0,_=o(n)+s(n,i,f)|0;m=b,b=p,p=l,l=u+y|0,u=f,f=i,i=n,n=y+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=f+this._c|0,this._d=u+this._d|0,this._e=l+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},i.prototype._hash=function(){var e=new t(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=i}).call(t,n(0).Buffer)},function(e,t,n){(function(t){function i(){this.init(),this._w=m,p.call(this,128,112)}function r(e,t,n){return n^e&(t^n)}function s(e,t,n){return e&t|n&(e|t)}function o(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function a(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function c(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function f(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function u(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function d(e,t){return e>>>0>>0?1:0}var l=n(2),p=n(22),b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],m=new Array(160);l(i,p),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},i.prototype._update=function(e){for(var t=this._w,n=0|this._ah,i=0|this._bh,l=0|this._ch,p=0|this._dh,m=0|this._eh,g=0|this._fh,v=0|this._gh,y=0|this._hh,_=0|this._al,w=0|this._bl,E=0|this._cl,S=0|this._dl,k=0|this._el,A=0|this._fl,M=0|this._gl,x=0|this._hl,R=0;R<32;R+=2)t[R]=e.readInt32BE(4*R),t[R+1]=e.readInt32BE(4*R+4);for(;R<160;R+=2){var I=t[R-30],T=t[R-30+1],C=c(I,T),D=h(T,I);I=t[R-4],T=t[R-4+1];var P=f(I,T),B=u(T,I),L=t[R-14],O=t[R-14+1],U=t[R-32],N=t[R-32+1],j=D+O|0,q=C+L+d(j,D)|0;j=j+B|0,q=q+P+d(j,B)|0,j=j+N|0,q=q+U+d(j,N)|0,t[R]=q,t[R+1]=j}for(var z=0;z<160;z+=2){q=t[z],j=t[z+1];var F=s(n,i,l),G=s(_,w,E),H=o(n,_),W=o(_,n),V=a(m,k),K=a(k,m),Z=b[z],Y=b[z+1],X=r(m,g,v),J=r(k,A,M),$=x+K|0,Q=y+V+d($,x)|0;$=$+J|0,Q=Q+X+d($,J)|0,$=$+Y|0,Q=Q+Z+d($,Y)|0,$=$+j|0,Q=Q+q+d($,j)|0;var ee=W+G|0,te=H+F+d(ee,W)|0;y=v,x=M,v=g,M=A,g=m,A=k,k=S+$|0,m=p+Q+d(k,S)|0,p=l,S=E,l=i,E=w,i=n,w=_,_=$+ee|0,n=Q+te+d(_,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+k|0,this._fl=this._fl+A|0,this._gl=this._gl+M|0,this._hl=this._hl+x|0,this._ah=this._ah+n+d(this._al,_)|0,this._bh=this._bh+i+d(this._bl,w)|0,this._ch=this._ch+l+d(this._cl,E)|0,this._dh=this._dh+p+d(this._dl,S)|0,this._eh=this._eh+m+d(this._el,k)|0,this._fh=this._fh+g+d(this._fl,A)|0,this._gh=this._gh+v+d(this._gl,M)|0,this._hh=this._hh+y+d(this._hl,x)|0},i.prototype._hash=function(){function e(e,t,i){n.writeInt32BE(e,i),n.writeInt32BE(t,i+4)}var n=new t(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),n},e.exports=i}).call(t,n(0).Buffer)},function(e,t,n){function i(){if(null!==y)return y;var e=1048576,t=[];t[0]=2;for(var n=1,i=3;ie;)n.ishrn(1);if(n.isEven()&&n.iadd(d),n.testn(1)||n.iadd(l),t.cmp(l)){if(!t.cmp(p))for(;n.mod(b).cmp(m);)n.iadd(v)}else for(;n.mod(h).cmp(g);)n.iadd(v);if(i=n.shrn(1),r(i)&&r(n)&&s(i)&&s(n)&&u.test(i)&&u.test(n))return n}}var a=n(30);e.exports=o,o.simpleSieve=r,o.fermatTest=s;var c=n(7),h=new c(24),f=n(107),u=new f,d=new c(1),l=new c(2),p=new c(5),b=(new c(16),new c(8),new c(10)),m=new c(3),g=(new c(7),new c(11)),v=new c(4),y=(new c(12),null)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){function i(e){this.rand=e||new s.Rand}var r=n(7),s=n(90);e.exports=i,i.create=function(e){return new i(e)},i.prototype._rand=function(e){var t=e.bitLength(),n=this.rand.generate(Math.ceil(t/8));n[0]|=3;var i=7&t;return 0!==i&&(n[n.length-1]>>=7-i),new r(n)},i.prototype.test=function(e,t,n){var i=e.bitLength(),s=r.mont(e),o=new r(1).toRed(s);t||(t=Math.max(1,i/48|0));for(var a=e.subn(1),c=a.subn(1),h=0;!a.testn(h);h++);for(var f=e.shrn(h),u=a.toRed(s),d=!0;t>0;t--){var l=this._rand(c);n&&n(l);var p=l.toRed(s).redPow(f);if(0!==p.cmp(o)&&0!==p.cmp(u)){for(var b=1;b0;t--){var u=this._rand(a),d=e.gcd(u);if(0!==d.cmpn(1))return d;var l=u.toRed(i).redPow(h);if(0!==l.cmp(s)&&0!==l.cmp(f)){for(var p=1;p0)throw i.length>1?new Error("options "+i.slice(0,i.length-1).join(", ")+" and "+i[i.length-1]+" must be defined"):new Error("option "+i[0]+" must be defined")}return Object.keys(e).forEach(function(n){n in t&&(t[n]=e[n])}),this},this.copy=function(t){var i={};return Object.keys(e).forEach(function(e){t.indexOf(e)!==-1&&(i[e]=n[e])}),i},this.read=function(e,t){if("function"==typeof t){var n=this;r.readFile(e,function(e,i){if(e)return t(e);var r=JSON.parse(i);n.merge(r),t()})}else{var i=JSON.parse(r.readFileSync(e));this.merge(i)}return this},this.isDefined=function(e){return"undefined"!=typeof n[e]},this.isDefinedAndNonNull=function(e){return"undefined"!=typeof n[e]&&null!==n[e]},Object.freeze(n),Object.freeze(this)}/*!
- * Copyright(c) 2011 Einar Otto Stangvik
- * MIT Licensed
- */
-var r=n(13);e.exports=i},function(e,t){"use strict";function n(e,t,n,i){for(var r=65535&e|0,s=e>>>16&65535|0,o=0;0!==n;){o=n>2e3?2e3:n,n-=o;do r=r+t[i++]|0,s=s+r|0;while(--o);r%=65521,s%=65521}return r|s<<16|0}e.exports=n},function(e,t){"use strict";function n(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}function i(e,t,n,i){var s=r,o=i+n;e^=-1;for(var a=i;a>>8^s[255&(e^t[a])];return e^-1}var r=n();e.exports=i},function(e,t){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,n){(function(e,i){var r=n(53),s=n(214);t.pbkdf2=function(e,n,i,r,o,a){if("function"==typeof o&&(a=o,o=void 0),s(i,r),"function"!=typeof a)throw new Error("No callback provided to pbkdf2");setTimeout(function(){a(null,t.pbkdf2Sync(e,n,i,r,o))})};var o;if(e.browser)o="utf-8";else{var a=parseInt(e.version.split(".")[0].slice(1),10);o=a>=6?"utf-8":"binary"}t.pbkdf2Sync=function(e,t,n,a,c){i.isBuffer(e)||(e=new i(e,o)),i.isBuffer(t)||(t=new i(t,o)),s(n,a),c=c||"sha1";var h,f=1,u=new i(a),d=new i(t.length+4);t.copy(d,0,0,t.length);for(var l,p,b=1;b<=f;b++){d.writeUInt32BE(b,t.length);var m=r(c,e).update(d).digest();h||(h=m.length,p=new i(h),f=Math.ceil(a/h),l=a-(f-1)*h),m.copy(p,0,0,h);for(var g=1;g0)if(t.ended&&!r){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&r){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var h;!t.decoder||r||i||(n=t.decoder.write(n),h=!t.objectMode&&0===n.length),r||(t.reading=!1),h||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&d(e))),p(e,t)}else r||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=z?e=z:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function h(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=c(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function f(e,t){var n=null;return P.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function u(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,d(e)}}function d(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(U("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?I(l,e):l(e))}function l(e){U("emit readable"),e.emit("readable"),_(e)}function p(e,t){t.readingMore||(t.readingMore=!0,I(b,e,t))}function b(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=E(e,t.buffer,t.decoder),n}function E(e,t,n){var i;return es.length?s.length:e;if(r+=o===s.length?s:s.slice(0,e),e-=o,0===e){o===s.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(o));break}++i}return t.length-=i,r}function k(e,t){var n=B.allocUnsafe(e),i=t.head,r=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var s=i.data,o=e>s.length?s.length:e;if(s.copy(n,n.length-e,0,o),e-=o,0===e){o===s.length?(++r,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=s.slice(o));break}++r}return t.length-=r,n}function A(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,I(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function x(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return U("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?A(this):d(this),null;if(e=h(e,t),0===e&&t.ended)return 0===t.length&&A(this),null;var i=t.needReadable;U("need readable",i),(0===t.length||t.length-e0?w(e,t):null,null===r?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&A(this)),null!==r&&this.emit("data",r),r},s.prototype._read=function(e){this.emit("error",new Error("not implemented"))},s.prototype.pipe=function(e,n){function r(e){U("onunpipe"),e===d&&o()}function s(){U("onend"),e.end()}function o(){U("cleanup"),e.removeListener("close",h),e.removeListener("finish",f),e.removeListener("drain",g),e.removeListener("error",c),e.removeListener("unpipe",r),d.removeListener("end",s),d.removeListener("end",o),d.removeListener("data",a),v=!0,!l.awaitDrain||e._writableState&&!e._writableState.needDrain||g()}function a(t){U("ondata"),y=!1;var n=e.write(t);!1!==n||y||((1===l.pipesCount&&l.pipes===e||l.pipesCount>1&&R(l.pipes,e)!==-1)&&!v&&(U("false write response, pause",d._readableState.awaitDrain),d._readableState.awaitDrain++,y=!0),d.pause())}function c(t){U("onerror",t),u(),e.removeListener("error",c),0===D(e,"error")&&e.emit("error",t)}function h(){e.removeListener("finish",f),u()}function f(){U("onfinish"),e.removeListener("close",h),u()}function u(){U("unpipe"),d.unpipe(e)}var d=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=e;break;case 1:l.pipes=[l.pipes,e];break;default:l.pipes.push(e)}l.pipesCount+=1,U("pipe count=%d opts=%j",l.pipesCount,n);var p=(!n||n.end!==!1)&&e!==t.stdout&&e!==t.stderr,b=p?s:o;l.endEmitted?I(b):d.once("end",b),e.on("unpipe",r);var g=m(d);e.on("drain",g);var v=!1,y=!1;return d.on("data",a),i(e,"error",c),e.once("close",h),e.once("finish",f),e.emit("pipe",d),l.flowing||(U("pipe resume"),d.resume()),e},s.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var r=0;r>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function i(e,t,n,i,r){var s,o=0;for(s=0;s>>8)-1}function r(e,t,n,r){return i(e,t,n,r,16)}function s(e,t,n,r){return i(e,t,n,r,32)}function o(e,t,n,i){for(var r,s=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,b=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=s,E=o,S=a,k=c,A=h,M=f,x=u,R=d,I=l,T=p,C=b,D=m,P=g,B=v,L=y,O=_,U=0;U<20;U+=2)r=w+P|0,A^=r<<7|r>>>25,r=A+w|0,I^=r<<9|r>>>23,r=I+A|0,P^=r<<13|r>>>19,r=P+I|0,w^=r<<18|r>>>14,r=M+E|0,T^=r<<7|r>>>25,r=T+M|0,B^=r<<9|r>>>23,r=B+T|0,E^=r<<13|r>>>19,r=E+B|0,M^=r<<18|r>>>14,r=C+x|0,L^=r<<7|r>>>25,r=L+C|0,S^=r<<9|r>>>23,r=S+L|0,x^=r<<13|r>>>19,r=x+S|0,C^=r<<18|r>>>14,r=O+D|0,k^=r<<7|r>>>25,r=k+O|0,R^=r<<9|r>>>23,r=R+k|0,D^=r<<13|r>>>19,r=D+R|0,O^=r<<18|r>>>14,r=w+k|0,E^=r<<7|r>>>25,r=E+w|0,S^=r<<9|r>>>23,r=S+E|0,k^=r<<13|r>>>19,r=k+S|0,w^=r<<18|r>>>14,r=M+A|0,x^=r<<7|r>>>25,r=x+M|0,R^=r<<9|r>>>23,r=R+x|0,A^=r<<13|r>>>19,r=A+R|0,M^=r<<18|r>>>14,r=C+T|0,D^=r<<7|r>>>25,r=D+C|0,I^=r<<9|r>>>23,r=I+D|0,T^=r<<13|r>>>19,r=T+I|0,C^=r<<18|r>>>14,r=O+L|0,P^=r<<7|r>>>25,r=P+O|0,B^=r<<9|r>>>23,r=B+P|0,L^=r<<13|r>>>19,r=L+B|0,O^=r<<18|r>>>14;w=w+s|0,E=E+o|0,S=S+a|0,k=k+c|0,A=A+h|0,M=M+f|0,x=x+u|0,R=R+d|0,I=I+l|0,T=T+p|0,C=C+b|0,D=D+m|0,P=P+g|0,B=B+v|0,L=L+y|0,O=O+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=k>>>0&255,e[13]=k>>>8&255,e[14]=k>>>16&255,e[15]=k>>>24&255,e[16]=A>>>0&255,e[17]=A>>>8&255,e[18]=A>>>16&255,e[19]=A>>>24&255,e[20]=M>>>0&255,e[21]=M>>>8&255,e[22]=M>>>16&255,e[23]=M>>>24&255,e[24]=x>>>0&255,e[25]=x>>>8&255,e[26]=x>>>16&255,e[27]=x>>>24&255,e[28]=R>>>0&255,e[29]=R>>>8&255,e[30]=R>>>16&255,e[31]=R>>>24&255,e[32]=I>>>0&255,e[33]=I>>>8&255,e[34]=I>>>16&255,e[35]=I>>>24&255,e[36]=T>>>0&255,e[37]=T>>>8&255,e[38]=T>>>16&255,e[39]=T>>>24&255,e[40]=C>>>0&255,e[41]=C>>>8&255,e[42]=C>>>16&255,e[43]=C>>>24&255,e[44]=D>>>0&255,e[45]=D>>>8&255,e[46]=D>>>16&255,e[47]=D>>>24&255,e[48]=P>>>0&255,e[49]=P>>>8&255,e[50]=P>>>16&255,e[51]=P>>>24&255,e[52]=B>>>0&255,e[53]=B>>>8&255,e[54]=B>>>16&255,e[55]=B>>>24&255,e[56]=L>>>0&255,e[57]=L>>>8&255,e[58]=L>>>16&255,e[59]=L>>>24&255,e[60]=O>>>0&255,e[61]=O>>>8&255,e[62]=O>>>16&255,e[63]=O>>>24&255}function a(e,t,n,i){for(var r,s=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,b=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=s,E=o,S=a,k=c,A=h,M=f,x=u,R=d,I=l,T=p,C=b,D=m,P=g,B=v,L=y,O=_,U=0;U<20;U+=2)r=w+P|0,A^=r<<7|r>>>25,r=A+w|0,I^=r<<9|r>>>23,r=I+A|0,P^=r<<13|r>>>19,r=P+I|0,w^=r<<18|r>>>14,r=M+E|0,T^=r<<7|r>>>25,r=T+M|0,B^=r<<9|r>>>23,r=B+T|0,E^=r<<13|r>>>19,r=E+B|0,M^=r<<18|r>>>14,r=C+x|0,L^=r<<7|r>>>25,r=L+C|0,S^=r<<9|r>>>23,r=S+L|0,x^=r<<13|r>>>19,r=x+S|0,C^=r<<18|r>>>14,r=O+D|0,k^=r<<7|r>>>25,r=k+O|0,R^=r<<9|r>>>23,r=R+k|0,D^=r<<13|r>>>19,r=D+R|0,O^=r<<18|r>>>14,r=w+k|0,E^=r<<7|r>>>25,r=E+w|0,S^=r<<9|r>>>23,r=S+E|0,k^=r<<13|r>>>19,r=k+S|0,w^=r<<18|r>>>14,r=M+A|0,x^=r<<7|r>>>25,r=x+M|0,R^=r<<9|r>>>23,r=R+x|0,A^=r<<13|r>>>19,r=A+R|0,M^=r<<18|r>>>14,r=C+T|0,D^=r<<7|r>>>25,r=D+C|0,I^=r<<9|r>>>23,r=I+D|0,T^=r<<13|r>>>19,r=T+I|0,C^=r<<18|r>>>14,r=O+L|0,P^=r<<7|r>>>25,r=P+O|0,B^=r<<9|r>>>23,r=B+P|0,L^=r<<13|r>>>19,r=L+B|0,O^=r<<18|r>>>14;e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=M>>>0&255,e[5]=M>>>8&255,e[6]=M>>>16&255,e[7]=M>>>24&255,e[8]=C>>>0&255,e[9]=C>>>8&255,e[10]=C>>>16&255,e[11]=C>>>24&255,e[12]=O>>>0&255,e[13]=O>>>8&255,e[14]=O>>>16&255,e[15]=O>>>24&255,e[16]=x>>>0&255,e[17]=x>>>8&255,e[18]=x>>>16&255,e[19]=x>>>24&255,e[20]=R>>>0&255,e[21]=R>>>8&255,e[22]=R>>>16&255,e[23]=R>>>24&255,e[24]=I>>>0&255,e[25]=I>>>8&255,e[26]=I>>>16&255,e[27]=I>>>24&255,e[28]=T>>>0&255,e[29]=T>>>8&255,e[30]=T>>>16&255,e[31]=T>>>24&255}function c(e,t,n,i){o(e,t,n,i)}function h(e,t,n,i){a(e,t,n,i)}function f(e,t,n,i,r,s,o){var a,h,f=new Uint8Array(16),u=new Uint8Array(64);for(h=0;h<16;h++)f[h]=0;for(h=0;h<8;h++)f[h]=s[h];for(;r>=64;){for(c(u,f,o,de),h=0;h<64;h++)e[t+h]=n[i+h]^u[h];for(a=1,h=8;h<16;h++)a=a+(255&f[h])|0,f[h]=255&a,a>>>=8;r-=64,t+=64,i+=64}if(r>0)for(c(u,f,o,de),h=0;h=64;){for(c(h,a,r,de),o=0;o<64;o++)e[t+o]=h[o];for(s=1,o=8;o<16;o++)s=s+(255&a[o])|0,a[o]=255&s,s>>>=8;n-=64,t+=64}if(n>0)for(c(h,a,r,de),o=0;o>16&1),s[n-1]&=65535;s[15]=o[15]-32767-(s[14]>>16&1),r=s[15]>>16&1,s[14]&=65535,_(o,s,1-r)}for(n=0;n<16;n++)e[2*n]=255&o[n],e[2*n+1]=o[n]>>8}function E(e,t){var n=new Uint8Array(32),i=new Uint8Array(32);return w(n,e),w(i,t),s(n,0,i,0)}function S(e){var t=new Uint8Array(32);return w(t,e),1&t[0]}function k(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function A(e,t,n){for(var i=0;i<16;i++)e[i]=t[i]+n[i]}function M(e,t,n){for(var i=0;i<16;i++)e[i]=t[i]-n[i]}function x(e,t,n){var i,r,s=0,o=0,a=0,c=0,h=0,f=0,u=0,d=0,l=0,p=0,b=0,m=0,g=0,v=0,y=0,_=0,w=0,E=0,S=0,k=0,A=0,M=0,x=0,R=0,I=0,T=0,C=0,D=0,P=0,B=0,L=0,O=n[0],U=n[1],N=n[2],j=n[3],q=n[4],z=n[5],F=n[6],G=n[7],H=n[8],W=n[9],V=n[10],K=n[11],Z=n[12],Y=n[13],X=n[14],J=n[15];i=t[0],s+=i*O,o+=i*U,a+=i*N,c+=i*j,h+=i*q,f+=i*z,u+=i*F,d+=i*G,l+=i*H,p+=i*W,b+=i*V,m+=i*K,g+=i*Z,v+=i*Y,y+=i*X,_+=i*J,i=t[1],o+=i*O,a+=i*U,c+=i*N,h+=i*j,f+=i*q,u+=i*z,d+=i*F,l+=i*G,p+=i*H,b+=i*W,m+=i*V,g+=i*K,v+=i*Z,y+=i*Y,_+=i*X,w+=i*J,i=t[2],a+=i*O,c+=i*U,h+=i*N,f+=i*j,u+=i*q,d+=i*z,l+=i*F,p+=i*G,b+=i*H,m+=i*W,g+=i*V,v+=i*K,y+=i*Z,_+=i*Y,w+=i*X,E+=i*J,i=t[3],c+=i*O,h+=i*U,f+=i*N,u+=i*j,d+=i*q,l+=i*z,p+=i*F,b+=i*G,m+=i*H,g+=i*W,v+=i*V,y+=i*K,_+=i*Z,w+=i*Y,E+=i*X,S+=i*J,i=t[4],h+=i*O,f+=i*U,u+=i*N,d+=i*j,l+=i*q,p+=i*z,b+=i*F,m+=i*G,g+=i*H,v+=i*W,y+=i*V,_+=i*K,w+=i*Z,E+=i*Y,S+=i*X,k+=i*J,i=t[5],f+=i*O,u+=i*U,d+=i*N,l+=i*j,p+=i*q,b+=i*z,m+=i*F,g+=i*G,v+=i*H,y+=i*W,_+=i*V,w+=i*K,E+=i*Z,S+=i*Y,k+=i*X,A+=i*J,i=t[6],u+=i*O,d+=i*U,l+=i*N,p+=i*j,b+=i*q,m+=i*z,g+=i*F,v+=i*G,y+=i*H,_+=i*W,w+=i*V,E+=i*K,S+=i*Z,k+=i*Y,A+=i*X,M+=i*J,i=t[7],d+=i*O,l+=i*U,p+=i*N,b+=i*j,m+=i*q,g+=i*z,v+=i*F,y+=i*G,_+=i*H,w+=i*W,E+=i*V,S+=i*K,k+=i*Z,A+=i*Y,M+=i*X,x+=i*J,i=t[8],l+=i*O,p+=i*U,b+=i*N,m+=i*j,g+=i*q,v+=i*z,y+=i*F,_+=i*G,w+=i*H,E+=i*W,S+=i*V,k+=i*K,A+=i*Z,M+=i*Y,x+=i*X,R+=i*J,i=t[9],p+=i*O,b+=i*U,m+=i*N,g+=i*j,v+=i*q,y+=i*z,_+=i*F,w+=i*G,E+=i*H,S+=i*W,k+=i*V,A+=i*K,M+=i*Z,x+=i*Y,R+=i*X,I+=i*J,i=t[10],b+=i*O,m+=i*U,g+=i*N,v+=i*j,y+=i*q,_+=i*z,w+=i*F,E+=i*G,S+=i*H,k+=i*W,A+=i*V,M+=i*K,x+=i*Z,R+=i*Y,I+=i*X,T+=i*J,i=t[11],m+=i*O,g+=i*U,v+=i*N,y+=i*j,_+=i*q,w+=i*z,E+=i*F,S+=i*G,k+=i*H,A+=i*W,M+=i*V,x+=i*K;R+=i*Z;I+=i*Y,T+=i*X,C+=i*J,i=t[12],g+=i*O,v+=i*U,y+=i*N,_+=i*j,w+=i*q,E+=i*z,S+=i*F,k+=i*G,A+=i*H,M+=i*W,x+=i*V,R+=i*K,I+=i*Z,T+=i*Y,C+=i*X,D+=i*J,i=t[13],v+=i*O,y+=i*U,_+=i*N,w+=i*j,E+=i*q,S+=i*z,k+=i*F,A+=i*G,M+=i*H,x+=i*W,R+=i*V,I+=i*K,T+=i*Z,C+=i*Y,D+=i*X,P+=i*J,i=t[14],y+=i*O,_+=i*U,w+=i*N,E+=i*j,S+=i*q,k+=i*z,A+=i*F,M+=i*G,x+=i*H,R+=i*W,I+=i*V,T+=i*K,C+=i*Z,D+=i*Y,P+=i*X,B+=i*J,i=t[15],_+=i*O,w+=i*U,E+=i*N,S+=i*j,k+=i*q,A+=i*z,M+=i*F,x+=i*G,R+=i*H,I+=i*W,T+=i*V,C+=i*K,D+=i*Z,P+=i*Y,B+=i*X,L+=i*J,s+=38*w,o+=38*E,a+=38*S,c+=38*k,h+=38*A,f+=38*M,u+=38*x,d+=38*R,l+=38*I,p+=38*T,b+=38*C,m+=38*D,g+=38*P,v+=38*B,y+=38*L,r=1,i=s+r+65535,r=Math.floor(i/65536),s=i-65536*r,i=o+r+65535,r=Math.floor(i/65536),o=i-65536*r,i=a+r+65535,r=Math.floor(i/65536),a=i-65536*r,i=c+r+65535,r=Math.floor(i/65536),c=i-65536*r,i=h+r+65535,r=Math.floor(i/65536),h=i-65536*r,i=f+r+65535,r=Math.floor(i/65536),f=i-65536*r,i=u+r+65535,r=Math.floor(i/65536),u=i-65536*r,i=d+r+65535,r=Math.floor(i/65536),d=i-65536*r,i=l+r+65535,r=Math.floor(i/65536),l=i-65536*r,i=p+r+65535,r=Math.floor(i/65536),p=i-65536*r,i=b+r+65535,r=Math.floor(i/65536),b=i-65536*r,i=m+r+65535,r=Math.floor(i/65536),m=i-65536*r,i=g+r+65535,r=Math.floor(i/65536),g=i-65536*r,i=v+r+65535,r=Math.floor(i/65536),v=i-65536*r,i=y+r+65535,r=Math.floor(i/65536),y=i-65536*r,i=_+r+65535,r=Math.floor(i/65536),_=i-65536*r,s+=r-1+37*(r-1),r=1,i=s+r+65535,r=Math.floor(i/65536),s=i-65536*r,i=o+r+65535,r=Math.floor(i/65536),o=i-65536*r,i=a+r+65535,r=Math.floor(i/65536),a=i-65536*r,i=c+r+65535,r=Math.floor(i/65536),c=i-65536*r,i=h+r+65535,r=Math.floor(i/65536),h=i-65536*r,i=f+r+65535,r=Math.floor(i/65536),f=i-65536*r,i=u+r+65535,r=Math.floor(i/65536),u=i-65536*r,i=d+r+65535,r=Math.floor(i/65536),d=i-65536*r,i=l+r+65535,r=Math.floor(i/65536),l=i-65536*r,i=p+r+65535,r=Math.floor(i/65536),p=i-65536*r,i=b+r+65535,r=Math.floor(i/65536),b=i-65536*r,i=m+r+65535,r=Math.floor(i/65536),m=i-65536*r,i=g+r+65535,r=Math.floor(i/65536),g=i-65536*r,i=v+r+65535,r=Math.floor(i/65536),v=i-65536*r,i=y+r+65535,r=Math.floor(i/65536),y=i-65536*r,i=_+r+65535,r=Math.floor(i/65536),_=i-65536*r,s+=r-1+37*(r-1),e[0]=s,e[1]=o,e[2]=a,e[3]=c,e[4]=h,e[5]=f,e[6]=u,e[7]=d,e[8]=l,e[9]=p,e[10]=b,e[11]=m,e[12]=g,e[13]=v;e[14]=y;e[15]=_}function R(e,t){x(e,t,t)}function I(e,t){var n,i=ee();for(n=0;n<16;n++)i[n]=t[n];for(n=253;n>=0;n--)R(i,i),2!==n&&4!==n&&x(i,i,t);for(n=0;n<16;n++)e[n]=i[n]}function T(e,t){var n,i=ee();for(n=0;n<16;n++)i[n]=t[n];for(n=250;n>=0;n--)R(i,i),1!==n&&x(i,i,t);for(n=0;n<16;n++)e[n]=i[n]}function C(e,t,n){var i,r,s=new Uint8Array(32),o=new Float64Array(80),a=ee(),c=ee(),h=ee(),f=ee(),u=ee(),d=ee();for(r=0;r<31;r++)s[r]=t[r];for(s[31]=127&t[31]|64,s[0]&=248,k(o,n),r=0;r<16;r++)c[r]=o[r],f[r]=a[r]=h[r]=0;for(a[0]=f[0]=1,r=254;r>=0;--r)i=s[r>>>3]>>>(7&r)&1,_(a,c,i),_(h,f,i),A(u,a,h),M(a,a,h),A(h,c,f),M(c,c,f),R(f,u),R(d,a),x(a,h,a),x(h,c,u),A(u,a,h),M(a,a,h),R(c,a),M(h,f,d),x(a,h,oe),A(a,a,f),x(h,h,a),x(a,f,d),x(f,c,o),R(c,u),_(a,c,i),_(h,f,i);for(r=0;r<16;r++)o[r+16]=a[r],o[r+32]=h[r],o[r+48]=c[r],o[r+64]=f[r];var l=o.subarray(32),p=o.subarray(16);return I(l,l),x(p,p,l),w(e,p),0}function D(e,t){return C(e,t,ie)}function P(e,t){return te(t,32),D(e,t)}function B(e,t,n){var i=new Uint8Array(32);return C(i,n,t),h(e,ne,i,de)}function L(e,t,n,i,r,s){var o=new Uint8Array(32);return B(o,r,s),pe(e,t,n,i,o)}function O(e,t,n,i,r,s){var o=new Uint8Array(32);return B(o,r,s),be(e,t,n,i,o)}function U(e,t,n,i){for(var r,s,o,a,c,h,f,u,d,l,p,b,m,g,v,y,_,w,E,S,k,A,M,x,R,I,T=new Int32Array(16),C=new Int32Array(16),D=e[0],P=e[1],B=e[2],L=e[3],O=e[4],U=e[5],N=e[6],j=e[7],q=t[0],z=t[1],F=t[2],G=t[3],H=t[4],W=t[5],V=t[6],K=t[7],Z=0;i>=128;){for(E=0;E<16;E++)S=8*E+Z,T[E]=n[S+0]<<24|n[S+1]<<16|n[S+2]<<8|n[S+3],C[E]=n[S+4]<<24|n[S+5]<<16|n[S+6]<<8|n[S+7];for(E=0;E<80;E++)if(r=D,s=P,o=B,a=L,c=O,h=U,f=N,u=j,d=q,l=z,p=F,b=G,m=H,g=W,v=V,y=K,k=j,A=K,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=(O>>>14|H<<18)^(O>>>18|H<<14)^(H>>>9|O<<23),A=(H>>>14|O<<18)^(H>>>18|O<<14)^(O>>>9|H<<23),M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,k=O&U^~O&N,A=H&W^~H&V,M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,k=me[2*E],A=me[2*E+1],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,k=T[E%16],A=C[E%16],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,_=65535&R|I<<16,w=65535&M|x<<16,k=_,A=w,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=(D>>>28|q<<4)^(q>>>2|D<<30)^(q>>>7|D<<25),A=(q>>>28|D<<4)^(D>>>2|q<<30)^(D>>>7|q<<25),M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,k=D&P^D&B^P&B,A=q&z^q&F^z&F,M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,u=65535&R|I<<16,y=65535&M|x<<16,k=a,A=b,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=_,A=w,M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,a=65535&R|I<<16,b=65535&M|x<<16,P=r,B=s,L=o,O=a,U=c,N=h,j=f,D=u,z=d,F=l,G=p,H=b,W=m,V=g,K=v,q=y,E%16===15)for(S=0;S<16;S++)k=T[S],A=C[S],M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=T[(S+9)%16],A=C[(S+9)%16],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,_=T[(S+1)%16],w=C[(S+1)%16],k=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7,A=(w>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25),M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,_=T[(S+14)%16],w=C[(S+14)%16],k=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6,A=(w>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26),M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,T[S]=65535&R|I<<16,C[S]=65535&M|x<<16;k=D,A=q,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=e[0],A=t[0],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,e[0]=D=65535&R|I<<16,t[0]=q=65535&M|x<<16,k=P,A=z,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=e[1],A=t[1],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,e[1]=P=65535&R|I<<16,t[1]=z=65535&M|x<<16,k=B,A=F,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=e[2],A=t[2],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,e[2]=B=65535&R|I<<16,t[2]=F=65535&M|x<<16,k=L,A=G,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=e[3],A=t[3],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,e[3]=L=65535&R|I<<16,t[3]=G=65535&M|x<<16,k=O,A=H,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=e[4],A=t[4],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,e[4]=O=65535&R|I<<16,t[4]=H=65535&M|x<<16,k=U,A=W,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=e[5],A=t[5],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,e[5]=U=65535&R|I<<16,t[5]=W=65535&M|x<<16,k=N,A=V,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=e[6],A=t[6],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,e[6]=N=65535&R|I<<16,t[6]=V=65535&M|x<<16,k=j,A=K,M=65535&A,x=A>>>16,R=65535&k,I=k>>>16,k=e[7],A=t[7],M+=65535&A,x+=A>>>16,R+=65535&k,I+=k>>>16,x+=M>>>16,R+=x>>>16,I+=R>>>16,e[7]=j=65535&R|I<<16,t[7]=K=65535&M|x<<16,Z+=128,i-=128}return i}function N(e,n,i){var r,s=new Int32Array(8),o=new Int32Array(8),a=new Uint8Array(256),c=i;for(s[0]=1779033703,s[1]=3144134277,s[2]=1013904242,s[3]=2773480762,s[4]=1359893119,s[5]=2600822924,s[6]=528734635,s[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,U(s,o,n,i),i%=128,r=0;r=0;--r)i=n[r/8|0]>>(7&r)&1,q(e,t,i),j(t,e),j(e,e),q(e,t,i)}function G(e,t){var n=[ee(),ee(),ee(),ee()];v(n[0],he),v(n[1],fe),v(n[2],se),x(n[3],he,fe),F(e,n,t)}function H(e,t,n){var i,r=new Uint8Array(64),s=[ee(),ee(),ee(),ee()];for(n||te(t,32),N(r,t,32),r[0]&=248,r[31]&=127,r[31]|=64,G(s,r),z(e,s),i=0;i<32;i++)t[i+32]=e[i];return 0}function W(e,t){var n,i,r,s;for(i=63;i>=32;--i){for(n=0,r=i-32,s=i-12;r>8,t[r]-=256*n;t[r]+=n,t[i]=0}for(n=0,r=0;r<32;r++)t[r]+=n-(t[31]>>4)*ge[r],n=t[r]>>8,t[r]&=255;for(r=0;r<32;r++)t[r]-=n*ge[r];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function V(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;W(e,n)}function K(e,t,n,i){var r,s,o=new Uint8Array(64),a=new Uint8Array(64),c=new Uint8Array(64),h=new Float64Array(64),f=[ee(),ee(),ee(),ee()];N(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var u=n+64;for(r=0;r>7&&M(e[0],re,e[0]),x(e[3],e[0],e[1]),0)}function Y(e,t,n,i){var r,o,a=new Uint8Array(32),c=new Uint8Array(64),h=[ee(),ee(),ee(),ee()],f=[ee(),ee(),ee(),ee()];if(o=-1,n<64)return-1;if(Z(f,i))return-1;for(r=0;r>>13|n<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|i<<6),r=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|r<<9),s=255&e[8]|(255&e[9])<<8,this.r[4]=255&(r>>>4|s<<12),this.r[5]=s>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(s>>>14|o<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|a<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};le.prototype.blocks=function(e,t,n){for(var i,r,s,o,a,c,h,f,u,d,l,p,b,m,g,v,y,_,w,E=this.fin?0:2048,S=this.h[0],k=this.h[1],A=this.h[2],M=this.h[3],x=this.h[4],R=this.h[5],I=this.h[6],T=this.h[7],C=this.h[8],D=this.h[9],P=this.r[0],B=this.r[1],L=this.r[2],O=this.r[3],U=this.r[4],N=this.r[5],j=this.r[6],q=this.r[7],z=this.r[8],F=this.r[9];n>=16;)i=255&e[t+0]|(255&e[t+1])<<8,S+=8191&i,r=255&e[t+2]|(255&e[t+3])<<8,k+=8191&(i>>>13|r<<3),s=255&e[t+4]|(255&e[t+5])<<8,A+=8191&(r>>>10|s<<6),o=255&e[t+6]|(255&e[t+7])<<8,M+=8191&(s>>>7|o<<9),a=255&e[t+8]|(255&e[t+9])<<8,x+=8191&(o>>>4|a<<12),R+=a>>>1&8191,c=255&e[t+10]|(255&e[t+11])<<8,I+=8191&(a>>>14|c<<2),h=255&e[t+12]|(255&e[t+13])<<8,T+=8191&(c>>>11|h<<5),f=255&e[t+14]|(255&e[t+15])<<8,C+=8191&(h>>>8|f<<8),D+=f>>>5|E,u=0,d=u,d+=S*P,d+=k*(5*F),d+=A*(5*z),d+=M*(5*q),d+=x*(5*j),u=d>>>13,d&=8191,d+=R*(5*N),d+=I*(5*U),d+=T*(5*O),d+=C*(5*L),d+=D*(5*B),u+=d>>>13,d&=8191,l=u,l+=S*B,l+=k*P,l+=A*(5*F),l+=M*(5*z),l+=x*(5*q),u=l>>>13,l&=8191,l+=R*(5*j),l+=I*(5*N),l+=T*(5*U),l+=C*(5*O),l+=D*(5*L),u+=l>>>13,l&=8191,p=u,p+=S*L,p+=k*B,p+=A*P,p+=M*(5*F),p+=x*(5*z),u=p>>>13,p&=8191,p+=R*(5*q),p+=I*(5*j),p+=T*(5*N),p+=C*(5*U),p+=D*(5*O),u+=p>>>13,p&=8191,b=u,b+=S*O,b+=k*L,b+=A*B,b+=M*P,b+=x*(5*F),u=b>>>13,b&=8191,b+=R*(5*z),b+=I*(5*q),b+=T*(5*j),b+=C*(5*N),b+=D*(5*U),u+=b>>>13,b&=8191,m=u,m+=S*U,m+=k*O,m+=A*L,m+=M*B,m+=x*P,u=m>>>13,m&=8191,m+=R*(5*F),m+=I*(5*z),m+=T*(5*q),m+=C*(5*j),m+=D*(5*N),u+=m>>>13,m&=8191,g=u,g+=S*N,g+=k*U,g+=A*O,g+=M*L,g+=x*B,u=g>>>13,g&=8191,g+=R*P,g+=I*(5*F),g+=T*(5*z),g+=C*(5*q),g+=D*(5*j),u+=g>>>13,g&=8191,v=u,v+=S*j,v+=k*N,v+=A*U,v+=M*O,v+=x*L,u=v>>>13,v&=8191,v+=R*B,v+=I*P,v+=T*(5*F),v+=C*(5*z),v+=D*(5*q),u+=v>>>13,v&=8191,y=u,y+=S*q,y+=k*j,y+=A*N,y+=M*U,y+=x*O,u=y>>>13,y&=8191,y+=R*L,y+=I*B,y+=T*P,y+=C*(5*F),y+=D*(5*z),u+=y>>>13,y&=8191,_=u,_+=S*z,_+=k*q,_+=A*j,_+=M*N,_+=x*U,u=_>>>13,_&=8191,_+=R*O,_+=I*L,_+=T*B,_+=C*P,_+=D*(5*F),u+=_>>>13,_&=8191,w=u,w+=S*F,w+=k*z,w+=A*q,w+=M*j,w+=x*N,u=w>>>13,w&=8191,w+=R*U,w+=I*O,w+=T*L,w+=C*B,w+=D*P,u+=w>>>13,w&=8191,u=(u<<2)+u|0,u=u+d|0,d=8191&u,u>>>=13,l+=u,S=d,k=l,A=p,M=b,x=m,R=g,I=v,T=y,C=_,D=w,t+=16,n-=16;this.h[0]=S,this.h[1]=k,this.h[2]=A,this.h[3]=M,this.h[4]=x,this.h[5]=R,this.h[6]=I,this.h[7]=T,this.h[8]=C,this.h[9]=D},le.prototype.finish=function(e,t){var n,i,r,s,o=new Uint16Array(10);if(this.leftover){for(s=this.leftover,this.buffer[s++]=1;s<16;s++)this.buffer[s]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,s=2;s<10;s++)this.h[s]+=n,n=this.h[s]>>>13,this.h[s]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,o[0]=this.h[0]+5,n=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this.h[s]+n,n=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,i=(1^n)-1,s=0;s<10;s++)o[s]&=i;for(i=~i,s=0;s<10;s++)this.h[s]=this.h[s]&i|o[s];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),r=this.h[0]+this.pad[0],this.h[0]=65535&r,s=1;s<8;s++)r=(this.h[s]+this.pad[s]|0)+(r>>>16)|0,this.h[s]=65535&r;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},le.prototype.update=function(e,t,n){var i,r;if(this.leftover){for(r=16-this.leftover,r>n&&(r=n),i=0;i=16&&(r=n-n%16,this.blocks(e,t,r),t+=r,n-=r),n){for(i=0;i=0},e.sign.keyPair=function(){var e=new Uint8Array(Ce),t=new Uint8Array(De);return H(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if($(e),e.length!==De)throw new Error("bad secret key size");for(var t=new Uint8Array(Ce),n=0;n
- * MIT Licensed
- */
-var i=e.exports=n(129);i.Server=n(246),i.Sender=n(128),i.Receiver=n(127),i.createServer=function(e,t){var n=new i.Server(e);return"function"==typeof t&&n.on("connection",t),n},i.connect=i.createConnection=function(e,t){var n=new i(e);return"function"==typeof t&&n.on("open",t),n}},function(e,t,n){"use strict";/*!
- * ws: a node.js websocket client
- * Copyright(c) 2011 Einar Otto Stangvik
- * MIT Licensed
- */
-try{e.exports=n(162)}catch(t){e.exports=n(241)}},function(e,t){/*!
- * ws: a node.js websocket client
- * Copyright(c) 2011 Einar Otto Stangvik
- * MIT Licensed
- */
-e.exports={isValidErrorCode:function(e){return e>=1e3&&e<=1011&&1004!=e&&1005!=e&&1006!=e||e>=3e3&&e<=4999},1e3:"normal",1001:"going away",1002:"protocol error",1003:"unsupported data",1004:"reserved",1005:"reserved for extensions",1006:"reserved for extensions",1007:"inconsistent or invalid data",1008:"policy violation",1009:"message too big",1010:"extension handshake missing",1011:"an unexpected condition prevented the request from being fulfilled"}},function(e,t,n){function i(e){e=e||"";var t={};return e.split(",").forEach(function(e){var n=e.split(";"),i=n.shift().trim(),r=t[i]=t[i]||[],s={};n.forEach(function(e){var t=e.trim().split("="),n=t[0],i=t[1];"undefined"==typeof i?i=!0:('"'===i[0]&&(i=i.slice(1)),'"'===i[i.length-1]&&(i=i.slice(0,i.length-1))),(s[n]=s[n]||[]).push(i)}),r.push(s)}),t}function r(e){return Object.keys(e).map(function(t){var n=e[t];return s.isArray(n)||(n=[n]),n.map(function(e){return[t].concat(Object.keys(e).map(function(t){var n=e[t];return s.isArray(n)||(n=[n]),n.map(function(e){return e===!0?t:t+"="+e}).join("; ")})).join("; ")}).join(", ")}).join(", ")}var s=n(10);t.parse=i,t.format=r},function(e,t,n){(function(t){function i(e,n){if(this instanceof i==!1)throw new TypeError("Classes can't be function-called");"number"==typeof e&&(n=e,e={});var r=-1;this.fragmentedBufferPool=new f(1024,function(e,t){return e.used+t},function(e){return r=r>=0?Math.ceil((r+e.used)/2):e.used});var s=-1;this.unfragmentedBufferPool=new f(1024,function(e,t){return e.used+t},function(e){return s=s>=0?Math.ceil((s+e.used)/2):e.used}),this.extensions=e||{},this.maxPayload=n||0,this.currentPayloadLength=0,this.state={activeFragmentedOperation:null,lastFragment:!1,masked:!1,opcode:0,fragmentedOperation:!1},this.overflow=[],this.headerBuffer=new t(10),this.expectOffset=0,this.expectBuffer=null,this.expectHandler=null,this.currentMessage=[],this.currentMessageLength=0,this.messageHandlers=[],this.expectHeader(2,this.processPacket),this.dead=!1,this.processing=!1,this.onerror=function(){},this.ontext=function(){},this.onbinary=function(){},this.onclose=function(){},this.onping=function(){},this.onpong=function(){}}function r(e){return(this[e]<<8)+this[e+1]}function s(e){return(this[e]<<24)+(this[e+1]<<16)+(this[e+2]<<8)+this[e+3]}function o(e,t,n,i){switch(e){default:t.copy(n,i,0,e);break;case 16:n[i+15]=t[15];case 15:n[i+14]=t[14];case 14:n[i+13]=t[13];case 13:n[i+12]=t[12];case 12:n[i+11]=t[11];case 11:n[i+10]=t[10];case 10:n[i+9]=t[9];case 9:n[i+8]=t[8];case 8:n[i+7]=t[7];case 7:n[i+6]=t[6];case 6:n[i+5]=t[5];case 5:n[i+4]=t[4];case 4:n[i+3]=t[3];case 3:n[i+2]=t[2];case 2:n[i+1]=t[1];case 1:n[i]=t[0]}}function a(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}/*!
- * ws: a node.js websocket client
- * Copyright(c) 2011 Einar Otto Stangvik
- * MIT Licensed
- */
-var c=(n(10),n(245).Validation),h=n(125),f=n(240),u=n(124).BufferUtil,d=n(44);e.exports=i,i.prototype.add=function(e){if(!this.dead){var t=e.length;if(0!=t){if(null==this.expectBuffer)return void this.overflow.push(e);var n=Math.min(t,this.expectBuffer.length-this.expectOffset);for(o(n,e,this.expectBuffer,this.expectOffset),this.expectOffset+=n,n0&&this.overflow.length>0;){var i=this.overflow.pop();n0&&this.overflow.length>0;){var i=this.overflow.pop();n=8&&t)return void this.error("control frames cannot have the Per-message Compressed bits",1002);this.state.compressed=t,this.state.opcode=n,this.state.lastFragment===!1?(this.state.fragmentedOperation=!0,this.state.activeFragmentedOperation=n):this.state.fragmentedOperation=!1}var i=l[this.state.opcode];"undefined"==typeof i?this.error("no handler for opcode "+this.state.opcode,1002):i.start.call(this,e)},i.prototype.endPacket=function(){this.dead||(this.state.fragmentedOperation?this.state.lastFragment&&this.fragmentedBufferPool.reset(!0):this.unfragmentedBufferPool.reset(!0),this.expectOffset=0,this.expectBuffer=null,this.expectHandler=null,this.state.lastFragment&&this.state.opcode===this.state.activeFragmentedOperation&&(this.state.activeFragmentedOperation=null),this.currentPayloadLength=0,this.state.lastFragment=!1,this.state.opcode=null!=this.state.activeFragmentedOperation?this.state.activeFragmentedOperation:0,this.state.masked=!1,this.expectHeader(2,this.processPacket))},i.prototype.reset=function(){this.dead||(this.state={activeFragmentedOperation:null,lastFragment:!1,masked:!1,opcode:0,fragmentedOperation:!1},this.fragmentedBufferPool.reset(!0),this.unfragmentedBufferPool.reset(!0),this.expectOffset=0,this.expectBuffer=null,this.expectHandler=null,this.overflow=[],this.currentMessage=[],this.currentMessageLength=0,this.messageHandlers=[],this.currentPayloadLength=0)},i.prototype.unmask=function(e,t,n){return null!=e&&null!=t&&u.unmask(t,e),n?t:null!=t?t.toString("utf8"):""},i.prototype.error=function(e,t){if(!this.dead)return this.reset(),"string"==typeof e?this.onerror(new Error(e),t):e.constructor==Error?this.onerror(e,t):this.onerror(new Error("An error occured"),t),this},i.prototype.flush=function(){if(!this.processing&&!this.dead){var e=this.messageHandlers.shift();if(e){this.processing=!0;var t=this;e(function(){t.processing=!1,t.flush()})}}},i.prototype.applyExtensions=function(e,t,n,i){var r=this;n?this.extensions[d.extensionName].decompress(e,t,function(e,t){if(!r.dead)return e?void i(new Error("invalid compressed data")):void i(null,t)}):i(null,e)},i.prototype.maxPayloadExceeded=function(e){if(void 0===this.maxPayload||null===this.maxPayload||this.maxPayload<1)return!1;var t=this.currentPayloadLength+e;return t0&&i.currentMessageLength+r.length0&&i.currentMessageLength+r.length1?r.call(t,0):1e3;if(!h.isValidErrorCode(e))return void n.error("invalid error code",1002);var s="";if(t&&t.length>2){var o=t.slice(2);if(!c.isValidUTF8(o))return void n.error("invalid utf8 sequence",1007);s=o.toString("utf8")}n.onclose(e,s,{masked:i.masked}),n.reset()}),this.flush()}},9:{start:function(e){var t=this;if(0==t.state.lastFragment)return void t.error("fragmented ping is not supported",1002);var n=127&e[1];n<126?l[9].getData.call(t,n):t.error("control frames cannot have more than 125 bytes of data",1002)},getData:function(e){var t=this;t.state.masked?t.expectHeader(4,function(n){var i=n;t.expectData(e,function(e){l[9].finish.call(t,i,e)})}):t.expectData(e,function(e){l[9].finish.call(t,null,e)})},finish:function(e,t){var n=this;t=this.unmask(e,t,!0);var i=a(this.state);this.messageHandlers.push(function(e){n.onping(t,{masked:i.masked,binary:!0}),e()}),this.flush(),this.endPacket()}},10:{start:function(e){var t=this;if(0==t.state.lastFragment)return void t.error("fragmented pong is not supported",1002);var n=127&e[1];n<126?l[10].getData.call(t,n):t.error("control frames cannot have more than 125 bytes of data",1002)},getData:function(e){var t=this;this.state.masked?this.expectHeader(4,function(n){var i=n;t.expectData(e,function(e){l[10].finish.call(t,i,e)})}):this.expectData(e,function(e){l[10].finish.call(t,null,e)})},finish:function(e,t){var n=this;t=n.unmask(e,t,!0);var i=a(this.state);this.messageHandlers.push(function(e){n.onpong(t,{masked:i.masked,binary:!0}),e()}),this.flush(),this.endPacket()}}}}).call(t,n(0).Buffer)},function(e,t,n){(function(t){function i(e,t){if(this instanceof i==!1)throw new TypeError("Classes can't be function-called");c.EventEmitter.call(this),this._socket=e,this.extensions=t||{},this.firstFragment=!0,this.compress=!1,this.messageHandlers=[],this.processing=!1}function r(e,t){this[t]=(65280&e)>>8,this[t+1]=255&e}function s(e,t){this[t]=(4278190080&e)>>24,this[t+1]=(16711680&e)>>16,this[t+2]=(65280&e)>>8,this[t+3]=255&e}function o(e){for(var n=new Uint8Array(e.buffer||e),i=e.byteLength||e.length,r=e.byteOffset||0,s=new t(i),o=0;o
- * MIT Licensed
- */
-var c=n(5),h=n(10),f=(c.EventEmitter,n(125)),u=n(124).BufferUtil,d=n(44);h.inherits(i,c.EventEmitter),i.prototype.close=function(e,n,i,s){if("undefined"!=typeof e&&("number"!=typeof e||!f.isValidErrorCode(e)))throw new Error("first argument must be a valid error code number");e=e||1e3;var o=new t(2+(n?t.byteLength(n):0));r.call(o,e,0),o.length>2&&o.write(n,2);var a=this;this.messageHandlers.push(function(e){a.frameAndSend(8,o,!0,i),e(),"function"==typeof s&&s()}),this.flush()},i.prototype.ping=function(e,t){var n=t&&t.mask,i=this;this.messageHandlers.push(function(t){i.frameAndSend(9,e||"",!0,n),t()}),this.flush()},i.prototype.pong=function(e,t){var n=t&&t.mask,i=this;this.messageHandlers.push(function(t){i.frameAndSend(10,e||"",!0,n),t()}),this.flush()},i.prototype.send=function(e,t,n){var i=!t||t.fin!==!1,r=t&&t.mask,s=t&&t.compress,o=t&&t.binary?2:1;this.firstFragment===!1?(o=0,s=!1):(this.firstFragment=!1,this.compress=s),i&&(this.firstFragment=!0);var a=this.compress,c=this;this.messageHandlers.push(function(t){c.applyExtensions(e,i,a,function(e,a){return e?void("function"==typeof n?n(e):c.emit("error",e)):(c.frameAndSend(o,a,i,r,s,n),void t())})}),this.flush()},i.prototype.frameAndSend=function(e,n,i,c,h,f){var d=!1;if(n){t.isBuffer(n)||(d=!0,!n||"undefined"==typeof n.byteLength&&"undefined"==typeof n.buffer?("number"==typeof n&&(n=n.toString()),n=new t(n)):n=o(n));var l=n.length,p=c?6:2,b=l;l>=65536?(p+=8,b=127):l>125&&(p+=2,b=126);var m=l<32768||c&&!d,g=m?l+p:p,v=new t(g);switch(v[0]=i?128|e:e,h&&(v[0]|=64),b){case 126:r.call(v,l,2);break;case 127:s.call(v,0,2),s.call(v,l,6)}if(c){v[1]=128|b;var y=a();if(v[p-4]=y[0],v[p-3]=y[1],v[p-2]=y[2],v[p-1]=y[3],m){u.mask(n,y,v,p,l);try{this._socket.write(v,"binary",f)}catch(e){"function"==typeof f?f(e):this.emit("error",e)}}else{u.mask(n,y,n,0,l);try{this._socket.write(v,"binary"),this._socket.write(n,"binary",f)}catch(e){"function"==typeof f?f(e):this.emit("error",e)}}}else if(v[1]=b,m){n.copy(v,p);try{this._socket.write(v,"binary",f)}catch(e){"function"==typeof f?f(e):this.emit("error",e)}}else try{this._socket.write(v,"binary"),this._socket.write(n,"binary",f)}catch(e){"function"==typeof f?f(e):this.emit("error",e)}}else try{this._socket.write(new t([e|(i?128:0),0|(c?128:0)].concat(c?[0,0,0,0]:[])),"binary",f)}catch(e){"function"==typeof f?f(e):this.emit("error",e)}},i.prototype.flush=function(){if(!this.processing){var e=this.messageHandlers.shift();if(e){this.processing=!0;var t=this;e(function(){t.processing=!1,t.flush()})}}},i.prototype.applyExtensions=function(e,t,n,i){n&&e?((e.buffer||e)instanceof ArrayBuffer&&(e=o(e)),this.extensions[d.extensionName].compress(e,t,i)):i(null,e)},e.exports=i}).call(t,n(0).Buffer)},function(e,t,n){"use strict";(function(t,i){function r(e,t,n){return this instanceof r==!1?new r(e,t,n):(T.call(this),t&&!Array.isArray(t)&&"object"==typeof t&&(n=t,t=null),"string"==typeof t&&(t=[t]),Array.isArray(t)||(t=[]),this._socket=null,this._ultron=null,this._closeReceived=!1,this.bytesReceived=0,this.readyState=null,this.supports={},this.extensions={},this._binaryType="nodebuffer",void(Array.isArray(e)?h.apply(this,e.concat(n)):f.apply(this,[e,t,n])))}function s(e,t,n){this.type="message",this.data=e,this.target=n,this.binary=t}function o(e,t,n){this.type="close",this.wasClean="undefined"==typeof e||1e3===e,this.code=e,this.reason=t,this.target=n}function a(e){this.type="open",this.target=e}function c(e,t,n){var i=t;return t&&(e&&443!=n||!e&&80!=n)&&(i=i+":"+n),i}function h(e,t,n,i){i=new S({protocolVersion:C,protocol:null,extensions:{},maxPayload:0}).merge(i),this.protocol=i.value.protocol,this.protocolVersion=i.value.protocolVersion,this.extensions=i.value.extensions,this.supports.binary="hixie-76"!==this.protocolVersion,this.upgradeReq=e,this.readyState=r.CONNECTING,this._isServer=!0,this.maxPayload=i.value.maxPayload,"hixie-76"===i.value.protocolVersion?u.call(this,x,M,t,n):u.call(this,A,k,t,n)}function f(e,n,i){if(i=new S({origin:null,protocolVersion:C,host:null,headers:null,protocol:n.join(","),agent:null,pfx:null,key:null,passphrase:null,cert:null,ca:null,ciphers:null,rejectUnauthorized:null,perMessageDeflate:!0,localAddress:null}).merge(i),8!==i.value.protocolVersion&&13!==i.value.protocolVersion)throw new Error("unsupported protocol version");var s=m.parse(e),o="ws+unix:"===s.protocol;if(!s.host&&!o)throw new Error("invalid url");var a,h="wss:"===s.protocol||"https:"===s.protocol,f=h?y:v,d=s.port||(h?443:80),l=s.auth,p={};i.value.perMessageDeflate&&(a=new I(typeof i.value.perMessageDeflate!==!0?i.value.perMessageDeflate:{},!1),p[I.extensionName]=a.offer()),this._isServer=!1,this.url=e,this.protocolVersion=i.value.protocolVersion,this.supports.binary="hixie-76"!==this.protocolVersion;var g=new t(i.value.protocolVersion+"-"+Date.now()).toString("base64"),w=_.createHash("sha1");w.update(g+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11");var E=w.digest("base64"),M=i.value.agent,x=c(h,s.hostname,d),T={port:d,host:s.hostname,headers:{Connection:"Upgrade",Upgrade:"websocket",Host:x,"Sec-WebSocket-Version":i.value.protocolVersion,"Sec-WebSocket-Key":g}};if(l&&(T.headers.Authorization="Basic "+new t(l).toString("base64")),i.value.protocol&&(T.headers["Sec-WebSocket-Protocol"]=i.value.protocol),i.value.host&&(T.headers.Host=i.value.host),i.value.headers)for(var D in i.value.headers)i.value.headers.hasOwnProperty(D)&&(T.headers[D]=i.value.headers[D]);Object.keys(p).length&&(T.headers["Sec-WebSocket-Extensions"]=R.format(p)),(i.isDefinedAndNonNull("pfx")||i.isDefinedAndNonNull("key")||i.isDefinedAndNonNull("passphrase")||i.isDefinedAndNonNull("cert")||i.isDefinedAndNonNull("ca")||i.isDefinedAndNonNull("ciphers")||i.isDefinedAndNonNull("rejectUnauthorized"))&&(i.isDefinedAndNonNull("pfx")&&(T.pfx=i.value.pfx),i.isDefinedAndNonNull("key")&&(T.key=i.value.key),i.isDefinedAndNonNull("passphrase")&&(T.passphrase=i.value.passphrase),i.isDefinedAndNonNull("cert")&&(T.cert=i.value.cert),i.isDefinedAndNonNull("ca")&&(T.ca=i.value.ca),i.isDefinedAndNonNull("ciphers")&&(T.ciphers=i.value.ciphers),i.isDefinedAndNonNull("rejectUnauthorized")&&(T.rejectUnauthorized=i.value.rejectUnauthorized),M||(M=new f.Agent(T))),T.path=s.path||"/",M&&(T.agent=M),o&&(T.socketPath=s.pathname),i.value.localAddress&&(T.localAddress=i.value.localAddress),i.value.origin&&(i.value.protocolVersion<13?T.headers["Sec-WebSocket-Origin"]=i.value.origin:T.headers.Origin=i.value.origin);var P=this,B=f.request(T);B.on("error",function(e){P.emit("error",e),b.call(P,e)}),B.once("response",function(e){var t;P.emit("unexpected-response",B,e)||(t=new Error("unexpected server response ("+e.statusCode+")"),B.abort(),P.emit("error",t)),b.call(P,t)}),B.once("upgrade",function(e,t,n){if(P.readyState===r.CLOSED)return P.emit("close"),P.removeAllListeners(),void t.end();var s=e.headers["sec-websocket-accept"];if("undefined"==typeof s||s!==E)return P.emit("error","invalid server key"),P.removeAllListeners(),void t.end();var o=e.headers["sec-websocket-protocol"],c=(i.value.protocol||"").split(/, */),h=null;if(!i.value.protocol&&o?h="server sent a subprotocol even though none requested":i.value.protocol&&!o?h="server sent no subprotocol even though requested":o&&c.indexOf(o)===-1&&(h="server responded with an invalid protocol"),h)return P.emit("error",h),P.removeAllListeners(),void t.end();o&&(P.protocol=o);var f=R.parse(e.headers["sec-websocket-extensions"]);if(a&&f[I.extensionName]){try{a.accept(f[I.extensionName])}catch(e){return P.emit("error","invalid extension parameter"),P.removeAllListeners(),void t.end()}P.extensions[I.extensionName]=a}u.call(P,A,k,t,n),B.removeAllListeners(),B=null,M=null}),B.end(),this.readyState=r.CONNECTING}function u(e,t,n,s){function o(e){h||f.readyState===r.CLOSED||(h=!0,n.removeListener("data",o),c.on("data",a),s&&s.length>0&&(a(s),s=null),e&&a(e))}function a(e){f.bytesReceived+=e.length,f._receiver.add(e)}var c=this._ultron=new E(n),h=!1,f=this;n.setTimeout(0),n.setNoDelay(!0),this._receiver=new e(this.extensions,this.maxPayload),this._socket=n,c.on("end",b.bind(this)),c.on("close",b.bind(this)),c.on("error",b.bind(this)),c.on("data",o),i.nextTick(o),f._receiver.ontext=function(e,t){t=t||{},f.emit("message",e,t)},f._receiver.onbinary=function(e,t){t=t||{},t.binary=!0,f.emit("message",e,t)},f._receiver.onping=function(e,t){t=t||{},f.pong(e,{mask:!f._isServer,binary:t.binary===!0},!0),f.emit("ping",e,t)},f._receiver.onpong=function(e,t){f.emit("pong",e,t||{})},f._receiver.onclose=function(e,t,n){n=n||{},f._closeReceived=!0,f.close(e,t)},f._receiver.onerror=function(e,t){f.close("undefined"!=typeof t?t:1002,""),f.emit("error",e instanceof Error?e:new Error(e))},this._sender=new t(n,this.extensions),this._sender.on("error",function(e){f.close(1002,""),f.emit("error",e)}),this.readyState=r.OPEN,this.emit("open")}function d(e){e._queue=e._queue||[]}function l(e){var t=e._queue;if("undefined"!=typeof t){delete e._queue;for(var n=0,i=t.length;n
- * MIT Licensed
- */
-var m=n(62),g=n(10),v=n(55),y=n(236),_=n(122),w=n(11),E=n(229),S=n(108),k=n(128),A=n(127),M=n(243),x=n(242),R=n(126),I=n(44),T=n(5).EventEmitter,C=13,D=3e4;g.inherits(r,T),["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e,t){r.prototype[e]=r[e]=t}),r.prototype.close=function(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING)return void(this.readyState=r.CLOSED);if(this.readyState===r.CLOSING)return void(this._closeReceived&&this._isServer&&this.terminate());var n=this;try{this.readyState=r.CLOSING,this._closeCode=e,this._closeMessage=t;var i=!this._isServer;this._sender.close(e,t,i,function(e){e&&n.emit("error",e),n._closeReceived&&n._isServer?n.terminate():(clearTimeout(n._closeTimer),n._closeTimer=setTimeout(b.bind(n,!0),D))})}catch(e){this.emit("error",e)}}},r.prototype.pause=function(){if(this.readyState!==r.OPEN)throw new Error("not opened");return this._socket.pause()},r.prototype.ping=function(e,t,n){if(this.readyState!==r.OPEN){if(n===!0)return;throw new Error("not opened")}t=t||{},"undefined"==typeof t.mask&&(t.mask=!this._isServer),this._sender.ping(e,t)},r.prototype.pong=function(e,t,n){if(this.readyState!==r.OPEN){if(n===!0)return;throw new Error("not opened")}t=t||{},"undefined"==typeof t.mask&&(t.mask=!this._isServer),this._sender.pong(e,t)},r.prototype.resume=function(){if(this.readyState!==r.OPEN)throw new Error("not opened");return this._socket.resume()},r.prototype.send=function(e,n,s){if("function"==typeof n&&(s=n,n={}),this.readyState!==r.OPEN){if("function"!=typeof s)throw new Error("not opened");return void s(new Error("not opened"))}if(e||(e=""),this._queue){var o=this;return void this._queue.push(function(){o.send(e,n,s)})}n=n||{},n.fin=!0,"undefined"==typeof n.binary&&(n.binary=e instanceof ArrayBuffer||e instanceof t||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array),"undefined"==typeof n.mask&&(n.mask=!this._isServer),"undefined"==typeof n.compress&&(n.compress=!0),this.extensions[I.extensionName]||(n.compress=!1);var a="function"==typeof w.Readable?w.Readable:w.Stream;if(e instanceof a){d(this);var o=this;p(this,e,n,function(e){i.nextTick(function(){l(o)}),"function"==typeof s&&s(e)})}else this._sender.send(e,n,s)},r.prototype.stream=function(e,t){function n(o,a){try{if(s.readyState!==r.OPEN)throw new Error("not opened");e.fin=a===!0,s._sender.send(o,e),a?l(s):i.nextTick(t.bind(null,null,n))}catch(e){"function"==typeof t?t(e):(delete s._queue,s.emit("error",e))}}"function"==typeof e&&(t=e,e={});var s=this;if("function"!=typeof t)throw new Error("callback must be provided");if(this.readyState!==r.OPEN){if("function"!=typeof t)throw new Error("not opened");return void t(new Error("not opened"))}return this._queue?void this._queue.push(function(){s.stream(e,t)}):(e=e||{},"undefined"==typeof e.mask&&(e.mask=!this._isServer),"undefined"==typeof e.compress&&(e.compress=!0),this.extensions[I.extensionName]||(e.compress=!1),d(this),void i.nextTick(t.bind(null,null,n)))},r.prototype.terminate=function(){if(this.readyState!==r.CLOSED)if(this._socket){this.readyState=r.CLOSING;try{this._socket.end()}catch(e){return void b.call(this,!0)}this._closeTimer&&clearTimeout(this._closeTimer),this._closeTimer=setTimeout(b.bind(this,!0),D)}else this.readyState===r.CONNECTING&&b.call(this,!0)},Object.defineProperty(r.prototype,"bufferedAmount",{get:function(){var e=0;return this._socket&&(e=this._socket.bufferSize||0),e}}),Object.defineProperty(r.prototype,"binaryType",{get:function(){return this._binaryType},set:function(e){if("arraybuffer"!==e&&"nodebuffer"!==e)throw new SyntaxError('unsupported binaryType: must be either "nodebuffer" or "arraybuffer"');this._binaryType=e}}),["open","error","close","message"].forEach(function(e){Object.defineProperty(r.prototype,"on"+e,{get:function(){var t=this.listeners(e)[0];return t?t._listener?t._listener:t:void 0},set:function(t){this.removeAllListeners(e),this.addEventListener(e,t)}})}),r.prototype.addEventListener=function(e,t){function n(e,n){n.binary&&"arraybuffer"===this.binaryType&&(e=new Uint8Array(e).buffer),t.call(h,new s(e,!!n.binary,h))}function i(e,n){t.call(h,new o(e,n,h))}function r(e){e.type="error",e.target=h,t.call(h,e)}function c(){t.call(h,new a(h))}var h=this;"function"==typeof t&&("message"===e?(n._listener=t,this.on(e,n)):"close"===e?(i._listener=t,this.on(e,i)):"error"===e?(r._listener=t,this.on(e,r)):"open"===e?(c._listener=t,this.on(e,c)):this.on(e,t))},e.exports=r,e.exports.buildHostHeader=c}).call(t,n(0).Buffer,n(8))},function(e,t,n){(function(t){const i=n(23),r=n(13),s=n(60),o=n(1),a=n(134),c=n(14),h=n(34),f=n(47),u=n(24),d=n(33),l=n(25),p=n(48);class b{constructor(e){this.client=e}resolveUser(e){return e instanceof c?e:"string"==typeof e?this.client.users.get(e)||null:e instanceof d?e.user:e instanceof h?e.author:e instanceof f?e.owner:null}resolveUserID(e){return e instanceof c||e instanceof d?e.id:"string"==typeof e?e||null:e instanceof h?e.author.id:e instanceof f?e.ownerID:null}resolveGuild(e){return e instanceof f?e:"string"==typeof e?this.client.guilds.get(e)||null:null}resolveGuildMember(e,t){return t instanceof d?t:(e=this.resolveGuild(e),t=this.resolveUser(t),e&&t?e.members.get(t.id)||null:null)}resolveChannel(e){return e instanceof u?e:e instanceof h?e.channel:e instanceof f?e.channels.get(e.id)||null:"string"==typeof e?this.client.channels.get(e)||null:null}resolveInviteCode(e){const t=/discord(?:app)?\.(?:gg|com\/invite)\/([a-z0-9]{5})/i,n=t.exec(e);return n&&n[1]?n[1]:e}resolvePermission(e){if("string"==typeof e&&(e=o.PermissionFlags[e]),"number"!=typeof e||e<1)throw new Error(o.Errors.NOT_A_PERMISSION);return e}resolveString(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}resolveBase64(e){return e instanceof t?`data:image/jpg;base64,${e.toString("base64")}`:e}resolveBuffer(e){return e instanceof t?Promise.resolve(e):this.client.browser&&e instanceof ArrayBuffer?Promise.resolve(a(e)):"string"==typeof e?new Promise((n,o)=>{if(/^https?:\/\//.test(e)){const i=s.get(e).set("Content-Type","blob");this.client.browser&&i.responseType("arraybuffer"),i.end((e,i)=>{return e?o(e):this.client.browser?n(a(i.xhr.response)):i.body instanceof t?n(i.body):o(new TypeError("Body is not a Buffer"))})}else{const t=i.resolve(e);r.stat(t,(e,i)=>{if(e&&o(e),!i||!i.isFile())throw new Error(`The file could not be found: ${t}`);r.readFile(t,(e,t)=>{e?o(e):n(t)})})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(e){return e instanceof l||e instanceof p?e.identifier:"string"!=typeof e||e.includes("%")?null:encodeURIComponent(e)}}e.exports=b}).call(t,n(0).Buffer)},function(e,t,n){const i=n(281),r=n(278),s=n(280),o=n(279),a=n(277),c=n(1);class h{constructor(e){this.client=e,this.handlers={},this.userAgentManager=new i(this),this.methods=new r(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(e,t){return new Promise((n,i)=>{e.push({request:t,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return s;case"burst":return o;default:throw new Error(c.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(e,t,n,i,r){const s=new a(this,e,t,n,i,r);if(!this.handlers[s.route]){const e=this.getRequestHandler();this.handlers[s.route]=new e(this,s.route)}return this.push(this.handlers[s.route],s)}}e.exports=h},function(e,t){class n{constructor(e){this.restManager=e,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(e){this.restManager.globallyRateLimited=e}push(e){this.queue.push(e)}handle(){}}e.exports=n},function(e,t){class n{constructor(e){this.player=e}encode(e){return e}decode(e){return e}}e.exports=n},function(e,t,n){(function(t){function n(e){const n=new t(e.byteLength),i=new Uint8Array(e);for(var r=0;r0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get status(){return this.ws.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get voiceConnections(){return this.voice.connections}get emojis(){const e=new Collection;for(const t of this.guilds.values())for(const n of t.emojis.values())e.set(n.id,n);return e}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}login(e,t=null){return t?this.rest.methods.loginEmailPassword(e,t):this.rest.methods.loginToken(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const t of this._intervals)clearInterval(t);return this._timeouts.clear(),this._intervals.clear(),this.token=null,this.email=null,this.password=null,this.manager.destroy()}syncGuilds(e=this.guilds){this.user.bot||this.ws.send({op:12,d:e instanceof Collection?e.keyArray():e.map(e=>e.id)})}fetchUser(e){return this.users.has(e)?Promise.resolve(this.users.get(e)):this.rest.methods.getUser(e)}fetchInvite(e){const t=this.resolver.resolveInviteCode(e);return this.rest.methods.getInvite(t)}fetchWebhook(e,t){return this.rest.methods.getWebhook(e,t)}sweepMessages(e=this.options.messageCacheLifetime){if("number"!=typeof e||isNaN(e))throw new TypeError("The lifetime must be a number.");if(e<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const t=1e3*e,n=Date.now();let i=0,r=0;for(const s of this.channels.values())if(s.messages){i++;for(const e of s.messages.values())n-(e.editedTimestamp||e.createdTimestamp)>t&&(s.messages.delete(e.id),r++)}return this.emit("debug",`Swept ${r} messages older than ${e} seconds in ${i} text-based channels`),r}fetchApplication(){if(!this.user.bot)throw new Error(Constants.Errors.NO_BOT_ACCOUNT);return this.rest.methods.getMyApplication()}setTimeout(e,t,...n){const i=setTimeout(()=>{e(),this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}_setPresence(e,t){return this.presences.get(e)?void this.presences.get(e).update(t):void this.presences.set(e,new Presence(t))}_eval(script){return eval(script)}_validateOptions(e=this.options){if("number"!=typeof e.shardCount||isNaN(e.shardCount))throw new TypeError("The shardCount option must be a number.");if("number"!=typeof e.shardId||isNaN(e.shardId))throw new TypeError("The shardId option must be a number.");if(e.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(e.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==e.shardId&&e.shardId>=e.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof e.messageCacheMaxSize||isNaN(e.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof e.messageCacheLifetime||isNaN(e.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof e.messageSweepInterval||isNaN(e.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof e.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof e.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof e.restWsBridgeTimeout||isNaN(e.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(e.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(8))},function(e,t,n){const i=n(49),r=n(131),s=n(130),o=n(45),a=n(1);class c extends i{constructor(e,t,n){super(null,e,t),this.options=o(a.DefaultOptions,n),this.rest=new r(this),this.resolver=new s(this)}}e.exports=c},function(e,t,n){(function(t){const i=n(23),r=n(13),s=n(5).EventEmitter,o=n(45),a=n(65),c=n(6),h=n(82);class f extends s{constructor(e,n={}){if(super(),n=o({totalShards:"auto",respawn:!0,shardArgs:[],token:null},n),this.file=e,!e)throw new Error("File must be specified.");i.isAbsolute(e)||(this.file=i.resolve(t.cwd(),e));const s=r.statSync(this.file);if(!s.isFile())throw new Error("File path does not point to a file.");if(this.totalShards=n.totalShards,"auto"!==this.totalShards){if("number"!=typeof this.totalShards||isNaN(this.totalShards))throw new TypeError("Amount of shards must be a number.");if(this.totalShards<1)throw new RangeError("Amount of shards must be at least 1.");if(this.totalShards!==Math.floor(this.totalShards))throw new RangeError("Amount of shards must be an integer.")}this.respawn=n.respawn,this.shardArgs=n.shardArgs,this.token=n.token?n.token.replace(/^Bot\s*/i,""):null,this.shards=new c}createShard(e=this.shards.size){const t=new a(this,e,this.shardArgs);return this.shards.set(e,t),this.emit("launch",t),Promise.resolve(t)}spawn(e=this.totalShards,t=5500){if("auto"===e)return h(this.token).then(e=>{return this.totalShards=e,this._spawn(e,t)});if("number"!=typeof e||isNaN(e))throw new TypeError("Amount of shards must be a number.");if(e<1)throw new RangeError("Amount of shards must be at least 1.");if(e!==Math.floor(e))throw new TypeError("Amount of shards must be an integer.");return this._spawn(e,t)}_spawn(e,t){return new Promise(n=>{if(this.shards.size>=e)throw new Error(`Already spawned ${this.shards.size} shards.`);if(this.totalShards=e,this.createShard(),this.shards.size>=this.totalShards)return void n(this.shards);if(t<=0){for(;this.shards.size{this.createShard(),this.shards.size>=this.totalShards&&(clearInterval(e),n(this.shards))},t)}})}broadcast(e){const t=[];for(const n of this.shards.values())t.push(n.send(e));return Promise.all(t)}broadcastEval(e){const t=[];for(const n of this.shards.values())t.push(n.eval(e));return Promise.all(t)}fetchClientValues(e){if(0===this.shards.size)return Promise.reject(new Error("No shards have been spawned."));if(this.shards.size!==this.totalShards)return Promise.reject(new Error("Still spawning shards."));const t=[];for(const n of this.shards.values())t.push(n.fetchClientValue(e));return Promise.all(t)}}e.exports=f}).call(t,n(8))},function(e,t,n){!function(){function e(e){this.message=e}var n=t,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.prototype=new Error,e.prototype.name="InvalidCharacterError",n.btoa||(n.btoa=function(t){for(var n,r,s=0,o=i,a="";t.charAt(0|s)||(o="=",s%1);a+=o.charAt(63&n>>8-s%1*8)){if(r=t.charCodeAt(s+=.75),r>255)throw new e("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|r}return a}),n.atob||(n.atob=function(t){if(t=t.replace(/=+$/,""),t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,s=0,o=0,a="";r=t.charAt(o++);~r&&(n=s%4?64*n+r:r,s++%4)?a+=String.fromCharCode(255&n>>(-2*s&6)):0)r=i.indexOf(r);return a})}()},function(e,t,n){function i(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}var r=n(36),s=n(2),o=t;o.define=function(e,t){return new i(e,t)},i.prototype._createNamed=function(e){var t;try{t=n(235).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return s(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r.decoders[e])),this.decoders[e]},i.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(r.encoders[e])),this.encoders[e]},i.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}},function(e,t,n){function i(e,t){var n={};this._baseState=n,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}var r=n(26).Reporter,s=n(26).EncoderBuffer,o=n(26).DecoderBuffer,a=n(29),c=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(c),f=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];e.exports=i;var u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];i.prototype.clone=function(){var e=this._baseState,t={};u.forEach(function(n){t[n]=e[n]});var n=new this.constructor(t.parent);return n._baseState=t,n},i.prototype._wrap=function(){var e=this._baseState;h.forEach(function(t){this[t]=function(){var n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}},this)},i.prototype._init=function(e){var t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),a.equal(t.children.length,1,"Root node can have only one child")},i.prototype._useArgs=function(e){var t=this._baseState,n=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==n.length&&(a(null===t.children),t.children=n,n.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(n){n==(0|n)&&(n|=0);var i=e[n];t[i]=n}),t}))},f.forEach(function(e){i.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),c.forEach(function(e){i.prototype[e]=function(){var t=this._baseState,n=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(n),this}}),i.prototype.use=function(e){a(e);var t=this._baseState;return a(null===t.use),t.use=e,this},i.prototype.optional=function(){var e=this._baseState;return e.optional=!0,this},i.prototype.def=function(e){var t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},i.prototype.explicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},i.prototype.implicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},i.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},i.prototype.key=function(e){var t=this._baseState;return a(null===t.key),t.key=e,this},i.prototype.any=function(){var e=this._baseState;return e.any=!0,this},i.prototype.choice=function(e){var t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},i.prototype.contains=function(e){var t=this._baseState;return a(null===t.use),t.contains=e,this},i.prototype._decode=function(e,t){var n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));var i=n.default,r=!0,s=null;if(null!==n.key&&(s=e.enterKey(n.key)),n.optional){var a=null;if(null!==n.explicit?a=n.explicit:null!==n.implicit?a=n.implicit:null!==n.tag&&(a=n.tag),null!==a||n.any){if(r=this._peekTag(e,a,n.any),e.isError(r))return r}else{var c=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),r=!0}catch(e){r=!1}e.restore(c)}}var h;if(n.obj&&r&&(h=e.enterObject()),r){if(null!==n.explicit){var f=this._decodeTag(e,n.explicit);if(e.isError(f))return f;e=f}var u=e.offset;if(null===n.use&&null===n.choice){if(n.any)var c=e.save();var d=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(d))return d;n.any?i=e.raw(c):e=d}if(t&&t.track&&null!==n.tag&&t.track(e.path(),u,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),i=n.any?i:null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),e.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach(function(n){n._decode(e,t)}),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){var l=new o(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(l,t)}}return n.obj&&r&&(i=e.leaveObject(h)),null===n.key||null===i&&r!==!0?null!==s&&e.exitKey(s):e.leaveKey(s,n.key,i),i},i.prototype._decodeGeneric=function(e,t,n){var i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],n):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},i.prototype._getUse=function(e,t){var n=this._baseState;return n.useDecoder=this._use(e,t),a(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},i.prototype._decodeChoice=function(e,t){var n=this._baseState,i=null,r=!1;return Object.keys(n.choice).some(function(s){var o=e.save(),a=n.choice[s];try{var c=a._decode(e,t);if(e.isError(c))return!1;i={type:s,value:c},r=!0}catch(t){return e.restore(o),!1}return!0},this),r?i:e.error("Choice not matched")},i.prototype._createEncoderBuffer=function(e){return new s(e,this.reporter)},i.prototype._encode=function(e,t,n){var i=this._baseState;if(null===i.default||i.default!==e){var r=this._encodeValue(e,t,n);if(void 0!==r&&!this._skipDefault(r,t,n))return r}},i.prototype._encodeValue=function(e,t,n){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new r);var s=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}var o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),a=!0;else if(i.children)o=i.children.map(function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");var i=t.enterKey(n._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var r=n._encode(e[n._baseState.key],t,e);return t.leaveKey(i),r},this).filter(function(e){return e}),o=this._createEncoderBuffer(o);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(n){var i=this._baseState;return this._getUse(i.args[0],e)._encode(n,t)},c))}else null!==i.use?s=this._getUse(i.use,n)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);var s;if(!i.any&&null===i.choice){var h=null!==i.implicit?i.implicit:i.tag,f=null===i.implicit?"universal":"context";null===h?null===i.use&&t.error("Tag could be ommited only for .use()"):null===i.use&&(s=this._encodeComposite(h,a,f,o))}return null!==i.explicit&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s},i.prototype._encodeChoice=function(e,t){var n=this._baseState,i=n.choice[e.type];return i||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)},i.prototype._encodePrimitive=function(e,t){var n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},i.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},i.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},function(e,t,n){function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function r(e,t){this.path=e,this.rethrow(t)}var s=n(2);t.Reporter=i,i.prototype.isError=function(e){return e instanceof r},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,n){var i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=n)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,n=t.obj;return t.obj=e,n},i.prototype.error=function(e){var t,n=this._reporterState,i=e instanceof r;if(t=i?e:new r(n.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return i||n.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},s(r,Error),r.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,r),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,n){var i=n(85);t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=i._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=i._reverse(t.tag)},function(e,t,n){var i=t;i.der=n(86),i.pem=n(146)},function(e,t,n){function i(e){o.call(this,e),this.enc="pem"}var r=n(2),s=n(0).Buffer,o=n(86);r(i,o),e.exports=i,i.prototype.decode=function(e,t){for(var n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),r=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,c=-1,h=0;h{const n=this.client.resolver.resolveBase64(t);return this.client.rest.methods.editWebhook(this,e,n)}):this.client.rest.methods.editWebhook(this,e).then(e=>{return this.setup(e),this})}delete(){return this.client.rest.methods.deleteWebhook(this)}}e.exports=s},function(e,t,n){"use strict";(function(e){var i=n(5),r=i.Buffer,s=i.SlowBuffer,o=i.kMaxLength||2147483647;t.alloc=function(e,t,n){if("function"==typeof r.alloc)return r.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>o)throw new RangeError("size is too large");var i=n,s=t;void 0===s&&(i=void 0,s=0);var a=new r(e);if("string"==typeof s)for(var h=new r(s,i),u=h.length,c=-1;++co)throw new RangeError("size is too large");return new r(e)},t.from=function(t,n,i){if("function"==typeof r.from&&(!e.Uint8Array||Uint8Array.from!==r.from))return r.from(t,n,i);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new r(t,n);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var s=n;if(1===arguments.length)return new r(t);"undefined"==typeof s&&(s=0);var o=i;if("undefined"==typeof o&&(o=t.byteLength-s),s>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(o>t.byteLength-s)throw new RangeError("'length' is out of bounds");return new r(t.slice(s,s+o))}if(r.isBuffer(t)){var a=new r(t.length);return t.copy(a,0,0,t.length),a}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new r(t);if("Buffer"===t.type&&Array.isArray(t.data))return new r(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},t.allocUnsafeSlow=function(e){if("function"==typeof r.allocUnsafeSlow)return r.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=o)throw new RangeError("size is too large");return new s(e)}}).call(t,n(18))},function(e,t,n){"use strict";(function(t){function n(e,n,i,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,o,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,i)});case 4:return t.nextTick(function(){e.call(null,n,i,r)});default:for(s=new Array(a-1),o=0;o-1?i:k;a.WritableState=o;var T=n(16);T.inherits=n(12);var R,M={deprecate:n(100)};!function(){try{R=n(25)}catch(e){}finally{R||(R=n(4).EventEmitter)}}();var D=n(5).Buffer,x=n(31);T.inherits(a,R);var I;o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:M.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var I;a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,n){var i=this._writableState,s=!1;return"function"==typeof t&&(n=t,t=null),D.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=r),i.ended?h(this,n):u(this,i,e,n)&&(i.pendingcb++,s=l(this,i,e,t,n)),s},a.prototype.cork=function(){var e=this._writableState;e.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,n){n(new Error("not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||E(this,i,n)}}).call(t,n(6),n(36).setImmediate)},function(e,t,n){function i(){}function r(e){if(!_(e))return e;var t=[];for(var n in e)s(t,n,e[n]);return t.join("&")}function s(e,t,n){if(null!=n)if(Array.isArray(n))n.forEach(function(n){s(e,t,n)});else if(_(n))for(var i in n)s(e,t+"["+i+"]",n[i]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(n));else null===n&&e.push(encodeURIComponent(t))}function o(e){for(var t,n,i={},r=e.split("&"),s=0,o=r.length;s=300)&&(i=new Error(t.statusText||"Unsuccessful HTTP response"),i.original=e,i.response=t,i.status=t.status)}catch(e){i=e}i?n.callback(i,t):n.callback(null,t)})}function d(e,t){var n=w("DELETE",e);return t&&n.end(t),n}var p;"undefined"!=typeof window?p=window:"undefined"!=typeof self?p=self:(console.warn("Using browser-only version of superagent in non-browser environment"),p=this);var g=n(84),m=n(98),_=n(66),w=e.exports=n(99).bind(null,f);w.getXHR=function(){if(!(!p.XMLHttpRequest||p.location&&"file:"==p.location.protocol&&p.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only verison of superagent could not find XHR")};var v="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};w.serializeObject=r,w.parseString=o,w.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},w.serialize={"application/x-www-form-urlencoded":r,"application/json":JSON.stringify},w.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},l.prototype.get=function(e){return this.header[e.toLowerCase()]},l.prototype._setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=u(t);var n=c(t);for(var i in n)this[i]=n[i]},l.prototype._parseBody=function(e){var t=w.parse[this.type];return!t&&h(this.type)&&(t=w.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null},l.prototype._setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},l.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,i="cannot "+t+" "+n+" ("+this.status+")",r=new Error(i);return r.status=this.status,r.method=t,r.url=n,r},w.Response=l,g(f.prototype),m(f.prototype),f.prototype.type=function(e){return this.set("Content-Type",w.types[e]||e),this},f.prototype.responseType=function(e){return this._responseType=e,this},f.prototype.accept=function(e){return this.set("Accept",w.types[e]||e),this},f.prototype.auth=function(e,t,n){switch(n||(n={type:"basic"}),n.type){case"basic":var i=btoa(e+":"+t);this.set("Authorization","Basic "+i);break;case"auto":this.username=e,this.password=t}return this},f.prototype.query=function(e){return"string"!=typeof e&&(e=r(e)),e&&this._query.push(e),this},f.prototype.attach=function(e,t,n){if(this._data)throw Error("superagent can't mix .send() and .attach()");return this._getFormData().append(e,t,n||t.name),this},f.prototype._getFormData=function(){return this._formData||(this._formData=new p.FormData),this._formData},f.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),e&&this.emit("error",e),n(e,t)},f.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},f.prototype.buffer=f.prototype.ca=f.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},f.prototype.pipe=f.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},f.prototype._timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},f.prototype._appendQueryString=function(){var e=this._query.join("&");e&&(this.url+=~this.url.indexOf("?")?"&"+e:"?"+e)},f.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},f.prototype.end=function(e){var t=this,n=this.xhr=w.getXHR(),r=this._timeout,s=this._formData||this._data;this._callback=e||i,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(t){e=0}if(0==e){if(t.timedout)return t._timeoutError();if(t._aborted)return;return t.crossDomainError()}t.emit("end")}};var o=function(e,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=e,t.emit("progress",n)};if(this.hasListeners("progress"))try{n.onprogress=o.bind(null,"download"),n.upload&&(n.upload.onprogress=o.bind(null,"upload"))}catch(e){}if(r&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},r)),this._appendQueryString(),this.username&&this.password?n.open(this.method,this.url,!0,this.username,this.password):n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!this._isHost(s)){var a=this._header["content-type"],u=this._serializer||w.serialize[a?a.split(";")[0]:""];!u&&h(a)&&(u=w.serialize["application/json"]),u&&(s=u(s))}for(var c in this.header)null!=this.header[c]&&n.setRequestHeader(c,this.header[c]);return this._responseType&&(n.responseType=this._responseType),this.emit("request",this),n.send("undefined"!=typeof s?s:null),this},w.Request=f,w.get=function(e,t,n){var i=w("GET",e);return"function"==typeof t&&(n=t,t=null),t&&i.query(t),n&&i.end(n),i},w.head=function(e,t,n){var i=w("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},w.options=function(e,t,n){var i=w("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},w.del=d,w.delete=d,w.patch=function(e,t,n){var i=w("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},w.post=function(e,t,n){var i=w("POST",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},w.put=function(e,t,n){var i=w("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i}},function(e,t,n){(function(e,i){function r(e,t){this._id=e,this._clearFn=t}var s=n(6).nextTick,o=Function.prototype.apply,a=Array.prototype.slice,h={},u=0;t.setTimeout=function(){return new r(o.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(o.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=u++,i=!(arguments.length<2)&&a.call(arguments,1);return h[n]=!0,s(function(){h[n]&&(i?e.apply(null,i):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof i?i:function(e){delete h[e]}}).call(t,n(36).setImmediate,n(36).clearImmediate)},function(e,t){e.exports=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(const n in e){const i=e[n],r=t.indexOf(i);r&&t.splice(r,1)}return 0===t.length}},function(e,t){e.exports={name:"discord.js",version:"10.0.1",description:"A powerful library for interacting with the Discord API",main:"./src/index",scripts:{test:"eslint src && node docs/generator test",docs:"node docs/generator","test-docs":"node docs/generator test",lint:"eslint src","web-dist":"node ./node_modules/parallel-webpack/bin/run.js"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",dependencies:{superagent:"^3.0.0",tweetnacl:"^0.14.3",ws:"^1.1.1"},peerDependencies:{"node-opus":"^0.2.0",opusscript:"^0.0.1"},devDependencies:{bufferutil:"^1.2.1",eslint:"^3.10.0","jsdoc-to-markdown":"^2.0.0","json-loader":"^0.5.4","parallel-webpack":"^1.5.0","uglify-js":"github:mishoo/UglifyJS2#harmony","utf-8-validate":"^1.2.1",webpack:"2.1.0-beta.27",zlibjs:"github:imaya/zlib.js"},engines:{node:">=6.0.0"}}},function(e,t,n){(function(t){const i=n(13),r=n(17),s=n(74),o=n(75);class a{constructor(e,n,s=[]){this.manager=e,this.id=n,this.env=Object.assign({},t.env,{SHARD_ID:this.id,SHARD_COUNT:this.manager.totalShards,CLIENT_TOKEN:this.manager.token}),this.process=i.fork(r.resolve(this.manager.file),s,{env:this.env}),this.process.on("message",this._handleMessage.bind(this)),this.process.once("exit",()=>{this.manager.respawn&&this.manager.createShard(this.id)}),this._evals=new Map,this._fetches=new Map}send(e){return new Promise((t,n)=>{const i=this.process.send(e,e=>{e?n(e):t(this)});if(!i)throw new Error("Failed to send message to shard's process.")})}fetchClientValue(e){if(this._fetches.has(e))return this._fetches.get(e);const t=new Promise((t,n)=>{const i=n=>{n&&n._fetchProp===e&&(this.process.removeListener("message",i),this._fetches.delete(e),t(n._result))};this.process.on("message",i),this.send({_fetchProp:e}).catch(t=>{this.process.removeListener("message",i),this._fetches.delete(e),n(t)})});return this._fetches.set(e,t),t}eval(e){if(this._evals.has(e))return this._evals.get(e);const t=new Promise((t,n)=>{const i=r=>{r&&r._eval===e&&(this.process.removeListener("message",i),this._evals.delete(e),r._error?n(s(r._error)):t(r._result))};this.process.on("message",i),this.send({_eval:e}).catch(t=>{this.process.removeListener("message",i),this._evals.delete(e),n(t)})});return this._evals.set(e,t),t}_handleMessage(e){if(e){if(e._sFetchProp)return void this.manager.fetchClientValues(e._sFetchProp).then(t=>this.send({_sFetchProp:e._sFetchProp,_result:t}),t=>this.send({_sFetchProp:e._sFetchProp,_error:o(t)}));if(e._sEval)return void this.manager.broadcastEval(e._sEval).then(t=>this.send({_sEval:e._sEval,_result:t}),t=>this.send({_sEval:e._sEval,_error:o(t)}))}this.manager.emit("message",this,e)}}e.exports=a}).call(t,n(6))},function(e,t,n){(function(t){const i=n(74),r=n(75);class s{constructor(e){this.client=e,t.on("message",this._handleMessage.bind(this))}get id(){return this.client.options.shardId}get count(){return this.client.options.shardCount}send(e){return new Promise((n,i)=>{const r=t.send(e,e=>{e?i(e):n()});if(!r)throw new Error("Failed to send message to master process.")})}fetchClientValues(e){return new Promise((n,r)=>{const s=o=>{o&&o._sFetchProp===e&&(t.removeListener("message",s),o._error?r(i(o._error)):n(o._result))};t.on("message",s),this.send({_sFetchProp:e}).catch(e=>{t.removeListener("message",s),r(e)})})}broadcastEval(e){return new Promise((n,r)=>{const s=o=>{o&&o._sEval===e&&(t.removeListener("message",s),o._error?r(i(o._error)):n(o._result))};t.on("message",s),this.send({_sEval:e}).catch(e=>{t.removeListener("message",s),r(e)})})}_handleMessage(e){if(e)if(e._fetchProp){const t=e._fetchProp.split(".");let n=this.client;for(const i of t)n=n[i];this._respond("fetchProp",{_fetchProp:e._fetchProp,_result:n})}else if(e._eval)try{this._respond("eval",{_eval:e._eval,_result:this.client._eval(e._eval)})}catch(t){this._respond("eval",{_eval:e._eval,_error:r(t)})}}_respond(e,t){this.send(t).catch(t=>this.client.emit("error",`Error when sending ${e} response to master process: ${t}`))}static singleton(e){return this._singleton?e.emit("error","Multiple clients created in child process; only the first will handle sharding helpers."):this._singleton=new this(e),this._singleton}}e.exports=s}).call(t,n(6))},function(e,t,n){const i=n(8),r=n(50);class s extends r{setup(e){super.setup(e),this.flags=e.flags,this.owner=new i(this.client,e.owner)}}e.exports=s},function(e,t,n){const i=n(8),r=n(3);class s extends i{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new r,this.blocked=new r,this.notes=new r}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e){return this.client.rest.methods.updateCurrentUser({username:e})}setEmail(e){return this.client.rest.methods.updateCurrentUser({email:e})}setPassword(e){return this.client.rest.methods.updateCurrentUser({password:e})}setAvatar(e){return e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return this.setPresence({game:{name:e,url:t}})}setAFK(e){return this.setPresence({afk:e})}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,n=null){return n?n.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:n,region:t}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:e,icon:n,region:t})):this.client.rest.methods.createGuild({name:e,icon:n,region:t})}setPresence(e){return new Promise(t=>{let n=this.localPresence.status||this.presence.status,i=this.localPresence.game,r=this.localPresence.afk||this.presence.afk;if(!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url}),e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");n=e.status}e.game&&(i=e.game,i.url&&(i.type=1)),"undefined"!=typeof e.afk&&(r=e.afk),r=Boolean(r),this.localPresence={status:n,game:i,afk:r},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),t(this)})}}e.exports=s},function(e,t,n){const i=n(14),r=n(19),s=n(3);class o extends i{constructor(e,t){super(e,t),this.type="dm",this.messages=new s,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}r.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(14),r=n(19),s=n(3),o=n(37);class a extends i{constructor(e,t){super(e,t),this.type="group",this.messages=new s,this._typing=new Map}setup(e){if(super.setup(e),this.name=e.name,this.icon=e.icon,this.ownerID=e.owner_id,this.recipients||(this.recipients=new s),e.recipients)for(const t of e.recipients){const e=this.client.dataManager.newUser(t);this.recipients.set(e.id,e)}this.lastMessageID=e.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(e){const t=e&&this.id===e.id&&this.name===e.name&&this.icon===e.icon&&this.ownerID===e.ownerID;if(t){const t=this.recipients.keyArray(),n=e.recipients.keyArray();return o(t,n)}return t}toString(){return this.name}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}r.applyToClass(a,!0),e.exports=a},function(e,t,n){const i=n(51),r=n(52),s=n(0);class o{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new i(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new r(this.client,e.channel),this.createdTimestamp=new Date(e.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 s.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=o},function(e,t){class n{constructor(e,t){this.client=e.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=n},function(e,t,n){const i=n(4).EventEmitter,r=n(3);class s extends i{constructor(e,t,n={}){super(),this.channel=e,this.filter=t,this.options=n,this.ended=!1,this.collected=new r,this.listener=(e=>this.verify(e)),this.channel.client.on("message",this.listener),n.time&&this.channel.client.setTimeout(()=>this.stop("time"),n.time)}verify(e){return(!this.channel||this.channel.id===e.channel.id)&&(!!this.filter(e,this)&&(this.collected.set(e.id,e),this.emit("message",e,this),this.collected.size>=this.options.maxMatches?this.stop("matchesLimit"):this.options.max&&this.collected.size===this.options.max&&this.stop("limit"),!0))}get next(){return new Promise((e,t)=>{if(this.ended)return void t(this.collected);const n=()=>{this.removeListener("message",i),this.removeListener("end",r)},i=(...t)=>{n(),e(...t)},r=(...e)=>{n(),t(...e)};this.once("message",i),this.once("end",r)})}stop(e="user"){this.ended||(this.ended=!0,this.channel.client.removeListener("message",this.listener),this.emit("end",this.collected,e))}}e.exports=s},function(e,t){class n{constructor(e,t){this.client=e.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=e,this.setup(t)}setup(e){if(this.title=e.title,this.type=e.type,this.description=e.description,this.url=e.url,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new o(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new i(this,e.thumbnail):null,this.author=e.author?new s(this,e.author):null,this.provider=e.provider?new r(this,e.provider):null,this.footer=e.footer?new a(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}}class i{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconUrl=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}n.Thumbnail=i,n.Provider=r,n.Author=s,n.Field=o,n.Footer=a,e.exports=n},function(e,t,n){const i=n(3),r=n(15),s=n(29);class o{constructor(e,t,n,r){this.message=e,this.me=r,this.count=n||0,this.users=new i,this._emoji=new s(this,t.name,t.id)}get emoji(){if(this._emoji instanceof r)return this._emoji;if(this._emoji.id){
+const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message;return e=this.message.client.resolver.resolveUserID(e),e?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,e):Promise.reject("Couldn't resolve the user ID to remove from the reaction.")}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new i;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}return this.count=this.users.size,e})}}e.exports=o},function(e,t){class n{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins}get createdTimestamp(){return this.id/4194304+14200704e5}get createdAt(){return new Date(this.createdTimestamp)}toString(){return this.name}}e.exports=n},function(e,t){class n{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=n},function(e,t,n){const i=n(0);class r{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=i.ChannelTypes.text===e.type?"text":"voice"}}e.exports=r},function(e,t){class n{constructor(e,t){this.channel=e,t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.denyData=e.deny,this.allowData=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=n},function(e,t,n){const i=n(20),r=n(19),s=n(3);class o extends i{constructor(e,t){super(e,t),this.type="text",this.messages=new s,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new s;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(n=>{t.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>n(this.client.rest.methods.createWebhook(this,e,t)))})}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}r.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(20),r=n(3);class s extends i{constructor(e,t){super(e,t),this.members=new r,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get joinable(){return this.permissionsFor(this.client.user).hasPermission("CONNECT")}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.voice.joinChannel(this)}leave(){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}e.exports=s},function(e,t,n){const i=n(35),r=n(0).Endpoints.botGateway;e.exports=function(e){return new Promise((t,n)=>{if(!e)throw new Error("A token must be provided.");i.get(r).set("Authorization",`Bot ${e.replace(/^Bot\s*/i,"")}`).end((e,i)=>{e&&n(e),t(i.body.shards)})})}},function(e,t){e.exports=function(e,{maxLength=1950,char="\n",prepend="",append=""}={}){if(e.length<=maxLength)return e;const t=e.split(char);if(1===t.length)throw new Error("Message exceeds the max length and contains no split characters.");const n=[""];let i=0;for(let r=0;rmaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+t[r];return n}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){"use strict";function n(e,t,n,i){for(var r=65535&e|0,s=e>>>16&65535|0,o=0;0!==n;){o=n>2e3?2e3:n,n-=o;do r=r+t[i++]|0,s=s+r|0;while(--o);r%=65521,s%=65521}return r|s<<16|0}e.exports=n},function(e,t){"use strict";function n(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}function i(e,t,n,i){var s=r,o=i+n;e^=-1;for(var a=i;a>>8^s[255&(e^t[a])];return e^-1}var r=n();e.exports=i},function(e,t){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,n){"use strict";function i(e){return this instanceof i?void r.call(this,e):new i(e)}e.exports=i;var r=n(33),s=n(16);s.inherits=n(12),s.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";(function(t){function i(e,t,n){return"function"==typeof e.prependListener?e.prependListener(t,n):void(e._events&&e._events[t]?x(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n))}function r(e,t){j=j||n(10),e=e||{},this.objectMode=!!e.objectMode,t instanceof j&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new G,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=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(B||(B=n(65).StringDecoder),this.decoder=new B(e.encoding),this.encoding=e.encoding)}function s(e){return j=j||n(10),this instanceof s?(this._readableState=new r(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),void I.call(this)):new s(e)}function o(e,t,n,i,r){var s=c(t,n);if(s)e.emit("error",s);else if(null===n)t.reading=!1,l(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!r){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&r){var h=new Error("stream.unshift() after end event");e.emit("error",h)}else{var u;!t.decoder||r||i||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),r||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&f(e))),p(e,t)}else r||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=z?e=z:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function u(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=h(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function c(e,t){var n=null;return L.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function l(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,f(e)}}function f(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(N("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?D(d,e):d(e))}function d(e){N("emit readable"),e.emit("readable"),y(e)}function p(e,t){t.readingMore||(t.readingMore=!0,D(g,e,t))}function g(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=E(e,t.buffer,t.decoder),n}function E(e,t,n){var i;return es.length?s.length:e;if(r+=o===s.length?s:s.slice(0,e),e-=o,0===e){o===s.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(o));break}++i}return t.length-=i,r}function k(e,t){var n=C.allocUnsafe(e),i=t.head,r=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var s=i.data,o=e>s.length?s.length:e;if(s.copy(n,n.length-e,0,o),e-=o,0===e){o===s.length?(++r,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=s.slice(o));break}++r}return t.length-=r,n}function S(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,D(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return N("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?S(this):f(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&S(this),null;var i=t.needReadable;N("need readable",i),(0===t.length||t.length-e0?b(e,t):null,null===r?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&S(this)),null!==r&&this.emit("data",r),r},s.prototype._read=function(e){this.emit("error",new Error("not implemented"))},s.prototype.pipe=function(e,n){function r(e){N("onunpipe"),e===f&&o()}function s(){N("onend"),e.end()}function o(){N("cleanup"),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("drain",_),e.removeListener("error",h),e.removeListener("unpipe",r),f.removeListener("end",s),f.removeListener("end",o),f.removeListener("data",a),w=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||_()}function a(t){N("ondata"),v=!1;var n=e.write(t);!1!==n||v||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&M(d.pipes,e)!==-1)&&!w&&(N("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,v=!0),f.pause())}function h(t){N("onerror",t),l(),e.removeListener("error",h),0===U(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",c),l()}function c(){N("onfinish"),e.removeListener("close",u),l()}function l(){N("unpipe"),f.unpipe(e)}var f=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,N("pipe count=%d opts=%j",d.pipesCount,n);var p=(!n||n.end!==!1)&&e!==t.stdout&&e!==t.stderr,g=p?s:o;d.endEmitted?D(g):f.once("end",g),e.on("unpipe",r);var _=m(f);e.on("drain",_);var w=!1,v=!1;return f.on("data",a),i(e,"error",h),e.once("close",u),e.once("finish",c),e.emit("pipe",f),d.flowing||(N("pipe resume"),f.resume()),e},s.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var r=0;r=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived),t+=e.toString(this.encoding,0,r);var r=t.length-1,i=t.charCodeAt(r);if(i>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,r)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,r=this.encoding;t+=i.slice(0,n).toString(r)}return t}},function(e,t){function n(e){return null!==e&&"object"==typeof e}e.exports=n},function(e,t,n){!function(e){"use strict";function t(e,t,n,i){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function i(e,t,n,i,r){var s,o=0;for(s=0;s>>8)-1}function r(e,t,n,r){return i(e,t,n,r,16)}function s(e,t,n,r){return i(e,t,n,r,32)}function o(e,t,n,i){for(var r,s=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,c=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,d=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,_=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,y=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,b=s,E=o,A=a,k=h,S=u,T=c,R=l,M=f,D=d,x=p,I=g,U=m,L=_,C=w,P=v,O=y,N=0;N<20;N+=2)r=b+L|0,S^=r<<7|r>>>25,r=S+b|0,D^=r<<9|r>>>23,r=D+S|0,L^=r<<13|r>>>19,r=L+D|0,b^=r<<18|r>>>14,r=T+E|0,x^=r<<7|r>>>25,r=x+T|0,C^=r<<9|r>>>23,r=C+x|0,E^=r<<13|r>>>19,r=E+C|0,T^=r<<18|r>>>14,r=I+R|0,P^=r<<7|r>>>25,r=P+I|0,A^=r<<9|r>>>23,r=A+P|0,R^=r<<13|r>>>19,r=R+A|0,I^=r<<18|r>>>14,r=O+U|0,k^=r<<7|r>>>25,r=k+O|0,M^=r<<9|r>>>23,r=M+k|0,U^=r<<13|r>>>19,r=U+M|0,O^=r<<18|r>>>14,r=b+k|0,E^=r<<7|r>>>25,r=E+b|0,A^=r<<9|r>>>23,r=A+E|0,k^=r<<13|r>>>19,r=k+A|0,b^=r<<18|r>>>14,r=T+S|0,R^=r<<7|r>>>25,r=R+T|0,M^=r<<9|r>>>23,r=M+R|0,S^=r<<13|r>>>19,r=S+M|0,T^=r<<18|r>>>14,r=I+x|0,U^=r<<7|r>>>25,r=U+I|0,D^=r<<9|r>>>23,r=D+U|0,x^=r<<13|r>>>19,r=x+D|0,I^=r<<18|r>>>14,r=O+P|0,L^=r<<7|r>>>25,r=L+O|0,C^=r<<9|r>>>23,r=C+L|0,P^=r<<13|r>>>19,r=P+C|0,O^=r<<18|r>>>14;b=b+s|0,E=E+o|0,A=A+a|0,k=k+h|0,S=S+u|0,T=T+c|0,R=R+l|0,M=M+f|0,D=D+d|0,x=x+p|0,I=I+g|0,U=U+m|0,L=L+_|0,C=C+w|0,P=P+v|0,O=O+y|0,e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=k>>>0&255,e[13]=k>>>8&255,e[14]=k>>>16&255,e[15]=k>>>24&255,e[16]=S>>>0&255,e[17]=S>>>8&255,e[18]=S>>>16&255,e[19]=S>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=R>>>0&255,e[25]=R>>>8&255,e[26]=R>>>16&255,e[27]=R>>>24&255,e[28]=M>>>0&255,e[29]=M>>>8&255,e[30]=M>>>16&255,e[31]=M>>>24&255,e[32]=D>>>0&255,e[33]=D>>>8&255,e[34]=D>>>16&255,e[35]=D>>>24&255,e[36]=x>>>0&255,e[37]=x>>>8&255,e[38]=x>>>16&255,e[39]=x>>>24&255,e[40]=I>>>0&255,e[41]=I>>>8&255,e[42]=I>>>16&255,e[43]=I>>>24&255,e[44]=U>>>0&255,e[45]=U>>>8&255,e[46]=U>>>16&255,e[47]=U>>>24&255,e[48]=L>>>0&255,e[49]=L>>>8&255,e[50]=L>>>16&255,e[51]=L>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=O>>>0&255,e[61]=O>>>8&255,e[62]=O>>>16&255,e[63]=O>>>24&255}function a(e,t,n,i){for(var r,s=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,c=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,f=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,d=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,_=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,y=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,b=s,E=o,A=a,k=h,S=u,T=c,R=l,M=f,D=d,x=p,I=g,U=m,L=_,C=w,P=v,O=y,N=0;N<20;N+=2)r=b+L|0,S^=r<<7|r>>>25,r=S+b|0,D^=r<<9|r>>>23,r=D+S|0,L^=r<<13|r>>>19,r=L+D|0,b^=r<<18|r>>>14,r=T+E|0,x^=r<<7|r>>>25,r=x+T|0,C^=r<<9|r>>>23,r=C+x|0,E^=r<<13|r>>>19,r=E+C|0,T^=r<<18|r>>>14,r=I+R|0,P^=r<<7|r>>>25,r=P+I|0,A^=r<<9|r>>>23,r=A+P|0,R^=r<<13|r>>>19,r=R+A|0,I^=r<<18|r>>>14,r=O+U|0,k^=r<<7|r>>>25,r=k+O|0,M^=r<<9|r>>>23,r=M+k|0,U^=r<<13|r>>>19,r=U+M|0,O^=r<<18|r>>>14,r=b+k|0,E^=r<<7|r>>>25,r=E+b|0,A^=r<<9|r>>>23,r=A+E|0,k^=r<<13|r>>>19,r=k+A|0,b^=r<<18|r>>>14,r=T+S|0,R^=r<<7|r>>>25,r=R+T|0,M^=r<<9|r>>>23,r=M+R|0,S^=r<<13|r>>>19,r=S+M|0,T^=r<<18|r>>>14,r=I+x|0,U^=r<<7|r>>>25,r=U+I|0,D^=r<<9|r>>>23,r=D+U|0,x^=r<<13|r>>>19,r=x+D|0,I^=r<<18|r>>>14,r=O+P|0,L^=r<<7|r>>>25,r=L+O|0,C^=r<<9|r>>>23,r=C+L|0,P^=r<<13|r>>>19,r=P+C|0,O^=r<<18|r>>>14;e[0]=b>>>0&255,e[1]=b>>>8&255,e[2]=b>>>16&255,e[3]=b>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=I>>>0&255,e[9]=I>>>8&255,e[10]=I>>>16&255,e[11]=I>>>24&255,e[12]=O>>>0&255,e[13]=O>>>8&255,e[14]=O>>>16&255,e[15]=O>>>24&255,e[16]=R>>>0&255,e[17]=R>>>8&255,e[18]=R>>>16&255,e[19]=R>>>24&255,e[20]=M>>>0&255,e[21]=M>>>8&255,e[22]=M>>>16&255,e[23]=M>>>24&255,e[24]=D>>>0&255,e[25]=D>>>8&255,e[26]=D>>>16&255,e[27]=D>>>24&255,e[28]=x>>>0&255,e[29]=x>>>8&255,e[30]=x>>>16&255,e[31]=x>>>24&255}function h(e,t,n,i){o(e,t,n,i)}function u(e,t,n,i){a(e,t,n,i)}function c(e,t,n,i,r,s,o){var a,u,c=new Uint8Array(16),l=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=s[u];for(;r>=64;){for(h(l,c,o,fe),u=0;u<64;u++)e[t+u]=n[i+u]^l[u];for(a=1,u=8;u<16;u++)a=a+(255&c[u])|0,c[u]=255&a,a>>>=8;r-=64,t+=64,i+=64}if(r>0)for(h(l,c,o,fe),u=0;u=64;){for(h(u,a,r,fe),o=0;o<64;o++)e[t+o]=u[o];for(s=1,o=8;o<16;o++)s=s+(255&a[o])|0,a[o]=255&s,s>>>=8;n-=64,t+=64}if(n>0)for(h(u,a,r,fe),o=0;o>16&1),s[n-1]&=65535;s[15]=o[15]-32767-(s[14]>>16&1),r=s[15]>>16&1,s[14]&=65535,y(o,s,1-r)}for(n=0;n<16;n++)e[2*n]=255&o[n],e[2*n+1]=o[n]>>8}function E(e,t){var n=new Uint8Array(32),i=new Uint8Array(32);return b(n,e),b(i,t),s(n,0,i,0)}function A(e){var t=new Uint8Array(32);return b(t,e),1&t[0]}function k(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function S(e,t,n){for(var i=0;i<16;i++)e[i]=t[i]+n[i]}function T(e,t,n){for(var i=0;i<16;i++)e[i]=t[i]-n[i]}function R(e,t,n){var i,r,s=0,o=0,a=0,h=0,u=0,c=0,l=0,f=0,d=0,p=0,g=0,m=0,_=0,w=0,v=0,y=0,b=0,E=0,A=0,k=0,S=0,T=0,R=0,M=0,D=0,x=0,I=0,U=0,L=0,C=0,P=0,O=n[0],N=n[1],B=n[2],G=n[3],j=n[4],z=n[5],q=n[6],F=n[7],W=n[8],H=n[9],Z=n[10],Y=n[11],V=n[12],K=n[13],X=n[14],J=n[15];i=t[0],s+=i*O,o+=i*N,a+=i*B,h+=i*G,u+=i*j,c+=i*z,l+=i*q,f+=i*F,d+=i*W,p+=i*H,g+=i*Z,m+=i*Y,_+=i*V,w+=i*K,v+=i*X,y+=i*J,i=t[1],o+=i*O,a+=i*N,h+=i*B,u+=i*G,c+=i*j,l+=i*z,f+=i*q,d+=i*F,p+=i*W,g+=i*H,m+=i*Z,_+=i*Y,w+=i*V,v+=i*K,y+=i*X,b+=i*J,i=t[2],a+=i*O,h+=i*N,u+=i*B,c+=i*G,l+=i*j,f+=i*z,d+=i*q,p+=i*F,g+=i*W,m+=i*H,_+=i*Z,w+=i*Y,v+=i*V,y+=i*K,b+=i*X,E+=i*J,i=t[3],h+=i*O,u+=i*N,c+=i*B,l+=i*G,f+=i*j,d+=i*z,p+=i*q,g+=i*F,m+=i*W,_+=i*H,w+=i*Z,v+=i*Y,y+=i*V,b+=i*K,E+=i*X,A+=i*J,i=t[4],u+=i*O,c+=i*N,l+=i*B,f+=i*G,d+=i*j,p+=i*z,g+=i*q,m+=i*F,_+=i*W,w+=i*H,v+=i*Z,y+=i*Y,b+=i*V,E+=i*K,A+=i*X,k+=i*J,i=t[5],c+=i*O,l+=i*N,f+=i*B,d+=i*G,p+=i*j,g+=i*z,m+=i*q,_+=i*F,w+=i*W,v+=i*H,y+=i*Z,b+=i*Y,E+=i*V,A+=i*K,k+=i*X,S+=i*J,i=t[6],l+=i*O,f+=i*N,d+=i*B,p+=i*G,g+=i*j,m+=i*z,_+=i*q,w+=i*F,v+=i*W,y+=i*H,b+=i*Z,E+=i*Y,A+=i*V,k+=i*K,S+=i*X,T+=i*J,i=t[7],f+=i*O,d+=i*N,p+=i*B,g+=i*G,m+=i*j,_+=i*z,w+=i*q,v+=i*F,y+=i*W,b+=i*H,E+=i*Z,A+=i*Y,k+=i*V,S+=i*K,T+=i*X,R+=i*J,i=t[8],d+=i*O,p+=i*N,g+=i*B,m+=i*G,_+=i*j,w+=i*z,v+=i*q,y+=i*F,b+=i*W,E+=i*H,A+=i*Z,k+=i*Y,S+=i*V,T+=i*K,R+=i*X,M+=i*J,i=t[9],p+=i*O,g+=i*N,m+=i*B,_+=i*G,w+=i*j,v+=i*z,y+=i*q,b+=i*F,E+=i*W,A+=i*H,k+=i*Z,S+=i*Y,T+=i*V,R+=i*K,M+=i*X,D+=i*J,i=t[10],g+=i*O,m+=i*N,_+=i*B,w+=i*G,v+=i*j,y+=i*z,b+=i*q,E+=i*F,A+=i*W,k+=i*H,S+=i*Z,T+=i*Y,R+=i*V,M+=i*K,D+=i*X,x+=i*J,i=t[11],m+=i*O,_+=i*N,w+=i*B,v+=i*G,y+=i*j,b+=i*z,E+=i*q,A+=i*F,k+=i*W,S+=i*H,T+=i*Z,R+=i*Y;M+=i*V;D+=i*K,x+=i*X,I+=i*J,i=t[12],_+=i*O,w+=i*N,v+=i*B,y+=i*G,b+=i*j,E+=i*z,A+=i*q,k+=i*F,S+=i*W,T+=i*H,R+=i*Z,M+=i*Y,D+=i*V,x+=i*K,I+=i*X,U+=i*J,i=t[13],w+=i*O,v+=i*N,y+=i*B,b+=i*G,E+=i*j,A+=i*z,k+=i*q,S+=i*F,T+=i*W,R+=i*H,M+=i*Z,D+=i*Y,x+=i*V,I+=i*K,U+=i*X,L+=i*J,i=t[14],v+=i*O,y+=i*N,b+=i*B,E+=i*G,A+=i*j,k+=i*z,S+=i*q,T+=i*F,R+=i*W,M+=i*H,D+=i*Z,x+=i*Y,I+=i*V,U+=i*K,L+=i*X,C+=i*J,i=t[15],y+=i*O,b+=i*N,E+=i*B,A+=i*G,k+=i*j,S+=i*z,T+=i*q,R+=i*F,M+=i*W,D+=i*H,x+=i*Z,I+=i*Y,U+=i*V,L+=i*K,C+=i*X,P+=i*J,s+=38*b,o+=38*E,a+=38*A,h+=38*k,u+=38*S,c+=38*T,l+=38*R,f+=38*M,d+=38*D,p+=38*x,g+=38*I,m+=38*U,_+=38*L,w+=38*C,v+=38*P,r=1,i=s+r+65535,r=Math.floor(i/65536),s=i-65536*r,i=o+r+65535,r=Math.floor(i/65536),o=i-65536*r,i=a+r+65535,r=Math.floor(i/65536),a=i-65536*r,i=h+r+65535,r=Math.floor(i/65536),h=i-65536*r,i=u+r+65535,r=Math.floor(i/65536),u=i-65536*r,i=c+r+65535,r=Math.floor(i/65536),c=i-65536*r,i=l+r+65535,r=Math.floor(i/65536),l=i-65536*r,i=f+r+65535,r=Math.floor(i/65536),f=i-65536*r,i=d+r+65535,r=Math.floor(i/65536),d=i-65536*r,i=p+r+65535,r=Math.floor(i/65536),p=i-65536*r,i=g+r+65535,r=Math.floor(i/65536),g=i-65536*r,i=m+r+65535,r=Math.floor(i/65536),m=i-65536*r,i=_+r+65535,r=Math.floor(i/65536),_=i-65536*r,i=w+r+65535,r=Math.floor(i/65536),w=i-65536*r,i=v+r+65535,r=Math.floor(i/65536),v=i-65536*r,i=y+r+65535,r=Math.floor(i/65536),y=i-65536*r,s+=r-1+37*(r-1),r=1,i=s+r+65535,r=Math.floor(i/65536),s=i-65536*r,i=o+r+65535,r=Math.floor(i/65536),o=i-65536*r,i=a+r+65535,r=Math.floor(i/65536),a=i-65536*r,i=h+r+65535,r=Math.floor(i/65536),h=i-65536*r,i=u+r+65535,r=Math.floor(i/65536),u=i-65536*r,i=c+r+65535,r=Math.floor(i/65536),c=i-65536*r,i=l+r+65535,r=Math.floor(i/65536),l=i-65536*r,i=f+r+65535,r=Math.floor(i/65536),f=i-65536*r,i=d+r+65535,r=Math.floor(i/65536),d=i-65536*r,i=p+r+65535,r=Math.floor(i/65536),p=i-65536*r,i=g+r+65535,r=Math.floor(i/65536),g=i-65536*r,i=m+r+65535,r=Math.floor(i/65536),m=i-65536*r,i=_+r+65535,r=Math.floor(i/65536),_=i-65536*r,i=w+r+65535,r=Math.floor(i/65536),w=i-65536*r,i=v+r+65535,r=Math.floor(i/65536),v=i-65536*r,i=y+r+65535,r=Math.floor(i/65536),y=i-65536*r,s+=r-1+37*(r-1),e[0]=s,e[1]=o,e[2]=a,e[3]=h,e[4]=u,e[5]=c,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=g,e[11]=m,e[12]=_,e[13]=w;e[14]=v;e[15]=y}function M(e,t){R(e,t,t)}function D(e,t){var n,i=ee();for(n=0;n<16;n++)i[n]=t[n];for(n=253;n>=0;n--)M(i,i),2!==n&&4!==n&&R(i,i,t);for(n=0;n<16;n++)e[n]=i[n]}function x(e,t){var n,i=ee();for(n=0;n<16;n++)i[n]=t[n];for(n=250;n>=0;n--)M(i,i),1!==n&&R(i,i,t);for(n=0;n<16;n++)e[n]=i[n]}function I(e,t,n){var i,r,s=new Uint8Array(32),o=new Float64Array(80),a=ee(),h=ee(),u=ee(),c=ee(),l=ee(),f=ee();for(r=0;r<31;r++)s[r]=t[r];for(s[31]=127&t[31]|64,s[0]&=248,k(o,n),r=0;r<16;r++)h[r]=o[r],c[r]=a[r]=u[r]=0;for(a[0]=c[0]=1,r=254;r>=0;--r)i=s[r>>>3]>>>(7&r)&1,y(a,h,i),y(u,c,i),S(l,a,u),T(a,a,u),S(u,h,c),T(h,h,c),M(c,l),M(f,a),R(a,u,a),R(u,h,l),S(l,a,u),T(a,a,u),M(h,a),T(u,c,f),R(a,u,oe),S(a,a,c),R(u,u,a),R(a,c,f),R(c,h,o),M(h,l),y(a,h,i),y(u,c,i);for(r=0;r<16;r++)o[r+16]=a[r],o[r+32]=u[r],o[r+48]=h[r],o[r+64]=c[r];var d=o.subarray(32),p=o.subarray(16);return D(d,d),R(p,p,d),b(e,p),0}function U(e,t){return I(e,t,ie)}function L(e,t){return te(t,32),U(e,t)}function C(e,t,n){var i=new Uint8Array(32);return I(i,n,t),u(e,ne,i,fe)}function P(e,t,n,i,r,s){var o=new Uint8Array(32);return C(o,r,s),pe(e,t,n,i,o)}function O(e,t,n,i,r,s){var o=new Uint8Array(32);return C(o,r,s),ge(e,t,n,i,o)}function N(e,t,n,i){for(var r,s,o,a,h,u,c,l,f,d,p,g,m,_,w,v,y,b,E,A,k,S,T,R,M,D,x=new Int32Array(16),I=new Int32Array(16),U=e[0],L=e[1],C=e[2],P=e[3],O=e[4],N=e[5],B=e[6],G=e[7],j=t[0],z=t[1],q=t[2],F=t[3],W=t[4],H=t[5],Z=t[6],Y=t[7],V=0;i>=128;){for(E=0;E<16;E++)A=8*E+V,x[E]=n[A+0]<<24|n[A+1]<<16|n[A+2]<<8|n[A+3],I[E]=n[A+4]<<24|n[A+5]<<16|n[A+6]<<8|n[A+7];for(E=0;E<80;E++)if(r=U,s=L,o=C,a=P,h=O,u=N,c=B,l=G,f=j,d=z,p=q,g=F,m=W,_=H,w=Z,v=Y,k=G,S=Y,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=(O>>>14|W<<18)^(O>>>18|W<<14)^(W>>>9|O<<23),S=(W>>>14|O<<18)^(W>>>18|O<<14)^(O>>>9|W<<23),T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,k=O&N^~O&B,S=W&H^~W&Z,T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,k=me[2*E],S=me[2*E+1],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,k=x[E%16],S=I[E%16],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,y=65535&M|D<<16,b=65535&T|R<<16,k=y,S=b,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=(U>>>28|j<<4)^(j>>>2|U<<30)^(j>>>7|U<<25),S=(j>>>28|U<<4)^(U>>>2|j<<30)^(U>>>7|j<<25),T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,k=U&L^U&C^L&C,S=j&z^j&q^z&q,T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,l=65535&M|D<<16,v=65535&T|R<<16,k=a,S=g,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=y,S=b,T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,a=65535&M|D<<16,g=65535&T|R<<16,L=r,C=s,P=o,O=a,N=h,B=u,G=c,U=l,z=f,q=d,F=p,W=g,H=m,Z=_,Y=w,j=v,E%16===15)for(A=0;A<16;A++)k=x[A],S=I[A],T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=x[(A+9)%16],S=I[(A+9)%16],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,y=x[(A+1)%16],b=I[(A+1)%16],
+k=(y>>>1|b<<31)^(y>>>8|b<<24)^y>>>7,S=(b>>>1|y<<31)^(b>>>8|y<<24)^(b>>>7|y<<25),T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,y=x[(A+14)%16],b=I[(A+14)%16],k=(y>>>19|b<<13)^(b>>>29|y<<3)^y>>>6,S=(b>>>19|y<<13)^(y>>>29|b<<3)^(b>>>6|y<<26),T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,x[A]=65535&M|D<<16,I[A]=65535&T|R<<16;k=U,S=j,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=e[0],S=t[0],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,e[0]=U=65535&M|D<<16,t[0]=j=65535&T|R<<16,k=L,S=z,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=e[1],S=t[1],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,e[1]=L=65535&M|D<<16,t[1]=z=65535&T|R<<16,k=C,S=q,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=e[2],S=t[2],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,e[2]=C=65535&M|D<<16,t[2]=q=65535&T|R<<16,k=P,S=F,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=e[3],S=t[3],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,e[3]=P=65535&M|D<<16,t[3]=F=65535&T|R<<16,k=O,S=W,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=e[4],S=t[4],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,e[4]=O=65535&M|D<<16,t[4]=W=65535&T|R<<16,k=N,S=H,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=e[5],S=t[5],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,e[5]=N=65535&M|D<<16,t[5]=H=65535&T|R<<16,k=B,S=Z,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=e[6],S=t[6],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,e[6]=B=65535&M|D<<16,t[6]=Z=65535&T|R<<16,k=G,S=Y,T=65535&S,R=S>>>16,M=65535&k,D=k>>>16,k=e[7],S=t[7],T+=65535&S,R+=S>>>16,M+=65535&k,D+=k>>>16,R+=T>>>16,M+=R>>>16,D+=M>>>16,e[7]=G=65535&M|D<<16,t[7]=Y=65535&T|R<<16,V+=128,i-=128}return i}function B(e,n,i){var r,s=new Int32Array(8),o=new Int32Array(8),a=new Uint8Array(256),h=i;for(s[0]=1779033703,s[1]=3144134277,s[2]=1013904242,s[3]=2773480762,s[4]=1359893119,s[5]=2600822924,s[6]=528734635,s[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,N(s,o,n,i),i%=128,r=0;r=0;--r)i=n[r/8|0]>>(7&r)&1,j(e,t,i),G(t,e),G(e,e),j(e,t,i)}function F(e,t){var n=[ee(),ee(),ee(),ee()];w(n[0],ue),w(n[1],ce),w(n[2],se),R(n[3],ue,ce),q(e,n,t)}function W(e,t,n){var i,r=new Uint8Array(64),s=[ee(),ee(),ee(),ee()];for(n||te(t,32),B(r,t,32),r[0]&=248,r[31]&=127,r[31]|=64,F(s,r),z(e,s),i=0;i<32;i++)t[i+32]=e[i];return 0}function H(e,t){var n,i,r,s;for(i=63;i>=32;--i){for(n=0,r=i-32,s=i-12;r>8,t[r]-=256*n;t[r]+=n,t[i]=0}for(n=0,r=0;r<32;r++)t[r]+=n-(t[31]>>4)*_e[r],n=t[r]>>8,t[r]&=255;for(r=0;r<32;r++)t[r]-=n*_e[r];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function Z(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;H(e,n)}function Y(e,t,n,i){var r,s,o=new Uint8Array(64),a=new Uint8Array(64),h=new Uint8Array(64),u=new Float64Array(64),c=[ee(),ee(),ee(),ee()];B(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var l=n+64;for(r=0;r>7&&T(e[0],re,e[0]),R(e[3],e[0],e[1]),0)}function K(e,t,n,i){var r,o,a=new Uint8Array(32),h=new Uint8Array(64),u=[ee(),ee(),ee(),ee()],c=[ee(),ee(),ee(),ee()];if(o=-1,n<64)return-1;if(V(c,i))return-1;for(r=0;r>>13|n<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|i<<6),r=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|r<<9),s=255&e[8]|(255&e[9])<<8,this.r[4]=255&(r>>>4|s<<12),this.r[5]=s>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(s>>>14|o<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|a<<5),h=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|h<<8),this.r[9]=h>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};de.prototype.blocks=function(e,t,n){for(var i,r,s,o,a,h,u,c,l,f,d,p,g,m,_,w,v,y,b,E=this.fin?0:2048,A=this.h[0],k=this.h[1],S=this.h[2],T=this.h[3],R=this.h[4],M=this.h[5],D=this.h[6],x=this.h[7],I=this.h[8],U=this.h[9],L=this.r[0],C=this.r[1],P=this.r[2],O=this.r[3],N=this.r[4],B=this.r[5],G=this.r[6],j=this.r[7],z=this.r[8],q=this.r[9];n>=16;)i=255&e[t+0]|(255&e[t+1])<<8,A+=8191&i,r=255&e[t+2]|(255&e[t+3])<<8,k+=8191&(i>>>13|r<<3),s=255&e[t+4]|(255&e[t+5])<<8,S+=8191&(r>>>10|s<<6),o=255&e[t+6]|(255&e[t+7])<<8,T+=8191&(s>>>7|o<<9),a=255&e[t+8]|(255&e[t+9])<<8,R+=8191&(o>>>4|a<<12),M+=a>>>1&8191,h=255&e[t+10]|(255&e[t+11])<<8,D+=8191&(a>>>14|h<<2),u=255&e[t+12]|(255&e[t+13])<<8,x+=8191&(h>>>11|u<<5),c=255&e[t+14]|(255&e[t+15])<<8,I+=8191&(u>>>8|c<<8),U+=c>>>5|E,l=0,f=l,f+=A*L,f+=k*(5*q),f+=S*(5*z),f+=T*(5*j),f+=R*(5*G),l=f>>>13,f&=8191,f+=M*(5*B),f+=D*(5*N),f+=x*(5*O),f+=I*(5*P),f+=U*(5*C),l+=f>>>13,f&=8191,d=l,d+=A*C,d+=k*L,d+=S*(5*q),d+=T*(5*z),d+=R*(5*j),l=d>>>13,d&=8191,d+=M*(5*G),d+=D*(5*B),d+=x*(5*N),d+=I*(5*O),d+=U*(5*P),l+=d>>>13,d&=8191,p=l,p+=A*P,p+=k*C,p+=S*L,p+=T*(5*q),p+=R*(5*z),l=p>>>13,p&=8191,p+=M*(5*j),p+=D*(5*G),p+=x*(5*B),p+=I*(5*N),p+=U*(5*O),l+=p>>>13,p&=8191,g=l,g+=A*O,g+=k*P,g+=S*C,g+=T*L,g+=R*(5*q),l=g>>>13,g&=8191,g+=M*(5*z),g+=D*(5*j),g+=x*(5*G),g+=I*(5*B),g+=U*(5*N),l+=g>>>13,g&=8191,m=l,m+=A*N,m+=k*O,m+=S*P,m+=T*C,m+=R*L,l=m>>>13,m&=8191,m+=M*(5*q),m+=D*(5*z),m+=x*(5*j),m+=I*(5*G),m+=U*(5*B),l+=m>>>13,m&=8191,_=l,_+=A*B,_+=k*N,_+=S*O,_+=T*P,_+=R*C,l=_>>>13,_&=8191,_+=M*L,_+=D*(5*q),_+=x*(5*z),_+=I*(5*j),_+=U*(5*G),l+=_>>>13,_&=8191,w=l,w+=A*G,w+=k*B,w+=S*N,w+=T*O,w+=R*P,l=w>>>13,w&=8191,w+=M*C,w+=D*L,w+=x*(5*q),w+=I*(5*z),w+=U*(5*j),l+=w>>>13,w&=8191,v=l,v+=A*j,v+=k*G,v+=S*B,v+=T*N,v+=R*O,l=v>>>13,v&=8191,v+=M*P,v+=D*C,v+=x*L,v+=I*(5*q),v+=U*(5*z),l+=v>>>13,v&=8191,y=l,y+=A*z,y+=k*j,y+=S*G,y+=T*B,y+=R*N,l=y>>>13,y&=8191,y+=M*O,y+=D*P,y+=x*C,y+=I*L,y+=U*(5*q),l+=y>>>13,y&=8191,b=l,b+=A*q,b+=k*z,b+=S*j,b+=T*G,b+=R*B,l=b>>>13,b&=8191,b+=M*N,b+=D*O,b+=x*P,b+=I*C,b+=U*L,l+=b>>>13,b&=8191,l=(l<<2)+l|0,l=l+f|0,f=8191&l,l>>>=13,d+=l,A=f,k=d,S=p,T=g,R=m,M=_,D=w,x=v,I=y,U=b,t+=16,n-=16;this.h[0]=A,this.h[1]=k,this.h[2]=S,this.h[3]=T,this.h[4]=R,this.h[5]=M,this.h[6]=D,this.h[7]=x,this.h[8]=I,this.h[9]=U},de.prototype.finish=function(e,t){var n,i,r,s,o=new Uint16Array(10);if(this.leftover){for(s=this.leftover,this.buffer[s++]=1;s<16;s++)this.buffer[s]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,s=2;s<10;s++)this.h[s]+=n,n=this.h[s]>>>13,this.h[s]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,o[0]=this.h[0]+5,n=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this.h[s]+n,n=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,i=(1^n)-1,s=0;s<10;s++)o[s]&=i;for(i=~i,s=0;s<10;s++)this.h[s]=this.h[s]&i|o[s];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),r=this.h[0]+this.pad[0],this.h[0]=65535&r,s=1;s<8;s++)r=(this.h[s]+this.pad[s]|0)+(r>>>16)|0,this.h[s]=65535&r;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},de.prototype.update=function(e,t,n){var i,r;if(this.leftover){for(r=16-this.leftover,r>n&&(r=n),i=0;i=16&&(r=n-n%16,this.blocks(e,t,r),t+=r,n-=r),n){for(i=0;i=0},e.sign.keyPair=function(){var e=new Uint8Array(Ie),t=new Uint8Array(Ue);return W(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if($(e),e.length!==Ue)throw new Error("bad secret key size");for(var t=new Uint8Array(Ie),n=0;n=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),g(n)?i.showHidden=n:n&&t._extend(i,n),b(i.showHidden)&&(i.showHidden=!1),b(i.depth)&&(i.depth=2),b(i.colors)&&(i.colors=!1),b(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=s),h(i,e,i.depth)}function s(e,t){var n=r.styles[t];return n?"["+r.colors[n][0]+"m"+e+"["+r.colors[n][1]+"m":e}function o(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function h(e,n,i){if(e.customInspect&&n&&T(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var r=n.inspect(i,e);return v(r)||(r=h(e,r,i)),r}var s=u(e,n);if(s)return s;var o=Object.keys(n),g=a(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(n)),S(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(n);if(0===o.length){if(T(n)){var m=n.name?": "+n.name:"";return e.stylize("[Function"+m+"]","special")}if(E(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(k(n))return e.stylize(Date.prototype.toString.call(n),"date");if(S(n))return c(n)}var _="",w=!1,y=["{","}"];if(p(n)&&(w=!0,y=["[","]"]),T(n)){var b=n.name?": "+n.name:"";_=" [Function"+b+"]"}if(E(n)&&(_=" "+RegExp.prototype.toString.call(n)),k(n)&&(_=" "+Date.prototype.toUTCString.call(n)),S(n)&&(_=" "+c(n)),0===o.length&&(!w||0==n.length))return y[0]+_+y[1];if(i<0)return E(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var A;return A=w?l(e,n,i,g,o):o.map(function(t){return f(e,n,i,g,t,w)}),e.seen.pop(),d(A,_,y)}function u(e,t){if(b(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return w(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,i,r){for(var s=[],o=0,a=t.length;o-1&&(a=s?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),b(o)){if(s&&r.match(/^\d+$/))return a;o=JSON.stringify(""+r),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function d(e,t,n){var i=0,r=e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function p(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function _(e){return null==e}function w(e){return"number"==typeof e}function v(e){return"string"==typeof e}function y(e){return"symbol"==typeof e}function b(e){return void 0===e}function E(e){return A(e)&&"[object RegExp]"===M(e)}function A(e){return"object"==typeof e&&null!==e}function k(e){return A(e)&&"[object Date]"===M(e)}function S(e){return A(e)&&("[object Error]"===M(e)||e instanceof Error)}function T(e){return"function"==typeof e}function R(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function M(e){return Object.prototype.toString.call(e)}function D(e){return e<10?"0"+e.toString(10):e.toString(10)}function x(){var e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":");return[e.getDate(),P[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var U=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],n=0;n=s)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return e}}),a=i[n];n{if(/^https?:\/\//.test(e)){const i=s.get(e).set("Content-Type","blob");this.client.browser&&i.responseType("arraybuffer"),i.end((e,i)=>{return e?o(e):this.client.browser?n(a(i.xhr.response)):i.body instanceof t?n(i.body):o(new TypeError("Body is not a Buffer"))})}else{const t=i.resolve(e);r.stat(t,(e,i)=>{if(e&&o(e),!i||!i.isFile())throw new Error(`The file could not be found: ${t}`);r.readFile(t,(e,t)=>{e?o(e):n(t)})})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(e){return e instanceof d||e instanceof p?e.identifier:"string"!=typeof e||e.includes("%")?null:encodeURIComponent(e)}}e.exports=g}).call(t,n(5).Buffer)},function(e,t,n){const i=n(138),r=n(135),s=n(137),o=n(136),a=n(134),h=n(0);class u{constructor(e){this.client=e,this.handlers={},this.userAgentManager=new i(this),this.methods=new r(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(e,t){return new Promise((n,i)=>{e.push({request:t,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return s;case"burst":return o;default:throw new Error(h.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(e,t,n,i,r){const s=new a(this,e,t,n,i,r);if(!this.handlers[s.route]){const e=this.getRequestHandler();this.handlers[s.route]=new e(this,s.route)}return this.push(this.handlers[s.route],s)}}e.exports=u},function(e,t){class n{constructor(e){this.restManager=e,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(e){this.restManager.globallyRateLimited=e}push(e){this.queue.push(e)}handle(){}}e.exports=n},function(e,t){class n{constructor(e){this.player=e}encode(e){return e}decode(e){return e}}e.exports=n},function(e,t,n){(function(t){function n(e){const n=new t(e.byteLength),i=new Uint8Array(e);for(var r=0;r0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get status(){return this.ws.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get voiceConnections(){return this.voice.connections}get emojis(){const e=new Collection;for(const t of this.guilds.values())for(const n of t.emojis.values())e.set(n.id,n);return e}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}login(e,t=null){return t?this.rest.methods.loginEmailPassword(e,t):this.rest.methods.loginToken(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const t of this._intervals)clearInterval(t);return this._timeouts.clear(),this._intervals.clear(),this.token=null,this.email=null,this.password=null,this.manager.destroy()}syncGuilds(e=this.guilds){this.user.bot||this.ws.send({op:12,d:e instanceof Collection?e.keyArray():e.map(e=>e.id)})}fetchUser(e){return this.users.has(e)?Promise.resolve(this.users.get(e)):this.rest.methods.getUser(e)}fetchInvite(e){const t=this.resolver.resolveInviteCode(e);return this.rest.methods.getInvite(t)}fetchWebhook(e,t){return this.rest.methods.getWebhook(e,t)}sweepMessages(e=this.options.messageCacheLifetime){if("number"!=typeof e||isNaN(e))throw new TypeError("The lifetime must be a number.");if(e<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const t=1e3*e,n=Date.now();let i=0,r=0;for(const s of this.channels.values())if(s.messages){i++;for(const e of s.messages.values())n-(e.editedTimestamp||e.createdTimestamp)>t&&(s.messages.delete(e.id),r++)}return this.emit("debug",`Swept ${r} messages older than ${e} seconds in ${i} text-based channels`),r}fetchApplication(){if(!this.user.bot)throw new Error(Constants.Errors.NO_BOT_ACCOUNT);return this.rest.methods.getMyApplication()}setTimeout(e,t,...n){const i=setTimeout(()=>{e(),this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}_setPresence(e,t){return this.presences.get(e)?void this.presences.get(e).update(t):void this.presences.set(e,new Presence(t))}_eval(script){return eval(script)}_validateOptions(e=this.options){if("number"!=typeof e.shardCount||isNaN(e.shardCount))throw new TypeError("The shardCount option must be a number.");
+if("number"!=typeof e.shardId||isNaN(e.shardId))throw new TypeError("The shardId option must be a number.");if(e.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(e.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==e.shardId&&e.shardId>=e.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof e.messageCacheMaxSize||isNaN(e.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof e.messageCacheLifetime||isNaN(e.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof e.messageSweepInterval||isNaN(e.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof e.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof e.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof e.restWsBridgeTimeout||isNaN(e.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(e.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(6))},function(e,t,n){const i=n(30),r=n(70),s=n(69),o=n(26),a=n(0);class h extends i{constructor(e,t,n){super(null,e,t),this.options=o(a.DefaultOptions,n),this.rest=new r(this),this.resolver=new s(this)}}e.exports=h},function(e,t,n){(function(t){const i=n(17),r=n(13),s=n(4).EventEmitter,o=n(26),a=n(39),h=n(3),u=n(56);class c extends s{constructor(e,n={}){if(super(),n=o({totalShards:"auto",respawn:!0,shardArgs:[],token:null},n),this.file=e,!e)throw new Error("File must be specified.");i.isAbsolute(e)||(this.file=i.resolve(t.cwd(),e));const s=r.statSync(this.file);if(!s.isFile())throw new Error("File path does not point to a file.");if(this.totalShards=n.totalShards,"auto"!==this.totalShards){if("number"!=typeof this.totalShards||isNaN(this.totalShards))throw new TypeError("Amount of shards must be a number.");if(this.totalShards<1)throw new RangeError("Amount of shards must be at least 1.");if(this.totalShards!==Math.floor(this.totalShards))throw new RangeError("Amount of shards must be an integer.")}this.respawn=n.respawn,this.shardArgs=n.shardArgs,this.token=n.token?n.token.replace(/^Bot\s*/i,""):null,this.shards=new h}createShard(e=this.shards.size){const t=new a(this,e,this.shardArgs);return this.shards.set(e,t),this.emit("launch",t),Promise.resolve(t)}spawn(e=this.totalShards,t=5500){if("auto"===e)return u(this.token).then(e=>{return this.totalShards=e,this._spawn(e,t)});if("number"!=typeof e||isNaN(e))throw new TypeError("Amount of shards must be a number.");if(e<1)throw new RangeError("Amount of shards must be at least 1.");if(e!==Math.floor(e))throw new TypeError("Amount of shards must be an integer.");return this._spawn(e,t)}_spawn(e,t){return new Promise(n=>{if(this.shards.size>=e)throw new Error(`Already spawned ${this.shards.size} shards.`);if(this.totalShards=e,this.createShard(),this.shards.size>=this.totalShards)return void n(this.shards);if(t<=0){for(;this.shards.size{this.createShard(),this.shards.size>=this.totalShards&&(clearInterval(e),n(this.shards))},t)}})}broadcast(e){const t=[];for(const n of this.shards.values())t.push(n.send(e));return Promise.all(t)}broadcastEval(e){const t=[];for(const n of this.shards.values())t.push(n.eval(e));return Promise.all(t)}fetchClientValues(e){if(0===this.shards.size)return Promise.reject(new Error("No shards have been spawned."));if(this.shards.size!==this.totalShards)return Promise.reject(new Error("Still spawning shards."));const t=[];for(const n of this.shards.values())t.push(n.fetchClientValue(e));return Promise.all(t)}}e.exports=c}).call(t,n(6))},function(e,t,n){"use strict";(function(t){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
*/
-function i(e,t){if(e===t)return 0;for(var n=e.length,i=t.length,r=0,s=Math.min(n,i);r=0;a--)if(c[a]!==h[a])return!1;for(a=c.length-1;a>=0;a--)if(o=c[a],!l(e[o],t[o],n,i))return!1;return!0}function m(e,t,n){l(e,t,!0)&&u(e,t,n,"notDeepStrictEqual",m)}function g(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&t.call({},e)===!0}function v(e){var t;try{e()}catch(e){t=e}return t}function y(e,t,n,i){var r;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(i=n,n=null),r=v(t),i=(n&&n.name?" ("+n.name+").":".")+(i?" "+i:"."),e&&!r&&u(r,n,"Missing expected exception"+i);var s="string"==typeof i,o=!e&&_.isError(r),a=!e&&r&&!n;if((o&&s&&g(r,n)||a)&&u(r,n,"Got unwanted exception"+i),e&&r&&n&&!g(r,n)||!e&&r)throw r}var _=n(10),w=Object.prototype.hasOwnProperty,E=Array.prototype.slice,S=function(){return"foo"===function(){}.name}(),k=e.exports=d,A=/\s*function\s+([^\(\s]*)\s*/;k.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var t=e.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var i=n.stack,r=a(t),s=i.indexOf("\n"+r);if(s>=0){var o=i.indexOf("\n",s+1);i=i.substring(o+1)}this.stack=i}}},_.inherits(k.AssertionError,Error),k.fail=u,k.ok=d,k.equal=function(e,t,n){e!=t&&u(e,t,n,"==",k.equal)},k.notEqual=function(e,t,n){e==t&&u(e,t,n,"!=",k.notEqual)},k.deepEqual=function(e,t,n){l(e,t,!1)||u(e,t,n,"deepEqual",k.deepEqual)},k.deepStrictEqual=function(e,t,n){l(e,t,!0)||u(e,t,n,"deepStrictEqual",k.deepStrictEqual)},k.notDeepEqual=function(e,t,n){l(e,t,!1)&&u(e,t,n,"notDeepEqual",k.notDeepEqual)},k.notDeepStrictEqual=m,k.strictEqual=function(e,t,n){e!==t&&u(e,t,n,"===",k.strictEqual)},k.notStrictEqual=function(e,t,n){e===t&&u(e,t,n,"!==",k.notStrictEqual)},k.throws=function(e,t,n){y(!0,e,t,n)},k.doesNotThrow=function(e,t,n){y(!1,e,t,n)},k.ifError=function(e){if(e)throw e};var M=Object.keys||function(e){var t=[];for(var n in e)w.call(e,n)&&t.push(n);return t}}).call(t,n(18))},function(e,t){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function r(e){var t,i,r,s,o,a,c=e.length;o=n(e),a=new f(3*c/4-o),r=o>0?c-4:c;var u=0;for(t=0,i=0;t