· 5 years ago · Sep 03, 2020, 07:58 PM
1/******/
2(function (modules) { // webpackBootstrap
3 /******/ // The module cache
4 /******/
5 var installedModules = {};
6 /******/
7 /******/ // The require function
8 /******/
9 function __webpack_require__(moduleId) {
10 /******/
11 /******/ // Check if module is in cache
12 /******/
13 if (installedModules[moduleId]) {
14 /******/
15 return installedModules[moduleId].exports;
16 /******/
17 }
18 /******/ // Create a new module (and put it into the cache)
19 /******/
20 var module = installedModules[moduleId] = {
21 /******/
22 i: moduleId,
23 /******/
24 l: false,
25 /******/
26 exports: {}
27 /******/
28 };
29 /******/
30 /******/ // Execute the module function
31 /******/
32 modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
33 /******/
34 /******/ // Flag the module as loaded
35 /******/
36 module.l = true;
37 /******/
38 /******/ // Return the exports of the module
39 /******/
40 return module.exports;
41 /******/
42 }
43 /******/
44 /******/
45 /******/ // expose the modules object (__webpack_modules__)
46 /******/
47 __webpack_require__.m = modules;
48 /******/
49 /******/ // expose the module cache
50 /******/
51 __webpack_require__.c = installedModules;
52 /******/
53 /******/ // define getter function for harmony exports
54 /******/
55 __webpack_require__.d = function (exports, name, getter) {
56 /******/
57 if (!__webpack_require__.o(exports, name)) {
58 /******/
59 Object.defineProperty(exports, name, {
60 enumerable: true,
61 get: getter
62 });
63 /******/
64 }
65 /******/
66 };
67 /******/
68 /******/ // define __esModule on exports
69 /******/
70 __webpack_require__.r = function (exports) {
71 /******/
72 if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
73 /******/
74 Object.defineProperty(exports, Symbol.toStringTag, {
75 value: 'Module'
76 });
77 /******/
78 }
79 /******/
80 Object.defineProperty(exports, '__esModule', {
81 value: true
82 });
83 /******/
84 };
85 /******/
86 /******/ // create a fake namespace object
87 /******/ // mode & 1: value is a module id, require it
88 /******/ // mode & 2: merge all properties of value into the ns
89 /******/ // mode & 4: return value when already ns object
90 /******/ // mode & 8|1: behave like require
91 /******/
92 __webpack_require__.t = function (value, mode) {
93 /******/
94 if (mode & 1) value = __webpack_require__(value);
95 /******/
96 if (mode & 8) return value;
97 /******/
98 if ((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
99 /******/
100 var ns = Object.create(null);
101 /******/
102 __webpack_require__.r(ns);
103 /******/
104 Object.defineProperty(ns, 'default', {
105 enumerable: true,
106 value: value
107 });
108 /******/
109 if (mode & 2 && typeof value != 'string')
110 for (var key in value) __webpack_require__.d(ns, key, function (key) {
111 return value[key];
112 }.bind(null, key));
113 /******/
114 return ns;
115 /******/
116 };
117 /******/
118 /******/ // getDefaultExport function for compatibility with non-harmony modules
119 /******/
120 __webpack_require__.n = function (module) {
121 /******/
122 var getter = module && module.__esModule ?
123 /******/
124 function getDefault() {
125 return module['default'];
126 } :
127 /******/
128 function getModuleExports() {
129 return module;
130 };
131 /******/
132 __webpack_require__.d(getter, 'a', getter);
133 /******/
134 return getter;
135 /******/
136 };
137 /******/
138 /******/ // Object.prototype.hasOwnProperty.call
139 /******/
140 __webpack_require__.o = function (object, property) {
141 return Object.prototype.hasOwnProperty.call(object, property);
142 };
143 /******/
144 /******/ // __webpack_public_path__
145 /******/
146 __webpack_require__.p = "";
147 /******/
148 /******/
149 /******/ // Load entry module and return exports
150 /******/
151 return __webpack_require__(__webpack_require__.s = "./browser.js");
152 /******/
153})
154/************************************************************************/
155/******/
156({
157
158 /***/
159 "./browser.js":
160 /*!********************!*\
161 !*** ./browser.js ***!
162 \********************/
163 /*! no static exports found */
164 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
165 /***/
166 (function (module, exports, __webpack_require__) {
167
168 eval("const browser = typeof window !== 'undefined';\nconst webpack = !!\"true\";\n\nconst Discord = __webpack_require__(/*! ./ */ \"./src/index.js\");\n\nmodule.exports = Discord;\nif (browser && webpack) window.Discord = Discord; // eslint-disable-line no-undef\n// eslint-disable-next-line no-console\nelse if (!browser) console.warn('Warning: Attempting to use browser version of Discord.js in a non-browser environment!');\n\n\n//# sourceURL=webpack:///./browser.js?");
169
170 /***/
171 }),
172
173 /***/
174 "./node_modules/base64-js/index.js":
175 /*!*****************************************!*\
176 !*** ./node_modules/base64-js/index.js ***!
177 \*****************************************/
178 /*! no static exports found */
179 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
180 /***/
181 (function (module, exports, __webpack_require__) {
182
183 "use strict";
184 eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n\n\n//# sourceURL=webpack:///./node_modules/base64-js/index.js?");
185
186 /***/
187 }),
188
189 /***/
190 "./node_modules/buffer/index.js":
191 /*!**************************************!*\
192 !*** ./node_modules/buffer/index.js ***!
193 \**************************************/
194 /*! no static exports found */
195 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
196 /***/
197 (function (module, exports, __webpack_require__) {
198
199 "use strict";
200 eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\")\nvar ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\")\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/buffer/index.js?");
201
202 /***/
203 }),
204
205 /***/
206 "./node_modules/events/events.js":
207 /*!***************************************!*\
208 !*** ./node_modules/events/events.js ***!
209 \***************************************/
210 /*! no static exports found */
211 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
212 /***/
213 (function (module, exports, __webpack_require__) {
214
215 "use strict";
216 eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\n\n//# sourceURL=webpack:///./node_modules/events/events.js?");
217
218 /***/
219 }),
220
221 /***/
222 "./node_modules/ieee754/index.js":
223 /*!***************************************!*\
224 !*** ./node_modules/ieee754/index.js ***!
225 \***************************************/
226 /*! no static exports found */
227 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
228 /***/
229 (function (module, exports) {
230
231 eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n//# sourceURL=webpack:///./node_modules/ieee754/index.js?");
232
233 /***/
234 }),
235
236 /***/
237 "./node_modules/isarray/index.js":
238 /*!***************************************!*\
239 !*** ./node_modules/isarray/index.js ***!
240 \***************************************/
241 /*! no static exports found */
242 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
243 /***/
244 (function (module, exports) {
245
246 eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n//# sourceURL=webpack:///./node_modules/isarray/index.js?");
247
248 /***/
249 }),
250
251 /***/
252 "./node_modules/long/src/long.js":
253 /*!***************************************!*\
254 !*** ./node_modules/long/src/long.js ***!
255 \***************************************/
256 /*! no static exports found */
257 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
258 /***/
259 (function (module, exports) {
260
261 eval("module.exports = Long;\r\n\r\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\r\nvar wasm = null;\r\n\r\ntry {\r\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\r\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\r\n ])), {}).exports;\r\n} catch (e) {\r\n // no wasm support :(\r\n}\r\n\r\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\r\nfunction Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n}\r\n\r\n// The internal representation of a long is the two given signed, 32-bit values.\r\n// We use 32-bit pieces because these are the size of integers on which\r\n// Javascript performs bit-operations. For operations like addition and\r\n// multiplication, we split each number into 16 bit pieces, which can easily be\r\n// multiplied within Javascript's floating-point representation without overflow\r\n// or change in sign.\r\n//\r\n// In the algorithms below, we frequently reduce the negative case to the\r\n// positive case by negating the input(s) and then post-processing the result.\r\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n// a positive number, it overflows back into a negative). Not handling this\r\n// case would often result in infinite recursion.\r\n//\r\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n// methods on which they depend.\r\n\r\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\nLong.prototype.__isLong__;\r\n\r\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\r\n\r\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\nfunction isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n}\r\n\r\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\nLong.isLong = isLong;\r\n\r\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar INT_CACHE = {};\r\n\r\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar UINT_CACHE = {};\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromInt = fromInt;\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromNumber(value, unsigned) {\r\n if (isNaN(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromNumber = fromNumber;\r\n\r\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromBits = fromBits;\r\n\r\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n}\r\n\r\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromString = fromString;\r\n\r\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromValue(val, unsigned) {\r\n if (typeof val === 'number')\r\n return fromNumber(val, unsigned);\r\n if (typeof val === 'string')\r\n return fromString(val, unsigned);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\r\n}\r\n\r\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\r\nLong.fromValue = fromValue;\r\n\r\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n// no runtime penalty for these.\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_16_DBL = 1 << 16;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24_DBL = 1 << 24;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ZERO = fromInt(0);\r\n\r\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\nLong.ZERO = ZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UZERO = fromInt(0, true);\r\n\r\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\nLong.UZERO = UZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ONE = fromInt(1);\r\n\r\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\nLong.ONE = ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UONE = fromInt(1, true);\r\n\r\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\nLong.UONE = UONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar NEG_ONE = fromInt(-1);\r\n\r\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\nLong.NEG_ONE = NEG_ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_VALUE = MAX_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MIN_VALUE = MIN_VALUE;\r\n\r\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\nvar LongPrototype = Long.prototype;\r\n\r\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\nLongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n};\r\n\r\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\nLongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n};\r\n\r\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\nLongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\nLongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\nLongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eqz = LongPrototype.isZero;\r\n\r\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eq = LongPrototype.equals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n};\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.neq = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ne = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lt = LongPrototype.lessThan;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.le = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n};\r\n\r\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.comp = LongPrototype.compare;\r\n\r\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n};\r\n\r\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.neg = LongPrototype.negate;\r\n\r\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\nLongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.sub = LongPrototype.subtract;\r\n\r\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = wasm.mul(this.low,\r\n this.high,\r\n multiplier.low,\r\n multiplier.high);\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.mul = LongPrototype.multiply;\r\n\r\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n // guard against signed division overflow: the largest\r\n // negative number / -1 would be 1 larger than the largest\r\n // positive number, due to two's complement.\r\n if (!this.unsigned &&\r\n this.high === -0x80000000 &&\r\n divisor.low === -1 && divisor.high === -1) {\r\n // be consistent with non-wasm code path\r\n return this;\r\n }\r\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n};\r\n\r\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.div = LongPrototype.divide;\r\n\r\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n return this.sub(this.div(divisor).mul(divisor));\r\n};\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.mod = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.rem = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\nLongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n};\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\nLongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n};\r\n\r\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\nLongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n};\r\n\r\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.<number>} Byte representation\r\n */\r\nLongPrototype.toBytes = function toBytes(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n};\r\n\r\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.<number>} Little endian byte representation\r\n */\r\nLongPrototype.toBytesLE = function toBytesLE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo >>> 16 & 0xff,\r\n lo >>> 24 ,\r\n hi & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi >>> 16 & 0xff,\r\n hi >>> 24\r\n ];\r\n};\r\n\r\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.<number>} Big endian byte representation\r\n */\r\nLongPrototype.toBytesBE = function toBytesBE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n hi >>> 24 ,\r\n hi >>> 16 & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi & 0xff,\r\n lo >>> 24 ,\r\n lo >>> 16 & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo & 0xff\r\n ];\r\n};\r\n\r\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.<number>} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\r\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\r\n};\r\n\r\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.<number>} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\r\n return new Long(\r\n bytes[0] |\r\n bytes[1] << 8 |\r\n bytes[2] << 16 |\r\n bytes[3] << 24,\r\n bytes[4] |\r\n bytes[5] << 8 |\r\n bytes[6] << 16 |\r\n bytes[7] << 24,\r\n unsigned\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.<number>} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\r\n return new Long(\r\n bytes[4] << 24 |\r\n bytes[5] << 16 |\r\n bytes[6] << 8 |\r\n bytes[7],\r\n bytes[0] << 24 |\r\n bytes[1] << 16 |\r\n bytes[2] << 8 |\r\n bytes[3],\r\n unsigned\r\n );\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/long/src/long.js?");
262
263 /***/
264 }),
265
266 /***/
267 "./node_modules/node-libs-browser/mock/empty.js":
268 /*!******************************************************!*\
269 !*** ./node_modules/node-libs-browser/mock/empty.js ***!
270 \******************************************************/
271 /*! no static exports found */
272 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
273 /***/
274 (function (module, exports) {
275
276 eval("\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/mock/empty.js?");
277
278 /***/
279 }),
280
281 /***/
282 "./node_modules/os-browserify/browser.js":
283 /*!***********************************************!*\
284 !*** ./node_modules/os-browserify/browser.js ***!
285 \***********************************************/
286 /*! no static exports found */
287 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
288 /***/
289 (function (module, exports) {
290
291 eval("exports.endianness = function () { return 'LE' };\n\nexports.hostname = function () {\n if (typeof location !== 'undefined') {\n return location.hostname\n }\n else return '';\n};\n\nexports.loadavg = function () { return [] };\n\nexports.uptime = function () { return 0 };\n\nexports.freemem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.cpus = function () { return [] };\n\nexports.type = function () { return 'Browser' };\n\nexports.release = function () {\n if (typeof navigator !== 'undefined') {\n return navigator.appVersion;\n }\n return '';\n};\n\nexports.networkInterfaces\n= exports.getNetworkInterfaces\n= function () { return {} };\n\nexports.arch = function () { return 'javascript' };\n\nexports.platform = function () { return 'browser' };\n\nexports.tmpdir = exports.tmpDir = function () {\n return '/tmp';\n};\n\nexports.EOL = '\\n';\n\nexports.homedir = function () {\n\treturn '/'\n};\n\n\n//# sourceURL=webpack:///./node_modules/os-browserify/browser.js?");
292
293 /***/
294 }),
295
296 /***/
297 "./node_modules/path-browserify/index.js":
298 /*!***********************************************!*\
299 !*** ./node_modules/path-browserify/index.js ***!
300 \***********************************************/
301 /*! no static exports found */
302 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
303 /***/
304 (function (module, exports, __webpack_require__) {
305
306 eval("/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/path-browserify/index.js?");
307
308 /***/
309 }),
310
311 /***/
312 "./node_modules/process/browser.js":
313 /*!*****************************************!*\
314 !*** ./node_modules/process/browser.js ***!
315 \*****************************************/
316 /*! no static exports found */
317 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
318 /***/
319 (function (module, exports) {
320
321 eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack:///./node_modules/process/browser.js?");
322
323 /***/
324 }),
325
326 /***/
327 "./node_modules/querystring-es3/decode.js":
328 /*!************************************************!*\
329 !*** ./node_modules/querystring-es3/decode.js ***!
330 \************************************************/
331 /*! no static exports found */
332 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
333 /***/
334 (function (module, exports, __webpack_require__) {
335
336 "use strict";
337 eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\n\n//# sourceURL=webpack:///./node_modules/querystring-es3/decode.js?");
338
339 /***/
340 }),
341
342 /***/
343 "./node_modules/querystring-es3/encode.js":
344 /*!************************************************!*\
345 !*** ./node_modules/querystring-es3/encode.js ***!
346 \************************************************/
347 /*! no static exports found */
348 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
349 /***/
350 (function (module, exports, __webpack_require__) {
351
352 "use strict";
353 eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n\n\n//# sourceURL=webpack:///./node_modules/querystring-es3/encode.js?");
354
355 /***/
356 }),
357
358 /***/
359 "./node_modules/querystring-es3/index.js":
360 /*!***********************************************!*\
361 !*** ./node_modules/querystring-es3/index.js ***!
362 \***********************************************/
363 /*! no static exports found */
364 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
365 /***/
366 (function (module, exports, __webpack_require__) {
367
368 "use strict";
369 eval("\n\nexports.decode = exports.parse = __webpack_require__(/*! ./decode */ \"./node_modules/querystring-es3/decode.js\");\nexports.encode = exports.stringify = __webpack_require__(/*! ./encode */ \"./node_modules/querystring-es3/encode.js\");\n\n\n//# sourceURL=webpack:///./node_modules/querystring-es3/index.js?");
370
371 /***/
372 }),
373
374 /***/
375 "./node_modules/snekfetch/esm.mjs":
376 /*!****************************************!*\
377 !*** ./node_modules/snekfetch/esm.mjs ***!
378 \****************************************/
379 /*! exports provided: default, version, METHODS, acl, bind, checkout, connect, copy, delete, get, head, link, lock, merge, mkactivity, mkcalendar, mkcol, move, notify, options, patch, post, propfind, proppatch, purge, put, rebind, report, search, subscribe, trace, unbind, unlink, unlock, unsubscribe, brew */
380 /*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/client/ClientDataResolver.js (referenced with cjs require), ./src/client/rest/APIRequest.js (referenced with cjs require), ./src/util/Util.js (referenced with cjs require) */
381 /***/
382 (function (__webpack_module__, __webpack_exports__, __webpack_require__) {
383
384 "use strict";
385 eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"METHODS\", function() { return METHODS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"acl\", function() { return acl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bind\", function() { return bind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkout\", function() { return checkout; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"connect\", function() { return connect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"delete\", function() { return _delete; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"head\", function() { return head; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"link\", function() { return link; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lock\", function() { return lock; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"merge\", function() { return merge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mkactivity\", function() { return mkactivity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mkcalendar\", function() { return mkcalendar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mkcol\", function() { return mkcol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"move\", function() { return move; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"notify\", function() { return notify; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"options\", function() { return options; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"patch\", function() { return patch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"post\", function() { return post; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"propfind\", function() { return propfind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proppatch\", function() { return proppatch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"purge\", function() { return purge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"put\", function() { return put; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rebind\", function() { return rebind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"report\", function() { return report; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"search\", function() { return search; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subscribe\", function() { return subscribe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"unbind\", function() { return unbind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"unlink\", function() { return unlink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"unlock\", function() { return unlock; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"unsubscribe\", function() { return unsubscribe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"brew\", function() { return brew; });\n/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ \"./node_modules/snekfetch/index.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_index_js__WEBPACK_IMPORTED_MODULE_0__);\n\nconst version = _index_js__WEBPACK_IMPORTED_MODULE_0__.version;\nconst METHODS = _index_js__WEBPACK_IMPORTED_MODULE_0__.METHODS;\n\nconst acl = _index_js__WEBPACK_IMPORTED_MODULE_0__.acl;\nconst bind = _index_js__WEBPACK_IMPORTED_MODULE_0__.bind;\nconst checkout = _index_js__WEBPACK_IMPORTED_MODULE_0__.checkout;\nconst connect = _index_js__WEBPACK_IMPORTED_MODULE_0__.connect;\nconst copy = _index_js__WEBPACK_IMPORTED_MODULE_0__.copy;\nconst _delete = _index_js__WEBPACK_IMPORTED_MODULE_0__.delete;\n\nconst get = _index_js__WEBPACK_IMPORTED_MODULE_0__.get;\nconst head = _index_js__WEBPACK_IMPORTED_MODULE_0__.head;\nconst link = _index_js__WEBPACK_IMPORTED_MODULE_0__.link;\nconst lock = _index_js__WEBPACK_IMPORTED_MODULE_0__.lock;\nconst merge = _index_js__WEBPACK_IMPORTED_MODULE_0__.merge;\nconst mkactivity = _index_js__WEBPACK_IMPORTED_MODULE_0__.mkactivity;\nconst mkcalendar = _index_js__WEBPACK_IMPORTED_MODULE_0__.mkcalendar;\nconst mkcol = _index_js__WEBPACK_IMPORTED_MODULE_0__.mkcol;\nconst move = _index_js__WEBPACK_IMPORTED_MODULE_0__.move;\nconst notify = _index_js__WEBPACK_IMPORTED_MODULE_0__.notify;\nconst options = _index_js__WEBPACK_IMPORTED_MODULE_0__.options;\nconst patch = _index_js__WEBPACK_IMPORTED_MODULE_0__.patch;\nconst post = _index_js__WEBPACK_IMPORTED_MODULE_0__.post;\nconst propfind = _index_js__WEBPACK_IMPORTED_MODULE_0__.propfind;\nconst proppatch = _index_js__WEBPACK_IMPORTED_MODULE_0__.proppatch;\nconst purge = _index_js__WEBPACK_IMPORTED_MODULE_0__.purge;\nconst put = _index_js__WEBPACK_IMPORTED_MODULE_0__.put;\nconst rebind = _index_js__WEBPACK_IMPORTED_MODULE_0__.rebind;\nconst report = _index_js__WEBPACK_IMPORTED_MODULE_0__.report;\nconst search = _index_js__WEBPACK_IMPORTED_MODULE_0__.search;\nconst subscribe = _index_js__WEBPACK_IMPORTED_MODULE_0__.subscribe;\nconst trace = _index_js__WEBPACK_IMPORTED_MODULE_0__.trace;\nconst unbind = _index_js__WEBPACK_IMPORTED_MODULE_0__.unbind;\nconst unlink = _index_js__WEBPACK_IMPORTED_MODULE_0__.unlink;\nconst unlock = _index_js__WEBPACK_IMPORTED_MODULE_0__.unlock;\nconst unsubscribe = _index_js__WEBPACK_IMPORTED_MODULE_0__.unsubscribe;\nconst brew = _index_js__WEBPACK_IMPORTED_MODULE_0__.brew;\n\n\n//# sourceURL=webpack:///./node_modules/snekfetch/esm.mjs?");
386
387 /***/
388 }),
389
390 /***/
391 "./node_modules/snekfetch/index.js":
392 /*!*****************************************!*\
393 !*** ./node_modules/snekfetch/index.js ***!
394 \*****************************************/
395 /*! no static exports found */
396 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
397 /***/
398 (function (module, exports, __webpack_require__) {
399
400 eval("module.exports = __webpack_require__(/*! ./src */ \"./node_modules/snekfetch/src/index.js\");\n\n\n//# sourceURL=webpack:///./node_modules/snekfetch/index.js?");
401
402 /***/
403 }),
404
405 /***/
406 "./node_modules/snekfetch/src/browser.js":
407 /*!***********************************************!*\
408 !*** ./node_modules/snekfetch/src/browser.js ***!
409 \***********************************************/
410 /*! no static exports found */
411 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
412 /***/
413 (function (module, exports) {
414
415 eval("function buildRequest(method, url) {\n return {\n method,\n path: url,\n redirect: this.options.followRedirects ? 'follow' : 'manual',\n headers: {},\n setHeader(name, value) {\n this.headers[name.toLowerCase()] = value;\n },\n getHeader(name) {\n return this.headers[name.toLowerCase()];\n },\n };\n}\n\nfunction finalizeRequest() {\n this._finalizeRequest();\n if (this.data)\n this.request.body = this.data;\n return window.fetch(this.request.path, this.request)\n .then((r) => r.text().then((t) => {\n const headers = {};\n for (const [k, v] of r.headers.entries())\n headers[k.toLowerCase()] = v;\n return { response: r, raw: t, headers };\n }));\n}\n\nmodule.exports = {\n buildRequest, finalizeRequest,\n shouldSendRaw: () => false,\n METHODS: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'PATCH'],\n STATUS_CODES: {},\n Extension: Object,\n FormData: window.FormData,\n};\n\n\n//# sourceURL=webpack:///./node_modules/snekfetch/src/browser.js?");
416
417 /***/
418 }),
419
420 /***/
421 "./node_modules/snekfetch/src/index.js":
422 /*!*********************************************!*\
423 !*** ./node_modules/snekfetch/src/index.js ***!
424 \*********************************************/
425 /*! no static exports found */
426 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
427 /***/
428 (function (module, exports, __webpack_require__) {
429
430 eval("const browser = typeof window !== 'undefined';\nconst querystring = __webpack_require__(/*! querystring */ \"./node_modules/querystring-es3/index.js\");\nconst transport = browser ? __webpack_require__(/*! ./browser */ \"./node_modules/snekfetch/src/browser.js\") : __webpack_require__(/*! ./node */ 0);\n\n/**\n * Snekfetch\n * @extends Stream.Readable\n * @extends Promise\n */\nclass Snekfetch extends transport.Extension {\n /**\n * Options to pass to the Snekfetch constructor\n * @typedef {object} SnekfetchOptions\n * @memberof Snekfetch\n * @property {object} [headers] Headers to initialize the request with\n * @property {object|string|Buffer} [data] Data to initialize the request with\n * @property {string|Object} [query] Query to intialize the request with\n * @property {boolean} [followRedirects=true] If the request should follow redirects\n * @property {object} [qs=querystring] Querystring module to use, any object providing\n * `stringify` and `parse` for querystrings\n * @property {number} [version = 1] The http version to use [1 or 2]\n * @property {external:Agent} [agent] Whether to use an http agent\n */\n\n /**\n * Create a request.\n * Usually you'll want to do `Snekfetch#method(url [, options])` instead of\n * `new Snekfetch(method, url [, options])`\n * @param {string} method HTTP method\n * @param {string} url URL\n * @param {SnekfetchOptions} [opts] Options\n */\n constructor(method, url, opts = {}) {\n super();\n this.options = Object.assign({ version: 1, qs: querystring, followRedirects: true }, opts);\n this.request = transport.buildRequest.call(this, method, url, opts);\n if (opts.headers)\n this.set(opts.headers);\n if (opts.query)\n this.query(opts.query);\n if (opts.data)\n this.send(opts.data);\n }\n\n /**\n * Add a query param to the request\n * @param {string|Object} name Name of query param or object to add to query\n * @param {string} [value] If name is a string value, this will be the value of the query param\n * @returns {Snekfetch} This request\n */\n query(name, value) {\n if (!this.request.query)\n this.request.query = {};\n if (name !== null && typeof name === 'object') {\n for (const [k, v] of Object.entries(name))\n this.query(k, v);\n } else {\n this.request.query[name] = value;\n }\n\n return this;\n }\n\n /**\n * Add a header to the request\n * @param {string|Object} name Name of query param or object to add to headers\n * @param {string} [value] If name is a string value, this will be the value of the header\n * @returns {Snekfetch} This request\n */\n set(name, value) {\n if (name !== null && typeof name === 'object') {\n for (const key of Object.keys(name))\n this.set(key, name[key]);\n } else {\n this.request.setHeader(name, value);\n }\n\n return this;\n }\n\n /**\n * Attach a form data object\n * @param {string} name Name of the form attachment\n * @param {string|Object|Buffer} data Data for the attachment\n * @param {string} [filename] Optional filename if form attachment name needs to be overridden\n * @returns {Snekfetch} This request\n */\n attach(...args) {\n const form = this.data instanceof transport.FormData ? this.data : this.data = new transport.FormData();\n if (typeof args[0] === 'object') {\n for (const [k, v] of Object.entries(args[0]))\n this.attach(k, v);\n } else {\n form.append(...args);\n }\n\n return this;\n }\n\n /**\n * Send data with the request\n * @param {string|Buffer|Object} data Data to send\n * @returns {Snekfetch} This request\n */\n send(data) {\n if (data instanceof transport.FormData || transport.shouldSendRaw(data)) {\n this.data = data;\n } else if (data !== null && typeof data === 'object') {\n const header = this.request.getHeader('content-type');\n let serialize;\n if (header) {\n if (header.includes('json'))\n serialize = JSON.stringify;\n else if (header.includes('urlencoded'))\n serialize = this.options.qs.stringify;\n } else {\n this.set('Content-Type', 'application/json');\n serialize = JSON.stringify;\n }\n this.data = serialize(data);\n } else {\n this.data = data;\n }\n return this;\n }\n\n then(resolver, rejector) {\n if (this._response)\n return this._response.then(resolver, rejector);\n // eslint-disable-next-line no-return-assign\n return this._response = transport.finalizeRequest.call(this)\n .then(({ response, raw, redirect, headers }) => {\n if (redirect) {\n let method = this.request.method;\n if ([301, 302].includes(response.statusCode)) {\n if (method !== 'HEAD')\n method = 'GET';\n this.data = null;\n } else if (response.statusCode === 303) {\n method = 'GET';\n }\n\n const redirectHeaders = this.request.getHeaders();\n delete redirectHeaders.host;\n return new Snekfetch(method, redirect, {\n data: this.data,\n headers: redirectHeaders,\n version: this.options.version,\n });\n }\n\n const statusCode = response.statusCode || response.status;\n // forgive me :(\n const self = this; // eslint-disable-line consistent-this\n /**\n * Response from Snekfetch\n * @typedef {Object} SnekfetchResponse\n * @memberof Snekfetch\n * @prop {HTTP.Request} request\n * @prop {?string|object|Buffer} body Processed response body\n * @prop {string} text Raw response body\n * @prop {boolean} ok If the response code is >= 200 and < 300\n * @prop {number} status HTTP status code\n * @prop {string} statusText Human readable HTTP status\n */\n const res = {\n request: this.request,\n get body() {\n delete res.body;\n const type = this.headers['content-type'];\n if (type && type.includes('application/json')) {\n try {\n res.body = JSON.parse(res.text);\n } catch (err) {\n res.body = res.text;\n }\n } else if (type && type.includes('application/x-www-form-urlencoded')) {\n res.body = self.options.qs.parse(res.text);\n } else {\n res.body = raw;\n }\n\n return res.body;\n },\n text: raw.toString(),\n ok: statusCode >= 200 && statusCode < 400,\n headers: headers || response.headers,\n status: statusCode,\n statusText: response.statusText || transport.STATUS_CODES[response.statusCode],\n };\n\n if (res.ok) {\n return res;\n } else {\n const err = new Error(`${res.status} ${res.statusText}`.trim());\n Object.assign(err, res);\n return Promise.reject(err);\n }\n })\n .then(resolver, rejector);\n }\n\n catch(rejector) {\n return this.then(null, rejector);\n }\n\n /**\n * End the request\n * @param {Function} [cb] Optional callback to handle the response\n * @returns {Promise} This request\n */\n end(cb) {\n return this.then(\n (res) => cb ? cb(null, res) : res,\n (err) => cb ? cb(err, err.status ? err : null) : Promise.reject(err)\n );\n }\n\n _finalizeRequest() {\n if (!this.request)\n return;\n\n if (this.request.method !== 'HEAD')\n this.set('Accept-Encoding', 'gzip, deflate');\n if (this.data && this.data.getBoundary)\n this.set('Content-Type', `multipart/form-data; boundary=${this.data.getBoundary()}`);\n\n if (this.request.query) {\n const [path, query] = this.request.path.split('?');\n this.request.path = `${path}?${this.options.qs.stringify(this.request.query)}${query ? `&${query}` : ''}`;\n }\n }\n}\n\n/**\n * Create a ((THIS)) request\n * @dynamic this.METHODS\n * @method Snekfetch.((THIS)lowerCase)\n * @param {string} url The url to request\n * @param {Snekfetch.snekfetchOptions} [opts] Options\n * @returns {Snekfetch}\n */\nSnekfetch.METHODS = transport.METHODS.concat('BREW').filter((m) => m !== 'M-SEARCH');\nfor (const method of Snekfetch.METHODS) {\n Snekfetch[method.toLowerCase()] = function runMethod(url, opts) {\n const Constructor = this.prototype instanceof Snekfetch ? this : Snekfetch;\n return new Constructor(method, url, opts);\n };\n}\n\nmodule.exports = Snekfetch;\n\n/**\n * @external Agent\n * @see {@link https://nodejs.org/api/http.html#http_class_http_agent}\n */\n\n\n//# sourceURL=webpack:///./node_modules/snekfetch/src/index.js?");
431
432 /***/
433 }),
434
435 /***/
436 "./node_modules/util/node_modules/inherits/inherits_browser.js":
437 /*!*********************************************************************!*\
438 !*** ./node_modules/util/node_modules/inherits/inherits_browser.js ***!
439 \*********************************************************************/
440 /*! no static exports found */
441 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
442 /***/
443 (function (module, exports) {
444
445 eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/util/node_modules/inherits/inherits_browser.js?");
446
447 /***/
448 }),
449
450 /***/
451 "./node_modules/util/support/isBufferBrowser.js":
452 /*!******************************************************!*\
453 !*** ./node_modules/util/support/isBufferBrowser.js ***!
454 \******************************************************/
455 /*! no static exports found */
456 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
457 /***/
458 (function (module, exports) {
459
460 eval("module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n\n//# sourceURL=webpack:///./node_modules/util/support/isBufferBrowser.js?");
461
462 /***/
463 }),
464
465 /***/
466 "./node_modules/util/util.js":
467 /*!***********************************!*\
468 !*** ./node_modules/util/util.js ***!
469 \***********************************/
470 /*! no static exports found */
471 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
472 /***/
473 (function (module, exports, __webpack_require__) {
474
475 eval("/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = Object({\"__DISCORD_WEBPACK__\":\"true\"}).NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ \"./node_modules/util/support/isBufferBrowser.js\");\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = __webpack_require__(/*! inherits */ \"./node_modules/util/node_modules/inherits/inherits_browser.js\");\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb, null, ret) },\n function(rej) { process.nextTick(callbackifyOnRejected, rej, cb) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/util/util.js?");
476
477 /***/
478 }),
479
480 /***/
481 "./node_modules/webpack/buildin/global.js":
482 /*!***********************************!*\
483 !*** (webpack)/buildin/global.js ***!
484 \***********************************/
485 /*! no static exports found */
486 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
487 /***/
488 (function (module, exports) {
489
490 eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?");
491
492 /***/
493 }),
494
495 /***/
496 "./package.json":
497 /*!**********************!*\
498 !*** ./package.json ***!
499 \**********************/
500 /*! exports provided: name, version, description, main, types, scripts, repository, keywords, author, license, bugs, homepage, runkitExampleFilename, dependencies, peerDependencies, peerDependenciesMeta, devDependencies, engines, browser, default */
501 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
502 /***/
503 (function (module) {
504
505 eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"discord.js\\\",\\\"version\\\":\\\"11.6.3\\\",\\\"description\\\":\\\"A powerful library for interacting with the Discord API\\\",\\\"main\\\":\\\"./src/index\\\",\\\"types\\\":\\\"./typings/index.d.ts\\\",\\\"scripts\\\":{\\\"test\\\":\\\"npm run lint && npm run docs:test\\\",\\\"docs\\\":\\\"docgen --source src --custom docs/index.yml --output docs/docs.json\\\",\\\"docs:test\\\":\\\"docgen --source src --custom docs/index.yml\\\",\\\"lint\\\":\\\"eslint src\\\",\\\"lint:fix\\\":\\\"eslint --fix src\\\",\\\"lint:typings\\\":\\\"tslint typings/index.d.ts typings/discord.js-test.ts\\\",\\\"webpack\\\":\\\"parallel-webpack\\\"},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"git+https://github.com/discordjs/discord.js.git\\\"},\\\"keywords\\\":[\\\"discord\\\",\\\"api\\\",\\\"bot\\\",\\\"client\\\",\\\"node\\\",\\\"discordapp\\\"],\\\"author\\\":\\\"Amish Shah <amishshah.2k@gmail.com>\\\",\\\"license\\\":\\\"Apache-2.0\\\",\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/discordjs/discord.js/issues\\\"},\\\"homepage\\\":\\\"https://github.com/discordjs/discord.js#readme\\\",\\\"runkitExampleFilename\\\":\\\"./docs/examples/ping.js\\\",\\\"dependencies\\\":{\\\"long\\\":\\\"^4.0.0\\\",\\\"prism-media\\\":\\\"^0.0.4\\\",\\\"snekfetch\\\":\\\"^3.6.4\\\",\\\"tweetnacl\\\":\\\"^1.0.0\\\",\\\"ws\\\":\\\"^6.0.0\\\"},\\\"peerDependencies\\\":{\\\"@discordjs/uws\\\":\\\"^10.149.0\\\",\\\"bufferutil\\\":\\\"^4.0.0\\\",\\\"erlpack\\\":\\\"discordapp/erlpack\\\",\\\"libsodium-wrappers\\\":\\\"^0.7.3\\\",\\\"@discordjs/opus\\\":\\\"^0.1.0\\\",\\\"node-opus\\\":\\\"^0.2.7\\\",\\\"opusscript\\\":\\\"^0.0.6\\\",\\\"sodium\\\":\\\"^2.0.3\\\"},\\\"peerDependenciesMeta\\\":{\\\"bufferutil\\\":{\\\"optional\\\":true},\\\"erlpack\\\":{\\\"optional\\\":true},\\\"@discordjs/opus\\\":{\\\"optional\\\":true},\\\"node-opus\\\":{\\\"optional\\\":true},\\\"opusscript\\\":{\\\"optional\\\":true},\\\"sodium\\\":{\\\"optional\\\":true},\\\"libsodium-wrappers\\\":{\\\"optional\\\":true},\\\"uws\\\":{\\\"optional\\\":true}},\\\"devDependencies\\\":{\\\"@types/node\\\":\\\"^9.4.6\\\",\\\"discord.js-docgen\\\":\\\"discordjs/docgen\\\",\\\"eslint\\\":\\\"^5.4.0\\\",\\\"parallel-webpack\\\":\\\"^2.3.0\\\",\\\"tslint\\\":\\\"^3.15.1\\\",\\\"tslint-config-typings\\\":\\\"^0.2.4\\\",\\\"typescript\\\":\\\"^3.0.1\\\",\\\"uglifyjs-webpack-plugin\\\":\\\"^1.3.0\\\",\\\"webpack\\\":\\\"^4.17.0\\\"},\\\"engines\\\":{\\\"node\\\":\\\">=6.0.0\\\"},\\\"browser\\\":{\\\"ws\\\":false,\\\"uws\\\":false,\\\"@discordjs/uws\\\":false,\\\"erlpack\\\":false,\\\"prism-media\\\":false,\\\"opusscript\\\":false,\\\"node-opus\\\":false,\\\"@discordjs/opus\\\":false,\\\"tweetnacl\\\":false,\\\"sodium\\\":false,\\\"src/sharding/Shard.js\\\":false,\\\"src/sharding/ShardClientUtil.js\\\":false,\\\"src/sharding/ShardingManager.js\\\":false,\\\"src/client/voice/dispatcher/StreamDispatcher.js\\\":false,\\\"src/client/voice/opus/BaseOpusEngine.js\\\":false,\\\"src/client/voice/opus/NodeOpusEngine.js\\\":false,\\\"src/client/voice/opus/DiscordJsOpusEngine.js\\\":false,\\\"src/client/voice/opus/OpusEngineList.js\\\":false,\\\"src/client/voice/opus/OpusScriptEngine.js\\\":false,\\\"src/client/voice/pcm/ConverterEngine.js\\\":false,\\\"src/client/voice/pcm/ConverterEngineList.js\\\":false,\\\"src/client/voice/pcm/FfmpegConverterEngine.js\\\":false,\\\"src/client/voice/player/AudioPlayer.js\\\":false,\\\"src/client/voice/receiver/VoiceReadable.js\\\":false,\\\"src/client/voice/receiver/VoiceReceiver.js\\\":false,\\\"src/client/voice/util/Secretbox.js\\\":false,\\\"src/client/voice/util/SecretKey.js\\\":false,\\\"src/client/voice/util/VolumeInterface.js\\\":false,\\\"src/client/voice/ClientVoiceManager.js\\\":false,\\\"src/client/voice/VoiceBroadcast.js\\\":false,\\\"src/client/voice/VoiceConnection.js\\\":false,\\\"src/client/voice/VoiceUDPClient.js\\\":false,\\\"src/client/voice/VoiceWebSocket.js\\\":false}}\");\n\n//# sourceURL=webpack:///./package.json?");
506
507 /***/
508 }),
509
510 /***/
511 "./src/client/Client.js":
512 /*!******************************!*\
513 !*** ./src/client/Client.js ***!
514 \******************************/
515 /*! no static exports found */
516 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
517 /***/
518 (function (module, exports, __webpack_require__) {
519
520 eval("/* WEBPACK VAR INJECTION */(function(process) {const EventEmitter = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\nconst Constants = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\nconst RESTManager = __webpack_require__(/*! ./rest/RESTManager */ \"./src/client/rest/RESTManager.js\");\nconst ClientDataManager = __webpack_require__(/*! ./ClientDataManager */ \"./src/client/ClientDataManager.js\");\nconst ClientManager = __webpack_require__(/*! ./ClientManager */ \"./src/client/ClientManager.js\");\nconst ClientDataResolver = __webpack_require__(/*! ./ClientDataResolver */ \"./src/client/ClientDataResolver.js\");\nconst ClientVoiceManager = __webpack_require__(/*! ./voice/ClientVoiceManager */ 4);\nconst WebSocketManager = __webpack_require__(/*! ./websocket/WebSocketManager */ \"./src/client/websocket/WebSocketManager.js\");\nconst ActionsManager = __webpack_require__(/*! ./actions/ActionsManager */ \"./src/client/actions/ActionsManager.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst Presence = __webpack_require__(/*! ../structures/Presence */ \"./src/structures/Presence.js\").Presence;\nconst ShardClientUtil = __webpack_require__(/*! ../sharding/ShardClientUtil */ 5);\nconst VoiceBroadcast = __webpack_require__(/*! ./voice/VoiceBroadcast */ 6);\n\n/**\n * The main hub for interacting with the Discord API, and the starting point for any bot.\n * @extends {EventEmitter}\n */\nclass Client extends EventEmitter {\n /**\n * @param {ClientOptions} [options] Options for the client\n */\n constructor(options = {}) {\n super();\n\n // Obtain shard details from environment\n if (!options.shardId && 'SHARD_ID' in Object({\"__DISCORD_WEBPACK__\":\"true\"})) options.shardId = Number(Object({\"__DISCORD_WEBPACK__\":\"true\"}).SHARD_ID);\n if (!options.shardCount && 'SHARD_COUNT' in Object({\"__DISCORD_WEBPACK__\":\"true\"})) options.shardCount = Number(Object({\"__DISCORD_WEBPACK__\":\"true\"}).SHARD_COUNT);\n\n /**\n * The options the client was instantiated with\n * @type {ClientOptions}\n */\n this.options = Util.mergeDefault(Constants.DefaultOptions, options);\n this._validateOptions();\n\n /**\n * The REST manager of the client\n * @type {RESTManager}\n * @private\n */\n this.rest = new RESTManager(this);\n\n /**\n * The data manager of the client\n * @type {ClientDataManager}\n * @private\n */\n this.dataManager = new ClientDataManager(this);\n\n /**\n * The manager of the client\n * @type {ClientManager}\n * @private\n */\n this.manager = new ClientManager(this);\n\n /**\n * The WebSocket manager of the client\n * @type {WebSocketManager}\n * @private\n */\n this.ws = new WebSocketManager(this);\n\n /**\n * The data resolver of the client\n * @type {ClientDataResolver}\n * @private\n */\n this.resolver = new ClientDataResolver(this);\n\n /**\n * The action manager of the client\n * @type {ActionsManager}\n * @private\n */\n this.actions = new ActionsManager(this);\n\n /**\n * The voice manager of the client (`null` in browsers)\n * @type {?ClientVoiceManager}\n * @private\n */\n this.voice = !this.browser ? new ClientVoiceManager(this) : null;\n\n /**\n * The shard helpers for the client\n * (only if the process was spawned as a child, such as from a {@link ShardingManager})\n * @type {?ShardClientUtil}\n */\n this.shard = process.send ? ShardClientUtil.singleton(this) : null;\n\n /**\n * All of the {@link User} objects that have been cached at any point, mapped by their IDs\n * @type {Collection<Snowflake, User>}\n */\n this.users = new Collection();\n\n /**\n * All of the guilds the client is currently handling, mapped by their IDs -\n * as long as sharding isn't being used, this will be *every* guild the bot is a member of\n * @type {Collection<Snowflake, Guild>}\n */\n this.guilds = new Collection();\n\n /**\n * All of the {@link Channel}s that the client is currently handling, mapped by their IDs -\n * as long as sharding isn't being used, this will be *every* channel in *every* guild, and all DM channels\n * @type {Collection<Snowflake, Channel>}\n */\n this.channels = new Collection();\n\n /**\n * Presences that have been received for the client user's friends, mapped by user IDs\n * <warn>This is only filled when using a user account.</warn>\n * @type {Collection<Snowflake, Presence>}\n * @deprecated\n */\n this.presences = new Collection();\n\n Object.defineProperty(this, 'token', { writable: true });\n if (!this.token && 'CLIENT_TOKEN' in Object({\"__DISCORD_WEBPACK__\":\"true\"})) {\n /**\n * Authorization token for the logged in user/bot\n * <warn>This should be kept private at all times.</warn>\n * @type {?string}\n */\n this.token = Object({\"__DISCORD_WEBPACK__\":\"true\"}).CLIENT_TOKEN;\n } else {\n this.token = null;\n }\n\n /**\n * User that the client is logged in as\n * @type {?ClientUser}\n */\n this.user = null;\n\n /**\n * Time at which the client was last regarded as being in the `READY` state\n * (each time the client disconnects and successfully reconnects, this will be overwritten)\n * @type {?Date}\n */\n this.readyAt = null;\n\n /**\n * Active voice broadcasts that have been created\n * @type {VoiceBroadcast[]}\n */\n this.broadcasts = [];\n\n /**\n * Previous heartbeat pings of the websocket (most recent first, limited to three elements)\n * @type {number[]}\n */\n this.pings = [];\n\n /**\n * Timeouts set by {@link Client#setTimeout} that are still active\n * @type {Set<Timeout>}\n * @private\n */\n this._timeouts = new Set();\n\n /**\n * Intervals set by {@link Client#setInterval} that are still active\n * @type {Set<Timeout>}\n * @private\n */\n this._intervals = new Set();\n\n if (this.options.messageSweepInterval > 0) {\n this.setInterval(this.sweepMessages.bind(this), this.options.messageSweepInterval * 1000);\n }\n }\n\n /**\n * Timestamp of the latest ping's start time\n * @type {number}\n * @private\n */\n get _pingTimestamp() {\n return this.ws.connection ? this.ws.connection.lastPingTimestamp : 0;\n }\n\n /**\n * Current status of the client's connection to Discord\n * @type {Status}\n * @readonly\n */\n get status() {\n return this.ws.connection ? this.ws.connection.status : Constants.Status.IDLE;\n }\n\n /**\n * How long it has been since the client last entered the `READY` state in milliseconds\n * @type {?number}\n * @readonly\n */\n get uptime() {\n return this.readyAt ? Date.now() - this.readyAt : null;\n }\n\n /**\n * Average heartbeat ping of the websocket, obtained by averaging the {@link Client#pings} property\n * @type {number}\n * @readonly\n */\n get ping() {\n return this.pings.reduce((prev, p) => prev + p, 0) / this.pings.length;\n }\n\n /**\n * All active voice connections that have been established, mapped by guild ID\n * @type {Collection<Snowflake, VoiceConnection>}\n * @readonly\n */\n get voiceConnections() {\n if (this.browser) return new Collection();\n return this.voice.connections;\n }\n\n /**\n * All custom emojis that the client has access to, mapped by their IDs\n * @type {Collection<Snowflake, Emoji>}\n * @readonly\n */\n get emojis() {\n const emojis = new Collection();\n for (const guild of this.guilds.values()) {\n for (const emoji of guild.emojis.values()) emojis.set(emoji.id, emoji);\n }\n return emojis;\n }\n\n /**\n * Timestamp of the time the client was last `READY` at\n * @type {?number}\n * @readonly\n */\n get readyTimestamp() {\n return this.readyAt ? this.readyAt.getTime() : null;\n }\n\n /**\n * Whether the client is in a browser environment\n * @type {boolean}\n * @readonly\n */\n get browser() {\n return typeof window !== 'undefined';\n }\n\n /**\n * Creates a voice broadcast.\n * @returns {VoiceBroadcast}\n */\n createVoiceBroadcast() {\n const broadcast = new VoiceBroadcast(this);\n this.broadcasts.push(broadcast);\n return broadcast;\n }\n\n /**\n * Logs the client in, establishing a websocket connection to Discord.\n * <info>Both bot and regular user accounts are supported, but it is highly recommended to use a bot account whenever\n * possible. User accounts are subject to harsher ratelimits and other restrictions that don't apply to bot accounts.\n * Bot accounts also have access to many features that user accounts cannot utilise. Automating a user account is\n * considered a violation of Discord's ToS.</info>\n * @param {string} token Token of the account to log in with\n * @returns {Promise<string>} Token of the account used\n * @example\n * client.login('my token')\n * .then(console.log)\n * .catch(console.error);\n */\n login(token = this.token) {\n return this.rest.methods.login(token);\n }\n\n /**\n * Logs out, terminates the connection to Discord, and destroys the client.\n * @returns {Promise}\n */\n destroy() {\n for (const t of this._timeouts) clearTimeout(t);\n for (const i of this._intervals) clearInterval(i);\n this._timeouts.clear();\n this._intervals.clear();\n return this.manager.destroy();\n }\n\n /**\n * Requests a sync of guild data with Discord.\n * <info>This can be done automatically every 30 seconds by enabling {@link ClientOptions#sync}.</info>\n * <warn>This is only available when using a user account.</warn>\n * @param {Guild[]|Collection<Snowflake, Guild>} [guilds=this.guilds] An array or collection of guilds to sync\n * @deprecated\n */\n syncGuilds(guilds = this.guilds) {\n if (this.user.bot) return;\n this.ws.send({\n op: 12,\n d: guilds instanceof Collection ? guilds.keyArray() : guilds.map(g => g.id),\n });\n }\n\n /**\n * Obtains a user from Discord, or the user cache if it's already available.\n * <warn>This is only available when using a bot account.</warn>\n * @param {Snowflake} id ID of the user\n * @param {boolean} [cache=true] Whether to cache the new user object if it isn't already\n * @returns {Promise<User>}\n */\n fetchUser(id, cache = true) {\n if (this.users.has(id)) return Promise.resolve(this.users.get(id));\n return this.rest.methods.getUser(id, cache);\n }\n\n /**\n * Obtains an invite from Discord.\n * @param {InviteResolvable} invite Invite code or URL\n * @returns {Promise<Invite>}\n * @example\n * client.fetchInvite('https://discord.gg/bRCvFy9')\n * .then(invite => console.log(`Obtained invite with code: ${invite.code}`))\n * .catch(console.error);\n */\n fetchInvite(invite) {\n const code = this.resolver.resolveInviteCode(invite);\n return this.rest.methods.getInvite(code);\n }\n\n /**\n * Obtains a webhook from Discord.\n * @param {Snowflake} id ID of the webhook\n * @param {string} [token] Token for the webhook\n * @returns {Promise<Webhook>}\n * @example\n * client.fetchWebhook('id', 'token')\n * .then(webhook => console.log(`Obtained webhook with name: ${webhook.name}`))\n * .catch(console.error);\n */\n fetchWebhook(id, token) {\n return this.rest.methods.getWebhook(id, token);\n }\n\n /**\n * Obtains the available voice regions from Discord.\n * @returns {Promise<Collection<string, VoiceRegion>>}\n * @example\n * client.fetchVoiceRegions()\n * .then(regions => console.log(`Available regions are: ${regions.map(region => region.name).join(', ')}`))\n * .catch(console.error);\n */\n fetchVoiceRegions() {\n return this.rest.methods.fetchVoiceRegions();\n }\n\n /**\n * Sweeps all text-based channels' messages and removes the ones older than the max message lifetime.\n * If the message has been edited, the time of the edit is used rather than the time of the original message.\n * @param {number} [lifetime=this.options.messageCacheLifetime] Messages that are older than this (in seconds)\n * will be removed from the caches. The default is based on {@link ClientOptions#messageCacheLifetime}\n * @returns {number} Amount of messages that were removed from the caches,\n * or -1 if the message cache lifetime is unlimited\n */\n sweepMessages(lifetime = this.options.messageCacheLifetime) {\n if (typeof lifetime !== 'number' || isNaN(lifetime)) throw new TypeError('The lifetime must be a number.');\n if (lifetime <= 0) {\n this.emit('debug', 'Didn\\'t sweep messages - lifetime is unlimited');\n return -1;\n }\n\n const lifetimeMs = lifetime * 1000;\n const now = Date.now();\n let channels = 0;\n let messages = 0;\n\n for (const channel of this.channels.values()) {\n if (!channel.messages) continue;\n channels++;\n\n messages += channel.messages.sweep(\n message => now - (message.editedTimestamp || message.createdTimestamp) > lifetimeMs\n );\n }\n\n this.emit('debug', `Swept ${messages} messages older than ${lifetime} seconds in ${channels} text-based channels`);\n return messages;\n }\n\n /**\n * Obtains the OAuth Application of the bot from Discord.\n * <warn>Bots can only fetch their own profile.</warn>\n * @param {Snowflake} [id='@me'] ID of application to fetch\n * @returns {Promise<OAuth2Application>}\n * @example\n * client.fetchApplication()\n * .then(application => console.log(`Obtained application with name: ${application.name}`))\n * .catch(console.error);\n */\n fetchApplication(id = '@me') {\n if (id !== '@me') ((any, ...more) => console.warn(any, more))('fetchApplication: use \"@me\" as an argument', 'DeprecationWarning');\n return this.rest.methods.getApplication(id);\n }\n\n /**\n * Generates a link that can be used to invite the bot to a guild.\n * <warn>This is only available when using a bot account.</warn>\n * @param {PermissionResolvable} [permissions] Permissions to request\n * @returns {Promise<string>}\n * @example\n * client.generateInvite(['SEND_MESSAGES', 'MANAGE_GUILD', 'MENTION_EVERYONE'])\n * .then(link => console.log(`Generated bot invite link: ${link}`))\n * .catch(console.error);\n */\n generateInvite(permissions) {\n permissions = Permissions.resolve(permissions);\n return this.fetchApplication().then(application =>\n `https://discordapp.com/oauth2/authorize?client_id=${application.id}&permissions=${permissions}&scope=bot`\n );\n }\n\n /**\n * Sets a timeout that will be automatically cancelled if the client is destroyed.\n * @param {Function} fn Function to execute\n * @param {number} delay Time to wait before executing (in milliseconds)\n * @param {...*} args Arguments for the function\n * @returns {Timeout}\n */\n setTimeout(fn, delay, ...args) {\n const timeout = setTimeout(() => {\n fn(...args);\n this._timeouts.delete(timeout);\n }, delay);\n this._timeouts.add(timeout);\n return timeout;\n }\n\n /**\n * Clears a timeout.\n * @param {Timeout} timeout Timeout to cancel\n */\n clearTimeout(timeout) {\n clearTimeout(timeout);\n this._timeouts.delete(timeout);\n }\n\n /**\n * Sets an interval that will be automatically cancelled if the client is destroyed.\n * @param {Function} fn Function to execute\n * @param {number} delay Time to wait before executing (in milliseconds)\n * @param {...*} args Arguments for the function\n * @returns {Timeout}\n */\n setInterval(fn, delay, ...args) {\n const interval = setInterval(fn, delay, ...args);\n this._intervals.add(interval);\n return interval;\n }\n\n /**\n * Clears an interval.\n * @param {Timeout} interval Interval to cancel\n */\n clearInterval(interval) {\n clearInterval(interval);\n this._intervals.delete(interval);\n }\n\n /**\n * Adds a ping to {@link Client#pings}.\n * @param {number} startTime Starting time of the ping\n * @private\n */\n _pong(startTime) {\n this.pings.unshift(Date.now() - startTime);\n if (this.pings.length > 3) this.pings.length = 3;\n this.ws.lastHeartbeatAck = true;\n }\n\n /**\n * Adds/updates a friend's presence in {@link Client#presences}.\n * @param {Snowflake} id ID of the user\n * @param {Object} presence Raw presence object from Discord\n * @private\n */\n _setPresence(id, presence) {\n if (this.presences.has(id)) {\n this.presences.get(id).update(presence);\n return;\n }\n this.presences.set(id, new Presence(presence, this));\n }\n\n /**\n * Calls {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval} on a script\n * with the client as `this`.\n * @param {string} script Script to eval\n * @returns {*}\n * @private\n */\n _eval(script) {\n return eval(script);\n }\n\n /**\n * Validates the client options.\n * @param {ClientOptions} [options=this.options] Options to validate\n * @private\n */\n _validateOptions(options = this.options) { // eslint-disable-line complexity\n if (typeof options.shardCount !== 'number' || isNaN(options.shardCount)) {\n throw new TypeError('The shardCount option must be a number.');\n }\n if (typeof options.shardId !== 'number' || isNaN(options.shardId)) {\n throw new TypeError('The shardId option must be a number.');\n }\n if (options.shardCount < 0) throw new RangeError('The shardCount option must be at least 0.');\n if (options.shardId < 0) throw new RangeError('The shardId option must be at least 0.');\n if (options.shardId !== 0 && options.shardId >= options.shardCount) {\n throw new RangeError('The shardId option must be less than shardCount.');\n }\n if (typeof options.messageCacheMaxSize !== 'number' || isNaN(options.messageCacheMaxSize)) {\n throw new TypeError('The messageCacheMaxSize option must be a number.');\n }\n if (typeof options.messageCacheLifetime !== 'number' || isNaN(options.messageCacheLifetime)) {\n throw new TypeError('The messageCacheLifetime option must be a number.');\n }\n if (typeof options.messageSweepInterval !== 'number' || isNaN(options.messageSweepInterval)) {\n throw new TypeError('The messageSweepInterval option must be a number.');\n }\n if (typeof options.fetchAllMembers !== 'boolean') {\n throw new TypeError('The fetchAllMembers option must be a boolean.');\n }\n if (typeof options.disableEveryone !== 'boolean') {\n throw new TypeError('The disableEveryone option must be a boolean.');\n }\n if (typeof options.restWsBridgeTimeout !== 'number' || isNaN(options.restWsBridgeTimeout)) {\n throw new TypeError('The restWsBridgeTimeout option must be a number.');\n }\n if (!(options.disabledEvents instanceof Array)) throw new TypeError('The disabledEvents option must be an Array.');\n if (typeof options.retryLimit !== 'number' || isNaN(options.retryLimit)) {\n throw new TypeError('The retryLimit options must be a number.');\n }\n }\n}\n\nmodule.exports = Client;\n\n/**\n * Emitted for general warnings.\n * @event Client#warn\n * @param {string} info The warning\n */\n\n/**\n * Emitted for general debugging information.\n * @event Client#debug\n * @param {string} info The debug information\n */\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./src/client/Client.js?");
521
522 /***/
523 }),
524
525 /***/
526 "./src/client/ClientDataManager.js":
527 /*!*****************************************!*\
528 !*** ./src/client/ClientDataManager.js ***!
529 \*****************************************/
530 /*! no static exports found */
531 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
532 /***/
533 (function (module, exports, __webpack_require__) {
534
535 eval("const Constants = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\nconst Guild = __webpack_require__(/*! ../structures/Guild */ \"./src/structures/Guild.js\");\nconst User = __webpack_require__(/*! ../structures/User */ \"./src/structures/User.js\");\nconst Emoji = __webpack_require__(/*! ../structures/Emoji */ \"./src/structures/Emoji.js\");\nconst GuildChannel = __webpack_require__(/*! ../structures/GuildChannel */ \"./src/structures/GuildChannel.js\");\nconst TextChannel = __webpack_require__(/*! ../structures/TextChannel */ \"./src/structures/TextChannel.js\");\nconst VoiceChannel = __webpack_require__(/*! ../structures/VoiceChannel */ \"./src/structures/VoiceChannel.js\");\nconst CategoryChannel = __webpack_require__(/*! ../structures/CategoryChannel */ \"./src/structures/CategoryChannel.js\");\nconst NewsChannel = __webpack_require__(/*! ../structures/NewsChannel */ \"./src/structures/NewsChannel.js\");\nconst StoreChannel = __webpack_require__(/*! ../structures/StoreChannel */ \"./src/structures/StoreChannel.js\");\nconst DMChannel = __webpack_require__(/*! ../structures/DMChannel */ \"./src/structures/DMChannel.js\");\nconst GroupDMChannel = __webpack_require__(/*! ../structures/GroupDMChannel */ \"./src/structures/GroupDMChannel.js\");\n\nclass ClientDataManager {\n constructor(client) {\n this.client = client;\n }\n\n get pastReady() {\n return this.client.ws.connection.status === Constants.Status.READY;\n }\n\n newGuild(data) {\n const already = this.client.guilds.has(data.id);\n const guild = new Guild(this.client, data);\n this.client.guilds.set(guild.id, guild);\n if (this.pastReady && !already) {\n /**\n * Emitted whenever the client joins a guild.\n * @event Client#guildCreate\n * @param {Guild} guild The created guild\n */\n if (this.client.options.fetchAllMembers) {\n guild.fetchMembers().then(() => { this.client.emit(Constants.Events.GUILD_CREATE, guild); });\n } else {\n this.client.emit(Constants.Events.GUILD_CREATE, guild);\n }\n }\n\n return guild;\n }\n\n newUser(data, cache = true) {\n if (this.client.users.has(data.id)) return this.client.users.get(data.id);\n const user = new User(this.client, data);\n if (cache) this.client.users.set(user.id, user);\n return user;\n }\n\n newChannel(data, guild) {\n const already = this.client.channels.has(data.id);\n let channel;\n if (data.type === Constants.ChannelTypes.DM) {\n channel = new DMChannel(this.client, data);\n } else if (data.type === Constants.ChannelTypes.GROUP_DM) {\n channel = new GroupDMChannel(this.client, data);\n } else {\n guild = guild || this.client.guilds.get(data.guild_id);\n if (already) {\n channel = this.client.channels.get(data.id);\n } else if (guild) {\n switch (data.type) {\n case Constants.ChannelTypes.TEXT:\n channel = new TextChannel(guild, data);\n break;\n case Constants.ChannelTypes.VOICE:\n channel = new VoiceChannel(guild, data);\n break;\n case Constants.ChannelTypes.CATEGORY:\n channel = new CategoryChannel(guild, data);\n break;\n case Constants.ChannelTypes.NEWS:\n channel = new NewsChannel(guild, data);\n break;\n case Constants.ChannelTypes.STORE:\n channel = new StoreChannel(guild, data);\n break;\n }\n\n guild.channels.set(channel.id, channel);\n }\n }\n\n if (channel && !already) {\n if (this.pastReady) this.client.emit(Constants.Events.CHANNEL_CREATE, channel);\n this.client.channels.set(channel.id, channel);\n return channel;\n } else if (already) {\n return channel;\n }\n\n return null;\n }\n\n newEmoji(data, guild) {\n const already = guild.emojis.has(data.id);\n if (data && !already) {\n let emoji = new Emoji(guild, data);\n this.client.emit(Constants.Events.GUILD_EMOJI_CREATE, emoji);\n guild.emojis.set(emoji.id, emoji);\n return emoji;\n } else if (already) {\n return guild.emojis.get(data.id);\n }\n\n return null;\n }\n\n killEmoji(emoji) {\n if (!(emoji instanceof Emoji && emoji.guild)) return;\n this.client.emit(Constants.Events.GUILD_EMOJI_DELETE, emoji);\n emoji.guild.emojis.delete(emoji.id);\n }\n\n killGuild(guild) {\n const already = this.client.guilds.has(guild.id);\n this.client.guilds.delete(guild.id);\n if (already && this.pastReady) this.client.emit(Constants.Events.GUILD_DELETE, guild);\n }\n\n killUser(user) {\n this.client.users.delete(user.id);\n }\n\n killChannel(channel) {\n this.client.channels.delete(channel.id);\n if (channel instanceof GuildChannel) channel.guild.channels.delete(channel.id);\n }\n\n updateGuild(currentGuild, newData) {\n const oldGuild = Util.cloneObject(currentGuild);\n currentGuild.setup(newData);\n if (this.pastReady) this.client.emit(Constants.Events.GUILD_UPDATE, oldGuild, currentGuild);\n }\n\n updateChannel(currentChannel, newData) {\n currentChannel.setup(newData);\n }\n\n updateEmoji(currentEmoji, newData) {\n const oldEmoji = Util.cloneObject(currentEmoji);\n currentEmoji.setup(newData);\n this.client.emit(Constants.Events.GUILD_EMOJI_UPDATE, oldEmoji, currentEmoji);\n return currentEmoji;\n }\n}\n\nmodule.exports = ClientDataManager;\n\n\n//# sourceURL=webpack:///./src/client/ClientDataManager.js?");
536
537 /***/
538 }),
539
540 /***/
541 "./src/client/ClientDataResolver.js":
542 /*!******************************************!*\
543 !*** ./src/client/ClientDataResolver.js ***!
544 \******************************************/
545 /*! no static exports found */
546 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
547 /***/
548 (function (module, exports, __webpack_require__) {
549
550 eval("/* WEBPACK VAR INJECTION */(function(Buffer) {const path = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\nconst fs = __webpack_require__(/*! fs */ \"./node_modules/node-libs-browser/mock/empty.js\");\nconst snekfetch = __webpack_require__(/*! snekfetch */ \"./node_modules/snekfetch/esm.mjs\");\n\nconst Constants = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst convertToBuffer = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\").convertToBuffer;\nconst User = __webpack_require__(/*! ../structures/User */ \"./src/structures/User.js\");\nconst Message = __webpack_require__(/*! ../structures/Message */ \"./src/structures/Message.js\");\nconst Guild = __webpack_require__(/*! ../structures/Guild */ \"./src/structures/Guild.js\");\nconst Channel = __webpack_require__(/*! ../structures/Channel */ \"./src/structures/Channel.js\");\nconst GuildMember = __webpack_require__(/*! ../structures/GuildMember */ \"./src/structures/GuildMember.js\");\nconst Emoji = __webpack_require__(/*! ../structures/Emoji */ \"./src/structures/Emoji.js\");\nconst ReactionEmoji = __webpack_require__(/*! ../structures/ReactionEmoji */ \"./src/structures/ReactionEmoji.js\");\nconst Role = __webpack_require__(/*! ../structures/Role */ \"./src/structures/Role.js\");\n\n/**\n * The DataResolver identifies different objects and tries to resolve a specific piece of information from them, e.g.\n * extracting a User from a Message object.\n * @private\n */\nclass ClientDataResolver {\n /**\n * @param {Client} client The client the resolver is for\n */\n constructor(client) {\n this.client = client;\n }\n\n /**\n * Data that resolves to give a User object. This can be:\n * * A User object\n * * A Snowflake\n * * A Message object (resolves to the message author)\n * * A Guild object (owner of the guild)\n * * A GuildMember object\n * @typedef {User|Snowflake|Message|Guild|GuildMember} UserResolvable\n */\n\n /**\n * Resolves a UserResolvable to a User object.\n * @param {UserResolvable} user The UserResolvable to identify\n * @returns {?User}\n */\n resolveUser(user) {\n if (user instanceof User) return user;\n if (typeof user === 'string') return this.client.users.get(user) || null;\n if (user instanceof GuildMember) return user.user;\n if (user instanceof Message) return user.author;\n if (user instanceof Guild) return this.resolveUser(user.ownerID);\n return null;\n }\n\n /**\n * Resolves a UserResolvable to a user ID string.\n * @param {UserResolvable} user The UserResolvable to identify\n * @returns {?Snowflake}\n */\n resolveUserID(user) {\n if (user instanceof User || user instanceof GuildMember) return user.id;\n if (typeof user === 'string') return user || null;\n if (user instanceof Message) return user.author.id;\n if (user instanceof Guild) return user.ownerID;\n return null;\n }\n\n /**\n * Data that resolves to give a Guild object. This can be:\n * * A Guild object\n * * A Snowflake\n * @typedef {Guild|Snowflake} GuildResolvable\n */\n\n /**\n * Resolves a GuildResolvable to a Guild object.\n * @param {GuildResolvable} guild The GuildResolvable to identify\n * @returns {?Guild}\n */\n resolveGuild(guild) {\n if (guild instanceof Guild) return guild;\n if (typeof guild === 'string') return this.client.guilds.get(guild) || null;\n return null;\n }\n\n /**\n * Data that resolves to give a GuildMember object. This can be:\n * * A GuildMember object\n * * A User object\n * @typedef {GuildMember|User} GuildMemberResolvable\n */\n\n /**\n * Resolves a GuildMemberResolvable to a GuildMember object.\n * @param {GuildResolvable} guild The guild that the member is part of\n * @param {UserResolvable} user The user that is part of the guild\n * @returns {?GuildMember}\n */\n resolveGuildMember(guild, user) {\n if (user instanceof GuildMember) return user;\n guild = this.resolveGuild(guild);\n user = this.resolveUser(user);\n if (!guild || !user) return null;\n return guild.members.get(user.id) || null;\n }\n\n /**\n * Data that can be resolved to a Role object. This can be:\n * * A Role\n * * A Snowflake\n * @typedef {Role|Snowflake} RoleResolvable\n */\n\n /**\n * Resolves a RoleResolvable to a Role object.\n * @param {GuildResolvable} guild The guild that this role is part of\n * @param {RoleResolvable} role The role resolvable to resolve\n * @returns {?Role}\n */\n resolveRole(guild, role) {\n if (role instanceof Role) return role;\n guild = this.resolveGuild(guild);\n if (!guild) return null;\n if (typeof role === 'string') return guild.roles.get(role);\n return null;\n }\n\n /**\n * Data that can be resolved to give a Channel object. This can be:\n * * A Channel object\n * * A Message object (the channel the message was sent in)\n * * A Guild object (the #general channel)\n * * A Snowflake\n * @typedef {Channel|Guild|Message|Snowflake} ChannelResolvable\n */\n\n /**\n * Resolves a ChannelResolvable to a Channel object.\n * @param {ChannelResolvable} channel The channel resolvable to resolve\n * @returns {?Channel}\n */\n resolveChannel(channel) {\n if (channel instanceof Channel) return channel;\n if (typeof channel === 'string') return this.client.channels.get(channel) || null;\n if (channel instanceof Message) return channel.channel;\n if (channel instanceof Guild) return channel.channels.get(channel.id) || null;\n return null;\n }\n\n /**\n * Resolves a ChannelResolvable to a channel ID.\n * @param {ChannelResolvable} channel The channel resolvable to resolve\n * @returns {?Snowflake}\n */\n resolveChannelID(channel) {\n if (channel instanceof Channel) return channel.id;\n if (typeof channel === 'string') return channel;\n if (channel instanceof Message) return channel.channel.id;\n if (channel instanceof Guild) return channel.defaultChannel.id;\n return null;\n }\n\n /**\n * Data that can be resolved to give an invite code. This can be:\n * * An invite code\n * * An invite URL\n * @typedef {string} InviteResolvable\n */\n\n /**\n * Resolves InviteResolvable to an invite code.\n * @param {InviteResolvable} data The invite resolvable to resolve\n * @returns {string}\n */\n resolveInviteCode(data) {\n const inviteRegex = /discord(?:app\\.com\\/invite|\\.gg(?:\\/invite)?)\\/([\\w-]{2,255})/i;\n const match = inviteRegex.exec(data);\n if (match && match[1]) return match[1];\n return data;\n }\n\n /**\n * Data that can be resolved to give a string. This can be:\n * * A string\n * * An array (joined with a new line delimiter to give a string)\n * * Any value\n * @typedef {string|Array|*} StringResolvable\n */\n\n /**\n * Resolves a StringResolvable to a string.\n * @param {StringResolvable} data The string resolvable to resolve\n * @returns {string}\n */\n resolveString(data) {\n if (typeof data === 'string') return data;\n if (data instanceof Array) return data.join('\\n');\n return String(data);\n }\n\n\n /**\n * Resolves a Base64Resolvable, a string, or a BufferResolvable to a Base 64 image.\n * @param {BufferResolvable|Base64Resolvable} image The image to be resolved\n * @returns {Promise<?string>}\n */\n resolveImage(image) {\n if (!image) return Promise.resolve(null);\n if (typeof image === 'string' && image.startsWith('data:')) {\n return Promise.resolve(image);\n }\n return this.resolveFile(image).then(this.resolveBase64);\n }\n\n /**\n * Data that resolves to give a Base64 string, typically for image uploading. This can be:\n * * A Buffer\n * * A base64 string\n * @typedef {Buffer|string} Base64Resolvable\n */\n\n /**\n * Resolves a Base64Resolvable to a Base 64 image.\n * @param {Base64Resolvable} data The base 64 resolvable you want to resolve\n * @returns {?string}\n */\n resolveBase64(data) {\n if (data instanceof Buffer) return `data:image/jpg;base64,${data.toString('base64')}`;\n return data;\n }\n\n /**\n * Data that can be resolved to give a Buffer. This can be:\n * * A Buffer\n * * The path to a local file\n * * A URL\n * * A Stream\n * @typedef {string|Buffer} BufferResolvable\n */\n\n /**\n * @external Stream\n * @see {@link https://nodejs.org/api/stream.html}\n */\n\n /**\n * Resolves a BufferResolvable to a Buffer.\n * @param {BufferResolvable|Stream} resource The buffer or stream resolvable to resolve\n * @returns {Promise<Buffer>}\n */\n resolveFile(resource) {\n if (resource instanceof Buffer) return Promise.resolve(resource);\n if (this.client.browser && resource instanceof ArrayBuffer) return Promise.resolve(convertToBuffer(resource));\n\n if (typeof resource === 'string') {\n if (/^https?:\\/\\//.test(resource)) {\n return snekfetch.get(resource).then(res => res.body instanceof Buffer ? res.body : Buffer.from(res.text));\n }\n return new Promise((resolve, reject) => {\n const file = path.resolve(resource);\n fs.stat(file, (err, stats) => {\n if (err) return reject(err);\n if (!stats || !stats.isFile()) return reject(new Error(`The file could not be found: ${file}`));\n fs.readFile(file, (err2, data) => {\n if (err2) reject(err2);\n else resolve(data);\n });\n return null;\n });\n });\n } else if (resource && resource.pipe && typeof resource.pipe === 'function') {\n return new Promise((resolve, reject) => {\n const buffers = [];\n resource.once('error', reject);\n resource.on('data', data => buffers.push(data));\n resource.once('end', () => resolve(Buffer.concat(buffers)));\n });\n }\n\n return Promise.reject(new TypeError('The resource must be a string or Buffer.'));\n }\n\n /**\n * Data that can be resolved to give an emoji identifier. This can be:\n * * The unicode representation of an emoji\n * * A custom emoji ID\n * * An Emoji object\n * * A ReactionEmoji object\n * @typedef {string|Emoji|ReactionEmoji} EmojiIdentifierResolvable\n */\n\n /**\n * Resolves an EmojiResolvable to an emoji identifier.\n * @param {EmojiIdentifierResolvable} emoji The emoji resolvable to resolve\n * @returns {?string}\n */\n resolveEmojiIdentifier(emoji) {\n if (emoji instanceof Emoji || emoji instanceof ReactionEmoji) return emoji.identifier;\n if (typeof emoji === 'string') {\n if (this.client.emojis.has(emoji)) return this.client.emojis.get(emoji).identifier;\n else if (!emoji.includes('%')) return encodeURIComponent(emoji);\n else return emoji;\n }\n return null;\n }\n\n /**\n * Can be a Hex Literal, Hex String, Number, RGB Array, or one of the following\n * ```\n * [\n * 'DEFAULT',\n * 'WHITE',\n * 'AQUA',\n * 'GREEN',\n * 'BLUE',\n * 'PURPLE',\n * 'LUMINOUS_VIVID_PINK',\n * 'GOLD',\n * 'ORANGE',\n * 'RED',\n * 'GREY',\n * 'DARKER_GREY',\n * 'NAVY',\n * 'DARK_AQUA',\n * 'DARK_GREEN',\n * 'DARK_BLUE',\n * 'DARK_PURPLE',\n * 'DARK_VIVID_PINK',\n * 'DARK_GOLD',\n * 'DARK_ORANGE',\n * 'DARK_RED',\n * 'DARK_GREY',\n * 'LIGHT_GREY',\n * 'DARK_NAVY',\n * 'RANDOM',\n * ]\n * ```\n * or something like\n * ```\n * [255, 0, 255]\n * ```\n * for purple\n * @typedef {string|number|Array} ColorResolvable\n */\n\n /**\n * Resolves a ColorResolvable into a color number.\n * @param {ColorResolvable} color Color to resolve\n * @returns {number} A color\n */\n static resolveColor(color) {\n if (typeof color === 'string') {\n if (color === 'RANDOM') return Math.floor(Math.random() * (0xFFFFFF + 1));\n if (color === 'DEFAULT') return 0;\n color = Constants.Colors[color] || parseInt(color.replace('#', ''), 16);\n } else if (color instanceof Array) {\n color = (color[0] << 16) + (color[1] << 8) + color[2];\n }\n\n if (color < 0 || color > 0xFFFFFF) {\n throw new RangeError('Color must be within the range 0 - 16777215 (0xFFFFFF).');\n } else if (color && isNaN(color)) {\n throw new TypeError('Unable to convert color to a number.');\n }\n\n return color;\n }\n\n /**\n * @param {ColorResolvable} color Color to resolve\n * @returns {number} A color\n */\n resolveColor(color) {\n return this.constructor.resolveColor(color);\n }\n}\n\nmodule.exports = ClientDataResolver;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/buffer/index.js */ \"./node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./src/client/ClientDataResolver.js?");
551
552 /***/
553 }),
554
555 /***/
556 "./src/client/ClientManager.js":
557 /*!*************************************!*\
558 !*** ./src/client/ClientManager.js ***!
559 \*************************************/
560 /*! no static exports found */
561 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
562 /***/
563 (function (module, exports, __webpack_require__) {
564
565 eval("const Constants = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst WebSocketConnection = __webpack_require__(/*! ./websocket/WebSocketConnection */ \"./src/client/websocket/WebSocketConnection.js\");\n\n/**\n * Manages the state and background tasks of the client.\n * @private\n */\nclass ClientManager {\n constructor(client) {\n /**\n * The client that instantiated this Manager\n * @type {Client}\n */\n this.client = client;\n\n /**\n * The heartbeat interval\n * @type {?number}\n */\n this.heartbeatInterval = null;\n }\n\n /**\n * The status of the client\n * @type {number}\n */\n get status() {\n return this.connection ? this.connection.status : Constants.Status.IDLE;\n }\n\n /**\n * Connects the client to the WebSocket.\n * @param {string} token The authorization token\n * @param {Function} resolve Function to run when connection is successful\n * @param {Function} reject Function to run when connection fails\n */\n connectToWebSocket(token, resolve, reject) {\n this.client.emit(Constants.Events.DEBUG, `Authenticated using token ${token}`);\n this.client.token = token;\n const timeout = this.client.setTimeout(() => reject(new Error(Constants.Errors.TOOK_TOO_LONG)), 1000 * 300);\n this.client.rest.methods.getGateway().then(res => {\n const protocolVersion = Constants.DefaultOptions.ws.version;\n const gateway = `${res.url}/?v=${protocolVersion}&encoding=${WebSocketConnection.ENCODING}`;\n this.client.emit(Constants.Events.DEBUG, `Using gateway ${gateway}`);\n this.client.ws.connect(gateway);\n this.client.ws.connection.once('error', reject);\n this.client.ws.connection.once('close', event => {\n if (event.code === 4004) reject(new Error(Constants.Errors.BAD_LOGIN));\n if (event.code === 4010) reject(new Error(Constants.Errors.INVALID_SHARD));\n if (event.code === 4011) reject(new Error(Constants.Errors.SHARDING_REQUIRED));\n });\n this.client.once(Constants.Events.READY, () => {\n resolve(token);\n this.client.clearTimeout(timeout);\n });\n }, reject);\n }\n\n destroy() {\n this.client.ws.destroy();\n this.client.rest.destroy();\n if (!this.client.user) return Promise.resolve();\n if (this.client.user.bot) {\n this.client.token = null;\n return Promise.resolve();\n } else {\n return this.client.rest.methods.logout().then(() => {\n this.client.token = null;\n });\n }\n }\n}\n\nmodule.exports = ClientManager;\n\n\n//# sourceURL=webpack:///./src/client/ClientManager.js?");
566
567 /***/
568 }),
569
570 /***/
571 "./src/client/WebhookClient.js":
572 /*!*************************************!*\
573 !*** ./src/client/WebhookClient.js ***!
574 \*************************************/
575 /*! no static exports found */
576 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
577 /***/
578 (function (module, exports, __webpack_require__) {
579
580 eval("const Webhook = __webpack_require__(/*! ../structures/Webhook */ \"./src/structures/Webhook.js\");\nconst RESTManager = __webpack_require__(/*! ./rest/RESTManager */ \"./src/client/rest/RESTManager.js\");\nconst ClientDataResolver = __webpack_require__(/*! ./ClientDataResolver */ \"./src/client/ClientDataResolver.js\");\nconst Constants = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * The webhook client.\n * @extends {Webhook}\n */\nclass WebhookClient extends Webhook {\n /**\n * @param {Snowflake} id ID of the webhook\n * @param {string} token Token of the webhook\n * @param {ClientOptions} [options] Options for the client\n * @example\n * // Create a new webhook and send a message\n * const hook = new Discord.WebhookClient('1234', 'abcdef');\n * hook.sendMessage('This will send a message').catch(console.error);\n */\n constructor(id, token, options) {\n super(null, id, token);\n\n /**\n * The options the client was instantiated with\n * @type {ClientOptions}\n */\n this.options = Util.mergeDefault(Constants.DefaultOptions, options);\n\n /**\n * The REST manager of the client\n * @type {RESTManager}\n * @private\n */\n this.rest = new RESTManager(this);\n\n /**\n * The data resolver of the client\n * @type {ClientDataResolver}\n * @private\n */\n this.resolver = new ClientDataResolver(this);\n\n /**\n * Timeouts set by {@link WebhookClient#setTimeout} that are still active\n * @type {Set<Timeout>}\n * @private\n */\n this._timeouts = new Set();\n\n /**\n * Intervals set by {@link WebhookClient#setInterval} that are still active\n * @type {Set<Timeout>}\n * @private\n */\n this._intervals = new Set();\n }\n\n /**\n * Sets a timeout that will be automatically cancelled if the client is destroyed.\n * @param {Function} fn Function to execute\n * @param {number} delay Time to wait before executing (in milliseconds)\n * @param {...*} args Arguments for the function\n * @returns {Timeout}\n */\n setTimeout(fn, delay, ...args) {\n const timeout = setTimeout(() => {\n fn(...args);\n this._timeouts.delete(timeout);\n }, delay);\n this._timeouts.add(timeout);\n return timeout;\n }\n\n /**\n * Clears a timeout.\n * @param {Timeout} timeout Timeout to cancel\n */\n clearTimeout(timeout) {\n clearTimeout(timeout);\n this._timeouts.delete(timeout);\n }\n\n /**\n * Sets an interval that will be automatically cancelled if the client is destroyed.\n * @param {Function} fn Function to execute\n * @param {number} delay Time to wait before executing (in milliseconds)\n * @param {...*} args Arguments for the function\n * @returns {Timeout}\n */\n setInterval(fn, delay, ...args) {\n const interval = setInterval(fn, delay, ...args);\n this._intervals.add(interval);\n return interval;\n }\n\n /**\n * Clears an interval.\n * @param {Timeout} interval Interval to cancel\n */\n clearInterval(interval) {\n clearInterval(interval);\n this._intervals.delete(interval);\n }\n\n\n /**\n * Destroys the client.\n */\n destroy() {\n for (const t of this._timeouts) clearTimeout(t);\n for (const i of this._intervals) clearInterval(i);\n this._timeouts.clear();\n this._intervals.clear();\n }\n}\n\nmodule.exports = WebhookClient;\n\n\n//# sourceURL=webpack:///./src/client/WebhookClient.js?");
581
582 /***/
583 }),
584
585 /***/
586 "./src/client/actions/Action.js":
587 /*!**************************************!*\
588 !*** ./src/client/actions/Action.js ***!
589 \**************************************/
590 /*! no static exports found */
591 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
592 /***/
593 (function (module, exports) {
594
595 eval("/*\n\nABOUT ACTIONS\n\nActions are similar to WebSocket Packet Handlers, but since introducing\nthe REST API methods, in order to prevent rewriting code to handle data,\n\"actions\" have been introduced. They're basically what Packet Handlers\nused to be but they're strictly for manipulating data and making sure\nthat WebSocket events don't clash with REST methods.\n\n*/\n\nclass GenericAction {\n constructor(client) {\n this.client = client;\n }\n\n handle(data) {\n return data;\n }\n}\n\nmodule.exports = GenericAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/Action.js?");
596
597 /***/
598 }),
599
600 /***/
601 "./src/client/actions/ActionsManager.js":
602 /*!**********************************************!*\
603 !*** ./src/client/actions/ActionsManager.js ***!
604 \**********************************************/
605 /*! no static exports found */
606 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
607 /***/
608 (function (module, exports, __webpack_require__) {
609
610 eval("class ActionsManager {\n constructor(client) {\n this.client = client;\n\n this.register(__webpack_require__(/*! ./MessageCreate */ \"./src/client/actions/MessageCreate.js\"));\n this.register(__webpack_require__(/*! ./MessageDelete */ \"./src/client/actions/MessageDelete.js\"));\n this.register(__webpack_require__(/*! ./MessageDeleteBulk */ \"./src/client/actions/MessageDeleteBulk.js\"));\n this.register(__webpack_require__(/*! ./MessageUpdate */ \"./src/client/actions/MessageUpdate.js\"));\n this.register(__webpack_require__(/*! ./MessageReactionAdd */ \"./src/client/actions/MessageReactionAdd.js\"));\n this.register(__webpack_require__(/*! ./MessageReactionRemove */ \"./src/client/actions/MessageReactionRemove.js\"));\n this.register(__webpack_require__(/*! ./MessageReactionRemoveEmoji */ \"./src/client/actions/MessageReactionRemoveEmoji.js\"));\n this.register(__webpack_require__(/*! ./MessageReactionRemoveAll */ \"./src/client/actions/MessageReactionRemoveAll.js\"));\n this.register(__webpack_require__(/*! ./ChannelCreate */ \"./src/client/actions/ChannelCreate.js\"));\n this.register(__webpack_require__(/*! ./ChannelDelete */ \"./src/client/actions/ChannelDelete.js\"));\n this.register(__webpack_require__(/*! ./ChannelUpdate */ \"./src/client/actions/ChannelUpdate.js\"));\n this.register(__webpack_require__(/*! ./GuildDelete */ \"./src/client/actions/GuildDelete.js\"));\n this.register(__webpack_require__(/*! ./GuildUpdate */ \"./src/client/actions/GuildUpdate.js\"));\n this.register(__webpack_require__(/*! ./GuildMemberGet */ \"./src/client/actions/GuildMemberGet.js\"));\n this.register(__webpack_require__(/*! ./GuildMemberRemove */ \"./src/client/actions/GuildMemberRemove.js\"));\n this.register(__webpack_require__(/*! ./GuildBanRemove */ \"./src/client/actions/GuildBanRemove.js\"));\n this.register(__webpack_require__(/*! ./GuildRoleCreate */ \"./src/client/actions/GuildRoleCreate.js\"));\n this.register(__webpack_require__(/*! ./GuildRoleDelete */ \"./src/client/actions/GuildRoleDelete.js\"));\n this.register(__webpack_require__(/*! ./GuildRoleUpdate */ \"./src/client/actions/GuildRoleUpdate.js\"));\n this.register(__webpack_require__(/*! ./InviteCreate */ \"./src/client/actions/InviteCreate.js\"));\n this.register(__webpack_require__(/*! ./InviteDelete */ \"./src/client/actions/InviteDelete.js\"));\n this.register(__webpack_require__(/*! ./UserGet */ \"./src/client/actions/UserGet.js\"));\n this.register(__webpack_require__(/*! ./UserUpdate */ \"./src/client/actions/UserUpdate.js\"));\n this.register(__webpack_require__(/*! ./UserNoteUpdate */ \"./src/client/actions/UserNoteUpdate.js\"));\n this.register(__webpack_require__(/*! ./GuildSync */ \"./src/client/actions/GuildSync.js\"));\n this.register(__webpack_require__(/*! ./GuildEmojiCreate */ \"./src/client/actions/GuildEmojiCreate.js\"));\n this.register(__webpack_require__(/*! ./GuildEmojiDelete */ \"./src/client/actions/GuildEmojiDelete.js\"));\n this.register(__webpack_require__(/*! ./GuildEmojiUpdate */ \"./src/client/actions/GuildEmojiUpdate.js\"));\n this.register(__webpack_require__(/*! ./GuildEmojisUpdate */ \"./src/client/actions/GuildEmojisUpdate.js\"));\n this.register(__webpack_require__(/*! ./GuildRolesPositionUpdate */ \"./src/client/actions/GuildRolesPositionUpdate.js\"));\n this.register(__webpack_require__(/*! ./GuildChannelsPositionUpdate */ \"./src/client/actions/GuildChannelsPositionUpdate.js\"));\n }\n\n register(Action) {\n this[Action.name.replace(/Action$/, '')] = new Action(this.client);\n }\n}\n\nmodule.exports = ActionsManager;\n\n\n//# sourceURL=webpack:///./src/client/actions/ActionsManager.js?");
611
612 /***/
613 }),
614
615 /***/
616 "./src/client/actions/ChannelCreate.js":
617 /*!*********************************************!*\
618 !*** ./src/client/actions/ChannelCreate.js ***!
619 \*********************************************/
620 /*! no static exports found */
621 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
622 /***/
623 (function (module, exports, __webpack_require__) {
624
625 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass ChannelCreateAction extends Action {\n handle(data) {\n const client = this.client;\n const channel = client.dataManager.newChannel(data);\n return { channel };\n }\n}\n\nmodule.exports = ChannelCreateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/ChannelCreate.js?");
626
627 /***/
628 }),
629
630 /***/
631 "./src/client/actions/ChannelDelete.js":
632 /*!*********************************************!*\
633 !*** ./src/client/actions/ChannelDelete.js ***!
634 \*********************************************/
635 /*! no static exports found */
636 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
637 /***/
638 (function (module, exports, __webpack_require__) {
639
640 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst DMChannel = __webpack_require__(/*! ../../structures/DMChannel */ \"./src/structures/DMChannel.js\");\n\nclass ChannelDeleteAction extends Action {\n constructor(client) {\n super(client);\n this.deleted = new Map();\n }\n\n handle(data) {\n const client = this.client;\n\n let channel = client.channels.get(data.id);\n if (channel) {\n client.dataManager.killChannel(channel);\n this.deleted.set(channel.id, channel);\n this.scheduleForDeletion(channel.id);\n } else {\n channel = this.deleted.get(data.id) || null;\n }\n if (channel) {\n if (channel.messages && !(channel instanceof DMChannel)) {\n for (const message of channel.messages.values()) {\n message.deleted = true;\n }\n }\n channel.deleted = true;\n }\n\n return { channel };\n }\n\n scheduleForDeletion(id) {\n this.client.setTimeout(() => this.deleted.delete(id), this.client.options.restWsBridgeTimeout);\n }\n}\n\nmodule.exports = ChannelDeleteAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/ChannelDelete.js?");
641
642 /***/
643 }),
644
645 /***/
646 "./src/client/actions/ChannelUpdate.js":
647 /*!*********************************************!*\
648 !*** ./src/client/actions/ChannelUpdate.js ***!
649 \*********************************************/
650 /*! no static exports found */
651 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
652 /***/
653 (function (module, exports, __webpack_require__) {
654
655 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst TextChannel = __webpack_require__(/*! ../../structures/TextChannel */ \"./src/structures/TextChannel.js\");\nconst VoiceChannel = __webpack_require__(/*! ../../structures/VoiceChannel */ \"./src/structures/VoiceChannel.js\");\nconst CategoryChannel = __webpack_require__(/*! ../../structures/CategoryChannel */ \"./src/structures/CategoryChannel.js\");\nconst NewsChannel = __webpack_require__(/*! ../../structures/NewsChannel */ \"./src/structures/NewsChannel.js\");\nconst StoreChannel = __webpack_require__(/*! ../../structures/StoreChannel */ \"./src/structures/StoreChannel.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\nconst ChannelTypes = Constants.ChannelTypes;\nconst Util = __webpack_require__(/*! ../../util/Util */ \"./src/util/Util.js\");\n\nclass ChannelUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n\n let channel = client.channels.get(data.id);\n if (channel) {\n const oldChannel = Util.cloneObject(channel);\n\n // If the channel is changing types, we need to follow a different process\n if (ChannelTypes[channel.type.toUpperCase()] !== data.type) {\n // Determine which channel class we're changing to\n let channelClass;\n switch (data.type) {\n case ChannelTypes.TEXT:\n channelClass = TextChannel;\n break;\n case ChannelTypes.VOICE:\n channelClass = VoiceChannel;\n break;\n case ChannelTypes.CATEGORY:\n channelClass = CategoryChannel;\n break;\n case ChannelTypes.NEWS:\n channelClass = NewsChannel;\n break;\n case ChannelTypes.STORE:\n channelClass = StoreChannel;\n break;\n }\n\n // Create the new channel instance and copy over cached data\n const newChannel = new channelClass(channel.guild, data);\n if (channel.messages && newChannel.messages) {\n for (const [id, message] of channel.messages) newChannel.messages.set(id, message);\n }\n\n channel = newChannel;\n this.client.channels.set(channel.id, channel);\n } else {\n channel.setup(data);\n }\n\n client.emit(Constants.Events.CHANNEL_UPDATE, oldChannel, channel);\n return {\n old: oldChannel,\n updated: channel,\n };\n }\n\n return {\n old: null,\n updated: null,\n };\n }\n}\n\n/**\n * Emitted whenever a channel is updated - e.g. name change, topic change.\n * @event Client#channelUpdate\n * @param {Channel} oldChannel The channel before the update\n * @param {Channel} newChannel The channel after the update\n */\n\nmodule.exports = ChannelUpdateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/ChannelUpdate.js?");
656
657 /***/
658 }),
659
660 /***/
661 "./src/client/actions/GuildBanRemove.js":
662 /*!**********************************************!*\
663 !*** ./src/client/actions/GuildBanRemove.js ***!
664 \**********************************************/
665 /*! no static exports found */
666 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
667 /***/
668 (function (module, exports, __webpack_require__) {
669
670 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass GuildBanRemove extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.get(data.guild_id);\n const user = client.dataManager.newUser(data.user);\n if (guild && user) client.emit(Constants.Events.GUILD_BAN_REMOVE, guild, user);\n }\n}\n\nmodule.exports = GuildBanRemove;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildBanRemove.js?");
671
672 /***/
673 }),
674
675 /***/
676 "./src/client/actions/GuildChannelsPositionUpdate.js":
677 /*!***********************************************************!*\
678 !*** ./src/client/actions/GuildChannelsPositionUpdate.js ***!
679 \***********************************************************/
680 /*! no static exports found */
681 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
682 /***/
683 (function (module, exports, __webpack_require__) {
684
685 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass GuildChannelsPositionUpdate extends Action {\n handle(data) {\n const client = this.client;\n\n const guild = client.guilds.get(data.guild_id);\n if (guild) {\n for (const partialChannel of data.channels) {\n const channel = guild.channels.get(partialChannel.id);\n if (channel) channel.position = partialChannel.position;\n }\n }\n\n return { guild };\n }\n}\n\nmodule.exports = GuildChannelsPositionUpdate;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildChannelsPositionUpdate.js?");
686
687 /***/
688 }),
689
690 /***/
691 "./src/client/actions/GuildDelete.js":
692 /*!*******************************************!*\
693 !*** ./src/client/actions/GuildDelete.js ***!
694 \*******************************************/
695 /*! no static exports found */
696 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
697 /***/
698 (function (module, exports, __webpack_require__) {
699
700 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass GuildDeleteAction extends Action {\n constructor(client) {\n super(client);\n this.deleted = new Map();\n }\n\n handle(data) {\n const client = this.client;\n\n let guild = client.guilds.get(data.id);\n if (guild) {\n for (const channel of guild.channels.values()) {\n if (channel.type === 'text') channel.stopTyping(true);\n }\n\n if (guild.available && data.unavailable) {\n // Guild is unavailable\n guild.available = false;\n client.emit(Constants.Events.GUILD_UNAVAILABLE, guild);\n\n // Stops the GuildDelete packet thinking a guild was actually deleted,\n // handles emitting of event itself\n return {\n guild: null,\n };\n }\n\n for (const channel of guild.channels.values()) this.client.channels.delete(channel.id);\n if (guild.voiceConnection) guild.voiceConnection.disconnect();\n\n // Delete guild\n client.guilds.delete(guild.id);\n this.deleted.set(guild.id, guild);\n this.scheduleForDeletion(guild.id);\n } else {\n guild = this.deleted.get(data.id) || null;\n }\n if (guild) guild.deleted = true;\n\n return { guild };\n }\n\n scheduleForDeletion(id) {\n this.client.setTimeout(() => this.deleted.delete(id), this.client.options.restWsBridgeTimeout);\n }\n}\n\n/**\n * Emitted whenever a guild becomes unavailable, likely due to a server outage.\n * @event Client#guildUnavailable\n * @param {Guild} guild The guild that has become unavailable\n */\n\nmodule.exports = GuildDeleteAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildDelete.js?");
701
702 /***/
703 }),
704
705 /***/
706 "./src/client/actions/GuildEmojiCreate.js":
707 /*!************************************************!*\
708 !*** ./src/client/actions/GuildEmojiCreate.js ***!
709 \************************************************/
710 /*! no static exports found */
711 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
712 /***/
713 (function (module, exports, __webpack_require__) {
714
715 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass GuildEmojiCreateAction extends Action {\n handle(guild, createdEmoji) {\n const client = this.client;\n const emoji = client.dataManager.newEmoji(createdEmoji, guild);\n return { emoji };\n }\n}\n\n/**\n * Emitted whenever a custom emoji is created in a guild.\n * @event Client#emojiCreate\n * @param {Emoji} emoji The emoji that was created\n */\n\nmodule.exports = GuildEmojiCreateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildEmojiCreate.js?");
716
717 /***/
718 }),
719
720 /***/
721 "./src/client/actions/GuildEmojiDelete.js":
722 /*!************************************************!*\
723 !*** ./src/client/actions/GuildEmojiDelete.js ***!
724 \************************************************/
725 /*! no static exports found */
726 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
727 /***/
728 (function (module, exports, __webpack_require__) {
729
730 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass GuildEmojiDeleteAction extends Action {\n handle(emoji) {\n const client = this.client;\n client.dataManager.killEmoji(emoji);\n emoji.deleted = true;\n return { emoji };\n }\n}\n\n/**\n * Emitted whenever a custom guild emoji is deleted.\n * @event Client#emojiDelete\n * @param {Emoji} emoji The emoji that was deleted\n */\n\nmodule.exports = GuildEmojiDeleteAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildEmojiDelete.js?");
731
732 /***/
733 }),
734
735 /***/
736 "./src/client/actions/GuildEmojiUpdate.js":
737 /*!************************************************!*\
738 !*** ./src/client/actions/GuildEmojiUpdate.js ***!
739 \************************************************/
740 /*! no static exports found */
741 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
742 /***/
743 (function (module, exports, __webpack_require__) {
744
745 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass GuildEmojiUpdateAction extends Action {\n handle(oldEmoji, newEmoji) {\n const emoji = this.client.dataManager.updateEmoji(oldEmoji, newEmoji);\n return { emoji };\n }\n}\n\n/**\n * Emitted whenever a custom guild emoji is updated.\n * @event Client#emojiUpdate\n * @param {Emoji} oldEmoji The old emoji\n * @param {Emoji} newEmoji The new emoji\n */\n\nmodule.exports = GuildEmojiUpdateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildEmojiUpdate.js?");
746
747 /***/
748 }),
749
750 /***/
751 "./src/client/actions/GuildEmojisUpdate.js":
752 /*!*************************************************!*\
753 !*** ./src/client/actions/GuildEmojisUpdate.js ***!
754 \*************************************************/
755 /*! no static exports found */
756 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
757 /***/
758 (function (module, exports, __webpack_require__) {
759
760 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nfunction mappify(iterable) {\n const map = new Map();\n for (const x of iterable) map.set(...x);\n return map;\n}\n\nclass GuildEmojisUpdateAction extends Action {\n handle(data) {\n const guild = this.client.guilds.get(data.guild_id);\n if (!guild || !guild.emojis) return;\n\n const deletions = mappify(guild.emojis.entries());\n\n for (const emoji of data.emojis) {\n // Determine type of emoji event\n const cachedEmoji = guild.emojis.get(emoji.id);\n if (cachedEmoji) {\n deletions.delete(emoji.id);\n if (!cachedEmoji.equals(emoji, true)) {\n // Emoji updated\n this.client.actions.GuildEmojiUpdate.handle(cachedEmoji, emoji);\n }\n } else {\n // Emoji added\n this.client.actions.GuildEmojiCreate.handle(guild, emoji);\n }\n }\n\n for (const emoji of deletions.values()) {\n // Emoji deleted\n this.client.actions.GuildEmojiDelete.handle(emoji);\n }\n }\n}\n\nmodule.exports = GuildEmojisUpdateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildEmojisUpdate.js?");
761
762 /***/
763 }),
764
765 /***/
766 "./src/client/actions/GuildMemberGet.js":
767 /*!**********************************************!*\
768 !*** ./src/client/actions/GuildMemberGet.js ***!
769 \**********************************************/
770 /*! no static exports found */
771 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
772 /***/
773 (function (module, exports, __webpack_require__) {
774
775 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass GuildMemberGetAction extends Action {\n handle(guild, data) {\n const member = guild._addMember(data, false);\n return { member };\n }\n}\n\nmodule.exports = GuildMemberGetAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildMemberGet.js?");
776
777 /***/
778 }),
779
780 /***/
781 "./src/client/actions/GuildMemberRemove.js":
782 /*!*************************************************!*\
783 !*** ./src/client/actions/GuildMemberRemove.js ***!
784 \*************************************************/
785 /*! no static exports found */
786 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
787 /***/
788 (function (module, exports, __webpack_require__) {
789
790 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass GuildMemberRemoveAction extends Action {\n constructor(client) {\n super(client);\n this.deleted = new Map();\n }\n\n handle(data) {\n const client = this.client;\n const guild = client.guilds.get(data.guild_id);\n let member = null;\n if (guild) {\n member = guild.members.get(data.user.id);\n guild.memberCount--;\n if (member) {\n guild._removeMember(member);\n this.deleted.set(guild.id + data.user.id, member);\n if (client.status === Constants.Status.READY) client.emit(Constants.Events.GUILD_MEMBER_REMOVE, member);\n this.scheduleForDeletion(guild.id, data.user.id);\n } else {\n member = this.deleted.get(guild.id + data.user.id) || null;\n }\n if (member) member.deleted = true;\n }\n return { guild, member };\n }\n\n scheduleForDeletion(guildID, userID) {\n this.client.setTimeout(() => this.deleted.delete(guildID + userID), this.client.options.restWsBridgeTimeout);\n }\n}\n\n/**\n * Emitted whenever a member leaves a guild, or is kicked.\n * @event Client#guildMemberRemove\n * @param {GuildMember} member The member that has left/been kicked from the guild\n */\n\nmodule.exports = GuildMemberRemoveAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildMemberRemove.js?");
791
792 /***/
793 }),
794
795 /***/
796 "./src/client/actions/GuildRoleCreate.js":
797 /*!***********************************************!*\
798 !*** ./src/client/actions/GuildRoleCreate.js ***!
799 \***********************************************/
800 /*! no static exports found */
801 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
802 /***/
803 (function (module, exports, __webpack_require__) {
804
805 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\nconst Role = __webpack_require__(/*! ../../structures/Role */ \"./src/structures/Role.js\");\n\nclass GuildRoleCreate extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.get(data.guild_id);\n let role;\n if (guild) {\n const already = guild.roles.has(data.role.id);\n role = new Role(guild, data.role);\n guild.roles.set(role.id, role);\n if (!already) client.emit(Constants.Events.GUILD_ROLE_CREATE, role);\n }\n return { role };\n }\n}\n\n/**\n * Emitted whenever a role is created.\n * @event Client#roleCreate\n * @param {Role} role The role that was created\n */\n\nmodule.exports = GuildRoleCreate;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildRoleCreate.js?");
806
807 /***/
808 }),
809
810 /***/
811 "./src/client/actions/GuildRoleDelete.js":
812 /*!***********************************************!*\
813 !*** ./src/client/actions/GuildRoleDelete.js ***!
814 \***********************************************/
815 /*! no static exports found */
816 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
817 /***/
818 (function (module, exports, __webpack_require__) {
819
820 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass GuildRoleDeleteAction extends Action {\n constructor(client) {\n super(client);\n this.deleted = new Map();\n }\n\n handle(data) {\n const client = this.client;\n const guild = client.guilds.get(data.guild_id);\n let role;\n\n if (guild) {\n role = guild.roles.get(data.role_id);\n if (role) {\n guild.roles.delete(data.role_id);\n this.deleted.set(guild.id + data.role_id, role);\n this.scheduleForDeletion(guild.id, data.role_id);\n client.emit(Constants.Events.GUILD_ROLE_DELETE, role);\n } else {\n role = this.deleted.get(guild.id + data.role_id) || null;\n }\n if (role) role.deleted = true;\n }\n\n return { role };\n }\n\n scheduleForDeletion(guildID, roleID) {\n this.client.setTimeout(() => this.deleted.delete(guildID + roleID), this.client.options.restWsBridgeTimeout);\n }\n}\n\n/**\n * Emitted whenever a guild role is deleted.\n * @event Client#roleDelete\n * @param {Role} role The role that was deleted\n */\n\nmodule.exports = GuildRoleDeleteAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildRoleDelete.js?");
821
822 /***/
823 }),
824
825 /***/
826 "./src/client/actions/GuildRoleUpdate.js":
827 /*!***********************************************!*\
828 !*** ./src/client/actions/GuildRoleUpdate.js ***!
829 \***********************************************/
830 /*! no static exports found */
831 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
832 /***/
833 (function (module, exports, __webpack_require__) {
834
835 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../../util/Util */ \"./src/util/Util.js\");\n\nclass GuildRoleUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.get(data.guild_id);\n\n if (guild) {\n const roleData = data.role;\n let oldRole = null;\n\n const role = guild.roles.get(roleData.id);\n if (role) {\n oldRole = Util.cloneObject(role);\n role.setup(data.role);\n client.emit(Constants.Events.GUILD_ROLE_UPDATE, oldRole, role);\n }\n\n return {\n old: oldRole,\n updated: role,\n };\n }\n\n return {\n old: null,\n updated: null,\n };\n }\n}\n\n/**\n * Emitted whenever a guild role is updated.\n * @event Client#roleUpdate\n * @param {Role} oldRole The role before the update\n * @param {Role} newRole The role after the update\n */\n\nmodule.exports = GuildRoleUpdateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildRoleUpdate.js?");
836
837 /***/
838 }),
839
840 /***/
841 "./src/client/actions/GuildRolesPositionUpdate.js":
842 /*!********************************************************!*\
843 !*** ./src/client/actions/GuildRolesPositionUpdate.js ***!
844 \********************************************************/
845 /*! no static exports found */
846 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
847 /***/
848 (function (module, exports, __webpack_require__) {
849
850 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass GuildRolesPositionUpdate extends Action {\n handle(data) {\n const client = this.client;\n\n const guild = client.guilds.get(data.guild_id);\n if (guild) {\n for (const partialRole of data.roles) {\n const role = guild.roles.get(partialRole.id);\n if (role) role.position = partialRole.position;\n }\n }\n\n return { guild };\n }\n}\n\nmodule.exports = GuildRolesPositionUpdate;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildRolesPositionUpdate.js?");
851
852 /***/
853 }),
854
855 /***/
856 "./src/client/actions/GuildSync.js":
857 /*!*****************************************!*\
858 !*** ./src/client/actions/GuildSync.js ***!
859 \*****************************************/
860 /*! no static exports found */
861 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
862 /***/
863 (function (module, exports, __webpack_require__) {
864
865 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass GuildSync extends Action {\n handle(data) {\n const client = this.client;\n\n const guild = client.guilds.get(data.id);\n if (guild) {\n if (data.presences) {\n for (const presence of data.presences) guild._setPresence(presence.user.id, presence);\n }\n\n if (data.members) {\n for (const syncMember of data.members) {\n const member = guild.members.get(syncMember.user.id);\n if (member) {\n guild._updateMember(member, syncMember);\n } else {\n guild._addMember(syncMember, false);\n }\n }\n }\n\n if ('large' in data) guild.large = data.large;\n }\n }\n}\n\nmodule.exports = GuildSync;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildSync.js?");
866
867 /***/
868 }),
869
870 /***/
871 "./src/client/actions/GuildUpdate.js":
872 /*!*******************************************!*\
873 !*** ./src/client/actions/GuildUpdate.js ***!
874 \*******************************************/
875 /*! no static exports found */
876 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
877 /***/
878 (function (module, exports, __webpack_require__) {
879
880 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../../util/Util */ \"./src/util/Util.js\");\n\nclass GuildUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n\n const guild = client.guilds.get(data.id);\n if (guild) {\n const oldGuild = Util.cloneObject(guild);\n guild.setup(data);\n client.emit(Constants.Events.GUILD_UPDATE, oldGuild, guild);\n return {\n old: oldGuild,\n updated: guild,\n };\n }\n\n return {\n old: null,\n updated: null,\n };\n }\n}\n\n/**\n * Emitted whenever a guild is updated - e.g. name change.\n * @event Client#guildUpdate\n * @param {Guild} oldGuild The guild before the update\n * @param {Guild} newGuild The guild after the update\n */\n\nmodule.exports = GuildUpdateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/GuildUpdate.js?");
881
882 /***/
883 }),
884
885 /***/
886 "./src/client/actions/InviteCreate.js":
887 /*!********************************************!*\
888 !*** ./src/client/actions/InviteCreate.js ***!
889 \********************************************/
890 /*! no static exports found */
891 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
892 /***/
893 (function (module, exports, __webpack_require__) {
894
895 "use strict";
896 eval("\n\nconst Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Invite = __webpack_require__(/*! ../../structures/Invite */ \"./src/structures/Invite.js\");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass InviteCreateAction extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.get(data.guild_id);\n const channel = client.channels.get(data.channel_id);\n if (guild && channel) {\n const inviteData = Object.assign(data, { guild, channel });\n const invite = new Invite(client, inviteData);\n /**\n * Emitted when an invite is created.\n * <info> This event only triggers if the client has `MANAGE_GUILD` permissions for the guild,\n * or `MANAGE_CHANNEL` permissions for the channel.</info>\n * @event Client#inviteCreate\n * @param {Invite} invite The invite that was created\n */\n client.emit(Events.INVITE_CREATE, invite);\n return { invite };\n }\n return { invite: null };\n }\n}\n\nmodule.exports = InviteCreateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/InviteCreate.js?");
897
898 /***/
899 }),
900
901 /***/
902 "./src/client/actions/InviteDelete.js":
903 /*!********************************************!*\
904 !*** ./src/client/actions/InviteDelete.js ***!
905 \********************************************/
906 /*! no static exports found */
907 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
908 /***/
909 (function (module, exports, __webpack_require__) {
910
911 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Invite = __webpack_require__(/*! ../../structures/Invite */ \"./src/structures/Invite.js\");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass InviteDeleteAction extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.get(data.guild_id);\n const channel = client.channels.get(data.channel_id);\n if (guild && channel) {\n const inviteData = Object.assign(data, { guild, channel });\n const invite = new Invite(client, inviteData);\n /**\n * Emitted when an invite is deleted.\n * <info> This event only triggers if the client has `MANAGE_GUILD` permissions for the guild,\n * or `MANAGE_CHANNEL` permissions for the channel.</info>\n * @event Client#inviteDelete\n * @param {Invite} invite The invite that was deleted\n */\n client.emit(Events.INVITE_DELETE, invite);\n }\n }\n}\n\nmodule.exports = InviteDeleteAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/InviteDelete.js?");
912
913 /***/
914 }),
915
916 /***/
917 "./src/client/actions/MessageCreate.js":
918 /*!*********************************************!*\
919 !*** ./src/client/actions/MessageCreate.js ***!
920 \*********************************************/
921 /*! no static exports found */
922 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
923 /***/
924 (function (module, exports, __webpack_require__) {
925
926 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Message = __webpack_require__(/*! ../../structures/Message */ \"./src/structures/Message.js\");\n\nclass MessageCreateAction extends Action {\n handle(data) {\n const client = this.client;\n\n const channel = client.channels.get((data instanceof Array ? data[0] : data).channel_id);\n const user = client.users.get((data instanceof Array ? data[0] : data).author.id);\n if (channel) {\n const member = channel.guild ? channel.guild.member(user) : null;\n if (data instanceof Array) {\n const messages = new Array(data.length);\n for (let i = 0; i < data.length; i++) {\n messages[i] = channel._cacheMessage(new Message(channel, data[i], client));\n }\n const lastMessage = messages[messages.length - 1];\n channel.lastMessageID = lastMessage.id;\n if (user) {\n user.lastMessageID = lastMessage.id;\n user.lastMessage = lastMessage;\n }\n if (member) {\n member.lastMessageID = lastMessage.id;\n member.lastMessage = lastMessage;\n }\n return {\n messages,\n };\n } else {\n const message = channel._cacheMessage(new Message(channel, data, client));\n channel.lastMessageID = data.id;\n if (user) {\n user.lastMessageID = data.id;\n user.lastMessage = message;\n }\n if (member) {\n member.lastMessageID = data.id;\n member.lastMessage = message;\n }\n return {\n message,\n };\n }\n }\n\n return {\n message: null,\n };\n }\n}\n\nmodule.exports = MessageCreateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/MessageCreate.js?");
927
928 /***/
929 }),
930
931 /***/
932 "./src/client/actions/MessageDelete.js":
933 /*!*********************************************!*\
934 !*** ./src/client/actions/MessageDelete.js ***!
935 \*********************************************/
936 /*! no static exports found */
937 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
938 /***/
939 (function (module, exports, __webpack_require__) {
940
941 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass MessageDeleteAction extends Action {\n constructor(client) {\n super(client);\n this.deleted = new Map();\n }\n\n handle(data) {\n const client = this.client;\n const channel = client.channels.get(data.channel_id);\n let message;\n\n if (channel) {\n message = channel.messages.get(data.id);\n if (message) {\n channel.messages.delete(message.id);\n this.deleted.set(channel.id + message.id, message);\n this.scheduleForDeletion(channel.id, message.id);\n } else {\n message = this.deleted.get(channel.id + data.id) || null;\n }\n if (message) message.deleted = true;\n }\n\n return { message };\n }\n\n scheduleForDeletion(channelID, messageID) {\n this.client.setTimeout(() => this.deleted.delete(channelID + messageID),\n this.client.options.restWsBridgeTimeout);\n }\n}\n\nmodule.exports = MessageDeleteAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/MessageDelete.js?");
942
943 /***/
944 }),
945
946 /***/
947 "./src/client/actions/MessageDeleteBulk.js":
948 /*!*************************************************!*\
949 !*** ./src/client/actions/MessageDeleteBulk.js ***!
950 \*************************************************/
951 /*! no static exports found */
952 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
953 /***/
954 (function (module, exports, __webpack_require__) {
955
956 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Collection = __webpack_require__(/*! ../../util/Collection */ \"./src/util/Collection.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass MessageDeleteBulkAction extends Action {\n handle(data) {\n const messages = new Collection();\n const channel = this.client.channels.get(data.channel_id);\n\n if (channel) {\n for (const id of data.ids) {\n const message = channel.messages.get(id);\n if (message) {\n message.deleted = true;\n messages.set(message.id, message);\n channel.messages.delete(id);\n }\n }\n }\n\n if (messages.size > 0) this.client.emit(Constants.Events.MESSAGE_BULK_DELETE, messages);\n return { messages };\n }\n}\n\nmodule.exports = MessageDeleteBulkAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/MessageDeleteBulk.js?");
957
958 /***/
959 }),
960
961 /***/
962 "./src/client/actions/MessageReactionAdd.js":
963 /*!**************************************************!*\
964 !*** ./src/client/actions/MessageReactionAdd.js ***!
965 \**************************************************/
966 /*! no static exports found */
967 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
968 /***/
969 (function (module, exports, __webpack_require__) {
970
971 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\n/*\n{ user_id: 'id',\n message_id: 'id',\n emoji: { name: '�', id: null },\n channel_id: 'id' } }\n*/\n\nclass MessageReactionAdd extends Action {\n handle(data) {\n const user = this.client.users.get(data.user_id);\n if (!user) return false;\n // Verify channel\n const channel = this.client.channels.get(data.channel_id);\n if (!channel || channel.type === 'voice') return false;\n // Verify message\n const message = channel.messages.get(data.message_id);\n if (!message) return false;\n if (!data.emoji) return false;\n // Verify reaction\n const reaction = message._addReaction(data.emoji, user);\n if (reaction) this.client.emit(Constants.Events.MESSAGE_REACTION_ADD, reaction, user);\n\n return { message, reaction, user };\n }\n}\n\n/**\n * Emitted whenever a reaction is added to a cached message.\n * @event Client#messageReactionAdd\n * @param {MessageReaction} messageReaction The reaction object\n * @param {User} user The user that applied the emoji or reaction emoji\n */\n\nmodule.exports = MessageReactionAdd;\n\n\n//# sourceURL=webpack:///./src/client/actions/MessageReactionAdd.js?");
972
973 /***/
974 }),
975
976 /***/
977 "./src/client/actions/MessageReactionRemove.js":
978 /*!*****************************************************!*\
979 !*** ./src/client/actions/MessageReactionRemove.js ***!
980 \*****************************************************/
981 /*! no static exports found */
982 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
983 /***/
984 (function (module, exports, __webpack_require__) {
985
986 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\n/*\n{ user_id: 'id',\n message_id: 'id',\n emoji: { name: '�', id: null },\n channel_id: 'id' } }\n*/\n\nclass MessageReactionRemove extends Action {\n handle(data) {\n const user = this.client.users.get(data.user_id);\n if (!user) return false;\n // Verify channel\n const channel = this.client.channels.get(data.channel_id);\n if (!channel || channel.type === 'voice') return false;\n // Verify message\n const message = channel.messages.get(data.message_id);\n if (!message) return false;\n if (!data.emoji) return false;\n // Verify reaction\n const reaction = message._removeReaction(data.emoji, user);\n if (reaction) this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE, reaction, user);\n\n return { message, reaction, user };\n }\n}\n\n/**\n * Emitted whenever a reaction is removed from a cached message.\n * @event Client#messageReactionRemove\n * @param {MessageReaction} messageReaction The reaction object\n * @param {User} user The user whose emoji or reaction emoji was removed\n */\n\nmodule.exports = MessageReactionRemove;\n\n\n//# sourceURL=webpack:///./src/client/actions/MessageReactionRemove.js?");
987
988 /***/
989 }),
990
991 /***/
992 "./src/client/actions/MessageReactionRemoveAll.js":
993 /*!********************************************************!*\
994 !*** ./src/client/actions/MessageReactionRemoveAll.js ***!
995 \********************************************************/
996 /*! no static exports found */
997 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
998 /***/
999 (function (module, exports, __webpack_require__) {
1000
1001 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass MessageReactionRemoveAll extends Action {\n handle(data) {\n const channel = this.client.channels.get(data.channel_id);\n if (!channel || channel.type === 'voice') return false;\n\n const message = channel.messages.get(data.message_id);\n if (!message) return false;\n\n message._clearReactions();\n this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE_ALL, message);\n\n return { message };\n }\n}\n\n/**\n * Emitted whenever all reactions are removed from a cached message.\n * @event Client#messageReactionRemoveAll\n * @param {Message} message The message the reactions were removed from\n */\n\nmodule.exports = MessageReactionRemoveAll;\n\n\n//# sourceURL=webpack:///./src/client/actions/MessageReactionRemoveAll.js?");
1002
1003 /***/
1004 }),
1005
1006 /***/
1007 "./src/client/actions/MessageReactionRemoveEmoji.js":
1008 /*!**********************************************************!*\
1009 !*** ./src/client/actions/MessageReactionRemoveEmoji.js ***!
1010 \**********************************************************/
1011 /*! no static exports found */
1012 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1013 /***/
1014 (function (module, exports, __webpack_require__) {
1015
1016 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass MessageReactionRemoveEmoji extends Action {\n handle(data) {\n // Verify channel\n const channel = this.client.channels.get(data.channel_id);\n if (!channel || channel.type === 'voice') return false;\n // Verify message\n const message = channel.messages.get(data.message_id);\n if (!message) return false;\n if (!data.emoji) return false;\n // Verify reaction\n const reaction = message._removeReaction(data.emoji);\n if (reaction) this.client.emit(Constants.Events.MESSAGE_REACTION_REMOVE_EMOJI, reaction);\n\n return { message, reaction };\n }\n}\n\n/**\n * Emitted whenever a reaction emoji is removed from a cached message.\n * @event Client#messageReactionRemoveEmoji\n * @param {MessageReaction} messageReaction The reaction object\n */\n\nmodule.exports = MessageReactionRemoveEmoji;\n\n\n//# sourceURL=webpack:///./src/client/actions/MessageReactionRemoveEmoji.js?");
1017
1018 /***/
1019 }),
1020
1021 /***/
1022 "./src/client/actions/MessageUpdate.js":
1023 /*!*********************************************!*\
1024 !*** ./src/client/actions/MessageUpdate.js ***!
1025 \*********************************************/
1026 /*! no static exports found */
1027 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1028 /***/
1029 (function (module, exports, __webpack_require__) {
1030
1031 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass MessageUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n\n const channel = client.channels.get(data.channel_id);\n if (channel) {\n const message = channel.messages.get(data.id);\n if (message) {\n message.patch(data);\n client.emit(Constants.Events.MESSAGE_UPDATE, message._edits[0], message);\n return {\n old: message._edits[0],\n updated: message,\n };\n }\n\n return {\n old: message,\n updated: message,\n };\n }\n\n return {\n old: null,\n updated: null,\n };\n }\n}\n\n/**\n * Emitted whenever a message is updated - e.g. embed or content change.\n * @event Client#messageUpdate\n * @param {Message} oldMessage The message before the update\n * @param {Message} newMessage The message after the update\n */\n\nmodule.exports = MessageUpdateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/MessageUpdate.js?");
1032
1033 /***/
1034 }),
1035
1036 /***/
1037 "./src/client/actions/UserGet.js":
1038 /*!***************************************!*\
1039 !*** ./src/client/actions/UserGet.js ***!
1040 \***************************************/
1041 /*! no static exports found */
1042 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1043 /***/
1044 (function (module, exports, __webpack_require__) {
1045
1046 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\n\nclass UserGetAction extends Action {\n handle(data) {\n const client = this.client;\n const user = client.dataManager.newUser(data);\n return { user };\n }\n}\n\nmodule.exports = UserGetAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/UserGet.js?");
1047
1048 /***/
1049 }),
1050
1051 /***/
1052 "./src/client/actions/UserNoteUpdate.js":
1053 /*!**********************************************!*\
1054 !*** ./src/client/actions/UserNoteUpdate.js ***!
1055 \**********************************************/
1056 /*! no static exports found */
1057 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1058 /***/
1059 (function (module, exports, __webpack_require__) {
1060
1061 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass UserNoteUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n\n const oldNote = client.user.notes.get(data.id);\n const note = data.note.length ? data.note : null;\n\n client.user.notes.set(data.id, note);\n\n client.emit(Constants.Events.USER_NOTE_UPDATE, data.id, oldNote, note);\n\n return {\n old: oldNote,\n updated: note,\n };\n }\n}\n\n/**\n * Emitted whenever a note is updated.\n * @event Client#userNoteUpdate\n * @param {User} user The user the note belongs to\n * @param {string} oldNote The note content before the update\n * @param {string} newNote The note content after the update\n */\n\nmodule.exports = UserNoteUpdateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/UserNoteUpdate.js?");
1062
1063 /***/
1064 }),
1065
1066 /***/
1067 "./src/client/actions/UserUpdate.js":
1068 /*!******************************************!*\
1069 !*** ./src/client/actions/UserUpdate.js ***!
1070 \******************************************/
1071 /*! no static exports found */
1072 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1073 /***/
1074 (function (module, exports, __webpack_require__) {
1075
1076 eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../../util/Util */ \"./src/util/Util.js\");\n\nclass UserUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n\n if (client.user) {\n if (client.user.equals(data)) {\n return {\n old: client.user,\n updated: client.user,\n };\n }\n\n const oldUser = Util.cloneObject(client.user);\n client.user.patch(data);\n client.emit(Constants.Events.USER_UPDATE, oldUser, client.user);\n return {\n old: oldUser,\n updated: client.user,\n };\n }\n\n return {\n old: null,\n updated: null,\n };\n }\n}\n\nmodule.exports = UserUpdateAction;\n\n\n//# sourceURL=webpack:///./src/client/actions/UserUpdate.js?");
1077
1078 /***/
1079 }),
1080
1081 /***/
1082 "./src/client/rest/APIRequest.js":
1083 /*!***************************************!*\
1084 !*** ./src/client/rest/APIRequest.js ***!
1085 \***************************************/
1086 /*! no static exports found */
1087 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1088 /***/
1089 (function (module, exports, __webpack_require__) {
1090
1091 eval("const snekfetch = __webpack_require__(/*! snekfetch */ \"./node_modules/snekfetch/esm.mjs\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass APIRequest {\n constructor(rest, method, path, auth, data, files, reason) {\n this.rest = rest;\n this.client = rest.client;\n this.method = method;\n this.path = path.toString();\n this.auth = auth;\n this.data = data;\n this.files = files;\n this.route = this.getRoute(this.path);\n this.reason = reason;\n }\n\n getRoute(url) {\n let route = url.split('?')[0];\n if (route.includes('/channels/') || route.includes('/guilds/')) {\n const startInd = route.includes('/channels/') ? route.indexOf('/channels/') : route.indexOf('/guilds/');\n const majorID = route.substring(startInd).split('/')[2];\n route = route.replace(/(\\d{8,})/g, ':id').replace(':id', majorID);\n }\n return route;\n }\n\n getAuth() {\n if (this.client.token && this.client.user && this.client.user.bot) {\n return `Bot ${this.client.token}`;\n } else if (this.client.token) {\n return this.client.token;\n }\n throw new Error(Constants.Errors.NO_TOKEN);\n }\n\n gen() {\n const API = `${this.client.options.http.host}/api/v${this.client.options.http.version}`;\n const request = snekfetch[this.method](`${API}${this.path}`);\n if (this.auth) request.set('Authorization', this.getAuth());\n if (this.reason) request.set('X-Audit-Log-Reason', encodeURIComponent(this.reason));\n if (!this.rest.client.browser) request.set('User-Agent', this.rest.userAgentManager.userAgent);\n if (this.files) {\n for (const file of this.files) if (file && file.file) request.attach(file.name, file.file, file.name);\n if (typeof this.data !== 'undefined') request.attach('payload_json', JSON.stringify(this.data));\n } else if (this.data) {\n request.send(this.data);\n }\n return request;\n }\n}\n\nmodule.exports = APIRequest;\n\n\n//# sourceURL=webpack:///./src/client/rest/APIRequest.js?");
1092
1093 /***/
1094 }),
1095
1096 /***/
1097 "./src/client/rest/DiscordAPIError.js":
1098 /*!********************************************!*\
1099 !*** ./src/client/rest/DiscordAPIError.js ***!
1100 \********************************************/
1101 /*! no static exports found */
1102 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1103 /***/
1104 (function (module, exports) {
1105
1106 eval("/**\n * Represents an error from the Discord API.\n * @extends Error\n */\nclass DiscordAPIError extends Error {\n constructor(path, error, method) {\n super();\n const flattened = this.constructor.flattenErrors(error.errors || error).join('\\n');\n this.name = 'DiscordAPIError';\n this.message = error.message && flattened ? `${error.message}\\n${flattened}` : error.message || flattened;\n\n /**\n * The path of the request relative to the HTTP endpoint\n * @type {string}\n */\n this.path = path;\n\n /**\n * HTTP error code returned by Discord\n * @type {number}\n */\n this.code = error.code;\n\n /**\n * The HTTP method used for the request\n * @type {string}\n */\n this.method = method;\n }\n\n /**\n * Flattens an errors object returned from the API into an array.\n * @param {Object} obj Discord errors object\n * @param {string} [key] Used internally to determine key names of nested fields\n * @returns {string[]}\n * @private\n */\n static flattenErrors(obj, key = '') {\n let messages = [];\n\n for (const k of Object.keys(obj)) {\n if (k === 'message') continue;\n const newKey = key ? isNaN(k) ? `${key}.${k}` : `${key}[${k}]` : k;\n\n if (obj[k]._errors) {\n messages.push(`${newKey}: ${obj[k]._errors.map(e => e.message).join(' ')}`);\n } else if (obj[k].code || obj[k].message) {\n messages.push(`${obj[k].code ? `${obj[k].code}: ` : ''}: ${obj[k].message}`.trim());\n } else if (typeof obj[k] === 'string') {\n messages.push(obj[k]);\n } else {\n messages = messages.concat(this.flattenErrors(obj[k], newKey));\n }\n }\n\n return messages;\n }\n}\n\nmodule.exports = DiscordAPIError;\n\n\n//# sourceURL=webpack:///./src/client/rest/DiscordAPIError.js?");
1107
1108 /***/
1109 }),
1110
1111 /***/
1112 "./src/client/rest/RESTManager.js":
1113 /*!****************************************!*\
1114 !*** ./src/client/rest/RESTManager.js ***!
1115 \****************************************/
1116 /*! no static exports found */
1117 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1118 /***/
1119 (function (module, exports, __webpack_require__) {
1120
1121 eval("const UserAgentManager = __webpack_require__(/*! ./UserAgentManager */ \"./src/client/rest/UserAgentManager.js\");\nconst RESTMethods = __webpack_require__(/*! ./RESTMethods */ \"./src/client/rest/RESTMethods.js\");\nconst SequentialRequestHandler = __webpack_require__(/*! ./RequestHandlers/Sequential */ \"./src/client/rest/RequestHandlers/Sequential.js\");\nconst BurstRequestHandler = __webpack_require__(/*! ./RequestHandlers/Burst */ \"./src/client/rest/RequestHandlers/Burst.js\");\nconst APIRequest = __webpack_require__(/*! ./APIRequest */ \"./src/client/rest/APIRequest.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass RESTManager {\n constructor(client) {\n this.client = client;\n this.handlers = {};\n this.userAgentManager = new UserAgentManager(this);\n this.methods = new RESTMethods(this);\n this.rateLimitedEndpoints = {};\n this.globallyRateLimited = false;\n }\n\n destroy() {\n for (const handlerKey of Object.keys(this.handlers)) {\n const handler = this.handlers[handlerKey];\n if (handler.destroy) handler.destroy();\n }\n }\n\n push(handler, apiRequest) {\n return new Promise((resolve, reject) => {\n handler.push({\n request: apiRequest,\n resolve,\n reject,\n retries: 0,\n });\n });\n }\n\n getRequestHandler() {\n switch (this.client.options.apiRequestMethod) {\n case 'sequential':\n return SequentialRequestHandler;\n case 'burst':\n return BurstRequestHandler;\n default:\n throw new Error(Constants.Errors.INVALID_RATE_LIMIT_METHOD);\n }\n }\n\n makeRequest(method, url, auth, data, file, reason) {\n const apiRequest = new APIRequest(this, method, url, auth, data, file, reason);\n if (!this.handlers[apiRequest.route]) {\n const RequestHandlerType = this.getRequestHandler();\n this.handlers[apiRequest.route] = new RequestHandlerType(this, apiRequest.route);\n }\n\n return this.push(this.handlers[apiRequest.route], apiRequest);\n }\n}\n\nmodule.exports = RESTManager;\n\n\n//# sourceURL=webpack:///./src/client/rest/RESTManager.js?");
1122
1123 /***/
1124 }),
1125
1126 /***/
1127 "./src/client/rest/RESTMethods.js":
1128 /*!****************************************!*\
1129 !*** ./src/client/rest/RESTMethods.js ***!
1130 \****************************************/
1131 /*! no static exports found */
1132 /*! ModuleConcatenation bailout: Module is not an ECMAScript module */
1133 /***/
1134 (function (module, exports, __webpack_require__) {
1135
1136 eval("const querystring = __webpack_require__(/*! querystring */ \"./node_modules/querystring-es3/index.js\");\nconst long = __webpack_require__(/*! long */ \"./node_modules/long/src/long.js\");\nconst Permissions = __webpack_require__(/*! ../../util/Permissions */ \"./src/util/Permissions.js\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\nconst Endpoints = Constants.Endpoints;\nconst Collection = __webpack_require__(/*! ../../util/Collection */ \"./src/util/Collection.js\");\nconst Util = __webpack_require__(/*! ../../util/Util */ \"./src/util/Util.js\");\nconst resolvePermissions = __webpack_require__(/*! ../../structures/shared/resolvePermissions */ \"./src/structures/shared/resolvePermissions.js\");\n\nconst RichEmbed = __webpack_require__(/*! ../../structures/RichEmbed */ \"./src/structures/RichEmbed.js\");\nconst User = __webpack_require__(/*! ../../structures/User */ \"./src/structures/User.js\");\nconst GuildMember = __webpack_require__(/*! ../../structures/GuildMember */ \"./src/structures/GuildMember.js\");\nconst Message = __webpack_require__(/*! ../../structures/Message */ \"./src/structures/Message.js\");\nconst Role = __webpack_require__(/*! ../../structures/Role */ \"./src/structures/Role.js\");\nconst Invite = __webpack_require__(/*! ../../structures/Invite */ \"./src/structures/Invite.js\");\nconst Webhook = __webpack_require__(/*! ../../structures/Webhook */ \"./src/structures/Webhook.js\");\nconst UserProfile = __webpack_require__(/*! ../../structures/UserProfile */ \"./src/structures/UserProfile.js\");\nconst OAuth2Application = __webpack_require__(/*! ../../structures/OAuth2Application */ \"./src/structures/OAuth2Application.js\");\nconst Channel = __webpack_require__(/*! ../../structures/Channel */ \"./src/structures/Channel.js\");\nconst GroupDMChannel = __webpack_require__(/*! ../../structures/GroupDMChannel */ \"./src/structures/GroupDMChannel.js\");\nconst Guild = __webpack_require__(/*! ../../structures/Guild */ \"./src/structures/Guild.js\");\nconst VoiceRegion = __webpack_require__(/*! ../../structures/VoiceRegion */ \"./src/structures/VoiceRegion.js\");\nconst GuildAuditLogs = __webpack_require__(/*! ../../structures/GuildAuditLogs */ \"./src/structures/GuildAuditLogs.js\");\n\nconst MessageFlags = __webpack_require__(/*! ../../util/MessageFlags */ \"./src/util/MessageFlags.js\");\n\nclass RESTMethods {\n constructor(restManager) {\n this.rest = restManager;\n this.client = restManager.client;\n this._ackToken = null;\n }\n\n login(token = this.client.token) {\n return new Promise((resolve, reject) => {\n if (!token || typeof token !== 'string') throw new Error(Constants.Errors.INVALID_TOKEN);\n token = token.replace(/^Bot\\s*/i, '');\n this.client.manager.connectToWebSocket(token, resolve, reject);\n }).catch(e => {\n this.client.destroy();\n return Promise.reject(e);\n });\n }\n\n logout() {\n return this.rest.makeRequest('post', Endpoints.logout, true, {});\n }\n\n getGateway(bot = false) {\n return this.rest.makeRequest('get', bot ? Endpoints.gateway.bot : Endpoints.gateway, true);\n }\n\n fetchVoiceRegions(guildID) {\n let endpoint;\n if (guildID) endpoint = Endpoints.Guild(guildID).voiceRegions;\n else endpoint = Endpoints.voiceRegions;\n return this.rest.makeRequest('get', endpoint, true).then(res => {\n const regions = new Collection();\n for (const region of res) regions.set(region.id, new VoiceRegion(region));\n return regions;\n });\n }\n\n fetchEmbed(guildID) {\n return this.rest.makeRequest('get', Endpoints.Guild(guildID).embed, true).then(data => ({\n enabled: data.enabled,\n channel: data.channel_id ? this.client.channels.get(data.channel_id) : null,\n }));\n }\n\n sendMessage(channel, content, { tts, nonce, embed, disableEveryone, split, code, reply } = {}, files = null) {\n return new Promise((resolve, reject) => { // eslint-disable-line complexity\n if (typeof content !== 'undefined') content = this.client.resolver.resolveString(content);\n\n // The nonce has to be a uint64 :<\n if (typeof nonce !== 'undefined') {\n nonce = parseInt(nonce);\n if (isNaN(nonce) || nonce < 0) throw new RangeError('Message nonce must fit in an unsigned 64-bit integer.');\n }\n\n if (content) {\n if (split && typeof split !== 'object') split = {};\n\n // Wrap everything in a code block\n if (typeof code !== 'undefined' && (typeof code !== 'boolean' || code === true)) {\n content = Util.escapeMarkdown(this.client.resolver.resolveString(content), true);\n content = `\\`\\`\\`${typeof code !== 'boolean' ? code || '' : ''}\\n${content}\\n\\`\\`\\``;\n if (split) {\n split.prepend = `\\`\\`\\`${typeof code !== 'boolean' ? code || '' : ''}\\n`;\n split.append = '\\n```';\n }\n }\n\n // Add zero-width spaces to @everyone/@here\n if (disableEveryone || (typeof disableEveryone === 'undefined' && this.client.options.disableEveryone)) {\n content = content.replace(/@(everyone|here)/g, '@\\u200b$1');\n }\n\n // Add the reply prefix\n if (reply && !(channel instanceof User || channel instanceof GuildMember) && channel.type !== 'dm') {\n const id = this.client.resolver.resolveUserID(reply);\n const mention = `<@${reply instanceof GuildMember && reply.nickname ? '!' : ''}${id}>`;\n content = `${mention}${content ? `, ${content}` : ''}`;\n if (split) split.prepend = `${mention}, ${split.prepend || ''}`;\n }\n\n // Split the content\n if (split) content = Util.splitMessage(content, split);\n } else if (reply && !(channel instanceof User || channel instanceof GuildMember) && channel.type !== 'dm') {\n const id = this.client.resolver.resolveUserID(reply);\n content = `<@${reply instanceof GuildMember && reply.nickname ? '!' : ''}${id}>`;\n }\n\n const send = chan => {\n if (content instanceof Array) {\n const messages = [];\n (function sendChunk(list, index) {\n const options = index === list.length - 1 ? { tts, embed, files } : { tts };\n chan.send(list[index], options).then(message => {\n messages.push(message);\n if (index >= list.length - 1) return resolve(messages);\n return sendChunk(list, ++index);\n }).catch(reject);\n }(content, 0));\n } else {\n this.rest.makeRequest('post', Endpoints.Channel(chan).messages, true, {\n content, tts, nonce, embed,\n }, files).then(data => resolve(this.client.actions.MessageCreate.handle(data).message), reject);\n }\n };\n\n if (channel instanceof User || channel instanceof GuildMember) this.createDM(channel).then(send, reject);\n else send(channel);\n });\n }\n\n updateMessage(message, content, { flags, embed, code, reply } = {}) {\n if (typeof content !== 'undefined') content = this.client.resolver.resolveString(content);\n\n if (typeof flags !== 'undefined') flags = MessageFlags.resolve(flags);\n\n // Wrap everything in a code block\n if (typeof code !== 'undefined' && (typeof code !== 'boolean' || code === true)) {\n content = Util.escapeMarkdown(this.client.resolver.resolveString(content), true);\n content = `\\`\\`\\`${typeof code !== 'boolean' ? code || '' : ''}\\n${content}\\n\\`\\`\\``;\n }\n\n // Add the reply prefix\n if (reply && message.channel.type !== 'dm') {\n const id = this.client.resolver.resolveUserID(reply);\n const mention = `<@${reply instanceof GuildMember && reply.nickname ? '!' : ''}${id}>`;\n content = `${mention}${content ? `, ${content}` : ''}`;\n }\n\n if (embed instanceof RichEmbed) embed = embed.toJSON();\n\n return this.rest.makeRequest('patch', Endpoints.Message(message), true, {\n content, embed, flags,\n }).then(data => this.client.actions.MessageUpdate.handle(data).updated);\n }\n\n deleteMessage(message) {\n return this.rest.makeRequest('delete', Endpoints.Message(message), true)\n .then(() =>\n this.client.actions.MessageDelete.handle({\n id: message.id,\n channel_id: message.channel.id,\n }).message\n );\n }\n\n ackMessage(message) {\n return this.rest.makeRequest('post', Endpoints.Message(message).ack, true, { token: this._ackToken }).then(res => {\n if (res.token) this._ackToken = res.token;\n return message;\n });\n }\n\n ackTextChannel(channel) {\n return this.rest.makeRequest('post', Endpoints.Channel(channel).Message(channel.lastMessageID).ack, true, {\n token: this._ackToken,\n }).then(res => {\n if (res.token) this._ackToken = res.token;\n return channel;\n });\n }\n\n ackGuild(guild) {\n return this.rest.makeRequest('post', Endpoints.Guild(guild).ack, true).then(() => guild);\n }\n\n bulkDeleteMessages(channel, messages) {\n return this.rest.makeRequest('post', Endpoints.Channel(channel).messages.bulkDelete, true, {\n messages: messages,\n }).then(() =>\n this.client.actions.MessageDeleteBulk.handle({\n channel_id: channel.id,\n ids: messages,\n }).messages\n );\n }\n\n search(target, options) {\n if (typeof options === 'string') options = { content: options };\n if (options.before) {\n if (!(options.before instanceof Date)) options.before = new Date(options.before);\n options.maxID = long.fromNumber(options.before.getTime() - 14200704e5).shiftLeft(22).toString();\n }\n if (options.after) {\n if (!(options.after instanceof Date)) options.after = new Date(options.after);\n options.minID = long.fromNumber(options.after.getTime() - 14200704e5).shiftLeft(22).toString();\n }\n if (options.during) {\n if (!(options.during instanceof Date)) options.during = new Date(options.during);\n const t = options.during.getTime() - 14200704e5;\n options.minID = long.fromNumber(t).shiftLeft(22).toString();\n options.maxID = long.fromNumber(t + 86400000).shiftLeft(22).toString();\n }\n if (options.channel) options.channel = this.client.resolver.resolveChannelID(options.channel);\n if (options.author) options.author = this.client.resolver.resolveUserID(options.author);\n if (options.mentions) options.mentions = this.client.resolver.resolveUserID(options.options.mentions);\n options = {\n content: options.content,\n max_id: options.maxID,\n min_id: options.minID,\n has: options.has,\n channel_id: options.channel,\n author_id: options.author,\n author_type: options.authorType,\n context_size: options.contextSize,\n sort_by: options.sortBy,\n sort_order: options.sortOrder,\n limit: options.limit,\n offset: options.offset,\n mentions: options.mentions,\n mentions_everyone: options.mentionsEveryone,\n link_hostname: options.linkHostname,\n embed_provider: options.embedProvider,\n embed_type: options.embedType,\n attachment_filename: options.attachmentFilename,\n attachment_extension: options.attachmentExtension,\n include_nsfw: options.nsfw,\n };\n\n for (const key of Object.keys(options)) if (options[key] === undefined) delete options[key];\n const queryString = (querystring.stringify(options).match(/[^=&?]+=[^=&?]+/g) || []).join('&');\n\n let endpoint;\n if (target instanceof Channel) {\n endpoint = Endpoints.Channel(target).search;\n } else if (target instanceof Guild) {\n endpoint = Endpoints.Guild(target).search;\n } else {\n throw new TypeError('Target must be a TextChannel, DMChannel, GroupDMChannel, or Guild.');\n }\n return this.rest.makeRequest('get', `${endpoint}?${queryString}`, true).then(body => {\n const messages = body.messages.map(x =>\n x.map(m => new Message(this.client.channels.get(m.channel_id), m, this.client))\n );\n return {\n totalResults: body.total_results,\n messages,\n };\n });\n }\n\n createChannel(guild, name, options) {\n const {\n type,\n topic,\n nsfw,\n bitrate,\n userLimit,\n parent,\n permissionOverwrites,\n position,\n rateLimitPerUser,\n reason,\n } = options;\n return this.rest.makeRequest('post', Endpoints.Guild(guild).channels, true, {\n name,\n topic,\n type: type ? Constants.ChannelTypes[type.toUpperCase()] : Constants.ChannelTypes.TEXT,\n nsfw,\n bitrate,\n user_limit: userLimit,\n parent_id: parent instanceof Channel ? parent.id : parent,\n permission_overwrites: resolvePermissions.call(this, permissionOverwrites, guild),\n position,\n rate_limit_per_user: rateLimitPerUser,\n },\n undefined,\n reason).then(data => this.client.actions.ChannelCreate.handle(data).channel);\n }\n\n createDM(recipient) {\n const dmChannel = this.getExistingDM(recipient);\n if (dmChannel) return Promise.resolve(dmChannel);\n return this.rest.makeRequest('post', Endpoints.User(this.client.user).channels, true, {\n recipient_id: recipient.id,\n }).then(data => this.client.actions.ChannelCreate.handle(data).channel);\n }\n\n createGroupDM(options) {\n const data = this.client.user.bot ?\n { access_tokens: options.accessTokens, nicks: options.nicks } :\n { recipients: options.recipients };\n return this.rest.makeRequest('post', Endpoints.User('@me').channels, true, data)\n .then(res => new GroupDMChannel(this.client, res));\n }\n\n addUserToGroupDM(channel, options) {\n const data = this.client.user.bot ?\n { nick: options.nick, access_token: options.accessToken } :\n { recipient: options.id };\n return this.rest.makeRequest('put', Endpoints.Channel(channel).Recipient(options.id), true, data)\n .then(() => channel);\n }\n\n removeUserFromGroupDM(channel, userId) {\n return this.rest.makeRequest('delete', Endpoints.Channel(channel).Recipient(userId), true)\n .then(() => channel);\n }\n\n updateGroupDMChannel(channel, _data) {\n const data = {};\n data.name = _data.name;\n data.icon = _data.icon;\n return this.rest.makeRequest('patch', Endpoints.Channel(channel), true, data).then(() => channel);\n }\n\n getExistingDM(recipient) {\n return this.client.channels.find(channel =>\n channel.recipient && channel.recipient.id === recipient.id\n );\n }\n\n deleteChannel(channel, reason) {\n if (channel instanceof User || channel instanceof GuildMember) channel = this.getExistingDM(channel);\n if (!channel) return Promise.reject(new Error('No channel to delete.'));\n return this.rest.makeRequest('delete', Endpoints.Channel(channel), true, undefined, undefined, reason)\n .then(data => {\n data.id = channel.id;\n return this.client.actions.ChannelDelete.handle(data).channel;\n });\n }\n\n updateChannel(channel, _data, reason) {\n const data = {};\n data.name = (_data.name || channel.name).trim();\n data.topic = typeof _data.topic === 'undefined' ? channel.topic : _data.topic;\n data.nsfw = typeof _data.nsfw === 'undefined' ? channel.nsfw : _data.nsfw;\n data.position = _data.position || channel.position;\n data.bitrate = _data.bitrate || (channel.bitrate ? channel.bitrate * 1000 : undefined);\n data.user_limit = typeof _data.userLimit !== 'undefined' ? _data.userLimit : channel.userLimit;\n data.parent_id = _data.parent instanceof Channel ? _data.parent.id : _data.parent;\n data.permission_overwrites = _data.permissionOverwrites ?\n resolvePermissions.call(this, _data.permissionOverwrites, channel.guild) : undefined;\n data.rate_limit_per_user = typeof _data.rateLimitPerUser !== 'undefined' ?\n _data.rateLimitPerUser : channel.rateLimitPerUser;\n return this.rest.makeRequest('patch', Endpoints.Channel(channel), true, data, undefined, reason).then(newData =>\n this.client.actions.ChannelUpdate.handle(newData).updated\n );\n }\n\n leaveGuild(guild) {\n if (guild.ownerID === this.client.user.id) return Promise.reject(new Error('Guild is owned by the client.'));\n return this.rest.makeRequest('delete', Endpoints.User('@me').Guild(guild.id), true).then(() =>\n this.client.actions.GuildDelete.handle({ id: guild.id }).guild\n );\n }\n\n createGuild(options) {\n options.icon = this.client.resolver.resolveBase64(options.icon) || null;\n options.region = options.region || 'us-central';\n return new Promise((resolve, reject) => {\n this.rest.makeRequest('post', Endpoints.guilds, true, options).then(data => {\n if (this.client.guilds.has(data.id)) return resolve(this.client.guilds.get(data.id));\n\n const handleGuild = guild => {\n if (guild.id === data.id) {\n this.client.removeListener(Constants.Events.GUILD_CREATE, handleGuild);\n this.client.clearTimeout(timeout);\n resolve(guild);\n }\n };\n this.client.on(Constants.Events.GUILD_CREATE, handleGuild);\n\n const timeout = this.client.setTimeout(() => {\n this.client.removeListener(Constants.Events.GUILD_CREATE, handleGuild);\n reject(new Error('Took too long to receive guild data.'));\n }, 10000);\n return undefined;\n }, reject);\n });\n }\n\n // Untested but probably will work\n deleteGuild(guild) {\n return this.rest.makeRequest('delete', Endpoints.Guild(guild), true).then(() =>\n this.client.actions.GuildDelete.handle({ id: guild.id }).guild\n );\n }\n\n getUser(userID, cache) {\n return this.rest.makeRequest('get', Endpoints.User(userID), true).then(data => {\n if (cache) return this.client.actions.UserGet.handle(data).user;\n else return new User(this.client, data);\n });\n }\n\n updateCurrentUser(_data, password) {\n const user = this.client.user;\n const data = {};\n data.username = _data.username || user.username;\n data.avatar = typeof _data.avatar === 'undefined' ? user.avatar : this.client.resolver.resolveBase64(_data.avatar);\n if (!user.bot) {\n data.email = _data.email || user.email;\n data.password = password;\n if (_data.new_password) data.new_password = _data.newPassword;\n }\n return this.rest.makeRequest('patch', Endpoints.User('@me'), true, data).then(newData =>\n this.client.actions.UserUpdate.handle(newData).updated\n );\n }\n\n updateGuild(guild, data, reason) {\n return this.rest.makeRequest('patch', Endpoints.Guild(guild), true, data, undefined, reason).then(newData =>\n this.client.actions.GuildUpdate.handle(newData).updated\n );\n }\n\n kickGuildMember(guild, member, reason) {\n return this.rest.makeRequest(\n 'delete', Endpoints.Guild(guild).Member(member), true,\n undefined, undefined, reason)\n .then(() => member);\n }\n\n createGuildRole(guild, data, reason) {\n if (data.color) data.color = this.client.resolver.resolveColor(data.color);\n if (data.permissions) data.permissions = Permissions.resolve(data.permissions);\n return this.rest.makeRequest('post', Endpoints.Guild(guild).roles, true, data, undefined, reason).then(r => {\n const { role } = this.client.actions.GuildRoleCreate.handle({\n guild_id: guild.id,\n role: r,\n });\n if (data.position) return role.setPosition(data.position, reason);\n return role;\n });\n }\n\n deleteGuildRole(role, reason) {\n return this.rest.makeRequest(\n 'delete', Endpoints.Guild(role.guild).Role(role.id), true,\n undefined, undefined, reason)\n .then(() =>\n this.client.actions.GuildRoleDelete.handle({\n guild_id: role.guild.id,\n role_id: role.id,\n }).role\n );\n }\n\n setChannelOverwrite(channel, payload) {\n return this.rest.makeRequest('put', `${Endpoints.Channel(channel).permissions}/${payload.id}`, true, payload);\n }\n\n deletePermissionOverwrites(overwrite, reason) {\n return this.rest.makeRequest(\n 'delete', `${Endpoints.Channel(overwrite.channel).permissions}/${overwrite.id}`,\n true, undefined, undefined, reason\n ).then(() => overwrite);\n }\n\n getChannelMessages(channel, payload = {}) {\n const params = [];\n if (payload.limit) params.push(`limit=${payload.limit}`);\n if (payload.around) params.push(`around=${payload.around}`);\n else if (payload.before) params.push(`before=${payload.before}`);\n else if (payload.after) params.push(`after=${payload.after}`);\n\n let endpoint = Endpoints.Channel(channel).messages;\n if (params.length > 0) endpoint += `?${params.join('&')}`;\n return this.rest.makeRequest('get', endpoint, true);\n }\n\n getChannelMessage(channel, messageID) {\n const msg = channel.messages.get(messageID);\n if (msg) return Promise.resolve(msg);\n return this.rest.makeRequest('get', Endpoints.Channel(channel).Message(messageID), true);\n }\n\n putGuildMember(guild, userID, options) {\n options.access_token = options.accessToken;\n if (options.roles) {\n const roles = options.roles;\n if (roles instanceof Collection || (roles instanceof Array && roles[0] instanceof Role)) {\n options.roles = roles.map(role => role.id);\n }\n }\n return this.rest.makeRequest('put', Endpoints.Guild(guild).Member(userID), true, options)\n .then(data => this.client.actions.GuildMemberGet.handle(guild, data).member);\n }\n\n getGuild(guild) {\n return this.rest.makeRequest('get', Endpoints.Guild(guild), true);\n }\n\n getGuildMember(guild, userID, cache) {\n return this.rest.makeRequest('get', Endpoints.Guild(guild).Member(userID), true).then(data => {\n if (cache) return this.client.actions.GuildMemberGet.handle(guild, data).member;\n else return new GuildMember(guild, data);\n });\n }\n\n updateGuildMember(member, data, reason) {\n if (data.channel) {\n const channel = this.client.resolver.resolveChannel(data.channel);\n if (!channel || channel.guild.id !== member.guild.id || channel.type !== 'voice') {\n return Promise.reject(new Error('Could not resolve channel to a guild voice channel.'));\n }\n data.channel_id = channel.id;\n data.channel = undefined;\n } else if (data.channel === null) {\n data.channel_id = null;\n data.channel = undefined;\n }\n if (data.roles) data.roles = [...new Set(data.roles.map(role => role instanceof Role ? role.id : role))];\n\n let endpoint = Endpoints.Member(member);\n // Fix your endpoints, discord ;-;\n if (member.id === this.client.user.id) {\n const keys = Object.keys(data);\n if (keys.length === 1 && keys[0] === 'nick') {\n endpoint = Endpoints.Member(member).nickname;\n }\n }\n\n return this.rest.makeRequest('patch', endpoint, true, data, undefined, reason).then(newData =>\n member.guild._updateMember(member, newData).mem\n );\n }\n\n addMemberRole(member, role, reason) {\n return new Promise((resolve, reject) => {\n if (member._roles.includes(role.id)) return resolve(member);\n\n const listener = (oldMember, newMember) => {\n if (newMember.id === member.id && !oldMember._roles.includes(role.id) && newMember._roles.includes(role.id)) {\n this.client.removeListener(Constants.Events.GUILD_MEMBER_UPDATE, listener);\n resolve(newMember);\n }\n };\n\n this.client.on(Constants.Events.GUILD_MEMBER_UPDATE, listener);\n const timeout = this.client.setTimeout(() => {\n this.client.removeListener(Constants.Events.GUILD_MEMBER_UPDATE, listener);\n reject(new Error('Adding the role timed out.'));\n }, 10e3);\n\n return this.rest.makeRequest('put', Endpoints.Member(member).Role(role.id), true, undefined, undefined, reason)\n .catch(err => {\n this.client.removeListener(Constants.Events.GUILD_MEMBER_UPDATE, listener);\n this.client.clearTimeout(timeout);\n reject(err);\n });\n });\n }\n\n removeMemberRole(member, role, reason) {\n return new Promise((resolve, reject) => {\n if (!member._roles.includes(role.id)) return resolve(member);\n\n const listener = (oldMember, newMember) => {\n if (newMember.id === member.id && oldMember._roles.includes(role.id) && !newMember._roles.includes(role.id)) {\n this.client.removeListener(Constants.Events.GUILD_MEMBER_UPDATE, listener);\n resolve(newMember);\n }\n };\n\n this.client.on(Constants.Events.GUILD_MEMBER_UPDATE, listener);\n const timeout = this.client.setTimeout(() => {\n this.client.removeListener(Constants.Events.GUILD_MEMBER_UPDATE, listener);\n reject(new Error('Removing the role timed out.'));\n }, 10e3);\n\n return this.rest.makeRequest('delete', Endpoints.Member(member).Role(role.id), true, undefined, undefined, reason)\n .catch(err => {\n this.client.removeListener(Constants.Events.GUILD_MEMBER_UPDATE, listener);\n this.client.clearTimeout(timeout);\n reject(err);\n });\n });\n }\n\n sendTyping(channelID) {\n return this.rest.makeRequest('post', Endpoints.Channel(channelID).typing, true);\n }\n\n banGuildMember(guild, member, options) {\n const id = this.client.resolver.resolveUserID(member);\n if (!id) return Promise.reject(new Error('Couldn\\'t resolve the user ID to ban.'));\n\n const url = `${Endpoints.Guild(guild).bans}/${id}?${querystring.stringify(options)}`;\n return this.rest.makeRequest('put', url, true).then(() => {\n if (member instanceof GuildMember) return member;\n const user = this.client.resolver.resolveUser(id);\n if (user) {\n member = this.client.resolver.resolveGuildMember(guild, user);\n return member || user;\n }\n return id;\n });\n }\n\n unbanGuildMember(guild, member, reason) {\n return new Promise((resolve, reject) => {\n const id = this.client.resolver.resolveUserID(member);\n if (!id) throw new Error('Couldn\\'t resolve the user ID to unban.');\n\n const listener = (eGuild, eUser) => {\n if (eGuild.id === guild.id && eUser.id === id) {\n this.client.removeListener(Constants.Events.GUILD_BAN_REMOVE, listener);\n this.client.clearTimeout(timeout);\n resolve(eUser);\n }\n };\n this.client.on(Constants.Events.GUILD_BAN_REMOVE, listener);\n\n const timeout = this.client.setTimeout(() => {\n this.client.removeListener(Constants.Events.GUILD_BAN_REMOVE, listener);\n reject(new Error('Took too long to receive the ban remove event.'));\n }, 10000);\n\n this.rest.makeRequest('delete', `${Endpoints.Guild(guild).bans}/${id}`, true, undefined, undefined, reason)\n .catch(err => {\n this.client.removeListener(Constants.Events.GUILD_BAN_REMOVE, listener);\n this.client.clearTimeout(timeout);\n reject(err);\n });\n });\n }\n\n getGuildBan(guild, user) {\n const id = this.client.resolver.resolveUserID(user);\n return this.rest.makeRequest('get', `${Endpoints.Guild(guild).bans}/${id}`, true).then(ban => ({\n reason: ban.reason,\n user: this.client.dataManager.newUser(ban.user),\n }));\n }\n\n getGuildBans(guild) {\n return this.rest.makeRequest('get', Endpoints.Guild(guild).bans, true).then(bans =>\n bans.reduce((collection, ban) => {\n collection.set(ban.user.id, {\n reason: ban.reason,\n user: this.client.dataManager.newUser(ban.user),\n });\n return collection;\n }, new Collection())\n );\n }\n\n updateGuildRole(role, _data, reason) {\n const data = {};\n data.name = _data.name || role.name;\n data.position = typeof _data.position !== 'undefined' ? _data.position : role.position;\n data.color = _data.color === null ? null : this.client.resolver.resolveColor(_data.color || role.color);\n data.hoist = typeof _data.hoist !== 'undefined' ? _data.hoist : role.hoist;\n data.mentionable = typeof _data.mentionable !== 'undefined' ? _data.mentionable : role.mentionable;\n\n if (typeof _data.permissions !== 'undefined') data.permissions = Permissions.resolve(_data.permissions);\n else data.permissions = role.permissions;\n\n return this.rest.makeRequest('patch', Endpoints.Guild(role.guild).Role(role.id), true, data, undefined, reason)\n .then(_role =>\n this.client.actions.GuildRoleUpdate.handle({\n role: _role,\n guild_id: role.guild.id,\n }).updated\n );\n }\n\n pinMessage(message) {\n return this.rest.makeRequest('put', Endpoints.Channel(message.channel).Pin(message.id), true)\n .then(() => message);\n }\n\n unpinMessage(message) {\n return this.rest.makeRequest('delete', Endpoints.Channel(message.channel).Pin(message.id), true)\n .then(() => message);\n }\n\n getChannelPinnedMessages(channel) {\n return this.rest.makeRequest('get', Endpoints.Channel(channel).pins, true);\n }\n\n createChannelInvite(channel, options, reason) {\n const payload = {};\n payload.temporary = options.temporary;\n payload.max_age = options.maxAge;\n payload.max_uses = options.maxUses;\n payload.unique = options.unique;\n return this.rest.makeRequest('post', Endpoints.Channel(channel).invites, true, payload, undefined, reason)\n .then(invite => new Invite(this.client, invite));\n }\n\n deleteInvite(invite, reason) {\n return this.rest.makeRequest('delete', Endpoints.Invite(invite.code), true, undefined, undefined, reason)\n .then(() => invite);\n }\n\n getInvite(code) {\n return this.rest.makeRequest('get', Endpoints.Invite(code), true).then(invite =>\n new Invite(this.client, invite)\n );\n }\n\n getGuildInvites(guild) {\n return this.rest.makeRequest('get', Endpoints.Guild(guild).invites, true).then(inviteItems => {\n const invites = new Collection();\n for (const inviteItem of inviteItems) {\n const invite = new Invite(this.client, inviteItem);\n invites.set(invite.code, invite);\n }\n return invites;\n });\n }\n\n getGuildVanityCode(guild) {\n return this.rest.makeRequest('get', Endpoints.Guild(guild).vanityURL, true)\n .then(res => res.code);\n }\n\n pruneGuildMembers(guild, days, dry, reason) {\n return this.rest.makeRequest(dry ?\n 'get' :\n 'post',\n `${Endpoints.Guild(guild).prune}?days=${days}`, true, undefined, undefined, reason)\n .then(data => data.pruned);\n }\n\n createEmoji(guild, image, name, roles, reason) {\n const data = { image, name };\n if (roles) data.roles = roles.map(r => r.id ? r.id : r);\n return this.rest.makeRequest('post', Endpoints.Guild(guild).emojis, true, data, undefined, reason)\n .then(emoji => this.client.actions.GuildEmojiCreate.handle(guild, emoji).emoji);\n }\n\n updateEmoji(emoji, _data, reason) {\n const data = {};\n if (_data.name) data.name = _data.name;\n if (_data.roles) data.roles = _data.roles.map(r => r.id ? r.id : r);\n return this.rest.makeRequest('patch', Endpoints.Guild(emoji.guild).Emoji(emoji.id), true, data, undefined, reason)\n .then(newEmoji => this.client.actions.GuildEmojiUpdate.handle(emoji, newEmoji).emoji);\n }\n\n deleteEmoji(emoji, reason) {\n return this.rest.makeRequest('delete', Endpoints.Guild(emoji.guild).Emoji(emoji.id), true, undefined, reason)\n .then(() => this.client.actions.GuildEmojiDelete.handle(emoji).emoji);\n }\n\n getGuildAuditLogs(guild, options = {}) {\n if (options.before && options.before instanceof GuildAuditLogs.Entry) options.before = options.before.id;\n if (options.after && options.after instanceof GuildAuditLogs.Entry) options.after = options.after.id;\n if (typeof options.type === 'string') options.type = GuildAuditLogs.Actions[options.type];\n\n const queryString = (querystring.stringify({\n before: options.before,\n after: