(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[2888],{ /***/ 20701: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Lt": function() { return /* binding */ BasicEvent; }, /* harmony export */ "cQ": function() { return /* binding */ Utils; }, /* harmony export */ "iQ": function() { return /* binding */ ErrorResponse; } /* harmony export */ }); /* unused harmony exports AbstractBuffer, InternalBuffer, StringMode, EncryptionUtils, Services, Service, ServiceClass, ClassVariable, ClassMeta, GetClassMeta, RegisterClass, RegisterClassVariable, UniqueArray, DataProviderVariable, VARIABLE, Class, DataProvider, Base64, Base85, Benchmark, BinaryUtils, Color, ColorUtils, InternalError, PromiseEvent, HaxCompressor, HaxEncryptor3, HaxRNG, ImprovedPerlin, StringUtils, TextUtils, Time, ObjectUtils, Mat4, Quat, Vec2, Vec3, WrappedBuffer, DynamicBuffer, SimpleBuffer, BufferError, AsyncQueue */ /* provided dependency */ var process = __webpack_require__(34155); /* provided dependency */ var Buffer = __webpack_require__(30816)["lW"]; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } class BinaryUtils { static stringToUint8Array(string) { let size = 0; for (let i = 0, len = string.length; i < len; i++) { const charcode = string.charCodeAt(i); if (charcode < 0x80) { size++; } else if (charcode < 0x800) { size += 2; } else if (charcode < 0xd800 || charcode >= 0xe000) { size += 3; } else { size += 4; } } const out = new Uint8Array(size); let index = 0; for (let i = 0, len = string.length; i < len; i++) { let charcode = string.charCodeAt(i); if (charcode < 0x80) { out[index++] = charcode; } else if (charcode < 0x800) { out[index++] = 0xc0 | (charcode >> 6); out[index++] = 0x80 | (charcode & 0x3f); } else if (charcode < 0xd800 || charcode >= 0xe000) { out[index++] = 0xe0 | (charcode >> 12); out[index++] = 0x80 | ((charcode >> 6) & 0x3f); out[index++] = 0x80 | (charcode & 0x3f); } else { i++; charcode = 0x10000 + (((charcode & 0x3ff) << 10) | (string.charCodeAt(i) & 0x3ff)); out[index++] = 0xf0 | (charcode >> 18); out[index++] = 0x80 | ((charcode >> 12) & 0x3f); out[index++] = 0x80 | ((charcode >> 6) & 0x3f); out[index++] = 0x80 | (charcode & 0x3f); } } return out; } static uint8ToStringArray(array) { let str = ""; const end = array.length; let i = 0; while (i < end) { const value = array[i]; i++; if (value < 0x80) { str += String.fromCharCode(value); } else if (value < 0xE0 && value > 0xBF) { str += String.fromCharCode((value & 0x1F) << 6 | array[i++] & 0x3F); } else if (value < 0xF0 && value > 0xDF) { str += String.fromCharCode((value & 0x0F) << 12 | (array[i++] & 0x3F) << 6 | array[i++] & 0x3F); } else { const charCode = ((value & 0x07) << 18 | (array[i++] & 0x3F) << 12 | (array[i++] & 0x3F) << 6 | array[i++] & 0x3F) - 0x010000; str += String.fromCharCode(charCode >> 10 | 0xD800, charCode & 0x03FF | 0xDC00); } } return str; } } class Base85 { constructor(map) { if (map.length !== 85) { throw new Error(); } let chars = []; for (let i = 0; i < map.length; i++) { chars.push(map.charAt(i)); } let rev = {}; chars.forEach((c, i) => { rev[c] = i; }); this.chars = chars; this.rev = rev; } encodeString(text) { return this.encode(BinaryUtils.stringToUint8Array(text)); } encode(array) { let chars = this.chars; let out = ""; let length = array.length; let groups = Math.floor(array.length / 4); for (let g = 0; g < groups; g++) { let number = 0; for (let i = 0; i < 4; i++) { number = (number * 256) + array[g * 4 + i]; } let divider = 85 * 85 * 85 * 85; for (let i = 0; i < 5; i++) { out += chars[((number / divider) >>> 0) % 85]; divider /= 85; } } let lastIndex = groups * 4; let lastSize = length - lastIndex; if (lastSize !== 0) { let number = 0; for (let i = 0; i < lastSize; i++) { number = (number * 256) + array[lastIndex + i]; } let divider = 85; if (lastSize === 3) { divider = 85 * 85 * 85; } else if (lastSize === 2) { divider = 85 * 85; } for (let i = 0; i < lastSize + 1; i++) { out += chars[((number / divider) >>> 0) % 85]; divider /= 85; } } return out; } decodeString(text) { return BinaryUtils.uint8ToStringArray(this.decode(text)); } decode(array) { let rev = this.rev; let length = array.length; let groups = Math.floor(array.length / 5); let lastIndex = groups * 5; let lastSize = length - lastIndex; let out = new Uint8Array(groups * 4 + (lastSize > 1 ? lastSize - 1 : 0)); let index = 0; for (let g = 0; g < groups; g++) { let number = 0; for (let i = 0; i < 5; i++) { number = number * 85 + rev[array[g * 5 + i]]; } let divider = 256 * 256 * 256; for (let i = 0; i < 4; i++) { out[index++] = ((number / divider) >>> 0) % 256; divider /= 256; } } if (lastSize !== 0) { let number = 0; for (let i = 0; i < lastSize; i++) { number = number * 85 + rev[array[lastIndex + i]]; } let divider = 1; if (lastSize === 4) { divider = 256 * 256; } else if (lastSize === 3) { divider = 256; } for (let i = 0; i < lastSize - 1; i++) { out[index++] = ((number / divider) >>> 0) % 256; divider /= 256; } } return out; } intToString(number) { number = number >>> 0; let out = ""; let divider = 85 * 85 * 85 * 85; for (let i = 0; i < 5; i++) { out += this.chars[((number / divider) >>> 0) % 85]; divider /= 85; } return out; } stringToInt(str) { let number = 0; for (let i = 0; i < 5; i++) { number = number * 85 + this.rev[str[i]]; } return number >>> 0; } } Base85.default = new Base85("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&_;()[]{}@%$#"); class HaxCompressor { static compressNumber(num, size) { if (num < 0 || num > Number.MAX_SAFE_INTEGER || num !== Math.floor(num)) { return ":" + num; } num = Math.floor(num); let text = ""; let handled = 0; let i = 0; while (i < 9) { let charNumber = Math.floor(i > 0 ? num / Math.pow(HaxCompressor.charsLength, i) : num) % HaxCompressor.charsLength; text = HaxCompressor.chars.charAt(charNumber) + text; handled += (charNumber) * (Math.pow(HaxCompressor.charsLength, i)); i++; if ((size === undefined || i >= size) && handled >= num) { break; } } return text; } static decompressNumber(text) { if (text.startsWith(":")) { return +text.substring(1); } let num = 0; for (let i = 0; i < text.length; i++) { num *= HaxCompressor.charsLength; num += HaxCompressor.charsRev[text[i]]; } return num; } } HaxCompressor.chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; HaxCompressor.charsRev = { "0": 0, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "9": 9, "A": 10, "B": 11, "C": 12, "D": 13, "E": 14, "F": 15, "G": 16, "H": 17, "I": 18, "J": 19, "K": 20, "L": 21, "M": 22, "N": 23, "O": 24, "P": 25, "Q": 26, "R": 27, "S": 28, "T": 29, "U": 30, "V": 31, "W": 32, "X": 33, "Y": 34, "Z": 35, "a": 36, "b": 37, "c": 38, "d": 39, "e": 40, "f": 41, "g": 42, "h": 43, "i": 44, "j": 45, "k": 46, "l": 47, "m": 48, "n": 49, "o": 50, "p": 51, "q": 52, "r": 53, "s": 54, "t": 55, "u": 56, "v": 57, "w": 58, "x": 59, "y": 60, "z": 61 }; HaxCompressor.charsLength = HaxCompressor.chars.length; const modulus = 0x80000000; const multiplier = 1103515245; const increment = 12345; const floatUnit = 1.0 / modulus; /** Toy RNG implementation do not use in production or security applications */ class HaxRNG { constructor(seed) { seed = (seed >>> 0); if (seed < 0) { seed = 2345679; } this.state = seed % modulus; this.nextInt(); // init } nextUInt() { return (this.state = (multiplier * this.state + increment) % modulus); } safeUInt() { return (31 * ((this.state = (multiplier * this.state + increment) % modulus) + 31 * (this.state = (multiplier * this.state + increment) % modulus)) + (this.state = (multiplier * this.state + increment) % modulus)) >>> 0; } nextInt() { return (31 * (this.state = (multiplier * this.state + increment) % modulus) + (this.state = (multiplier * this.state + increment) % modulus)) | 0; } boolean(chance = 0.5) { return ((this.state = (multiplier * this.state + increment) % modulus) * (floatUnit)) < chance; } nextFloat() { return (this.state = (multiplier * this.state + increment) % modulus) * (floatUnit); } nextUByte() { return ((this.state = (multiplier * this.state + increment) % modulus) >>> 8) & 0xFF; } nextUShort() { return ((this.state = (multiplier * this.state + increment) % modulus) >>> 8) & 0xFFFF; } /* public nextUInt() { return (this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus); } public safeUInt() { return ( 31 * ( (this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) + 31 * (this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) ) + (this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) ) >>> 0; } public nextInt() { return ( 31 * (this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) + (this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) ) | 0; } public boolean(chance: number = 0.5) { return ((this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) * (floatUnit)) < chance; } public nextFloat() { return (this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) * (floatUnit); } public nextUByte() { return ((this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) >>> 8) & 0xFF; } public nextUShort() { return ((this.state = ((Math.imul(this.state, multiplier) >>> 0) + increment) % modulus) >>> 8) & 0xFFFF; } */ nextHChar() { return HaxCompressor.chars[this.nextUInt() % HaxCompressor.charsLength]; } rangeInt(min, max) { min = (min) | 0; max = (max) | 0; return ((this.nextFloat() * (max - min)) + min) | 0; } rangeFloat(min, max) { min = +(min); max = +(max); return +((this.nextFloat() * (max - min)) + min); } pickArraySafe(array) { if (array.length <= 0) { throw new Error("... it wasn't safe..."); } return array[this.rangeInt(0, array.length)]; } pickArray(array) { if (array.length <= 0) { return undefined; } return array[this.rangeInt(0, array.length)]; } } var ObjectUtils; (function (ObjectUtils) { function deepCopy(input) { if (input === null || input === undefined) { return input; } else if (typeof input === "object") { if (Array.isArray(input)) { input = input.map((x) => deepCopy(x)); } else { let output = {}; for (const key in input) { if (Object.prototype.hasOwnProperty.call(input, key)) { const value = input[key]; output[key] = deepCopy(value); } } input = output; } } return input; } ObjectUtils.deepCopy = deepCopy; /** Construct an object of type T and assign data to it */ function from(target, data, ...args) { return Object.assign(new target(...args), data); } ObjectUtils.from = from; /** Construct an object of type T and assign JSON data to it */ function fromJSON(target, data, ...args) { return from(target, JSON.parse(data), ...args); } ObjectUtils.fromJSON = fromJSON; })(ObjectUtils || (ObjectUtils = {})); var Utils; (function (Utils) { Utils.Object = ObjectUtils; /** Generate a random integer between min and max(inclusive) */ function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1) + min); } Utils.randomInt = randomInt; /** Generate a random integer between min and max(exclusive) */ function rangeInt(min, max) { min = (min) | 0; max = (max) | 0; return ((Math.random() * (max - min)) + min) | 0; } Utils.rangeInt = rangeInt; /** Generate a random float between min and max(exclusive) */ function rangeFloat(min, max) { min = +(min); max = +(max); return +((Math.random() * (max - min)) + min); } Utils.rangeFloat = rangeFloat; function pickArray(array) { if (array.length <= 0) { return undefined; } return array[Utils.rangeInt(0, array.length)]; } Utils.pickArray = pickArray; function minMax(value, min = 0, max = 1) { if (min >= max) { throw new Error("[minMax] min >= max"); } return (value > max) ? max : ((value < min) ? min : value); } Utils.minMax = minMax; /** Converts number from one range to another */ function remapRange(value, sourceMin = 0, sourceMax = 1, targetMin = 0, targetMax = 1) { if (sourceMin >= sourceMax) { throw new Error("[remapRange] sourceMin >= sourceMax"); } if (value > sourceMax) { value = sourceMax; } if (value < sourceMin) { value = sourceMin; } return (value - sourceMin) * (targetMax - targetMin) / (sourceMax - sourceMin) + targetMin; } Utils.remapRange = remapRange; function sortedIndex(array, value) { let low = 0; let high = array.length; while (low < high) { let mid = low + high >>> 1; if (array[mid] < value) { low = mid + 1; } else { high = mid; } } return low; } Utils.sortedIndex = sortedIndex; function sortedInsert(array, value) { let index = Utils.sortedIndex(array, value); array.splice(index, 0, value); } Utils.sortedInsert = sortedInsert; function sortedIndexComparator(array, value, comparator) { let min = 0; let max = array.length; let index = (min + max) >>> 1; while (max > min) { if (comparator(value, array[index]) < 0) { max = index; } else { min = index + 1; } index = (min + max) >>> 1; } return index; } Utils.sortedIndexComparator = sortedIndexComparator; function sortedInsertComparator(array, value, comparator) { let index = Utils.sortedIndexComparator(array, value, comparator); array.splice(index, 0, value); } Utils.sortedInsertComparator = sortedInsertComparator; function timeout(delay) { return __awaiter(this, void 0, void 0, function* () { const lastTime = Date.now(); return new Promise(resolve => { setTimeout((args, ms) => { resolve(Date.now() - lastTime); }, delay); }); }); } Utils.timeout = timeout; function internalNextTick(cb) { if ((typeof process === 'object') && process && (typeof process.nextTick === 'function')) { return process.nextTick(cb); } if (typeof queueMicrotask === "function") { return queueMicrotask(cb); } if (typeof setImmediate === 'function') { return setImmediate(cb); } return setTimeout(cb, 0); } Utils.internalNextTick = internalNextTick; function internalImmediate(cb) { if (typeof setImmediate === 'function') { return setImmediate(cb); } return setTimeout(cb, 0); } Utils.internalImmediate = internalImmediate; function immediate(value) { return __awaiter(this, void 0, void 0, function* () { return new Promise(resolve => { Utils.internalImmediate(() => resolve(value)); }); }); } Utils.immediate = immediate; function nextTick(value) { return __awaiter(this, void 0, void 0, function* () { return new Promise(resolve => { Utils.internalNextTick(() => resolve(value)); }); }); } Utils.nextTick = nextTick; function strReplaceMulti(str, replace) { let out = ""; let i = 0; while (i < str.length) { let replaced = false; for (const find in replace) { if (replace.hasOwnProperty(find)) { const target = replace[find]; if (str.startsWith(find, i)) { out += target; i += find.length; replaced = true; break; } } } if (!replaced) { out += str[i]; i++; } } return out; } Utils.strReplaceMulti = strReplaceMulti; let hidIndex = 0; function generateHID() { const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let text = ""; const time = new Date().valueOf(); for (let i = 0; i < 8; i++) { text += chars.charAt(Math.floor(Math.random() * chars.length)); } for (let i = 0; i < 2; i++) { text += chars.charAt(Math.floor(i > 0 ? hidIndex / Math.pow(chars.length, i) : hidIndex) % chars.length); } hidIndex++; for (let i = 0; i < 6; i++) { text += chars.charAt(Math.floor(i > 0 ? time / Math.pow(chars.length, i) : time) % chars.length); } return text; } Utils.generateHID = generateHID; let huuidIndex = 0; let huuidRNG = new HaxRNG(Date.now()); function generateHUUID() { const time = (Date.now() / 1000) | 0; let text = HaxCompressor.compressNumber(time, 6); text += HaxCompressor.compressNumber(huuidIndex, 3); for (let i = 0; i < 4; i++) { text += HaxCompressor.chars.charAt(Math.floor(Math.random() * HaxCompressor.charsLength)); } for (let i = 0; i < 3; i++) { text += huuidRNG.nextHChar(); } huuidIndex++; return text; } Utils.generateHUUID = generateHUUID; function generateHUUID24() { const time = (Date.now() / 1000) | 0; let text = HaxCompressor.compressNumber(time, 8); text += HaxCompressor.compressNumber(huuidIndex, 3); for (let i = 0; i < 6; i++) { text += HaxCompressor.chars.charAt(Math.floor(Math.random() * HaxCompressor.charsLength)); } for (let i = 0; i < 7; i++) { text += huuidRNG.nextHChar(); } huuidIndex++; return text; } Utils.generateHUUID24 = generateHUUID24; Utils.imul = Math.imul != undefined ? Math.imul : (a, b) => { let result = (a & 0x003fffff) * b; if (a & 0xffc00000) result += ((a & 0xffc00000) * b) | 0; return result | 0; }; // cyrb53 (public domain) function hashString(str) { let h1 = 0xdeadbeef; let h2 = 0x41c6ce57; for (let i = 0, ch; i < str.length; i++) { ch = str.charCodeAt(i); h1 = Utils.imul(h1 ^ ch, 2654435761); h2 = Utils.imul(h2 ^ ch, 1597334677); } h1 = Utils.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Utils.imul(h2 ^ (h2 >>> 13), 3266489909); h2 = Utils.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Utils.imul(h1 ^ (h1 >>> 13), 3266489909); return Base85.default.intToString(h2 >>> 0) + Base85.default.intToString(h1 >>> 0); } Utils.hashString = hashString; function equals(a, b, keyIgnore) { if (a === b) { return true; } if (Array.isArray(a) && Array.isArray(b)) { if (a.length !== b.length) { return false; } for (let i = 0; i < a.length; i++) { if (!Utils.equals(a[i], b[i], keyIgnore)) { return false; } } return true; } if (!(typeof (a) === "object") || !(typeof (b) === "object") || a === null || b === null) { return false; } if (a.constructor !== b.constructor) { return false; } for (const key in a) { if ((keyIgnore && keyIgnore(key))) { continue; } if (!a.hasOwnProperty(key)) { continue; } if (!b.hasOwnProperty(key)) { return false; } if (a[key] === b[key]) { continue; } if (typeof (a[key]) !== "object") { return false; } if (!Utils.equals(a[key], b[key], keyIgnore)) { return false; } } for (const key in b) { if ((keyIgnore && keyIgnore(key))) { continue; } if (b.hasOwnProperty(key) && !a.hasOwnProperty(key)) { return false; } } return true; } Utils.equals = equals; function randomWeightedObject(object) { let totalWeight = 0; for (let name in object) { if (object.hasOwnProperty(name)) { let element = object[name]; totalWeight += element.weight; } } let randomWeight = Math.random() * totalWeight; for (let name in object) { if (object.hasOwnProperty(name)) { let element = object[name]; randomWeight -= element.weight; if (randomWeight <= 0) { return { key: name, value: element }; } } } return undefined; } Utils.randomWeightedObject = randomWeightedObject; function randomWeightedArray(object) { let totalWeight = 0; for (let i = 0; i < object.length; i++) { const element = object[i]; totalWeight += element.weight; } let randomWeight = Math.random() * totalWeight; for (let i = 0; i < object.length; i++) { const element = object[i]; randomWeight -= element.weight; if (randomWeight <= 0) { return { key: i, value: element }; } } return undefined; } Utils.randomWeightedArray = randomWeightedArray; function getOrdinal(num) { let s = ["th", "st", "nd", "rd"]; let v = num % 100; return num.toLocaleString("en-US") + (s[(v - 20) % 10] || s[v] || s[0]); } Utils.getOrdinal = getOrdinal; function initArray(size, value) { if (typeof value === "function") { const arr = []; arr.length = size; for (let i = 0; i < size; i++) { arr[i] = value(i); } return arr; } else { const arr = []; arr.length = size; for (let i = 0; i < size; i++) { arr[i] = value; } return arr; } } Utils.initArray = initArray; function initArray2(sizeX, sizeY, value) { let size = sizeX * sizeY; const arr = []; arr.length = size; for (let y = 0; y < sizeY; y++) { for (let x = 0; x < sizeX; x++) { let i = y * sizeX + x; arr[i] = value(x, y, i); } } return arr; } Utils.initArray2 = initArray2; function initArray3(sizeX, sizeY, sizeZ, value) { let size = sizeX * sizeY * sizeZ; let sizeXY = sizeX * sizeY; const arr = []; arr.length = size; for (let z = 0; z < sizeZ; z++) { for (let y = 0; y < sizeY; y++) { for (let x = 0; x < sizeX; x++) { let i = z * sizeXY + y * sizeX + x; arr[i] = value(x, y, z, i); } } } return arr; } Utils.initArray3 = initArray3; function normalizeNulls(data, inArray = false) { if (typeof (data) === "object") { // tslint:disable-next-line:forin for (const key in data) { let value = data[key]; if (!inArray && value === null) { data[key] = undefined; } else if (typeof (value) === "object") { Utils.normalizeNulls(value, Array.isArray(value)); } } } } Utils.normalizeNulls = normalizeNulls; })(Utils || (Utils = {})); class EventCallbackRef { constructor(event, func, target) { this.event = event; this.func = func; this.target = target; this.valid = true; } remove() { if (this.valid === true) { this.event.removeCallbackRef(this); this.valid = false; this.event = undefined; this.func = undefined; this.target = undefined; } } } /** Basic event, provides a way to add callbacks and execute. * * TFunc is the callback function and KFunc is the execution function * * Normally TFunc and KFunc will be equal, this is exposed for overriding */ class BasicEvent { constructor() { this.callbacks = []; this.executing = false; } addCallback(func, thisArg) { if (!func) { throw new Error("Callback can't be null!"); } // Detect the usage of func.bind() - it kills optimization therefore is not allowed. if (typeof func.prototype !== "object" && func.name.substr(0, 5) === "bound") { throw new Error("Don't use .bind() on functions! (" + func.name + ")"); } const ref = new EventCallbackRef(this, func, thisArg); this.callbacks.push(ref); return ref; } clearCallbacks() { this.callbacks = []; } /** * Number of callbacks */ get count() { return this.callbacks.length; } removeCallback(func, thisArg) { const callbacks = this.executing ? Array.from(this.callbacks) : this.callbacks; for (let i = callbacks.length - 1; i >= 0; i--) { const callback = callbacks[i]; if (callback.func === func && callback.target === thisArg) { callbacks.splice(i, 1); } } this.callbacks = callbacks; } removeCallbackRef(ref) { const callbacks = this.executing ? Array.from(this.callbacks) : this.callbacks; for (let i = callbacks.length - 1; i >= 0; i--) { const callback = callbacks[i]; if (callback === ref) { callbacks.splice(i, 1); } } this.callbacks = callbacks; } hasCallback(func, thisArg) { for (let i = this.callbacks.length - 1; i >= 0; i--) { const callback = this.callbacks[i]; if (callback.func === func && callback.target === thisArg) { return true; } } return false; } execute(...args) { this.executing = true; const callbacks = this.callbacks; const length = callbacks.length; for (let i = 0; i < length; i++) { const callback = callbacks[i]; if (callback.valid === true) { const ret = callback.func.apply(callback.target, args); if (ret === BasicEvent.REMOVE_CALLBACK) { callback.remove(); } } } this.executing = false; } ; } BasicEvent.REMOVE_CALLBACK = Symbol.for("Event::REMOVE"); class PromiseEventCallbackRef { constructor(event, func, target) { this.event = event; this.func = func; this.target = target; this.valid = true; } remove() { if (this.valid === true) { this.event.removeCallbackRef(this); this.valid = false; this.event = undefined; this.func = undefined; this.target = undefined; } } } class PromiseEvent { constructor() { this.callbacks = []; this.executing = false; } addCallback(func, thisArg) { if (!func) { throw new Error("Callback can't be null!"); } // Detect the usage of func.bind() - it kills optimization therefore is not allowed. if (typeof func.prototype !== "object" && func.name.substr(0, 5) === "bound") { throw new Error("Don't use .bind() on functions! (" + func.name + ")"); } const ref = new PromiseEventCallbackRef(this, func, thisArg); this.callbacks.push(ref); return ref; } clearCallbacks() { this.callbacks = []; } /** * Number of callbacks */ get count() { return this.callbacks.length; } removeCallback(func, thisArg) { const callbacks = this.executing ? Array.from(this.callbacks) : this.callbacks; for (let i = callbacks.length - 1; i >= 0; i--) { const callback = callbacks[i]; if (callback.func === func && callback.target === thisArg) { callbacks.splice(i, 1); } } this.callbacks = callbacks; } removeCallbackRef(ref) { const callbacks = this.executing ? Array.from(this.callbacks) : this.callbacks; for (let i = callbacks.length - 1; i >= 0; i--) { const callback = callbacks[i]; if (callback === ref) { callbacks.splice(i, 1); } } this.callbacks = callbacks; } hasCallback(func, thisArg) { for (let i = this.callbacks.length - 1; i >= 0; i--) { const callback = this.callbacks[i]; if (callback.func === func && callback.target === thisArg) { return true; } } return false; } execute(...args) { return __awaiter(this, void 0, void 0, function* () { this.executing = true; const callbacks = this.callbacks; const length = callbacks.length; for (let i = 0; i < length; i++) { const callback = callbacks[i]; if (callback.valid === true) { const ret = yield callback.func.apply(callback.target, args); if (ret === BasicEvent.REMOVE_CALLBACK) { callback.remove(); } } } this.executing = false; }); } ; } class ClassVariable { constructor(name) { this.data = new Map(); this.name = name; } register(clazz) { this.data.forEach((it) => { if (it && typeof it.register === "function") { it.register(this); } }); } static createType(key) { let symbol = Symbol.for("ClassVariable::" + key); return symbol; } getData(key) { return this.data.get(key); } attachData(key, value, override) { let current = this.data.get(key); if (current === undefined || override) { this.data.set(key, value); return value; } else { throw new Error("[ClassVariable::attachData] Couldn't attach data, data already exists!"); } } } class ClassMeta { constructor(clazz, prototype) { this.registered = false; this.registerCallbacks = []; this.finalizeCallbacks = []; this.variables = new Map(); if (!clazz) { throw new Error("[ClassMeta::constructor] Something went wrong, trying to create a class with no prototype!"); } this.$clazz = clazz; this.$prototype = prototype; this.parent = Object.getPrototypeOf(prototype).constructor["$ClassMeta"]; } register(singleton) { if (this.registered) { throw new Error("[ClassMeta::register] Class already registered!"); } this.registered = true; this.singleton = singleton; this.callRegister(this); ClassMeta.registerDecorators.forEach((fn) => { fn(this); }); this.callFinalize(this); ClassMeta.finalizeDecorators.forEach((fn) => { fn(this); }); this.forEachVariable((variable) => { variable.register(this); }); } callRegister(target) { if (this.parent !== undefined) { this.parent.callRegister(target); } this.registerCallbacks.forEach((fn) => { fn(this); }); } callFinalize(target) { if (this.parent !== undefined) { this.parent.callFinalize(target); } this.finalizeCallbacks.forEach((fn) => { fn(this); }); } isRegistered() { return this.registered; } attachSingleton(instance) { if (this.singleton === false) { throw new Error("[ClassMeta::attachSingleton] This class wasn't registered as singleton class!"); } this.instance = instance; } getSingleton() { if (this.singleton === false) { throw new Error("[ClassMeta::attachSingleton] This class wasn't registered as singleton class!"); } return this.instance; } createVariable(key) { let variable = this.variables.get(key); if (variable === undefined) { variable = new ClassVariable(key); this.variables.set(key, variable); } return variable; } getVariable(key) { let variable = this.variables.get(key); if (variable !== undefined) { return variable; } if (this.parent !== undefined) { return this.parent.getVariable(key); } else { return undefined; } } forEachVariable(callback) { if (this.parent !== undefined) { this.parent.forEachVariable(callback); } this.variables.forEach(callback); } registerCallback(type, fn) { if (type === "Register") { this.registerCallbacks.push(fn); } else if (type === "Finalize") { this.finalizeCallbacks.push(fn); } else { throw new Error("[ClassMeta::RegisterCallback] Invalid callback type!"); } } static registerDecoratorCallback(type, fn) { if (type === "Register") { ClassMeta.registerDecorators.push(fn); } else if (type === "Finalize") { ClassMeta.finalizeDecorators.push(fn); } else { throw new Error("[ClassMeta::RegisterCallback] Invalid callback type!"); } } } ClassMeta.registerDecorators = []; ClassMeta.finalizeDecorators = []; function GetClassMeta(target, create) { if (!target || !target.constructor) { throw new Error("[GetClassMeta] Something went wrong, invalid target!"); } if (!target.constructor.hasOwnProperty("$ClassMeta")) { if (!create) { return undefined; } const classMeta = new ClassMeta(target.constructor, target); target.constructor["$ClassMeta"] = classMeta; return classMeta; } else { return target.constructor["$ClassMeta"]; } } function RegisterClass(target, singleton) { let meta = GetClassMeta(target.prototype, true); meta.register(singleton); return meta; } function RegisterClassVariable(target, key) { let meta = GetClassMeta(target.prototype, true); return meta.createVariable(key); } const Services = {}; function Service(name) { return function (target) { name = (name !== undefined) ? name : target.name; if (Services[name]) { throw new Error("Couldn't register " + target.name + " with name " + name + " as Service! Another service with that name is already registered!"); } target.singleton = true; target.instance = undefined; Services[name] = target; if (!target.createService) { throw new Error("Service doesn't have CreateService function on " + target.name + " with name " + name + "!"); } let serviceCreatedEvent = new BasicEvent(); target.onServiceCreated = serviceCreatedEvent; let classMeta = RegisterClass(target, true); serviceCreatedEvent.addCallback((instance) => { classMeta.attachSingleton(instance); }); }; } class ServiceClass { constructor() { this.onStartedEvent = new BasicEvent(); this.onStoppedEvent = new BasicEvent(); this.active = false; this.__starting = false; this.__stopping = false; } static createService() { const instance = new this(); let clazz = Object.getPrototypeOf(instance).constructor; if (!clazz.hasOwnProperty("singleton")) { throw new Error("Can't attach instance of service! Service not registered correctly!"); } // make sure there are no singletons already attached while (clazz.hasOwnProperty("singleton")) { if (clazz.hasOwnProperty("instance") && clazz.instance !== undefined) { throw new Error("Can't attach instance of " + Object.getPrototypeOf(instance).constructor.name + " service! " + clazz.name + " already attached!"); } clazz = Object.getPrototypeOf(clazz); } clazz = Object.getPrototypeOf(instance).constructor; while (clazz.hasOwnProperty("singleton")) { clazz.instance = instance; clazz = Object.getPrototypeOf(clazz); } Object.getPrototypeOf(instance).constructor.onServiceCreated.execute(instance); return instance; } static get valid() { if (this.instance) { return this.instance.active; } return false; } /** * Only returns the instance when it's valid (enabled and active) */ static getInstance() { if (this.instance && this.instance.active) { return this.instance; } return undefined; } setActive(active) { this.active = active; } start() { return __awaiter(this, void 0, void 0, function* () { if (this.__starting === true || this.__stopping === true) { return false; } this.__starting = true; console.log("Starting service " + Object.getPrototypeOf(this).constructor.name); let ret; try { ret = yield this.onStart(); } catch (err) { console.log("Failed to start service " + Object.getPrototypeOf(this).constructor.name + ": force stopping", err); try { yield this.onStop(); } catch (err) { // ignore } this.__starting = false; this.__stopping = false; this.setActive(false); return false; } this.setActive(true); this.onStartedEvent.execute(); this.__starting = false; console.log("Started service " + Object.getPrototypeOf(this).constructor.name); return ret; }); } stop() { return __awaiter(this, void 0, void 0, function* () { if (this.__starting === true || this.__stopping === true) { return false; } this.__stopping = true; console.log("Stopping service " + Object.getPrototypeOf(this).constructor.name); this.setActive(false); let ret; try { ret = yield this.onStop(); } catch (err) { console.log("Error stopping service " + Object.getPrototypeOf(this).constructor.name, err); this.__stopping = false; return false; } this.onStoppedEvent.execute(); this.__stopping = false; console.log("Stopped service " + Object.getPrototypeOf(this).constructor.name); return ret; }); } onStart() { return __awaiter(this, void 0, void 0, function* () { return true; }); } onStop() { return __awaiter(this, void 0, void 0, function* () { return true; }); } restart() { return __awaiter(this, void 0, void 0, function* () { if (this.__starting === true || this.__stopping === true) { return false; } if (this.active && !(yield this.stop())) { return false; } if (this.active) { throw new Error("Service still active after stopping!"); } yield Utils.timeout(1); if (!(yield this.start())) { return false; } if (!this.active) { throw new Error("Service still not active after starting!"); } return true; }); } } ServiceClass.dependencies = []; class UniqueArray extends Array { constructor(...items) { super(...items); } get(index) { return this[index]; } map(callback, thisArg) { return Array.from(this, (v, i) => callback.call(thisArg, v, i, this)); } copy() { return new UniqueArray(...this); } concat(...items) { // TODO: improve? return this.copy().concat(...items).filter((v, i, self) => self.lastIndexOf(v) === i); } push(...items) { if (items.length > 1) { items = items.filter((value, index, self) => self.lastIndexOf(value) === index); } for (const item of items) { const at = this.indexOf(item); if (at > -1) { super.splice(at, 1); } } return super.push(...items); } unshift(...items) { if (items.length > 1) { items = items.filter((value, index, self) => self.lastIndexOf(value) === index); } for (const item of items) { const at = this.indexOf(item); if (at > -1) { super.splice(at, 1); } } return super.unshift(...items); } /** * Removes the last element from an array and returns it. * If the array is empty, undefined is returned and the array is not modified. */ // pop(): T | undefined; /** * Removes the first element from an array and returns it. * If the array is empty, undefined is returned and the array is not modified. */ // shift(): T | undefined; insertAt(index, ...items) { if (items.length > 1) { items = items.filter((value, index, self) => self.lastIndexOf(value) === index); } for (const item of items) { const at = this.indexOf(item); if (at > -1) { super.splice(at, 1); if (at < index) { index--; } } } super.splice(index, 0, ...items); } removeElement(element) { const at = this.indexOf(element); if (at > -1) { super.splice(at, 1); return true; } return false; } removeAt(index) { if (index < this.length) { super.splice(index, 1); index--; return true; } return false; } clear() { super.splice(0, this.length); } /** @deprecated This function doesn't work with UniqueArray (or it's usage would be confusing) */ fill() { throw new Error("Intentionally disabled"); } /** @deprecated This function doesn't work with UniqueArray (or it's usage would be confusing) */ copyWithin() { throw new Error("Intentionally disabled"); } splice() { throw new Error("Intentionally disabled"); } } class DataProviderVariable { register(variable) { this.name = variable.name; } } const VARIABLE = ClassVariable.createType("DataProviderVariable"); /* let test_var = new ClassVariable("a"); let data = test_var.getData(VARIABLE); data; data = test_var.attachData(VARIABLE, new DataProviderVariable()); data.varA = "test"; data.varB = 123; data; data = test_var.getData(VARIABLE); data; */ function Class() { return function (target) { let classMeta = RegisterClass(target, true); }; } class DataProvider { static variable() { return function (target, key) { let variable = RegisterClassVariable(target.constructor, key).attachData(VARIABLE, new DataProviderVariable()); }; } } /* @Class() class TestAProvider { @DataProvider.variable() varA: string; @DataProvider.variable() varB: number; } let varAData = GetClassMeta(TestAProvider.prototype, false)!.getVariable("varA")!.getData(VARIABLE); varAData; let varBData = GetClassMeta(TestAProvider.prototype, false)!.getVariable("varB")!.getData(VARIABLE); varBData; */ class Base64 { constructor(map) { if (map.length !== 64) { throw new Error(); } let chars = []; for (let i = 0; i < map.length; i++) { chars.push(map.charAt(i)); } let rev = {}; chars.forEach((c, i) => { rev[c] = i; }); this.chars = chars; this.rev = rev; } encodeString(text) { return this.encode(BinaryUtils.stringToUint8Array(text)); } encode(array) { let chars = this.chars; let out = ""; let length = array.length; let groups = Math.floor(array.length / 3); for (let g = 0; g < groups; g++) { let number = 0; for (let i = 0; i < 3; i++) { number = (number * 256) + array[g * 3 + i]; } let divider = 64 * 64 * 64; for (let i = 0; i < 4; i++) { out += chars[((number / divider) >>> 0) % 64]; divider /= 64; } } let lastIndex = groups * 3; let lastSize = length - lastIndex; if (lastSize !== 0) { let number = 0; for (let i = 0; i < lastSize; i++) { number = (number * 256) + array[lastIndex + i]; } let divider = 64; if (lastSize === 2) { divider = 64 * 64; number <<= 2; } if (lastSize === 1) { number <<= 4; } for (let i = 0; i < lastSize + 1; i++) { out += chars[((number / divider) >>> 0) % 64]; divider /= 64; } } return out; } decodeString(text) { return BinaryUtils.uint8ToStringArray(this.decode(text)); } decode(array) { let rev = this.rev; let length = array.length; if (array[length - 1] === "=") { length -= 1; } if (array[length - 1] === "=") { length -= 1; } if (array[length - 1] === "=") { length -= 1; } let groups = Math.floor(length / 4); let lastIndex = groups * 4; let lastSize = length - lastIndex; let out = new Uint8Array(groups * 3 + (lastSize > 1 ? lastSize - 1 : 0)); let index = 0; for (let g = 0; g < groups; g++) { let number = 0; for (let i = 0; i < 4; i++) { number = number * 64 + rev[array[g * 4 + i]]; } let divider = 256 * 256; for (let i = 0; i < 3; i++) { out[index++] = ((number / divider) >>> 0) % 256; divider /= 256; } } if (lastSize !== 0) { let number = 0; for (let i = 0; i < lastSize; i++) { number = number * 64 + rev[array[(lastIndex) + i]]; } let divider = 1; if (lastSize === 3) { divider = 256; number >>= 2; } if (lastSize === 2) { number >>= 4; } for (let i = 0; i < lastSize - 1; i++) { out[index++] = ((number / divider) >>> 0) % 256; divider /= 256; } } return out; } packObject(data) { return this.encodeString(JSON.stringify(data)); } unpackObject(data) { return JSON.parse(this.decodeString(data)); } } Base64.default = new Base64("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); Base64.web = new Base64("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"); function now() { let hrTime = process.hrtime(); return hrTime[0] * 1000 + hrTime[1] / 1000000.0; } class Benchmark { static benchmark(func, iterations) { const starTime = now(); func(iterations); const endTime = now(); return endTime - starTime; } static benchmarkFull(tests, warmups, iterations, multiplier = 1, loops = 5) { const results = {}; for (const testName in tests) { if (tests.hasOwnProperty(testName)) { const test = tests[testName]; results[testName] = { code: test.code.trim(), results: [] }; // warmup Benchmark.benchmark(test.func, warmups); } } for (let i = 0; i < loops; i++) { for (const testName in tests) { if (tests.hasOwnProperty(testName)) { const test = tests[testName]; const time = Benchmark.benchmark(test.func, iterations); results[testName].results.push(time); console.log(testName, time); } } } return { "iterations": iterations, "multiplier": multiplier, "results": results }; } } class Color { constructor(r, g, b, a) { this.r = r | 0; this.g = g | 0; this.b = b | 0; this.a = a | 0; } copy() { return new Color(this.r, this.g, this.b, this.a); } static fromHSL(h, s, l, a) { let r, g, b; if (s === 0) { r = g = b = l; // achromatic } else { const hue2rgb = (x, y, t) => { if (t < 0) { t += 1; } if (t > 1) { t -= 1; } if (t < 1 / 6) { return x + (y - x) * 6 * t; } if (t < 1 / 2) { return y; } if (t < 2 / 3) { return x + (y - x) * (2 / 3 - t) * 6; } return x; }; const q = l < 0.5 ? l * (1 + s) : l + s - l * s; const p = 2 * l - q; r = hue2rgb(p, q, h + 1 / 3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1 / 3); } return new Color((r * 255) | 0, (g * 255) | 0, (b * 255) | 0, a); } mix(other, t) { return new Color((this.r * t) + (other.r * (1 - t)) | 0, (this.g * t) + (other.g * (1 - t)) | 0, (this.b * t) + (other.b * (1 - t)) | 0, (this.a * t) + (other.a * (1 - t)) | 0); } toHTML() { return `rgba(${this.r}, ${this.g}, ${this.b}, ${(this.a / 255).toFixed(4)})`; } } class ColorUtils { static hslToHex(h, s, l) { let r, g, b; if (s === 0) { r = g = b = l; // achromatic } else { const hue2rgb = (x, y, t) => { if (t < 0) { t += 1; } if (t > 1) { t -= 1; } if (t < 1 / 6) { return x + (y - x) * 6 * t; } if (t < 1 / 2) { return y; } if (t < 2 / 3) { return x + (y - x) * (2 / 3 - t) * 6; } return x; }; const q = l < 0.5 ? l * (1 + s) : l + s - l * s; const p = 2 * l - q; r = hue2rgb(p, q, h + 1 / 3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1 / 3); } const hexChars = "0123456789ABCDEF".split(""); function hex(x) { return hexChars[(x / 16) | 0] + hexChars[(x % 16) | 0]; } return `#${hex(((r * 255) | 0))}${hex(((g * 255) | 0))}${hex(((b * 255) | 0))}`; } } class ErrorResponse extends Error { constructor(message, code = 0) { super(message); this.code = code; this.error = message; Object.setPrototypeOf(this, new.target.prototype); } } class InternalError extends Error { constructor(message, code = 0) { super(message); this.code = code; this.error = message; Object.setPrototypeOf(this, new.target.prototype); } } // 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 const keySizeA = 47; const keySizeB = 61; const keySizeC = 83; class HaxEncryptor3 { constructor(keyA, keyB, keyC) { this.encA = new Uint8Array(256 * 256); this.decA = new Uint8Array(256 * 256); this.encB = new Uint8Array(256 * 256); this.decB = new Uint8Array(256 * 256); this.encC = new Uint8Array(256 * 256); this.decC = new Uint8Array(256 * 256); this.randomize(this.encA, this.decA, HaxEncryptor3.stringHash(keyA)); this.randomize(this.encB, this.decB, HaxEncryptor3.stringHash(keyB)); this.randomize(this.encC, this.decC, HaxEncryptor3.stringHash(keyC)); this.keyA = this.stringHashArray(keyA, keySizeA); this.keyB = this.stringHashArray(keyB, keySizeB); this.keyC = this.stringHashArray(keyC, keySizeC); this.keyHash = HaxEncryptor3.calculateHash(keyA, keyB, keyC); } static calculateHash(keyA, keyB, keyC) { let keyHash = HaxEncryptor3.stringHash(keyA + keyB + keyC); keyHash = HaxEncryptor3.stringHash("Special0CaloriesSalt" + keyHash); keyHash = HaxEncryptor3.stringHash("EmptyCalories" + keyHash); keyHash = HaxEncryptor3.stringHash("ImpossibleSalt" + keyHash); return keyHash; } randomize(encArray, decArray, seed) { const rngA = new HaxRNG(seed | 0); const rngB = new HaxRNG((seed + rngA.safeUInt() + 666) | 0); const rngC = new HaxRNG((seed + rngA.safeUInt() + 1337) | 0); for (let i = 0; i < 256; i++) { for (let j = 0; j < 256; j++) { encArray[(i * 256) + j] = j; } for (let j = 0; j < 256; j++) { const r2 = rngA.nextUByte(), tmp = encArray[(i * 256) + j]; encArray[(i * 256) + j] = encArray[(i * 256) + r2]; encArray[(i * 256) + r2] = tmp; } for (let j = 0; j < 256; j++) { const r1 = rngB.nextUByte(), tmp = encArray[(i * 256) + r1]; encArray[(i * 256) + r1] = encArray[(i * 256) + j]; encArray[(i * 256) + j] = tmp; } for (let j = 0; j < (4 * 256); j++) { const r1 = rngC.nextUByte(), r2 = rngC.nextUByte(), tmp = encArray[(i * 256) + r1]; encArray[(i * 256) + r1] = encArray[(i * 256) + r2]; encArray[(i * 256) + r2] = tmp; } for (let j = 0; j < 256; j++) { const r1 = rngA.nextUByte(), r2 = rngB.nextUByte(), tmp = encArray[(i * 256) + r1]; encArray[(i * 256) + r1] = encArray[(i * 256) + r2]; encArray[(i * 256) + r2] = tmp; } } for (let i = 0; i < 256; i++) { for (let j = 0; j < 256; j++) { decArray[(i * 256) + (encArray[(i * 256) + j])] = j; } } } stringHashArray(str, size) { str = str + "$HaxEncryptor$" + str + "$HaxEncryptor$" + str; const length = str.length; const outBuffer = new Uint8Array(size); // outBuffer let hashCode = 0; for (let i = 0; i < size; i++) { hashCode += i; for (let j = i; j < i + 8; j++) { hashCode = (31 * hashCode + str.charCodeAt(j % length)) << 0; } outBuffer[i] = (hashCode | 0); } return outBuffer; } static stringHash(str) { str = str + "$HaxEncryptor$" + str + "$HaxEncryptor$" + str; let hashCode = 0; for (let i = 0; i < str.length; i++) { hashCode = (31 * hashCode + str.charCodeAt(i)) << 0; } return hashCode; } encrypt(buffer, keyOffset) { const size = buffer.byteLength; const outBuffer = new Uint8Array(buffer.byteLength); for (let i = 0; i < size; i++) { outBuffer[i] = this.encryptByte(buffer[i], keyOffset + i); } return outBuffer; } encryptByte(input, keyOffset) { input = input | 0; input = (this.encA[this.keyA[keyOffset % keySizeA] * 256 + input] | 0); input = (this.encB[this.keyB[keyOffset % keySizeB] * 256 + input] | 0); input = (this.encC[this.keyC[keyOffset % keySizeC] * 256 + input] | 0); return input; } decrypt(buffer, keyOffset) { const size = buffer.byteLength; const outBuffer = new Uint8Array(buffer.byteLength); for (let i = 0; i < size; i++) { outBuffer[i] = this.decryptByte(buffer[i], keyOffset + i); } return outBuffer; } decryptByte(input, keyOffset) { input = input | 0; input = (this.decC[this.keyC[keyOffset % keySizeC] * 256 + input] | 0); input = (this.decB[this.keyB[keyOffset % keySizeB] * 256 + input] | 0); input = (this.decA[this.keyA[keyOffset % keySizeA] * 256 + input] | 0); return input; } } class ImprovedPerlin { static noise3(x, y, z) { let X = ImprovedPerlin.floor(x) & 255; let Y = ImprovedPerlin.floor(y) & 255; let Z = ImprovedPerlin.floor(z) & 255; x -= ImprovedPerlin.floor(x); y -= ImprovedPerlin.floor(y); z -= ImprovedPerlin.floor(z); let u = ImprovedPerlin.fade(x); let v = ImprovedPerlin.fade(y); let w = ImprovedPerlin.fade(z); let A = ImprovedPerlin.p[X] + Y, AA = ImprovedPerlin.p[A] + Z, AB = ImprovedPerlin.p[A + 1] + Z; let B = ImprovedPerlin.p[X + 1] + Y, BA = ImprovedPerlin.p[B] + Z, BB = ImprovedPerlin.p[B + 1] + Z; return ImprovedPerlin.lerp(w, ImprovedPerlin.lerp(v, ImprovedPerlin.lerp(u, ImprovedPerlin.grad3(ImprovedPerlin.p[AA], x, y, z), ImprovedPerlin.grad3(ImprovedPerlin.p[BA], x - 1, y, z)), ImprovedPerlin.lerp(u, ImprovedPerlin.grad3(ImprovedPerlin.p[AB], x, y - 1, z), ImprovedPerlin.grad3(ImprovedPerlin.p[BB], x - 1, y - 1, z))), ImprovedPerlin.lerp(v, ImprovedPerlin.lerp(u, ImprovedPerlin.grad3(ImprovedPerlin.p[AA + 1], x, y, z - 1), ImprovedPerlin.grad3(ImprovedPerlin.p[BA + 1], x - 1, y, z - 1)), ImprovedPerlin.lerp(u, ImprovedPerlin.grad3(ImprovedPerlin.p[AB + 1], x, y - 1, z - 1), ImprovedPerlin.grad3(ImprovedPerlin.p[BB + 1], x - 1, y - 1, z - 1)))); } static noise2(x, y) { let X = ImprovedPerlin.floor(x) & 255, Y = ImprovedPerlin.floor(y) & 255; x -= ImprovedPerlin.floor(x); y -= ImprovedPerlin.floor(y); let u = ImprovedPerlin.fade(x), v = ImprovedPerlin.fade(y); let A = ImprovedPerlin.p[X] + Y, AA = ImprovedPerlin.p[A], AB = ImprovedPerlin.p[A + 1], B = ImprovedPerlin.p[X + 1] + Y, BA = ImprovedPerlin.p[B], BB = ImprovedPerlin.p[B + 1]; return ImprovedPerlin.lerp(v, ImprovedPerlin.lerp(u, ImprovedPerlin.grad2(ImprovedPerlin.p[AA], x, y), ImprovedPerlin.grad2(ImprovedPerlin.p[BA], x - 1, y)), ImprovedPerlin.lerp(u, ImprovedPerlin.grad2(ImprovedPerlin.p[AB], x, y - 1), ImprovedPerlin.grad2(ImprovedPerlin.p[BB], x - 1, y - 1))); } static fade(t) { return t * t * t * ((t * ((t * 6) - 15)) + 10); } static lerp(t, a, b) { return a + (t * (b - a)); } static grad3(hash, x, y, z) { let h = hash & 15; let u = h < 8 ? x : y, v = h < 4 ? y : (h === 12) || (h === 14) ? x : z; return ((h & 1) === 0 ? u : -u) + ((h & 2) === 0 ? v : -v); } static grad2(hash, x, y) { let h = hash & 11; let u = h < 8 ? x : y, v = h < 4 ? y : (h === 12) || (h === 14) ? x : 0.0; return ((h & 1) === 0 ? u : -u) + ((h & 2) === 0 ? v : -v); } static floor(x) { return x > 0 ? (x | 0) : (x | 0) - 1; } } ImprovedPerlin.p = [ 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180, 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180 ]; class StringUtils { static splitChar(str, char, limit) { let last = 0; let i = 0; const parts = []; limit = limit !== undefined ? limit : Number.POSITIVE_INFINITY; while (str.length > i && limit > 1) { if (str[i] === char) { parts.push(str.substring(last, i)); last = i + 1; limit--; } i++; } if (last < str.length) { parts.push(str.substring(last, str.length)); } else if (last === i) { parts.push(""); } return parts; } static replaceChars(str, chars) { let last = 0; let i = 0; const parts = []; while (str.length > i) { const replace = chars[str[i]]; if (replace !== undefined) { parts.push(str.substring(last, i)); parts.push(replace); last = i + 1; } i++; } if (last < str.length) { parts.push(str.substring(last, str.length)); } return parts.join(""); } static findAndReplaceAll(source, find, replace, flags = "") { return source.replace(new RegExp(find, flags + "g"), replace); } // Function that count occurrences of a substring in a string; // Source: http://stackoverflow.com/questions/4009756/how-to-count-string-occurrence-in-string/7924240#7924240 static occurrences(source, find, allowOverlapping = false) { source += ""; find += ""; if (find.length <= 0) { return (source.length + 1); } let n = 0; let pos = 0; let step = allowOverlapping ? 1 : find.length; while (true) { pos = source.indexOf(find, pos); if (pos >= 0) { ++n; pos += step; } else { break; } } return n; } } class TextUtils { static toStringMapping(args) { const map = {}; args.forEach((arg) => { map[arg] = true; }); return map; } static getLetterData(char) { let isLowerLetter = !!TextUtils.lowerLetters[char]; let isUpperLetter = !!TextUtils.upperLetters[char]; let isLetter = isLowerLetter || isUpperLetter; return { isLowerLetter, isUpperLetter, isLetter }; } static cleanWord(str) { let last = 0; let i = 0; const parts = []; while (str.length > i) { if (!TextUtils.getLetterData(str[i]).isLetter) { parts.push(str.substring(last, i)); last = i + 1; } i++; } if (last < str.length) { parts.push(str.substring(last, str.length)); } return parts.join(""); } static splitToWords(str) { let parts = []; { // split using spaces let lastSplit = 0; let i = 0; let last = TextUtils.getLetterData(str[0]); while (str.length > i) { let char = str[i]; let current = TextUtils.getLetterData(char); if (char === " ") { parts.push(str.substring(lastSplit, i)); lastSplit = i + 1; } i++; last = current; } if (lastSplit < str.length) { parts.push(str.substring(lastSplit, str.length)); } } { // split TextTTextText -> Tex TText Text let lastSplit = 0; let i = 0; let last = TextUtils.getLetterData(str[0]); while (str.length > i) { let char = str[i]; let current = TextUtils.getLetterData(char); if (char === " " || !current.isLetter) { parts.push(str.substring(lastSplit, i)); lastSplit = i + 1; } else if (current.isUpperLetter && last.isLowerLetter) { parts.push(str.substring(lastSplit, i)); lastSplit = i; } i++; last = current; } if (lastSplit < str.length) { parts.push(str.substring(lastSplit, str.length)); } } { // split TextTTextText -> Textt Text Text let lastSplit = 0; let i = 0; let last = TextUtils.getLetterData(str[0]); while (str.length > i) { let char = str[i]; let current = TextUtils.getLetterData(char); if (char === " " || !current.isLetter) { parts.push(str.substring(lastSplit, i)); lastSplit = i + 1; } else if (i > 1 && current.isLowerLetter && last.isUpperLetter) { parts.push(str.substring(lastSplit, i - 1)); lastSplit = i - 1; } i++; last = current; } if (lastSplit < str.length) { parts.push(str.substring(lastSplit, str.length)); } } { let lastSplit = 0; let i = 0; let last = TextUtils.getLetterData(str[0]); while (str.length > i) { let char = str[i]; let current = TextUtils.getLetterData(char); if (char === " " || !current.isLetter) { parts.push(str.substring(lastSplit, i)); lastSplit = i + 1; } else if (i > 1 && last.isUpperLetter && current.isLowerLetter) { parts.push(str.substring(lastSplit, i - 1)); lastSplit = i - 1; } i++; last = current; } if (lastSplit < str.length) { parts.push(str.substring(lastSplit, str.length)); } } { let lastSplit = 0; let i = 0; let last = TextUtils.getLetterData(str[0]); while (str.length > i) { let char = str[i]; let current = TextUtils.getLetterData(char); if (char === " " || !current.isLetter) { parts.push(str.substring(lastSplit, i)); lastSplit = i + 1; } else if (i > 0 && last.isUpperLetter !== current.isUpperLetter) { parts.push(str.substring(lastSplit, i)); lastSplit = i; } i++; last = current; } if (lastSplit < str.length) { parts.push(str.substring(lastSplit, str.length)); } } let out = []; parts.forEach((word) => { word = word.toLowerCase(); if (word.length <= 1) { // 1 character words return; } if (out.indexOf(word) === -1) { out.push(word); } let cleanWord = TextUtils.cleanWord(word); if (cleanWord !== word) { if (out.indexOf(cleanWord) === -1) { out.push(cleanWord); } } // 1337 -> leet }); return out; } } TextUtils.lowerLetters = TextUtils.toStringMapping("abcdefghijklmnopqrstuvwxyz".split("")); TextUtils.upperLetters = TextUtils.toStringMapping("ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("")); class Time { static getReadableTime(timeToPrintMS) { const second = 1000; const minute = 60 * second; const hour = 60 * minute; const day = 24 * hour; const month = 30 * day; // approximately const year = 365 * day; // approximately const time = [{ year }, { month }, { day }, { hour }, { minute }, { second }].map((item, i, a) => { const unitName = Object.keys(item)[0]; const units = timeToPrintMS / item[unitName] | 0; timeToPrintMS -= item[unitName] * units; const maybePlural = units === 1 ? "" : "s"; return units > 0 ? units + " " + unitName + maybePlural : ""; }).filter(x => x); const formattedTime = time.length > 1 ? [...time.slice(0, -1), "and", time.slice(-1)].join(" ") : time[0]; return formattedTime; } static getTimeBreakdown(timeToPrintMS) { const seconds = 1000; const minutes = 60 * seconds; const hours = 60 * minutes; const days = 24 * hours; const months = 30 * days; // approximately const years = 365 * days; // approximately let retObj = {}; [{ years }, { months }, { days }, { hours }, { minutes }, { seconds }].forEach((item, i, a) => { const unitName = Object.keys(item)[0]; const units = timeToPrintMS / item[unitName] | 0; timeToPrintMS -= item[unitName] * units; retObj[unitName] = (units > 0) ? units : 0; }); return retObj; } static getTimeBreakdownHMS(timeToPrintMS) { const seconds = 1000; const minutes = 60 * seconds; const hours = 60 * minutes; let retObj = {}; [{ hours }, { minutes }, { seconds }].forEach((item, i, a) => { const unitName = Object.keys(item)[0]; const units = timeToPrintMS / item[unitName] | 0; timeToPrintMS -= item[unitName] * units; retObj[unitName] = (units > 0) ? units : 0; }); return retObj; } static calculateDifference(then, now) { return this.getReadableTime(now.getTime() - then.getTime()); } static getTimeMDY(time) { let dateObj; if (time) { dateObj = new Date(time); } else { dateObj = new Date(); } let month = dateObj.getUTCMonth() + 1; // months from 1-12 let day = dateObj.getUTCDate(); let year = dateObj.getUTCFullYear(); let newDate = month + "/" + day + "/" + year; return newDate; } static getTimestamp(time) { let date; if (time) { date = new Date(time); } else { date = new Date(); } let year = date.getFullYear(); let month = ("0" + (date.getMonth() + 1)).substr(-2); let day = ("0" + date.getDate()).substr(-2); let hours = ("0" + date.getHours()).substr(-2); let minutes = ("0" + date.getMinutes()).substr(-2); let seconds = ("0" + date.getSeconds()).substr(-2); return "" + year + "-" + month + "-" + day + "_" + hours + "-" + minutes + "-" + seconds; } static calculateMilliseconds(hours, minutes, seconds) { let ms = hours * this.HOUR_MS; if (minutes !== undefined) { ms += minutes * this.MINUTE_MS; } if (seconds !== undefined) { ms += seconds * this.SECOND_MS; } return ms; } static asParts(timeOrDate, utc = false) { let date = (typeof (timeOrDate) === "number") ? new Date(timeOrDate) : timeOrDate; let month = ((utc === true) ? date.getUTCMonth() : date.getMonth()) + 1; // months from 1-12 let day = ((utc === true) ? date.getUTCDate() : date.getDate()); let year = ((utc === true) ? date.getUTCFullYear() : date.getFullYear()); let hours = ((utc === true) ? date.getUTCHours() : date.getHours()); let minutes = ((utc === true) ? date.getUTCMinutes() : date.getMinutes()); let seconds = ((utc === true) ? date.getUTCSeconds() : date.getSeconds()); let ms = ((utc === true) ? date.getUTCMilliseconds() : date.getMilliseconds()); return { d: day, day: day, dd: ("0" + day).substr(-2), m: month, month: month, mm: ("0" + month).substr(-2), yyyy: year, year: year, h: hours, hours: hours, hh: ("0" + hours).substr(-2), min: minutes, minutes: minutes, mmin: ("0" + minutes).substr(-2), s: seconds, seconds: seconds, ss: ("0" + seconds).substr(-2), ms: ms, milliseconds: ms, msms: ("00" + ms).substr(-3), monthName: Time.MonthNames[month - 1] }; } } Time.HOUR_MS = 60 * 60 * 1000; Time.MINUTE_MS = 60 * 1000; Time.SECOND_MS = 1000; Time.MonthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; class Quat { constructor(x = 0, y = 0, z = 0, w = 1) { this.x = x; this.y = y; this.z = z; this.w = w; } toString() { return `Quat<${this.x},${this.y},${this.z},${this.w}>`; } set(x, y, z, w) { this.x = x; this.y = y; this.z = z; this.w = w; return this; } reset() { this.x = 0; this.y = 0; this.z = 0; this.w = 1; return this; } copy(dest) { if (dest === undefined) { dest = new Quat(this.x, this.y, this.z, this.w); } else { dest.x = this.x; dest.y = this.y; dest.z = this.z; dest.w = this.w; } return dest; } roll() { let x = this.x, y = this.y, z = this.z, w = this.w; return Math.atan2(2.0 * (x * y + w * z), w * w + x * x - y * y - z * z); } pitch() { let x = this.x, y = this.y, z = this.z, w = this.w; return Math.atan2(2.0 * (y * z + w * x), w * w - x * x - y * y + z * z); } yaw() { return Math.asin(2.0 * (this.x * this.z - this.w * this.y)); } equals(other, threshold = 0.000001) { if (Math.abs(this.x - other.x) > threshold) { return false; } if (Math.abs(this.y - other.y) > threshold) { return false; } if (Math.abs(this.z - other.z) > threshold) { return false; } if (Math.abs(this.w - other.w) > threshold) { return false; } return true; } calculateW() { let x = this.x, y = this.y, z = this.z; this.w = -(Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z))); return this; } static dot(q1, q2) { return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w; } inverse() { let dot = Quat.dot(this, this); if (!dot) { this.reset(); return this; } let invDot = dot ? 1.0 / dot : 0; this.x *= -invDot; this.y *= -invDot; this.z *= -invDot; this.w *= invDot; return this; } conjugate() { this.x *= -1; this.y *= -1; this.z *= -1; return this; } length() { let x = this.x, y = this.y, z = this.z, w = this.w; return Math.sqrt(x * x + y * y + z * z + w * w); } normalize(dest) { if (!dest) { dest = this; } let x = this.x, y = this.y, z = this.z, w = this.w; let length = Math.sqrt(x * x + y * y + z * z + w * w); if (!length) { dest.x = 0; dest.y = 0; dest.z = 0; dest.w = 0; return dest; } length = 1 / length; dest.x = x * length; dest.y = y * length; dest.z = z * length; dest.w = w * length; return dest; } add(other) { this.x += other.x; this.y += other.y; this.z += other.z; this.w += other.w; return this; } multiply(other) { let q1x = this.x, q1y = this.y, q1z = this.z, q1w = this.w; let q2x = other.x, q2y = other.y, q2z = other.z, q2w = other.w; this.x = q1x * q2w + q1w * q2x + q1y * q2z - q1z * q2y; this.y = q1y * q2w + q1w * q2y + q1z * q2x - q1x * q2z; this.z = q1z * q2w + q1w * q2z + q1x * q2y - q1y * q2x; this.w = q1w * q2w - q1x * q2x - q1y * q2y - q1z * q2z; return this; } multiplyVec3(vector, dest) { if (!dest) { dest = new Vec3(); } let x = vector.x, y = vector.y, z = vector.z; let qx = this.x, qy = this.y, qz = this.z, qw = this.w; let ix = qw * x + qy * z - qz * y, iy = qw * y + qz * x - qx * z, iz = qw * z + qx * y - qy * x, iw = -qx * x - qy * y - qz * z; dest.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; dest.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; dest.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; return dest; } toMat4(dest) { if (!dest) { dest = new Mat4(); } let x = this.x, y = this.y, z = this.z, w = this.w, x2 = x + x, y2 = y + y, z2 = z + z, xx = x * x2, xy = x * y2, xz = x * z2, yy = y * y2, yz = y * z2, zz = z * z2, wx = w * x2, wy = w * y2, wz = w * z2; dest.set([ 1 - (yy + zz), xy + wz, xz - wy, 0, xy - wz, 1 - (xx + zz), yz + wx, 0, xz + wy, yz - wx, 1 - (xx + yy), 0, 0, 0, 0, 1 ]); return dest; } static sum(q1, q2, dest) { if (!dest) { dest = new Quat(); } dest.x = q1.x + q2.x; dest.y = q1.y + q2.y; dest.z = q1.z + q2.z; dest.w = q1.w + q2.w; return dest; } static product(q1, q2, dest) { if (!dest) { dest = new Quat(); } let q1x = q1.x; let q1y = q1.y; let q1z = q1.z; let q1w = q1.w; let q2x = q2.x; let q2y = q2.y; let q2z = q2.z; let q2w = q2.w; dest.x = q1x * q2w + q1w * q2x + q1y * q2z - q1z * q2y; dest.y = q1y * q2w + q1w * q2y + q1z * q2x - q1x * q2z; dest.z = q1z * q2w + q1w * q2z + q1x * q2y - q1y * q2x; dest.w = q1w * q2w - q1x * q2x - q1y * q2y - q1z * q2z; return dest; } static cross(q1, q2, dest) { if (!dest) { dest = new Quat(); } let q1x = q1.x; let q1y = q1.y; let q1z = q1.z; let q1w = q1.w; let q2x = q2.x; let q2y = q2.y; let q2z = q2.z; let q2w = q2.w; dest.x = q1w * q2z + q1z * q2w + q1x * q2y - q1y * q2x; dest.y = q1w * q2w - q1x * q2x - q1y * q2y - q1z * q2z; dest.z = q1w * q2x + q1x * q2w + q1y * q2z - q1z * q2y; dest.w = q1w * q2y + q1y * q2w + q1z * q2x - q1x * q2z; return dest; } static shortMix(q1, q2, time, dest) { if (!dest) { dest = new Quat(); } if (time <= 0.0) { q1.copy(dest); return dest; } else if (time >= 1.0) { q2.copy(dest); return dest; } let cos = Quat.dot(q1, q2), q2a = q2.copy(); if (cos < 0.0) { q2a.inverse(); cos = -cos; } let k0, k1; if (cos > 0.9999) { k0 = 1 - time; k1 = 0 + time; } else { let sin = Math.sqrt(1 - cos * cos); let angle = Math.atan2(sin, cos); let oneOverSin = 1 / sin; k0 = Math.sin((1 - time) * angle) * oneOverSin; k1 = Math.sin((0 + time) * angle) * oneOverSin; } dest.x = k0 * q1.x + k1 * q2a.x; dest.y = k0 * q1.y + k1 * q2a.y; dest.z = k0 * q1.z + k1 * q2a.z; dest.w = k0 * q1.w + k1 * q2a.w; return dest; } static mix(q1, q2, time, dest) { if (!dest) { dest = new Quat(); } let cosHalfTheta = q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w; if (Math.abs(cosHalfTheta) >= 1.0) { q1.copy(dest); return dest; } let halfTheta = Math.acos(cosHalfTheta), sinHalfTheta = Math.sqrt(1.0 - cosHalfTheta * cosHalfTheta); if (Math.abs(sinHalfTheta) < 0.001) { dest.x = q1.x * 0.5 + q2.x * 0.5; dest.y = q1.y * 0.5 + q2.y * 0.5; dest.z = q1.z * 0.5 + q2.z * 0.5; dest.w = q1.w * 0.5 + q2.w * 0.5; return dest; } let ratioA = Math.sin((1 - time) * halfTheta) / sinHalfTheta, ratioB = Math.sin(time * halfTheta) / sinHalfTheta; dest.x = q1.x * ratioA + q2.x * ratioB; dest.y = q1.y * ratioA + q2.y * ratioB; dest.z = q1.z * ratioA + q2.z * ratioB; dest.w = q1.w * ratioA + q2.w * ratioB; return dest; } /** Get quaternion from the supplied axis and angle (in degrees). */ static fromAxis(axis, angle, dest) { if (!dest) { dest = new Quat(); } angle *= 0.5; let sin = Math.sin(angle * Quat.degToRad); dest.x = axis.x * sin; dest.y = axis.y * sin; dest.z = axis.z * sin; dest.w = Math.cos(angle * Quat.degToRad); return dest; } /** Get quaternion from the supplied euler angles (in degrees) with rotation order XYZ. */ static fromRotationXYZ(angleX, angleY, angleZ, dest) { if (!dest) { dest = new Quat(); } angleX = angleX * Quat.degToRad; angleY = angleY * Quat.degToRad; angleZ = angleZ * Quat.degToRad; let sx = Math.sin(angleX * 0.5); let cx = Math.cos(angleX * 0.5); let sy = Math.sin(angleY * 0.5); let cy = Math.cos(angleY * 0.5); let sz = Math.sin(angleZ * 0.5); let cz = Math.cos(angleZ * 0.5); let cycz = cy * cz; let sysz = sy * sz; let sycz = sy * cz; let cysz = cy * sz; dest.w = (cx * cycz) - (sx * sysz); dest.x = (sx * cycz) + (cx * sysz); dest.y = (cx * sycz) - (sx * cysz); dest.z = (cx * cysz) + (sx * sycz); return dest; } /** Get quaternion from the supplied euler angles (in degrees) with rotation order ZYX. */ static fromRotationZYX(angleZ, angleY, angleX, dest) { if (!dest) { dest = new Quat(); } angleX = angleX * Quat.degToRad; angleY = angleY * Quat.degToRad; angleZ = angleZ * Quat.degToRad; let sx = Math.sin(angleX * 0.5); let cx = Math.cos(angleX * 0.5); let sy = Math.sin(angleY * 0.5); let cy = Math.cos(angleY * 0.5); let sz = Math.sin(angleZ * 0.5); let cz = Math.cos(angleZ * 0.5); let cycz = cy * cz; let sysz = sy * sz; let sycz = sy * cz; let cysz = cy * sz; dest.w = (cx * cycz) + (sx * sysz); dest.x = (sx * cycz) - (cx * sysz); dest.y = (cx * sycz) + (sx * cysz); dest.z = (cx * cysz) - (sx * sycz); return dest; } /** Get quaternion from the supplied euler angles (in degrees) with rotation order YXZ. */ static fromRotationYXZ(angleY, angleX, angleZ, dest) { if (!dest) { dest = new Quat(); } angleX = angleX * Quat.degToRad; angleY = angleY * Quat.degToRad; angleZ = angleZ * Quat.degToRad; let sx = Math.sin(angleX * 0.5); let cx = Math.cos(angleX * 0.5); let sy = Math.sin(angleY * 0.5); let cy = Math.cos(angleY * 0.5); let sz = Math.sin(angleZ * 0.5); let cz = Math.cos(angleZ * 0.5); let x = cy * sx; let y = sy * cx; let z = sy * sx; let w = cy * cx; dest.x = (x * cz) + (y * sz); dest.y = (y * cz) - (x * sz); dest.z = (w * sz) - (z * cz); dest.w = (w * cz) + (z * sz); return dest; } } Quat.degToRad = Math.PI / 180; Quat.radToDeg = 180 / Math.PI; class Vec3 { constructor(x = 0, y = 0, z = 0) { this.x = x; this.y = y; this.z = z; } static get zero() { return new Vec3(0, 0, 0); } static get up() { return new Vec3(0, 1, 0); } static get right() { return new Vec3(1, 0, 0); } static get forward() { return new Vec3(0, 0, 1); } toString() { return `Vec3<${this.x.toFixed(5)},${this.y.toFixed(5)},${this.z.toFixed(5)}>`; } set(x, y, z) { this.x = x; this.y = y; this.z = z; return this; } toXYZ() { return { x: this.x, y: this.y, z: this.z }; } reset() { this.x = 0; this.y = 0; this.z = 0; return this; } copy(dest) { if (!dest) { return new Vec3(this.x, this.y, this.z); } else { dest.x = this.x; dest.y = this.y; dest.z = this.z; return dest; } } negate(dest) { if (!dest) { dest = this; } dest.x = -this.x; dest.y = -this.y; dest.z = -this.z; return dest; } equals(vector, threshold = 0.000001) { if (Math.abs(this.x - vector.x) > threshold) { return false; } if (Math.abs(this.y - vector.y) > threshold) { return false; } if (Math.abs(this.z - vector.z) > threshold) { return false; } return true; } length() { return Math.sqrt(this.squaredLength()); } squaredLength() { const x = this.x, y = this.y, z = this.z; return (x * x + y * y + z * z); } add(vector) { this.x += vector.x; this.y += vector.y; this.z += vector.z; return this; } addScalar(value) { this.x += value; this.y += value; this.z += value; return this; } addXYZ(x, y, z) { this.x += x; this.y += y; this.z += z; return this; } subtract(vector) { this.x -= vector.x; this.y -= vector.y; this.z -= vector.z; return this; } subtractScalar(value) { this.x -= value; this.y -= value; this.z -= value; return this; } subtractXYZ(x, y, z) { this.x -= x; this.y -= y; this.z -= z; return this; } multiply(vector) { this.x *= vector.x; this.y *= vector.y; this.z *= vector.z; return this; } multiplyScalar(value) { this.x *= value; this.y *= value; this.z *= value; return this; } multiplyXYZ(x, y, z) { this.x *= x; this.y *= y; this.z *= z; return this; } divide(vector) { this.x /= vector.x; this.y /= vector.y; this.z /= vector.z; return this; } divideScalar(value) { this.x /= value; this.y /= value; this.z /= value; return this; } divideXYZ(x, y, z) { this.x /= x; this.y /= y; this.z /= z; return this; } static normalize(source, dest) { let length = source.length(); if (length === 1) { return source.copy(dest); } if (length === 0) { dest.x = 0; dest.y = 0; dest.z = 0; return dest; } length = 1.0 / length; dest.x *= length; dest.y *= length; dest.z *= length; return dest; } normalize() { let length = this.length(); if (length === 1) { return this; } if (length === 0) { this.x = 0; this.y = 0; this.z = 0; return this; } length = 1.0 / length; this.x *= length; this.y *= length; this.z *= length; return this; } multiplyByQuat(quat, dest) { if (!dest) { dest = this; } return quat.multiplyVec3(this, dest); } static cross(vector, vector2, dest) { if (!dest) { dest = new Vec3(); } const x = vector.x; const y = vector.y; const z = vector.z; const x2 = vector2.x; const y2 = vector2.y; const z2 = vector2.z; dest.x = y * z2 - z * y2; dest.y = z * x2 - x * z2; dest.z = x * y2 - y * x2; return dest; } static dot(vector, vector2) { const x = vector.x; const y = vector.y; const z = vector.z; const x2 = vector2.x; const y2 = vector2.y; const z2 = vector2.z; return (x * x2 + y * y2 + z * z2); } static distance(vector, vector2) { return Math.sqrt(this.squaredDistance(vector, vector2)); } static squaredDistance(vector, vector2) { let x = vector2.x - vector.x; let y = vector2.y - vector.y; let z = vector2.z - vector.z; return (x * x + y * y + z * z); } static direction(vector, vector2, dest) { if (!dest) { dest = new Vec3(); } const x = vector.x - vector2.x; const y = vector.y - vector2.y; const z = vector.z - vector2.z; let length = Math.sqrt(x * x + y * y + z * z); if (length === 0) { dest.x = 0; dest.y = 0; dest.z = 0; return dest; } length = 1 / length; dest.x = x * length; dest.y = y * length; dest.z = z * length; return dest; } static mix(vector, vector2, time, dest) { if (!dest) { dest = new Vec3(); } dest.x = vector.x + time * (vector2.x - vector.x); dest.y = vector.y + time * (vector2.y - vector.y); dest.z = vector.z + time * (vector2.z - vector.z); return dest; } static sum(vector, vector2, dest) { if (!dest) { dest = new Vec3(); } dest.x = vector.x + vector2.x; dest.y = vector.y + vector2.y; dest.z = vector.z + vector2.z; return dest; } static difference(vector, vector2, dest) { if (!dest) { dest = new Vec3(); } dest.x = vector.x - vector2.x; dest.y = vector.y - vector2.y; dest.z = vector.z - vector2.z; return dest; } static product(vector, vector2, dest) { if (!dest) { dest = new Vec3(); } dest.x = vector.x * vector2.x; dest.y = vector.y * vector2.y; dest.z = vector.z * vector2.z; return dest; } static quotient(vector, vector2, dest) { if (!dest) { dest = new Vec3(); } dest.x = vector.x / vector2.x; dest.y = vector.y / vector2.y; dest.z = vector.z / vector2.z; return dest; } toQuat(dest) { if (!dest) { dest = new Quat(); } let cx = Math.cos(this.x * 0.5); let sx = Math.sin(this.x * 0.5); let cy = Math.cos(this.y * 0.5); let sy = Math.sin(this.y * 0.5); let cz = Math.cos(this.z * 0.5); let sz = Math.sin(this.z * 0.5); dest.x = sx * cy * cz - cx * sy * sz; dest.y = cx * sy * cz + sx * cy * sz; dest.z = cx * cy * sz - sx * sy * cz; dest.w = cx * cy * cz + sx * sy * sz; return dest; } static unproject(vec, view, proj, viewport) { // NOTE not tested // build and invert viewproj matrix let matrix = proj.copy().multiply(view); let invMat = matrix.inverse(); if (invMat === null) { return null; } // apply viewport transform let x = (vec.x - viewport[0]) * 2.0 / viewport[2] - 1.0; let y = (vec.y - viewport[1]) * 2.0 / viewport[3] - 1.0; let z = (vec.z * 2.0) - 1.0; let w = 1.0; let tx = invMat.at(0) * x + invMat.at(4) * y + invMat.at(8) * z + invMat.at(12) * w; let ty = invMat.at(1) * x + invMat.at(5) * y + invMat.at(9) * z + invMat.at(13) * w; let tz = invMat.at(2) * x + invMat.at(6) * y + invMat.at(10) * z + invMat.at(14) * w; let tw = invMat.at(3) * x + invMat.at(7) * y + invMat.at(11) * z + invMat.at(15) * w; if (tw === 0.0) { return null; } return new Vec3(tx / tw, ty / tw, tz / tw); } } class Mat4 { constructor(values) { if (values !== undefined) { if (values instanceof Float32Array) { this.values = values; } else { this.values = new Float32Array(values); } } else { this.values = new Float32Array(Mat4.IdentityArray.buffer.slice(0)); } this._buffer = this.values.buffer; } get raw() { return this.values; } get buffer() { return this._buffer; } at(index) { return this.values[index]; } set(values) { for (let i = 0; i < 16; i++) { this.values[i] = values[i]; } return this; } reset() { this.values.set(Mat4.IdentityArray, 0); return this; } copy(dest) { if (!dest) { dest = new Mat4(); } for (let i = 0; i < 16; i++) { dest.values[i] = this.values[i]; } return dest; } all() { let data = []; for (let i = 0; i < 16; i++) { data[i] = this.values[i]; } return data; } row(index) { return [ this.values[index * 4 + 0], this.values[index * 4 + 1], this.values[index * 4 + 2], this.values[index * 4 + 3] ]; } col(index) { return [ this.values[index], this.values[index + 4], this.values[index + 8], this.values[index + 12] ]; } equals(matrix, threshold = 0.000001) { for (let i = 0; i < 16; i++) { if (Math.abs(this.values[i] - matrix.at(i)) > threshold) { return false; } } return true; } determinant() { let a00 = this.values[0], a01 = this.values[1], a02 = this.values[2], a03 = this.values[3], a10 = this.values[4], a11 = this.values[5], a12 = this.values[6], a13 = this.values[7], a20 = this.values[8], a21 = this.values[9], a22 = this.values[10], a23 = this.values[11], a30 = this.values[12], a31 = this.values[13], a32 = this.values[14], a33 = this.values[15]; let det00 = a00 * a11 - a01 * a10, det01 = a00 * a12 - a02 * a10, det02 = a00 * a13 - a03 * a10, det03 = a01 * a12 - a02 * a11, det04 = a01 * a13 - a03 * a11, det05 = a02 * a13 - a03 * a12, det06 = a20 * a31 - a21 * a30, det07 = a20 * a32 - a22 * a30, det08 = a20 * a33 - a23 * a30, det09 = a21 * a32 - a22 * a31, det10 = a21 * a33 - a23 * a31, det11 = a22 * a33 - a23 * a32; return (det00 * det11 - det01 * det10 + det02 * det09 + det03 * det08 - det04 * det07 + det05 * det06); } transpose() { let temp01 = this.values[1], temp02 = this.values[2], temp03 = this.values[3], temp12 = this.values[6], temp13 = this.values[7], temp23 = this.values[11]; this.values[1] = this.values[4]; this.values[2] = this.values[8]; this.values[3] = this.values[12]; this.values[4] = temp01; this.values[6] = this.values[9]; this.values[7] = this.values[13]; this.values[8] = temp02; this.values[9] = temp12; this.values[11] = this.values[14]; this.values[12] = temp03; this.values[13] = temp13; this.values[14] = temp23; return this; } inverse() { let a00 = this.values[0], a01 = this.values[1], a02 = this.values[2], a03 = this.values[3], a10 = this.values[4], a11 = this.values[5], a12 = this.values[6], a13 = this.values[7], a20 = this.values[8], a21 = this.values[9], a22 = this.values[10], a23 = this.values[11], a30 = this.values[12], a31 = this.values[13], a32 = this.values[14], a33 = this.values[15]; let det00 = a00 * a11 - a01 * a10, det01 = a00 * a12 - a02 * a10, det02 = a00 * a13 - a03 * a10, det03 = a01 * a12 - a02 * a11, det04 = a01 * a13 - a03 * a11, det05 = a02 * a13 - a03 * a12, det06 = a20 * a31 - a21 * a30, det07 = a20 * a32 - a22 * a30, det08 = a20 * a33 - a23 * a30, det09 = a21 * a32 - a22 * a31, det10 = a21 * a33 - a23 * a31, det11 = a22 * a33 - a23 * a32; let det = (det00 * det11 - det01 * det10 + det02 * det09 + det03 * det08 - det04 * det07 + det05 * det06); if (!det) { return null; } det = 1.0 / det; this.values[0] = (a11 * det11 - a12 * det10 + a13 * det09) * det; this.values[1] = (-a01 * det11 + a02 * det10 - a03 * det09) * det; this.values[2] = (a31 * det05 - a32 * det04 + a33 * det03) * det; this.values[3] = (-a21 * det05 + a22 * det04 - a23 * det03) * det; this.values[4] = (-a10 * det11 + a12 * det08 - a13 * det07) * det; this.values[5] = (a00 * det11 - a02 * det08 + a03 * det07) * det; this.values[6] = (-a30 * det05 + a32 * det02 - a33 * det01) * det; this.values[7] = (a20 * det05 - a22 * det02 + a23 * det01) * det; this.values[8] = (a10 * det10 - a11 * det08 + a13 * det06) * det; this.values[9] = (-a00 * det10 + a01 * det08 - a03 * det06) * det; this.values[10] = (a30 * det04 - a31 * det02 + a33 * det00) * det; this.values[11] = (-a20 * det04 + a21 * det02 - a23 * det00) * det; this.values[12] = (-a10 * det09 + a11 * det07 - a12 * det06) * det; this.values[13] = (a00 * det09 - a01 * det07 + a02 * det06) * det; this.values[14] = (-a30 * det03 + a31 * det01 - a32 * det00) * det; this.values[15] = (a20 * det03 - a21 * det01 + a22 * det00) * det; return this; } multiply(matrix) { let a00 = this.values[0], a01 = this.values[1], a02 = this.values[2], a03 = this.values[3]; let a10 = this.values[4], a11 = this.values[5], a12 = this.values[6], a13 = this.values[7]; let a20 = this.values[8], a21 = this.values[9], a22 = this.values[10], a23 = this.values[11]; let a30 = this.values[12], a31 = this.values[13], a32 = this.values[14], a33 = this.values[15]; let b0 = matrix.at(0), b1 = matrix.at(1), b2 = matrix.at(2), b3 = matrix.at(3); this.values[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; this.values[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; this.values[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; this.values[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; b0 = matrix.at(4); b1 = matrix.at(5); b2 = matrix.at(6); b3 = matrix.at(7); this.values[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; this.values[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; this.values[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; this.values[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; b0 = matrix.at(8); b1 = matrix.at(9); b2 = matrix.at(10); b3 = matrix.at(11); this.values[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; this.values[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; this.values[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; this.values[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; b0 = matrix.at(12); b1 = matrix.at(13); b2 = matrix.at(14); b3 = matrix.at(15); this.values[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; this.values[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; this.values[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; this.values[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; return this; } multiplyVec3(vector) { let x = vector.x, y = vector.y, z = vector.z; return new Vec3(this.values[0] * x + this.values[4] * y + this.values[8] * z + this.values[12], this.values[1] * x + this.values[5] * y + this.values[9] * z + this.values[13], this.values[2] * x + this.values[6] * y + this.values[10] * z + this.values[14]); } translate(vector) { let x = vector.x; let y = vector.y; let z = vector.z; this.values[12] += this.values[0] * x + this.values[4] * y + this.values[8] * z; this.values[13] += this.values[1] * x + this.values[5] * y + this.values[9] * z; this.values[14] += this.values[2] * x + this.values[6] * y + this.values[10] * z; this.values[15] += this.values[3] * x + this.values[7] * y + this.values[11] * z; return this; } scale(vector) { let x = vector.x; let y = vector.y; let z = vector.z; this.values[0] *= x; this.values[1] *= x; this.values[2] *= x; this.values[3] *= x; this.values[4] *= y; this.values[5] *= y; this.values[6] *= y; this.values[7] *= y; this.values[8] *= z; this.values[9] *= z; this.values[10] *= z; this.values[11] *= z; return this; } rotate(angle, axis) { let x = axis.x; let y = axis.y; let z = axis.z; let length = Math.sqrt(x * x + y * y + z * z); if (!length) { return null; } if (length !== 1) { length = 1 / length; x *= length; y *= length; z *= length; } let s = Math.sin(angle); let c = Math.cos(angle); let t = 1.0 - c; let a00 = this.values[0], a01 = this.values[1], a02 = this.values[2], a03 = this.values[3], a10 = this.values[4], a11 = this.values[5], a12 = this.values[6], a13 = this.values[7], a20 = this.values[8], a21 = this.values[9], a22 = this.values[10], a23 = this.values[11]; let b00 = x * x * t + c, b01 = y * x * t + z * s, b02 = z * x * t - y * s, b10 = x * y * t - z * s, b11 = y * y * t + c, b12 = z * y * t + x * s, b20 = x * z * t + y * s, b21 = y * z * t - x * s, b22 = z * z * t + c; this.values[0] = a00 * b00 + a10 * b01 + a20 * b02; this.values[1] = a01 * b00 + a11 * b01 + a21 * b02; this.values[2] = a02 * b00 + a12 * b01 + a22 * b02; this.values[3] = a03 * b00 + a13 * b01 + a23 * b02; this.values[4] = a00 * b10 + a10 * b11 + a20 * b12; this.values[5] = a01 * b10 + a11 * b11 + a21 * b12; this.values[6] = a02 * b10 + a12 * b11 + a22 * b12; this.values[7] = a03 * b10 + a13 * b11 + a23 * b12; this.values[8] = a00 * b20 + a10 * b21 + a20 * b22; this.values[9] = a01 * b20 + a11 * b21 + a21 * b22; this.values[10] = a02 * b20 + a12 * b21 + a22 * b22; this.values[11] = a03 * b20 + a13 * b21 + a23 * b22; return this; } static frustum(left, right, bottom, top, near, far) { let rl = (right - left), tb = (top - bottom), fn = (far - near); return new Mat4([ (near * 2) / rl, 0, 0, 0, 0, (near * 2) / tb, 0, 0, (right + left) / rl, (top + bottom) / tb, -(far + near) / fn, -1, 0, 0, -(far * near * 2) / fn, 0 ]); } static perspective(fov, aspect, near, far) { let top = near * Math.tan(fov * Math.PI / 360.0), right = top * aspect; return Mat4.frustum(-right, right, -top, top, near, far); } static orthographic(left, right, bottom, top, near, far) { let rl = (right - left), tb = (top - bottom), fn = (far - near); return new Mat4([ 2 / rl, 0, 0, 0, 0, 2 / tb, 0, 0, 0, 0, -2 / fn, 0, -(left + right) / rl, -(top + bottom) / tb, -(far + near) / fn, 1 ]); } static lookAt(position, target, up = Vec3.up) { if (position.equals(target)) { return new Mat4(); } let z = Vec3.difference(position, target).normalize(); let x = Vec3.cross(up, z).normalize(); let y = Vec3.cross(z, x).normalize(); return new Mat4([ x.x, y.x, z.x, 0, x.y, y.y, z.y, 0, x.z, y.z, z.z, 0, -Vec3.dot(x, position), -Vec3.dot(y, position), -Vec3.dot(z, position), 1 ]); } static product(m1, m2, result) { let a00 = m1.at(0), a01 = m1.at(1), a02 = m1.at(2), a03 = m1.at(3), a10 = m1.at(4), a11 = m1.at(5), a12 = m1.at(6), a13 = m1.at(7), a20 = m1.at(8), a21 = m1.at(9), a22 = m1.at(10), a23 = m1.at(11), a30 = m1.at(12), a31 = m1.at(13), a32 = m1.at(14), a33 = m1.at(15); let b00 = m2.at(0), b01 = m2.at(1), b02 = m2.at(2), b03 = m2.at(3), b10 = m2.at(4), b11 = m2.at(5), b12 = m2.at(6), b13 = m2.at(7), b20 = m2.at(8), b21 = m2.at(9), b22 = m2.at(10), b23 = m2.at(11), b30 = m2.at(12), b31 = m2.at(13), b32 = m2.at(14), b33 = m2.at(15); if (result) { result.set([ b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31, b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32, b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33, b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 ]); return result; } else { return new Mat4([ b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31, b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32, b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33, b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 ]); } } } Mat4.IdentityArray = new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]); class Vec2 { constructor(x = 0, y = 0) { this.x = x; this.y = y; } static get zero() { return new Vec2(0, 0); } toString() { return `Vec2<${this.x.toFixed(5)},${this.y.toFixed(5)}>`; } set(x, y) { this.x = x; this.y = y; return this; } toXY() { return { x: this.x, y: this.y }; } toUV(precision) { if (precision !== undefined) { return { u: parseFloat(this.x.toFixed(precision)), v: parseFloat(this.y.toFixed(precision)) }; } else { return { u: this.x, v: this.y }; } } reset() { this.x = 0; this.y = 0; return this; } copy(dest) { if (!dest) { return new Vec2(this.x, this.y); } else { dest.x = this.x; dest.y = this.y; return dest; } } negate(dest) { if (!dest) { dest = this; } dest.x = -this.x; dest.y = -this.y; return dest; } equals(vector, threshold = 0.000001) { if (Math.abs(this.x - vector.x) > threshold) { return false; } if (Math.abs(this.y - vector.y) > threshold) { return false; } return true; } length() { return Math.sqrt(this.squaredLength()); } squaredLength() { let { x, y } = this; return (x * x + y * y); } add(vector) { this.x += vector.x; this.y += vector.y; return this; } addScalar(value) { this.x += value; this.y += value; return this; } addXY(x, y) { this.x += x; this.y += y; return this; } subtract(vector) { this.x -= vector.x; this.y -= vector.y; return this; } subtractScalar(value) { this.x -= value; this.y -= value; return this; } subtractXY(x, y) { this.x -= x; this.y -= y; return this; } multiply(vector) { this.x *= vector.x; this.y *= vector.y; return this; } multiplyScalar(value) { this.x *= value; this.y *= value; return this; } multiplyXY(x, y) { this.x *= x; this.y *= y; return this; } divide(vector) { this.x /= vector.x; this.y /= vector.y; return this; } divideScalar(value) { this.x /= value; this.y /= value; return this; } divideXY(x, y) { this.x /= x; this.y /= y; return this; } scale(value, dest) { if (!dest) { dest = this; } dest.x *= value; dest.y *= value; return dest; } normalize(dest) { if (!dest) { dest = this; } let length = this.length(); if (length === 1) { return this; } if (length === 0) { dest.x = 0; dest.y = 0; return dest; } length = 1.0 / length; dest.x *= length; dest.y *= length; return dest; } static cross(vector, vector2, dest) { if (!dest) { dest = new Vec3(); } dest.x = 0; dest.y = 0; dest.z = vector.x * vector2.y - vector.y * vector2.x; return dest; } static dot(vector, vector2) { return (vector.x * vector2.x + vector.y * vector2.y); } static distance(vector, vector2) { return Math.sqrt(this.squaredDistance(vector, vector2)); } static squaredDistance(vector, vector2) { let x = vector2.x - vector.x; let y = vector2.y - vector.y; return (x * x + y * y); } static direction(vector, vector2, dest) { if (!dest) { dest = new Vec2(); } let x = vector.x - vector2.x; let y = vector.y - vector2.y; let length = Math.sqrt(x * x + y * y); if (length === 0) { dest.x = 0; dest.y = 0; return dest; } length = 1 / length; dest.x = x * length; dest.y = y * length; return dest; } static mix(vector, vector2, time, dest) { if (!dest) { dest = new Vec2(); } let x = vector.x; let y = vector.y; let x2 = vector2.x; let y2 = vector2.y; dest.x = x + time * (x2 - x); dest.y = y + time * (y2 - y); return dest; } static sum(vector, vector2, dest) { if (!dest) { dest = new Vec2(); } dest.x = vector.x + vector2.x; dest.y = vector.y + vector2.y; return dest; } static difference(vector, vector2, dest) { if (!dest) { dest = new Vec2(); } dest.x = vector.x - vector2.x; dest.y = vector.y - vector2.y; return dest; } static product(vector, vector2, dest) { if (!dest) { dest = new Vec2(); } dest.x = vector.x * vector2.x; dest.y = vector.y * vector2.y; return dest; } static quotient(vector, vector2, dest) { if (!dest) { dest = new Vec2(); } dest.x = vector.x / vector2.x; dest.y = vector.y / vector2.y; return dest; } } const internalBuffer = new ArrayBuffer(8); const internalBytes = new Uint8Array(internalBuffer); const internalFloatArray = new Float32Array(internalBuffer); const internalDoubleArray = new Float64Array(internalBuffer); var StringMode; (function (StringMode) { StringMode[StringMode["Fixed8"] = 0] = "Fixed8"; StringMode[StringMode["Fixed16"] = 1] = "Fixed16"; StringMode[StringMode["Fixed24"] = 2] = "Fixed24"; StringMode[StringMode["Fixed32"] = 3] = "Fixed32"; StringMode[StringMode["Dynamic"] = 4] = "Dynamic"; })(StringMode || (StringMode = {})); class InternalBuffer { constructor(size) { this._readPos = 0; this._writePos = 0; this._buffer = new ArrayBuffer(size); this.buffer = new Uint8Array(this._buffer); this.bufferS = new Int8Array(this._buffer); this._limit = this.buffer.byteLength; } toBuffer() { return this.buffer.slice(0, this._writePos); } } class AbstractBuffer { /* Utils */ static isFloat32(value) { internalFloatArray[0] = +value; return value === internalFloatArray[0]; } writeUByte(value) { this.writeUInt8(value); } readUByte() { return this.readUInt8(); } writeByte(value) { this.writeInt8(value); } readByte() { return this.readInt8(); } readString() { const length = this.readUInt32(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } writeString(string) { let buf = this.bufferFromString(string); this.writeUInt32(buf.byteLength); this.writeBuffer(buf); } readVarInt() { let value = 0; let digits = 0; while (value <= 0) { let next = this.readInt8(); if (next < 0) { value = (next << digits) + value; } else { value = (next << digits) - value; } digits += 7; } return value; } writeVarInt(value) { while (value >= 128) { this.writeInt8(-(value & 0x7F)); value >>>= 7; } } readStringMode(mode) { if (mode === StringMode.Fixed8) { const length = this.readUInt8(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else if (mode === StringMode.Fixed16) { const length = this.readUInt16(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else if (mode === StringMode.Fixed24) { const length = this.readUInt24(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else if (mode === StringMode.Fixed32) { const length = this.readUInt32(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else if (mode === StringMode.Dynamic) { let length = 0; let digits = 0; while (length <= 0) { let next = this.readInt8(); if (next < 0) { length = (next << digits) + length; } else { length = (next << digits) - length; } digits += 7; } let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else { throw new Error("Invalid StringMode!"); } } writeStringMode(mode, string) { if (mode === StringMode.Fixed8) { let buf = this.bufferFromString(string); this.writeUInt8(buf.byteLength); this.writeBuffer(buf); } else if (mode === StringMode.Fixed16) { let buf = this.bufferFromString(string); this.writeUInt16(buf.byteLength); this.writeBuffer(buf); } else if (mode === StringMode.Fixed24) { let buf = this.bufferFromString(string); this.writeUInt24(buf.byteLength); this.writeBuffer(buf); } else if (mode === StringMode.Fixed32) { let buf = this.bufferFromString(string); this.writeUInt32(buf.byteLength); this.writeBuffer(buf); } else if (mode === StringMode.Dynamic) { let buf = this.bufferFromString(string); let length = buf.byteLength; while (length >= 128) { this.writeInt8(-(length & 0x7F)); length >>>= 7; } this.writeInt8(length); this.writeBuffer(buf); } else { throw new Error("Invalid StringMode!"); } } bufferFromString(string) { // browser optimization if (__webpack_require__.g.TextEncoder !== undefined) { let encoder = new TextEncoder(); return encoder.encode(string); } return BinaryUtils.stringToUint8Array(string); } stringFromBuffer(buffer) { // browser optimization if (__webpack_require__.g.TextDecoder !== undefined) { let decoder = new TextDecoder("utf-8"); return decoder.decode(buffer); } return BinaryUtils.uint8ToStringArray(buffer); } } class BufferError extends Error { constructor(message) { super(message); this.error = message; Object.setPrototypeOf(this, new.target.prototype); } } class WrappedBuffer extends (/* unused pure expression or super */ null && (AbstractBuffer)) { constructor(buffer, offset, length) { super(); this.offset = offset; if (!(buffer instanceof ArrayBuffer)) { throw new BufferError("Couldn't create WrappedBuffer, invalid constructor argument " + typeof (buffer) + ", expected ArrayBuffer!"); } offset = offset | 0; length = length | 0; this._buffer = buffer; this.buffer = new Uint8Array(buffer, offset, length); this.bufferS = new Int8Array(buffer, offset, length); this._readPos = 0; this._writePos = 0; this._limit = this.buffer.byteLength; } getInternalBuffers() { return [this]; } static fromBuffer(buffer) { if (!(buffer instanceof Uint8Array)) { throw new BufferError("Couldn't create WrappedBuffer(fromBuffer), invalid constructor argument " + typeof (buffer) + ", expected Uint8Array!"); } return new WrappedBuffer(buffer.buffer, buffer.byteOffset, buffer.byteLength); } static fromArrayBuffer(buffer) { if (!(buffer instanceof ArrayBuffer)) { throw new BufferError("Couldn't create WrappedBuffer(fromArrayBuffer), invalid constructor argument " + typeof (buffer) + ", expected ArrayBuffer!"); } return new WrappedBuffer(buffer, 0, buffer.byteLength); } static allocate(size) { size = size | 0; return new WrappedBuffer(new ArrayBuffer(size), 0, size); } subBuffer(start, length) { return new WrappedBuffer(this._buffer, this.offset + start, length); } set writePos(value) { if (value > this._limit) { throw new BufferError("[WrappedBuffer::writePos] Can't set writePos above buffer's capacity!"); } if (value < 0) { throw new BufferError("[WrappedBuffer::writePos] Can't set writePos below 0!"); } this._writePos = value; } get writePos() { return this._writePos; } set readPos(value) { if (value > this._limit) { throw new BufferError("[WrappedBuffer::readPos] Can't set readPos above buffer's capacity!"); } if (value < 0) { throw new BufferError("[WrappedBuffer::readPos] Can't set readPos below 0!"); } this._readPos = value; } get readPos() { return this._readPos; } set limit(value) { if (value > this.buffer.byteLength) { throw new BufferError("[WrappedBuffer::limit] Can't set limit above buffer's capacity!"); } if (value < 0) { throw new BufferError("[WrappedBuffer::limit] Can't set limit below 0!"); } this._limit = value; } get limit() { return this._limit; } resetLimit() { this.limit = this.buffer.byteLength; } restart() { this._readPos = 0; this._writePos = 0; } writeBool(value) { if (this._limit < (this._writePos + 1)) { throw new BufferError("[WrappedBuffer::writeBool] buffer access out of bounds!"); } this.buffer[this._writePos++] = (value ? 1 : -1); } readBool() { if (this._limit < (this._readPos + 1)) { throw new BufferError("[WrappedBuffer::readBool] buffer access out of bounds!"); } return (this.buffer[this._readPos++] === 1); } writeUInt8(value) { if (this._limit < (this._writePos + 1)) { throw new BufferError("[WrappedBuffer::writeUByte] buffer access out of bounds!"); } this.buffer[this._writePos++] = (value | 0); } readUInt8() { if (this._limit < (this._readPos + 1)) { throw new BufferError("[WrappedBuffer::readUByte] buffer access out of bounds!"); } return this.buffer[this._readPos++]; } writeInt8(value) { if (this._limit < (this._writePos + 1)) { throw new BufferError("[WrappedBuffer::writeByte] buffer access out of bounds!"); } this.bufferS[this._writePos++] = (value | 0); } readInt8() { if (this._limit < (this._readPos + 1)) { throw new BufferError("[WrappedBuffer::readByte] buffer access out of bounds!"); } return this.bufferS[this._readPos++]; } writeInt16(value) { if (this._limit < (this._writePos + 2)) { throw new BufferError("[WrappedBuffer::writeInt16] buffer access out of bounds!"); } value = value | 0; this.bufferS[this._writePos + 0] = (value >> 8); this.buffer[this._writePos + 1] = value; this._writePos += 2; } readInt16() { if (this._limit < (this._readPos + 2)) { throw new BufferError("[WrappedBuffer::readInt16] buffer access out of bounds!"); } const out = (this.bufferS[this._readPos + 0] << 8) | this.buffer[this._readPos + 1]; this._readPos += 2; return out; } writeUInt16(value) { if (this._limit < (this._writePos + 2)) { throw new BufferError("[WrappedBuffer::writeUInt16] buffer access out of bounds!"); } value = value | 0; this.buffer[this._writePos + 0] = (value >> 8); this.buffer[this._writePos + 1] = value; this._writePos += 2; } readUInt16() { if (this._limit < (this._readPos + 2)) { throw new BufferError("[WrappedBuffer::readUInt16] buffer access out of bounds!"); } const out = (this.buffer[this._readPos + 0] << 8) | this.buffer[this._readPos + 1]; this._readPos += 2; return out; } writeInt24(value) { if (this._limit < (this._writePos + 3)) { throw new BufferError("[WrappedBuffer::writeInt24] buffer access out of bounds!"); } value = value | 0; this.bufferS[this._writePos + 0] = (value >> 16); this.buffer[this._writePos + 1] = (value >> 8); this.buffer[this._writePos + 2] = value; this._writePos += 3; } readInt24() { if (this._limit < (this._readPos + 3)) { throw new BufferError("[WrappedBuffer::readInt24] buffer access out of bounds!"); } const out = (this.bufferS[this._readPos + 0] << 16) | (this.buffer[this._readPos + 1] << 8) | this.buffer[this._readPos + 2]; this._readPos += 3; return out; } writeUInt24(value) { if (this._limit < (this._writePos + 3)) { throw new BufferError("[WrappedBuffer::writeUInt24] buffer access out of bounds!"); } value = value >>> 0; this.buffer[this._writePos + 0] = (value >> 16); this.buffer[this._writePos + 1] = (value >> 8); this.buffer[this._writePos + 2] = value; this._writePos += 3; } readUInt24() { if (this._limit < (this._readPos + 3)) { throw new BufferError("[WrappedBuffer::readUInt24] buffer access out of bounds!"); } const out = (this.buffer[this._readPos + 0] << 16) | (this.buffer[this._readPos + 1] << 8) | this.buffer[this._readPos + 2]; this._readPos += 3; return out >>> 0; } writeInt32(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[WrappedBuffer::writeInt32] buffer access out of bounds!"); } value = value | 0; this.buffer[this._writePos + 0] = (value >> 24); this.buffer[this._writePos + 1] = (value >> 16); this.buffer[this._writePos + 2] = (value >> 8); this.buffer[this._writePos + 3] = value; this._writePos += 4; } readInt32() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[WrappedBuffer::readInt32] buffer access out of bounds!"); } const out = (this.buffer[this._readPos + 0] << 24) | (this.buffer[this._readPos + 1] << 16) | (this.buffer[this._readPos + 2] << 8) | this.buffer[this._readPos + 3]; this._readPos += 4; return out; } writeUInt32(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[WrappedBuffer::writeInt32] buffer access out of bounds!"); } value = value >>> 0; this.buffer[this._writePos + 0] = (value >> 24); this.buffer[this._writePos + 1] = (value >> 16); this.buffer[this._writePos + 2] = (value >> 8); this.buffer[this._writePos + 3] = value; this._writePos += 4; } readUInt32() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[WrappedBuffer::readInt32] buffer access out of bounds!"); } const out = (this.buffer[this._readPos + 0] << 24) | (this.buffer[this._readPos + 1] << 16) | (this.buffer[this._readPos + 2] << 8) | this.buffer[this._readPos + 3]; this._readPos += 4; return out >>> 0; } writeFloat32(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[WrappedBuffer::writeFloat32] buffer access out of bounds!"); } internalFloatArray[0] = +value; this.buffer[this._writePos + 0] = (internalBytes[0] | 0); this.buffer[this._writePos + 1] = (internalBytes[1] | 0); this.buffer[this._writePos + 2] = (internalBytes[2] | 0); this.buffer[this._writePos + 3] = (internalBytes[3] | 0); this._writePos += 4; } readFloat32() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[WrappedBuffer::readFloat32] buffer access out of bounds!"); } internalBytes[0] = this.buffer[this._readPos + 0]; internalBytes[1] = this.buffer[this._readPos + 1]; internalBytes[2] = this.buffer[this._readPos + 2]; internalBytes[3] = this.buffer[this._readPos + 3]; this._readPos += 4; return internalFloatArray[0]; } writeFloat64(value) { if (this._limit < (this._writePos + 8)) { throw new BufferError("[WrappedBuffer::writeFloat64] buffer access out of bounds!"); } internalDoubleArray[0] = +value; this.buffer[this._writePos + 0] = (internalBytes[0] | 0); this.buffer[this._writePos + 1] = (internalBytes[1] | 0); this.buffer[this._writePos + 2] = (internalBytes[2] | 0); this.buffer[this._writePos + 3] = (internalBytes[3] | 0); this.buffer[this._writePos + 4] = (internalBytes[4] | 0); this.buffer[this._writePos + 5] = (internalBytes[5] | 0); this.buffer[this._writePos + 6] = (internalBytes[6] | 0); this.buffer[this._writePos + 7] = (internalBytes[7] | 0); this._writePos += 8; } readFloat64() { if (this._limit < (this._readPos + 8)) { throw new BufferError("[WrappedBuffer::readFloat64] buffer access out of bounds!"); } internalBytes[0] = this.buffer[this._readPos + 0]; internalBytes[1] = this.buffer[this._readPos + 1]; internalBytes[2] = this.buffer[this._readPos + 2]; internalBytes[3] = this.buffer[this._readPos + 3]; internalBytes[4] = this.buffer[this._readPos + 4]; internalBytes[5] = this.buffer[this._readPos + 5]; internalBytes[6] = this.buffer[this._readPos + 6]; internalBytes[7] = this.buffer[this._readPos + 7]; this._readPos += 8; return internalDoubleArray[0]; } setInt32(offset, value) { if (this._limit < (offset + 4)) { throw new BufferError("[WrappedBuffer::setInt32] buffer access out of bounds!"); } offset = offset | 0; value = value | 0; this.buffer[offset] = (value >> 24); this.buffer[offset + 1] = (value >> 16); this.buffer[offset + 2] = (value >> 8); this.buffer[offset + 3] = value; } writeBuffer(buffer) { this.buffer.set(buffer, this._writePos); this._writePos += buffer.byteLength; } readBuffer(size) { let start = this._readPos; let buffer = this.buffer.slice(start, start + size); this._readPos += buffer.byteLength; return buffer; } toBuffer() { return this.buffer.slice(0, this.writePos); } /***************************************************************** LE - little endian *****************************************************************/ writeInt16LE(value) { if (this._limit < (this._writePos + 2)) { throw new BufferError("[WrappedBuffer::writeInt16] buffer access out of bounds!"); } value = value | 0; this.bufferS[this._writePos + 1] = (value >> 8); this.buffer[this._writePos + 0] = value; this._writePos += 2; } readInt16LE() { if (this._limit < (this._readPos + 2)) { throw new BufferError("[WrappedBuffer::readInt16] buffer access out of bounds!"); } const out = (this.bufferS[this._readPos + 1] << 8) | this.buffer[this._readPos + 0]; this._readPos += 2; return out; } writeUInt16LE(value) { if (this._limit < (this._writePos + 2)) { throw new BufferError("[WrappedBuffer::writeUInt16] buffer access out of bounds!"); } value = value | 0; this.buffer[this._writePos + 1] = (value >> 8); this.buffer[this._writePos + 0] = value; this._writePos += 2; } readUInt16LE() { if (this._limit < (this._readPos + 2)) { throw new BufferError("[WrappedBuffer::readUInt16] buffer access out of bounds!"); } const out = (this.buffer[this._readPos + 1] << 8) | this.buffer[this._readPos + 0]; this._readPos += 2; return out; } writeInt24LE(value) { if (this._limit < (this._writePos + 3)) { throw new BufferError("[WrappedBuffer::writeInt24] buffer access out of bounds!"); } value = value | 0; this.bufferS[this._writePos + 2] = (value >> 16); this.buffer[this._writePos + 1] = (value >> 8); this.buffer[this._writePos + 0] = value; this._writePos += 3; } readInt24LE() { if (this._limit < (this._readPos + 3)) { throw new BufferError("[WrappedBuffer::readInt24] buffer access out of bounds!"); } const out = (this.bufferS[this._readPos + 2] << 16) | (this.buffer[this._readPos + 1] << 8) | this.buffer[this._readPos + 0]; this._readPos += 3; return out; } writeUInt24LE(value) { if (this._limit < (this._writePos + 3)) { throw new BufferError("[WrappedBuffer::writeUInt24] buffer access out of bounds!"); } value = value >>> 0; this.buffer[this._writePos + 2] = (value >> 16); this.buffer[this._writePos + 1] = (value >> 8); this.buffer[this._writePos + 0] = value; this._writePos += 3; } readUInt24LE() { if (this._limit < (this._readPos + 3)) { throw new BufferError("[WrappedBuffer::readUInt24] buffer access out of bounds!"); } const out = (this.buffer[this._readPos + 2] << 16) | (this.buffer[this._readPos + 1] << 8) | this.buffer[this._readPos + 0]; this._readPos += 3; return out >>> 0; } writeInt32LE(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[WrappedBuffer::writeInt32] buffer access out of bounds!"); } value = value | 0; this.buffer[this._writePos + 3] = (value >> 24); this.buffer[this._writePos + 2] = (value >> 16); this.buffer[this._writePos + 1] = (value >> 8); this.buffer[this._writePos + 0] = value; this._writePos += 4; } readInt32LE() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[WrappedBuffer::readInt32] buffer access out of bounds!"); } const out = (this.buffer[this._readPos + 3] << 24) | (this.buffer[this._readPos + 2] << 16) | (this.buffer[this._readPos + 1] << 8) | this.buffer[this._readPos + 0]; this._readPos += 4; return out; } writeUInt32LE(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[WrappedBuffer::writeInt32] buffer access out of bounds!"); } value = value >>> 0; this.buffer[this._writePos + 3] = (value >> 24); this.buffer[this._writePos + 2] = (value >> 16); this.buffer[this._writePos + 1] = (value >> 8); this.buffer[this._writePos + 0] = value; this._writePos += 4; } readUInt32LE() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[WrappedBuffer::readInt32] buffer access out of bounds!"); } const out = (this.buffer[this._readPos + 3] << 24) | (this.buffer[this._readPos + 2] << 16) | (this.buffer[this._readPos + 1] << 8) | this.buffer[this._readPos + 0]; this._readPos += 4; return out >>> 0; } writeFloat32LE(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[WrappedBuffer::writeFloat32] buffer access out of bounds!"); } internalFloatArray[0] = +value; this.buffer[this._writePos + 3] = (internalBytes[0] | 0); this.buffer[this._writePos + 2] = (internalBytes[1] | 0); this.buffer[this._writePos + 1] = (internalBytes[2] | 0); this.buffer[this._writePos + 0] = (internalBytes[3] | 0); this._writePos += 4; } readFloat32LE() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[WrappedBuffer::readFloat32] buffer access out of bounds!"); } internalBytes[3] = this.buffer[this._readPos + 0]; internalBytes[2] = this.buffer[this._readPos + 1]; internalBytes[1] = this.buffer[this._readPos + 2]; internalBytes[0] = this.buffer[this._readPos + 3]; this._readPos += 4; return internalFloatArray[0]; } writeFloat64LE(value) { if (this._limit < (this._writePos + 8)) { throw new BufferError("[WrappedBuffer::writeFloat64] buffer access out of bounds!"); } internalDoubleArray[0] = +value; this.buffer[this._writePos + 7] = (internalBytes[0] | 0); this.buffer[this._writePos + 6] = (internalBytes[1] | 0); this.buffer[this._writePos + 5] = (internalBytes[2] | 0); this.buffer[this._writePos + 4] = (internalBytes[3] | 0); this.buffer[this._writePos + 3] = (internalBytes[4] | 0); this.buffer[this._writePos + 2] = (internalBytes[5] | 0); this.buffer[this._writePos + 1] = (internalBytes[6] | 0); this.buffer[this._writePos + 0] = (internalBytes[7] | 0); this._writePos += 8; } readFloat64LE() { if (this._limit < (this._readPos + 8)) { throw new BufferError("[WrappedBuffer::readFloat64] buffer access out of bounds!"); } internalBytes[7] = this.buffer[this._readPos + 0]; internalBytes[6] = this.buffer[this._readPos + 1]; internalBytes[5] = this.buffer[this._readPos + 2]; internalBytes[4] = this.buffer[this._readPos + 3]; internalBytes[3] = this.buffer[this._readPos + 4]; internalBytes[2] = this.buffer[this._readPos + 5]; internalBytes[1] = this.buffer[this._readPos + 6]; internalBytes[0] = this.buffer[this._readPos + 7]; this._readPos += 8; return internalDoubleArray[0]; } } class DynamicBuffer extends (/* unused pure expression or super */ null && (AbstractBuffer)) { constructor(buffers, chunkSize = 64 * 1024) { super(); this.chunkSize = chunkSize; this.readBufferIndex = 0; if (chunkSize < 8) { throw new BufferError("Chunk size can't be smaller than 8!"); } this.buffers = buffers; this.allocateNewBuffer(); this.rBuffer = this.wBuffer; } static mergeBuffers(...buffers) { let buffs = []; for (const merge of buffers) { buffs.push(...(merge.getInternalBuffers())); } return new DynamicBuffer(buffs, 8); } getInternalBuffers() { return this.buffers; } static allocate(chunkSize = 64 * 1024) { return new DynamicBuffer([], chunkSize); } restart() { this.buffers = []; this.allocateNewBuffer(); this.rBuffer = this.wBuffer; this.readBufferIndex = 0; } allocateNewBuffer() { this.wBuffer = new InternalBuffer(this.chunkSize); this.buffers.push(this.wBuffer); } nextReadBuffer() { this.rBuffer = this.buffers[++this.readBufferIndex]; if (this.rBuffer === undefined) { throw new BufferError("Read out of bounds"); } } writeBool(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 1)) { this.allocateNewBuffer(); } this.wBuffer.buffer[this.wBuffer._writePos++] = (value ? 1 : -1); } readBool() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 1)) { this.nextReadBuffer(); } return (this.rBuffer.buffer[this.rBuffer._readPos++] === 1); } writeUInt8(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 1)) { this.allocateNewBuffer(); } this.wBuffer.buffer[this.wBuffer._writePos++] = (value | 0); } readUInt8() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 1)) { this.nextReadBuffer(); } return this.rBuffer.buffer[this.rBuffer._readPos++]; } writeInt8(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 1)) { this.allocateNewBuffer(); } this.wBuffer.bufferS[this.wBuffer._writePos++] = (value | 0); } readInt8() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 1)) { this.nextReadBuffer(); } return this.rBuffer.bufferS[this.rBuffer._readPos++]; } writeInt16(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 2)) { this.allocateNewBuffer(); } value = value | 0; this.wBuffer.bufferS[this.wBuffer._writePos + 0] = (value >> 8); this.wBuffer.buffer[this.wBuffer._writePos + 1] = value; this.wBuffer._writePos += 2; } readInt16() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 2)) { this.nextReadBuffer(); } const out = (this.rBuffer.bufferS[this.rBuffer._readPos + 0] << 8) | this.rBuffer.buffer[this.rBuffer._readPos + 1]; this.rBuffer._readPos += 2; return out; } writeUInt16(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 2)) { this.allocateNewBuffer(); } value = value | 0; this.wBuffer.buffer[this.wBuffer._writePos + 0] = (value >> 8); this.wBuffer.buffer[this.wBuffer._writePos + 1] = value; this.wBuffer._writePos += 2; } readUInt16() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 2)) { this.nextReadBuffer(); } const out = (this.rBuffer.buffer[this.rBuffer._readPos + 0] << 8) | this.rBuffer.buffer[this.rBuffer._readPos + 1]; this.rBuffer._readPos += 2; return out; } writeInt24(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 3)) { this.allocateNewBuffer(); } value = value | 0; this.wBuffer.bufferS[this.wBuffer._writePos + 0] = (value >> 16); this.wBuffer.buffer[this.wBuffer._writePos + 1] = (value >> 8); this.wBuffer.buffer[this.wBuffer._writePos + 2] = value; this.wBuffer._writePos += 3; } readInt24() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 3)) { this.nextReadBuffer(); } const out = (this.rBuffer.bufferS[this.rBuffer._readPos + 0] << 16) | (this.rBuffer.buffer[this.rBuffer._readPos + 1] << 8) | this.rBuffer.buffer[this.rBuffer._readPos + 2]; this.rBuffer._readPos += 3; return out; } writeUInt24(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 3)) { this.allocateNewBuffer(); } value = value >>> 0; this.wBuffer.buffer[this.wBuffer._writePos + 0] = (value >> 16); this.wBuffer.buffer[this.wBuffer._writePos + 1] = (value >> 8); this.wBuffer.buffer[this.wBuffer._writePos + 2] = value; this.wBuffer._writePos += 3; } readUInt24() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 3)) { this.nextReadBuffer(); } const out = (this.rBuffer.buffer[this.rBuffer._readPos + 0] << 16) | (this.rBuffer.buffer[this.rBuffer._readPos + 1] << 8) | this.rBuffer.buffer[this.rBuffer._readPos + 2]; this.rBuffer._readPos += 3; return out >>> 0; } writeInt32(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 4)) { this.allocateNewBuffer(); } value = value | 0; this.wBuffer.buffer[this.wBuffer._writePos + 0] = (value >> 24); this.wBuffer.buffer[this.wBuffer._writePos + 1] = (value >> 16); this.wBuffer.buffer[this.wBuffer._writePos + 2] = (value >> 8); this.wBuffer.buffer[this.wBuffer._writePos + 3] = value; this.wBuffer._writePos += 4; } readInt32() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 4)) { this.nextReadBuffer(); } const out = (this.rBuffer.buffer[this.rBuffer._readPos + 0] << 24) | (this.rBuffer.buffer[this.rBuffer._readPos + 1] << 16) | (this.rBuffer.buffer[this.rBuffer._readPos + 2] << 8) | this.rBuffer.buffer[this.rBuffer._readPos + 3]; this.rBuffer._readPos += 4; return out; } writeUInt32(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 4)) { this.allocateNewBuffer(); } value = value >>> 0; this.wBuffer.buffer[this.wBuffer._writePos + 0] = (value >> 24); this.wBuffer.buffer[this.wBuffer._writePos + 1] = (value >> 16); this.wBuffer.buffer[this.wBuffer._writePos + 2] = (value >> 8); this.wBuffer.buffer[this.wBuffer._writePos + 3] = value; this.wBuffer._writePos += 4; } readUInt32() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 4)) { this.nextReadBuffer(); } const out = (this.rBuffer.buffer[this.rBuffer._readPos + 0] << 24) | (this.rBuffer.buffer[this.rBuffer._readPos + 1] << 16) | (this.rBuffer.buffer[this.rBuffer._readPos + 2] << 8) | this.rBuffer.buffer[this.rBuffer._readPos + 3]; this.rBuffer._readPos += 4; return out >>> 0; } writeFloat32(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 4)) { this.allocateNewBuffer(); } internalFloatArray[0] = +value; this.wBuffer.buffer[this.wBuffer._writePos + 0] = (internalBytes[0] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 1] = (internalBytes[1] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 2] = (internalBytes[2] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 3] = (internalBytes[3] | 0); this.wBuffer._writePos += 4; } readFloat32() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 4)) { this.nextReadBuffer(); } internalBytes[0] = this.rBuffer.buffer[this.rBuffer._readPos + 0]; internalBytes[1] = this.rBuffer.buffer[this.rBuffer._readPos + 1]; internalBytes[2] = this.rBuffer.buffer[this.rBuffer._readPos + 2]; internalBytes[3] = this.rBuffer.buffer[this.rBuffer._readPos + 3]; this.rBuffer._readPos += 4; return internalFloatArray[0]; } writeFloat64(value) { if (this.wBuffer._limit < (this.wBuffer._writePos + 8)) { this.allocateNewBuffer(); } internalDoubleArray[0] = +value; this.wBuffer.buffer[this.wBuffer._writePos + 0] = (internalBytes[0] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 1] = (internalBytes[1] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 2] = (internalBytes[2] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 3] = (internalBytes[3] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 4] = (internalBytes[4] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 5] = (internalBytes[5] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 6] = (internalBytes[6] | 0); this.wBuffer.buffer[this.wBuffer._writePos + 7] = (internalBytes[7] | 0); this.wBuffer._writePos += 8; } readFloat64() { if (this.rBuffer._writePos < (this.rBuffer._readPos + 8)) { this.nextReadBuffer(); } internalBytes[0] = this.rBuffer.buffer[this.rBuffer._readPos + 0]; internalBytes[1] = this.rBuffer.buffer[this.rBuffer._readPos + 1]; internalBytes[2] = this.rBuffer.buffer[this.rBuffer._readPos + 2]; internalBytes[3] = this.rBuffer.buffer[this.rBuffer._readPos + 3]; internalBytes[4] = this.rBuffer.buffer[this.rBuffer._readPos + 4]; internalBytes[5] = this.rBuffer.buffer[this.rBuffer._readPos + 5]; internalBytes[6] = this.rBuffer.buffer[this.rBuffer._readPos + 6]; internalBytes[7] = this.rBuffer.buffer[this.rBuffer._readPos + 7]; this.rBuffer._readPos += 8; return internalDoubleArray[0]; } writeBuffer(buffer) { /*if (this.wBuffer._limit < (this.wBuffer._writePos + 8)) { this.allocateNewBuffer(); }*/ let offset = 0; while (offset !== buffer.byteLength) { if (this.wBuffer._limit === this.wBuffer._writePos) { this.allocateNewBuffer(); } let available = this.wBuffer._limit - this.wBuffer._writePos; available = Math.min(available, buffer.byteLength - offset); this.wBuffer.buffer.set(buffer.subarray(offset, offset + available), this.wBuffer._writePos); this.wBuffer._writePos += available; offset += available; } } readBuffer(size) { let buffer = new Uint8Array(size); let offset = 0; while (offset !== buffer.byteLength) { if (this.rBuffer._writePos === this.rBuffer._readPos) { this.nextReadBuffer(); } let available = this.rBuffer._writePos - this.rBuffer._readPos; available = Math.min(available, buffer.byteLength - offset); buffer.set(this.rBuffer.buffer.subarray(this.rBuffer._readPos, this.rBuffer._readPos + available), offset); this.rBuffer._readPos += available; offset += available; } return buffer; } toBuffer() { let length = 0; for (const buffer of this.buffers) { length += buffer._writePos; } let out = new Uint8Array(length); let offset = 0; for (const buffer of this.buffers) { out.set(new Uint8Array(buffer._buffer, 0, buffer._writePos), offset); offset += buffer._writePos; } return out; } } class SimpleBuffer extends Uint8Array { constructor(buffer, offset, length) { super(buffer, offset, length); this.offset = offset; this.bufferS = new Int8Array(buffer, offset, length); this._readPos = 0; this._writePos = 0; this._limit = this.byteLength; } static fromBuffer(buffer) { if (!(buffer instanceof Uint8Array)) { throw new BufferError("Couldn't create SimpleBuffer(fromBuffer), invalid constructor argument " + typeof (buffer) + ", expected Uint8Array!"); } return new SimpleBuffer(buffer.buffer, buffer.byteOffset, buffer.byteLength); } static fromArrayBuffer(buffer) { if (!(buffer instanceof ArrayBuffer)) { throw new BufferError("Couldn't create SimpleBuffer(fromArrayBuffer), invalid constructor argument " + typeof (buffer) + ", expected ArrayBuffer!"); } return new SimpleBuffer(buffer, 0, buffer.byteLength); } static allocate(size) { size = size | 0; return new SimpleBuffer(new ArrayBuffer(size), 0, size); } subBuffer(start, length) { return new SimpleBuffer(this, this.offset + start, length); } set writePos(value) { if (value > this._limit) { throw new BufferError("[SimpleBuffer::writePos] Can't set writePos above buffer's capacity!"); } if (value < 0) { throw new BufferError("[SimpleBuffer::writePos] Can't set writePos below 0!"); } this._writePos = value; } get writePos() { return this._writePos; } set readPos(value) { if (value > this._limit) { throw new BufferError("[SimpleBuffer::readPos] Can't set readPos above buffer's capacity!"); } if (value < 0) { throw new BufferError("[SimpleBuffer::readPos] Can't set readPos below 0!"); } this._readPos = value; } get readPos() { return this._readPos; } set limit(value) { if (value > this.buffer.byteLength) { throw new BufferError("[SimpleBuffer::limit] Can't set limit above buffer's capacity!"); } if (value < 0) { throw new BufferError("[SimpleBuffer::limit] Can't set limit below 0!"); } this._limit = value; } get limit() { return this._limit; } resetLimit() { this.limit = this.buffer.byteLength; } restart() { this._readPos = 0; this._writePos = 0; } writeBool(value) { if (this._limit < (this._writePos + 1)) { throw new BufferError("[SimpleBuffer::writeBool] buffer access out of bounds!"); } this[this._writePos++] = (value ? 1 : -1); } readBool() { if (this._limit < (this._readPos + 1)) { throw new BufferError("[SimpleBuffer::readBool] buffer access out of bounds!"); } return (this[this._readPos++] === 1); } writeUInt8(value) { if (this._limit < (this._writePos + 1)) { throw new BufferError("[SimpleBuffer::writeUByte] buffer access out of bounds!"); } this[this._writePos++] = (value | 0); } readUInt8() { if (this._limit < (this._readPos + 1)) { throw new BufferError("[SimpleBuffer::readUByte] buffer access out of bounds!"); } return this[this._readPos++]; } writeInt8(value) { if (this._limit < (this._writePos + 1)) { throw new BufferError("[SimpleBuffer::writeByte] buffer access out of bounds!"); } this.bufferS[this._writePos++] = (value | 0); } readInt8() { if (this._limit < (this._readPos + 1)) { throw new BufferError("[SimpleBuffer::readByte] buffer access out of bounds!"); } return this.bufferS[this._readPos++]; } writeInt16(value) { if (this._limit < (this._writePos + 2)) { throw new BufferError("[SimpleBuffer::writeInt16] buffer access out of bounds!"); } value = value | 0; this.bufferS[this._writePos + 0] = (value >> 8); this[this._writePos + 1] = value; this._writePos += 2; } readInt16() { if (this._limit < (this._readPos + 2)) { throw new BufferError("[SimpleBuffer::readInt16] buffer access out of bounds!"); } const out = (this.bufferS[this._readPos + 0] << 8) | this[this._readPos + 1]; this._readPos += 2; return out; } writeUInt16(value) { if (this._limit < (this._writePos + 2)) { throw new BufferError("[SimpleBuffer::writeUInt16] buffer access out of bounds!"); } value = value | 0; this[this._writePos + 0] = (value >> 8); this[this._writePos + 1] = value; this._writePos += 2; } readUInt16() { if (this._limit < (this._readPos + 2)) { throw new BufferError("[SimpleBuffer::readUInt16] buffer access out of bounds!"); } const out = (this[this._readPos + 0] << 8) | this[this._readPos + 1]; this._readPos += 2; return out; } writeInt24(value) { if (this._limit < (this._writePos + 3)) { throw new BufferError("[SimpleBuffer::writeInt24] buffer access out of bounds!"); } value = value | 0; this.bufferS[this._writePos + 0] = (value >> 16); this[this._writePos + 1] = (value >> 8); this[this._writePos + 2] = value; this._writePos += 3; } readInt24() { if (this._limit < (this._readPos + 3)) { throw new BufferError("[SimpleBuffer::readInt24] buffer access out of bounds!"); } const out = (this.bufferS[this._readPos + 0] << 16) | (this[this._readPos + 1] << 8) | this[this._readPos + 2]; this._readPos += 3; return out; } writeUInt24(value) { if (this._limit < (this._writePos + 3)) { throw new BufferError("[SimpleBuffer::writeUInt24] buffer access out of bounds!"); } value = value >>> 0; this[this._writePos + 0] = (value >> 16); this[this._writePos + 1] = (value >> 8); this[this._writePos + 2] = value; this._writePos += 3; } readUInt24() { if (this._limit < (this._readPos + 3)) { throw new BufferError("[SimpleBuffer::readUInt24] buffer access out of bounds!"); } const out = (this[this._readPos + 0] << 16) | (this[this._readPos + 1] << 8) | this[this._readPos + 2]; this._readPos += 3; return out >>> 0; } writeInt32(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[SimpleBuffer::writeInt32] buffer access out of bounds!"); } value = value | 0; this[this._writePos + 0] = (value >> 24); this[this._writePos + 1] = (value >> 16); this[this._writePos + 2] = (value >> 8); this[this._writePos + 3] = value; this._writePos += 4; } readInt32() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[SimpleBuffer::readInt32] buffer access out of bounds!"); } const out = (this[this._readPos + 0] << 24) | (this[this._readPos + 1] << 16) | (this[this._readPos + 2] << 8) | this[this._readPos + 3]; this._readPos += 4; return out; } writeUInt32(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[SimpleBuffer::writeInt32] buffer access out of bounds!"); } value = value >>> 0; this[this._writePos + 0] = (value >> 24); this[this._writePos + 1] = (value >> 16); this[this._writePos + 2] = (value >> 8); this[this._writePos + 3] = value; this._writePos += 4; } readUInt32() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[SimpleBuffer::readInt32] buffer access out of bounds!"); } const out = (this[this._readPos + 0] << 24) | (this[this._readPos + 1] << 16) | (this[this._readPos + 2] << 8) | this[this._readPos + 3]; this._readPos += 4; return out >>> 0; } writeFloat32(value) { if (this._limit < (this._writePos + 4)) { throw new BufferError("[SimpleBuffer::writeFloat32] buffer access out of bounds!"); } internalFloatArray[0] = +value; this[this._writePos + 0] = (internalBytes[0] | 0); this[this._writePos + 1] = (internalBytes[1] | 0); this[this._writePos + 2] = (internalBytes[2] | 0); this[this._writePos + 3] = (internalBytes[3] | 0); this._writePos += 4; } readFloat32() { if (this._limit < (this._readPos + 4)) { throw new BufferError("[SimpleBuffer::readFloat32] buffer access out of bounds!"); } internalBytes[0] = this[this._readPos + 0]; internalBytes[1] = this[this._readPos + 1]; internalBytes[2] = this[this._readPos + 2]; internalBytes[3] = this[this._readPos + 3]; this._readPos += 4; return internalFloatArray[0]; } writeFloat64(value) { if (this._limit < (this._writePos + 8)) { throw new BufferError("[SimpleBuffer::writeFloat64] buffer access out of bounds!"); } internalDoubleArray[0] = +value; this[this._writePos + 0] = (internalBytes[0] | 0); this[this._writePos + 1] = (internalBytes[1] | 0); this[this._writePos + 2] = (internalBytes[2] | 0); this[this._writePos + 3] = (internalBytes[3] | 0); this[this._writePos + 4] = (internalBytes[4] | 0); this[this._writePos + 5] = (internalBytes[5] | 0); this[this._writePos + 6] = (internalBytes[6] | 0); this[this._writePos + 7] = (internalBytes[7] | 0); this._writePos += 8; } readFloat64() { if (this._limit < (this._readPos + 8)) { throw new BufferError("[SimpleBuffer::readFloat64] buffer access out of bounds!"); } internalBytes[0] = this[this._readPos + 0]; internalBytes[1] = this[this._readPos + 1]; internalBytes[2] = this[this._readPos + 2]; internalBytes[3] = this[this._readPos + 3]; internalBytes[4] = this[this._readPos + 4]; internalBytes[5] = this[this._readPos + 5]; internalBytes[6] = this[this._readPos + 6]; internalBytes[7] = this[this._readPos + 7]; this._readPos += 8; return internalDoubleArray[0]; } setInt32(offset, value) { if (this._limit < (offset + 4)) { throw new BufferError("[SimpleBuffer::setInt32] buffer access out of bounds!"); } offset = offset | 0; value = value | 0; this[offset] = (value >> 24); this[offset + 1] = (value >> 16); this[offset + 2] = (value >> 8); this[offset + 3] = value; } writeBuffer(buffer) { this.set(buffer, this._writePos); this._writePos += buffer.byteLength; } readBuffer(size) { let buffer = this.buffer.slice(this._readPos, size); this._readPos += buffer.byteLength; return new Uint8Array(buffer); } toBuffer() { return this.buffer.slice(0, this.writePos); } toUint8Array() { return new Uint8Array(this.toBuffer()); } //******************************************************************************/ // From AbstractBuffer writeUByte(value) { this.writeUInt8(value); } readUByte() { return this.readUInt8(); } writeByte(value) { this.writeInt8(value); } readByte() { return this.readInt8(); } readString() { const length = this.readUInt32(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } writeString(string) { let buf = this.bufferFromString(string); this.writeUInt32(buf.byteLength); this.writeBuffer(buf); } readVarInt() { let value = 0; let digits = 0; while (value <= 0) { let next = this.readInt8(); if (next < 0) { value = (next << digits) + value; } else { value = (next << digits) - value; } digits += 7; } return value; } writeVarInt(value) { while (value >= 128) { this.writeInt8(-(value & 0x7F)); value >>>= 7; } this.writeInt8((value & 0x7F)); } readStringMode(mode) { if (mode === StringMode.Fixed8) { const length = this.readUInt8(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else if (mode === StringMode.Fixed16) { const length = this.readUInt16(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else if (mode === StringMode.Fixed24) { const length = this.readUInt24(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else if (mode === StringMode.Fixed32) { const length = this.readUInt32(); let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else if (mode === StringMode.Dynamic) { let length = 0; let digits = 0; while (length <= 0) { let next = this.readInt8(); if (next < 0) { length = (next << digits) + length; } else { length = (next << digits) - length; } digits += 7; } let buf = this.readBuffer(length); return this.stringFromBuffer(buf); } else { throw new Error("Invalid StringMode!"); } } writeStringMode(mode, string) { if (mode === StringMode.Fixed8) { let buf = this.bufferFromString(string); this.writeUInt8(buf.byteLength); this.writeBuffer(buf); } else if (mode === StringMode.Fixed16) { let buf = this.bufferFromString(string); this.writeUInt16(buf.byteLength); this.writeBuffer(buf); } else if (mode === StringMode.Fixed24) { let buf = this.bufferFromString(string); this.writeUInt24(buf.byteLength); this.writeBuffer(buf); } else if (mode === StringMode.Fixed32) { let buf = this.bufferFromString(string); this.writeUInt32(buf.byteLength); this.writeBuffer(buf); } else if (mode === StringMode.Dynamic) { let buf = this.bufferFromString(string); let length = buf.byteLength; while (length >= 128) { this.writeInt8(-(length & 0x7F)); length >>>= 7; } this.writeInt8(length); this.writeBuffer(buf); } else { throw new Error("Invalid StringMode!"); } } bufferFromString(string) { // browser optimization if (__webpack_require__.g.TextEncoder !== undefined) { let encoder = new TextEncoder(); return encoder.encode(string); } return BinaryUtils.stringToUint8Array(string); } stringFromBuffer(buffer) { // browser optimization if (__webpack_require__.g.TextDecoder !== undefined) { let decoder = new TextDecoder("utf-8"); return decoder.decode(buffer); } return BinaryUtils.uint8ToStringArray(buffer); } } let base85Encoder = new Base85("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&_;()[]{}@%$#"); class InternalEncryptionUtils { static sha256(text) { return __awaiter(this, void 0, void 0, function* () { try { return yield crypto.subtle.digest("SHA-256", BinaryUtils.stringToUint8Array(text)); } catch (e) { throw new Error("Failed to sha256!"); } }); } static aesGcmEncrypt(data, key) { return __awaiter(this, void 0, void 0, function* () { if (typeof (data) === "string") { data = Buffer.from(data); } try { const keyBuffer = typeof (key) === "string" ? yield this.sha256(key) : key; const iv = crypto.getRandomValues(new Uint8Array(12)); if (!iv) { throw new Error("Failed to created IV!"); } const alg = { name: "AES-GCM", iv: iv }; const cryptoKey = yield crypto.subtle.importKey("raw", keyBuffer, alg.name, false, ["encrypt"]); const encryptedBuffer = yield crypto.subtle.encrypt(alg, cryptoKey, data); return Buffer.concat([Buffer.from(iv.buffer), Buffer.from(encryptedBuffer)]); } catch (e) { throw new Error("Failed to encrypt!"); } }); } static aesGcmDecrypt(encrypted, key) { return __awaiter(this, void 0, void 0, function* () { try { const keyBuffer = typeof (key) === "string" ? yield this.sha256(key) : key; const iv = encrypted.slice(0, 12); const data = encrypted.slice(12, -16); const alg = { name: "AES-GCM", iv: new Uint8Array(iv) }; const cryptoKey = yield crypto.subtle.importKey("raw", keyBuffer, alg.name, false, ["decrypt"]); const decryptedBuffer = new Uint8Array(yield crypto.subtle.decrypt(alg, cryptoKey, data)); const text = BinaryUtils.uint8ToStringArray(decryptedBuffer); return text; } catch (e) { throw new Error("Failed to decrypt!"); } }); } static aesGcmDecryptBuffer(encrypted, key) { return __awaiter(this, void 0, void 0, function* () { try { const keyBuffer = typeof (key) === "string" ? yield this.sha256(key) : key; const iv = encrypted.slice(0, 12); const data = encrypted.slice(12, -16); const alg = { name: "AES-GCM", iv: new Uint8Array(iv) }; const cryptoKey = yield crypto.subtle.importKey("raw", keyBuffer, alg.name, false, ["decrypt"]); return Buffer.from(yield crypto.subtle.decrypt(alg, cryptoKey, data)); } catch (e) { throw new Error("Failed to decrypt!"); } }); } static aesGcmEncryptBase85(data, key) { return __awaiter(this, void 0, void 0, function* () { if (typeof (data) === "string") { data = Buffer.from(data); } try { const keyBuffer = typeof (key) === "string" ? yield this.sha256(key) : key; const iv = crypto.getRandomValues(new Uint8Array(12)); if (!iv) { throw new Error("Failed to created IV!"); } const alg = { name: "AES-GCM", iv: iv }; const cryptoKey = yield crypto.subtle.importKey("raw", keyBuffer, alg.name, false, ["encrypt"]); const encryptedBuffer = yield crypto.subtle.encrypt(alg, cryptoKey, data); return base85Encoder.encode(iv) + "|" + base85Encoder.encode(new Uint8Array(encryptedBuffer)); } catch (e) { throw new Error("Failed to encrypt!"); } }); } static aesGcmDecryptBase85(encrypted, key) { return __awaiter(this, void 0, void 0, function* () { try { const keyBuffer = typeof (key) === "string" ? yield this.sha256(key) : key; const [iv, data] = encrypted.split("|").map(v => base85Encoder.decode(v)); const alg = { name: "AES-GCM", iv: new Uint8Array(iv) }; const cryptoKey = yield crypto.subtle.importKey("raw", keyBuffer, alg.name, false, ["decrypt"]); const decryptedBuffer = new Uint8Array(yield crypto.subtle.decrypt(alg, cryptoKey, data)); const text = BinaryUtils.uint8ToStringArray(decryptedBuffer); return text; } catch (e) { throw new Error("Failed to decrypt!"); } }); } static aesGcmDecryptBufferBase85(encrypted, key) { return __awaiter(this, void 0, void 0, function* () { try { const keyBuffer = typeof (key) === "string" ? yield this.sha256(key) : key; const [iv, data] = encrypted.split("|").map(v => base85Encoder.decode(v)); const alg = { name: "AES-GCM", iv: new Uint8Array(iv) }; const cryptoKey = yield crypto.subtle.importKey("raw", keyBuffer, alg.name, false, ["decrypt"]); return Buffer.from(yield crypto.subtle.decrypt(alg, cryptoKey, data)); } catch (e) { throw new Error("Failed to decrypt!"); } }); } } class QueueItem { constructor(callback) { this.callback = callback; this.promise = new Promise((resolve, reject) => { this.resolve = resolve; this.reject = reject; }); } resolve(val) { } reject(err) { } execute(queue) { return this.callback().then((val) => { this.resolve(val); queue.onItemFinished(this); }, (err) => { this.reject(err); queue.onItemError(this, err); }); } } class AsyncQueue { constructor(config) { this.queue = []; this.slots = 1; this.running = 0; this.scheduled = false; this.manualStart = false; this.finishing = false; this.finished = false; this.stopOnError = false; this.waitOnError = false; this.crashed = false; this.lastItemCallback = () => { }; this._lastItemCallback = () => { }; this.errorItemCallback = () => { }; this._lastItemError = () => { }; if (config !== undefined) { if (config.slots !== undefined) { this.slots = config.slots | 0; } if (config.stopOnError === true) { this.stopOnError = true; } if (config.waitOnError === true) { this.waitOnError = true; } } this.active = !this.manualStart; } add(callback) { if (this.finished) { throw new Error("Queue already finished!"); } let item = new QueueItem(callback); this.queue.push(item); this.trySchedule(); return item.promise; } onItemFinished(item) { this.slots++; this.running--; if (this.crashed === true) { if (this.waitOnError) { if (this.running === 0) { if (this.finishing) { this._lastItemCallback(); this.finished = true; } } } } else if (this.queue.length > 0) { this.trySchedule(); } else if (this.running === 0) { this.lastItemCallback(); if (this.finishing) { this._lastItemCallback(); this.finished = true; } } } onItemError(item, err) { this.slots++; this.running--; if (this.stopOnError) { this.queue = []; // nuke the queue if we are stopping on error this.active = false; if (this.waitOnError) { if (this.crashed === false) { this._lastItemCallback = () => { this.errorItemCallback(err); this._lastItemError(err); }; this.crashed = true; } if (this.running === 0) { this._lastItemCallback(); } } else { this.errorItemCallback(err); this.running = 0; this.crashed = true; if (this.finishing && !this.waitOnError) { this._lastItemError(err); this.finished = true; } } } else { if (this.crashed === true) { return; } this.errorItemCallback(err); if (this.queue.length > 0) { this.trySchedule(); } else if (this.running === 0) { this.lastItemCallback(); if (this.finishing && this.waitOnError) { this._lastItemError(err); } } if (this.finishing && !this.waitOnError) { this._lastItemError(err); this.finished = true; } } } trySchedule() { if (this.active === true && this.scheduled === false && this.queue.length > 0 && this.slots > 0) { this.scheduled = true; process.nextTick(() => { this.run(); this.scheduled = false; }); } } run() { while (this.queue.length > 0 && this.slots > 0) { let newItem = this.queue.shift(); if (newItem !== undefined) { this.slots--; this.running++; newItem.execute(this); } } } finish() { this.finishing = true; if (this.running === 0 && this.queue.length === 0) { this.finished = true; return Promise.resolve(); } else { return new Promise((resolve, reject) => { this._lastItemCallback = resolve; this._lastItemError = reject; }); } } } //# sourceMappingURL=index.js.map /***/ }), /***/ 82285: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export setTranslateValue */ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(87462); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45987); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73935); /* harmony import */ var _utils_debounce__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(79437); /* harmony import */ var react_transition_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8662); /* harmony import */ var _utils_useForkRef__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17294); /* harmony import */ var _styles_useTheme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8920); /* harmony import */ var _styles_transitions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43366); /* harmony import */ var _transitions_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5653); // Translate the node so he can't be seen on the screen. // Later, we gonna translate back the node to his original location // with `none`.` function getTranslateValue(direction, node) { var rect = node.getBoundingClientRect(); var transform; if (node.fakeTransform) { transform = node.fakeTransform; } else { var computedStyle = window.getComputedStyle(node); transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform'); } var offsetX = 0; var offsetY = 0; if (transform && transform !== 'none' && typeof transform === 'string') { var transformValues = transform.split('(')[1].split(')')[0].split(','); offsetX = parseInt(transformValues[4], 10); offsetY = parseInt(transformValues[5], 10); } if (direction === 'left') { return "translateX(".concat(window.innerWidth, "px) translateX(").concat(offsetX - rect.left, "px)"); } if (direction === 'right') { return "translateX(-".concat(rect.left + rect.width - offsetX, "px)"); } if (direction === 'up') { return "translateY(".concat(window.innerHeight, "px) translateY(").concat(offsetY - rect.top, "px)"); } // direction === 'down' return "translateY(-".concat(rect.top + rect.height - offsetY, "px)"); } function setTranslateValue(direction, node) { var transform = getTranslateValue(direction, node); if (transform) { node.style.webkitTransform = transform; node.style.transform = transform; } } var defaultTimeout = { enter: _styles_transitions__WEBPACK_IMPORTED_MODULE_2__/* .duration.enteringScreen */ .x9.enteringScreen, exit: _styles_transitions__WEBPACK_IMPORTED_MODULE_2__/* .duration.leavingScreen */ .x9.leavingScreen }; /** * The Slide transition is used by the [Drawer](/components/drawers/) component. * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally. */ var Slide = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function Slide(props, ref) { var children = props.children, _props$direction = props.direction, direction = _props$direction === void 0 ? 'down' : _props$direction, inProp = props.in, onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, style = props.style, _props$timeout = props.timeout, timeout = _props$timeout === void 0 ? defaultTimeout : _props$timeout, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? react_transition_group__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP : _props$TransitionComp, other = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(props, ["children", "direction", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]); var theme = (0,_styles_useTheme__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(); var childrenRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); /** * used in cloneElement(children, { ref: handleRef }) */ var handleOwnRef = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (instance) { // #StrictMode ready childrenRef.current = react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode(instance); }, []); var handleRefIntermediary = (0,_utils_useForkRef__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(children.ref, handleOwnRef); var handleRef = (0,_utils_useForkRef__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(handleRefIntermediary, ref); var normalizedTransitionCallback = function normalizedTransitionCallback(callback) { return function (isAppearing) { if (callback) { // onEnterXxx and onExitXxx callbacks have a different arguments.length value. if (isAppearing === undefined) { callback(childrenRef.current); } else { callback(childrenRef.current, isAppearing); } } }; }; var handleEnter = normalizedTransitionCallback(function (node, isAppearing) { setTranslateValue(direction, node); (0,_transitions_utils__WEBPACK_IMPORTED_MODULE_7__/* .reflow */ .n)(node); if (onEnter) { onEnter(node, isAppearing); } }); var handleEntering = normalizedTransitionCallback(function (node, isAppearing) { var transitionProps = (0,_transitions_utils__WEBPACK_IMPORTED_MODULE_7__/* .getTransitionProps */ .C)({ timeout: timeout, style: style }, { mode: 'enter' }); node.style.webkitTransition = theme.transitions.create('-webkit-transform', (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)({}, transitionProps, { easing: theme.transitions.easing.easeOut })); node.style.transition = theme.transitions.create('transform', (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)({}, transitionProps, { easing: theme.transitions.easing.easeOut })); node.style.webkitTransform = 'none'; node.style.transform = 'none'; if (onEntering) { onEntering(node, isAppearing); } }); var handleEntered = normalizedTransitionCallback(onEntered); var handleExiting = normalizedTransitionCallback(onExiting); var handleExit = normalizedTransitionCallback(function (node) { var transitionProps = (0,_transitions_utils__WEBPACK_IMPORTED_MODULE_7__/* .getTransitionProps */ .C)({ timeout: timeout, style: style }, { mode: 'exit' }); node.style.webkitTransition = theme.transitions.create('-webkit-transform', (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)({}, transitionProps, { easing: theme.transitions.easing.sharp })); node.style.transition = theme.transitions.create('transform', (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)({}, transitionProps, { easing: theme.transitions.easing.sharp })); setTranslateValue(direction, node); if (onExit) { onExit(node); } }); var handleExited = normalizedTransitionCallback(function (node) { // No need for transitions when the component is hidden node.style.webkitTransition = ''; node.style.transition = ''; if (onExited) { onExited(node); } }); var updatePosition = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function () { if (childrenRef.current) { setTranslateValue(direction, childrenRef.current); } }, [direction]); react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { // Skip configuration where the position is screen size invariant. if (inProp || direction === 'down' || direction === 'right') { return undefined; } var handleResize = (0,_utils_debounce__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z)(function () { if (childrenRef.current) { setTranslateValue(direction, childrenRef.current); } }); window.addEventListener('resize', handleResize); return function () { handleResize.clear(); window.removeEventListener('resize', handleResize); }; }, [direction, inProp]); react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { if (!inProp) { // We need to update the position of the drawer when the direction change and // when it's hidden. updatePosition(); } }, [inProp, updatePosition]); return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(TransitionComponent, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)({ nodeRef: childrenRef, onEnter: handleEnter, onEntered: handleEntered, onEntering: handleEntering, onExit: handleExit, onExited: handleExited, onExiting: handleExiting, appear: true, in: inProp, timeout: timeout }, other), function (state, childProps) { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(children, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)({ ref: handleRef, style: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)({ visibility: state === 'exited' && !inProp ? 'hidden' : undefined }, style, children.props.style) }, childProps)); }); }); false ? 0 : void 0; /* harmony default export */ __webpack_exports__["Z"] = (Slide); /***/ }), /***/ 62087: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export styles */ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(87462); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45987); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86010); /* harmony import */ var _styles_withStyles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1591); /* harmony import */ var _utils_capitalize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93871); var styles = function styles(theme) { return { /* Styles applied to the root element. */ root: { userSelect: 'none', width: '1em', height: '1em', display: 'inline-block', fill: 'currentColor', flexShrink: 0, fontSize: theme.typography.pxToRem(24), transition: theme.transitions.create('fill', { duration: theme.transitions.duration.shorter }) }, /* Styles applied to the root element if `color="primary"`. */ colorPrimary: { color: theme.palette.primary.main }, /* Styles applied to the root element if `color="secondary"`. */ colorSecondary: { color: theme.palette.secondary.main }, /* Styles applied to the root element if `color="action"`. */ colorAction: { color: theme.palette.action.active }, /* Styles applied to the root element if `color="error"`. */ colorError: { color: theme.palette.error.main }, /* Styles applied to the root element if `color="disabled"`. */ colorDisabled: { color: theme.palette.action.disabled }, /* Styles applied to the root element if `fontSize="inherit"`. */ fontSizeInherit: { fontSize: 'inherit' }, /* Styles applied to the root element if `fontSize="small"`. */ fontSizeSmall: { fontSize: theme.typography.pxToRem(20) }, /* Styles applied to the root element if `fontSize="large"`. */ fontSizeLarge: { fontSize: theme.typography.pxToRem(35) } }; }; var SvgIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function SvgIcon(props, ref) { var children = props.children, classes = props.classes, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'inherit' : _props$color, _props$component = props.component, Component = _props$component === void 0 ? 'svg' : _props$component, _props$fontSize = props.fontSize, fontSize = _props$fontSize === void 0 ? 'medium' : _props$fontSize, htmlColor = props.htmlColor, titleAccess = props.titleAccess, _props$viewBox = props.viewBox, viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox, other = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]); return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)({ className: (0,clsx__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(classes.root, className, color !== 'inherit' && classes["color".concat((0,_utils_capitalize__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(color))], fontSize !== 'default' && fontSize !== 'medium' && classes["fontSize".concat((0,_utils_capitalize__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(fontSize))]), focusable: "false", viewBox: viewBox, color: htmlColor, "aria-hidden": titleAccess ? undefined : true, role: titleAccess ? 'img' : undefined, ref: ref }, other), children, titleAccess ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("title", null, titleAccess) : null); }); false ? 0 : void 0; SvgIcon.muiName = 'SvgIcon'; /* harmony default export */ __webpack_exports__["Z"] = ((0,_styles_withStyles__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(styles, { name: 'MuiSvgIcon' })(SvgIcon)); /***/ }), /***/ 96230: /***/ (function(__unused_webpack_module, __webpack_exports__) { "use strict"; var blue = { 50: '#e3f2fd', 100: '#bbdefb', 200: '#90caf9', 300: '#64b5f6', 400: '#42a5f5', 500: '#2196f3', 600: '#1e88e5', 700: '#1976d2', 800: '#1565c0', 900: '#0d47a1', A100: '#82b1ff', A200: '#448aff', A400: '#2979ff', A700: '#2962ff' }; /* harmony default export */ __webpack_exports__["Z"] = (blue); /***/ }), /***/ 20907: /***/ (function(__unused_webpack_module, __webpack_exports__) { "use strict"; var red = { 50: '#ffebee', 100: '#ffcdd2', 200: '#ef9a9a', 300: '#e57373', 400: '#ef5350', 500: '#f44336', 600: '#e53935', 700: '#d32f2f', 800: '#c62828', 900: '#b71c1c', A100: '#ff8a80', A200: '#ff5252', A400: '#ff1744', A700: '#d50000' }; /* harmony default export */ __webpack_exports__["Z"] = (red); /***/ }), /***/ 59693: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "$n": function() { return /* binding */ lighten; }, /* harmony export */ "Fq": function() { return /* binding */ alpha; }, /* harmony export */ "H3": function() { return /* binding */ getLuminance; }, /* harmony export */ "U1": function() { return /* binding */ fade; }, /* harmony export */ "_4": function() { return /* binding */ emphasize; }, /* harmony export */ "_j": function() { return /* binding */ darken; }, /* harmony export */ "mi": function() { return /* binding */ getContrastRatio; }, /* harmony export */ "oo": function() { return /* binding */ hexToRgb; }, /* harmony export */ "tB": function() { return /* binding */ decomposeColor; }, /* harmony export */ "ve": function() { return /* binding */ hslToRgb; }, /* harmony export */ "vq": function() { return /* binding */ rgbToHex; }, /* harmony export */ "wy": function() { return /* binding */ recomposeColor; } /* harmony export */ }); /* harmony import */ var _material_ui_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60288); /* eslint-disable no-use-before-define */ /** * Returns a number whose value is limited to the given range. * * @param {number} value The value to be clamped * @param {number} min The lower boundary of the output range * @param {number} max The upper boundary of the output range * @returns {number} A number in the range [min, max] */ function clamp(value) { var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; if (false) {} return Math.min(Math.max(min, value), max); } /** * Converts a color from CSS hex format to CSS rgb format. * * @param {string} color - Hex color, i.e. #nnn or #nnnnnn * @returns {string} A CSS rgb color string */ function hexToRgb(color) { color = color.substr(1); var re = new RegExp(".{1,".concat(color.length >= 6 ? 2 : 1, "}"), 'g'); var colors = color.match(re); if (colors && colors[0].length === 1) { colors = colors.map(function (n) { return n + n; }); } return colors ? "rgb".concat(colors.length === 4 ? 'a' : '', "(").concat(colors.map(function (n, index) { return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000; }).join(', '), ")") : ''; } function intToHex(int) { var hex = int.toString(16); return hex.length === 1 ? "0".concat(hex) : hex; } /** * Converts a color from CSS rgb format to CSS hex format. * * @param {string} color - RGB color, i.e. rgb(n, n, n) * @returns {string} A CSS rgb color string, i.e. #nnnnnn */ function rgbToHex(color) { // Idempotent if (color.indexOf('#') === 0) { return color; } var _decomposeColor = decomposeColor(color), values = _decomposeColor.values; return "#".concat(values.map(function (n) { return intToHex(n); }).join('')); } /** * Converts a color from hsl format to rgb format. * * @param {string} color - HSL color values * @returns {string} rgb color values */ function hslToRgb(color) { color = decomposeColor(color); var _color = color, values = _color.values; var h = values[0]; var s = values[1] / 100; var l = values[2] / 100; var a = s * Math.min(l, 1 - l); var f = function f(n) { var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12; return l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1); }; var type = 'rgb'; var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)]; if (color.type === 'hsla') { type += 'a'; rgb.push(values[3]); } return recomposeColor({ type: type, values: rgb }); } /** * Returns an object with the type and values of a color. * * Note: Does not support rgb % values. * * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @returns {object} - A MUI color object: {type: string, values: number[]} */ function decomposeColor(color) { // Idempotent if (color.type) { return color; } if (color.charAt(0) === '#') { return decomposeColor(hexToRgb(color)); } var marker = color.indexOf('('); var type = color.substring(0, marker); if (['rgb', 'rgba', 'hsl', 'hsla'].indexOf(type) === -1) { throw new Error( false ? 0 : (0,_material_ui_utils__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(3, color)); } var values = color.substring(marker + 1, color.length - 1).split(','); values = values.map(function (value) { return parseFloat(value); }); return { type: type, values: values }; } /** * Converts a color object with type and values to a string. * * @param {object} color - Decomposed color * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla' * @param {array} color.values - [n,n,n] or [n,n,n,n] * @returns {string} A CSS color string */ function recomposeColor(color) { var type = color.type; var values = color.values; if (type.indexOf('rgb') !== -1) { // Only convert the first 3 values to int (i.e. not alpha) values = values.map(function (n, i) { return i < 3 ? parseInt(n, 10) : n; }); } else if (type.indexOf('hsl') !== -1) { values[1] = "".concat(values[1], "%"); values[2] = "".concat(values[2], "%"); } return "".concat(type, "(").concat(values.join(', '), ")"); } /** * Calculates the contrast ratio between two colors. * * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests * * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @returns {number} A contrast ratio value in the range 0 - 21. */ function getContrastRatio(foreground, background) { var lumA = getLuminance(foreground); var lumB = getLuminance(background); return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05); } /** * The relative brightness of any point in a color space, * normalized to 0 for darkest black and 1 for lightest white. * * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests * * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @returns {number} The relative brightness of the color in the range 0 - 1 */ function getLuminance(color) { color = decomposeColor(color); var rgb = color.type === 'hsl' ? decomposeColor(hslToRgb(color)).values : color.values; rgb = rgb.map(function (val) { val /= 255; // normalized return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); }); // Truncate at 3 digits return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3)); } /** * Darken or lighten a color, depending on its luminance. * Light colors are darkened, dark colors are lightened. * * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @param {number} coefficient=0.15 - multiplier in the range 0 - 1 * @returns {string} A CSS color string. Hex input values are returned as rgb */ function emphasize(color) { var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15; return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient); } var warnedOnce = false; /** * Set the absolute transparency of a color. * Any existing alpha values are overwritten. * * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @param {number} value - value to set the alpha channel to in the range 0 -1 * @returns {string} A CSS color string. Hex input values are returned as rgb * * @deprecated * Use `import { alpha } from '@material-ui/core/styles'` instead. */ function fade(color, value) { if (false) {} return alpha(color, value); } /** * Set the absolute transparency of a color. * Any existing alpha value is overwritten. * * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @param {number} value - value to set the alpha channel to in the range 0-1 * @returns {string} A CSS color string. Hex input values are returned as rgb */ function alpha(color, value) { color = decomposeColor(color); value = clamp(value); if (color.type === 'rgb' || color.type === 'hsl') { color.type += 'a'; } color.values[3] = value; return recomposeColor(color); } /** * Darkens a color. * * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @param {number} coefficient - multiplier in the range 0 - 1 * @returns {string} A CSS color string. Hex input values are returned as rgb */ function darken(color, coefficient) { color = decomposeColor(color); coefficient = clamp(coefficient); if (color.type.indexOf('hsl') !== -1) { color.values[2] *= 1 - coefficient; } else if (color.type.indexOf('rgb') !== -1) { for (var i = 0; i < 3; i += 1) { color.values[i] *= 1 - coefficient; } } return recomposeColor(color); } /** * Lightens a color. * * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @param {number} coefficient - multiplier in the range 0 - 1 * @returns {string} A CSS color string. Hex input values are returned as rgb */ function lighten(color, coefficient) { color = decomposeColor(color); coefficient = clamp(coefficient); if (color.type.indexOf('hsl') !== -1) { color.values[2] += (100 - color.values[2]) * coefficient; } else if (color.type.indexOf('rgb') !== -1) { for (var i = 0; i < 3; i += 1) { color.values[i] += (255 - color.values[i]) * coefficient; } } return recomposeColor(color); } /***/ }), /***/ 90157: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "X": function() { return /* binding */ keys; }, /* harmony export */ "Z": function() { return /* binding */ createBreakpoints; } /* harmony export */ }); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87462); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45987); // Sorted ASC by size. That's important. // It can't be configured as it's used statically for propTypes. var keys = ['xs', 'sm', 'md', 'lg', 'xl']; // Keep in mind that @media is inclusive by the CSS specification. function createBreakpoints(breakpoints) { var _breakpoints$values = breakpoints.values, values = _breakpoints$values === void 0 ? { xs: 0, sm: 600, md: 960, lg: 1280, xl: 1920 } : _breakpoints$values, _breakpoints$unit = breakpoints.unit, unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit, _breakpoints$step = breakpoints.step, step = _breakpoints$step === void 0 ? 5 : _breakpoints$step, other = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(breakpoints, ["values", "unit", "step"]); function up(key) { var value = typeof values[key] === 'number' ? values[key] : key; return "@media (min-width:".concat(value).concat(unit, ")"); } function down(key) { var endIndex = keys.indexOf(key) + 1; var upperbound = values[keys[endIndex]]; if (endIndex === keys.length) { // xl down applies to all sizes return up('xs'); } var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key; return "@media (max-width:".concat(value - step / 100).concat(unit, ")"); } function between(start, end) { var endIndex = keys.indexOf(end); if (endIndex === keys.length - 1) { return up(start); } return "@media (min-width:".concat(typeof values[start] === 'number' ? values[start] : start).concat(unit, ") and ") + "(max-width:".concat((endIndex !== -1 && typeof values[keys[endIndex + 1]] === 'number' ? values[keys[endIndex + 1]] : end) - step / 100).concat(unit, ")"); } function only(key) { return between(key, key); } var warnedOnce = false; function width(key) { if (false) {} return values[key]; } return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)({ keys: keys, values: values, up: up, down: down, between: between, only: only, width: width }, other); } /***/ }), /***/ 35117: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ createStyles; } /* harmony export */ }); /* harmony import */ var _material_ui_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10150); // let warnOnce = false; // To remove in v5 function createStyles(styles) { // warning( // warnOnce, // [ // 'Material-UI: createStyles from @material-ui/core/styles is deprecated.', // 'Please use @material-ui/styles/createStyles', // ].join('\n'), // ); // warnOnce = true; return (0,_material_ui_styles__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(styles); } /***/ }), /***/ 47823: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "A": function() { return /* binding */ createMuiTheme; }, "Z": function() { return /* binding */ styles_createTheme; } }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(45987); // EXTERNAL MODULE: ./node_modules/@material-ui/utils/esm/deepmerge.js var deepmerge = __webpack_require__(35953); // EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/styles/createBreakpoints.js var createBreakpoints = __webpack_require__(90157); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__(4942); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(87462); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/createMixins.js function createMixins(breakpoints, spacing, mixins) { var _toolbar; return (0,esm_extends/* default */.Z)({ gutters: function gutters() { var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; console.warn(['Material-UI: theme.mixins.gutters() is deprecated.', 'You can use the source of the mixin directly:', "\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join('\n')); return (0,esm_extends/* default */.Z)({ paddingLeft: spacing(2), paddingRight: spacing(2) }, styles, (0,defineProperty/* default */.Z)({}, breakpoints.up('sm'), (0,esm_extends/* default */.Z)({ paddingLeft: spacing(3), paddingRight: spacing(3) }, styles[breakpoints.up('sm')]))); }, toolbar: (_toolbar = { minHeight: 56 }, (0,defineProperty/* default */.Z)(_toolbar, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), { minHeight: 48 }), (0,defineProperty/* default */.Z)(_toolbar, breakpoints.up('sm'), { minHeight: 64 }), _toolbar) }, mixins); } // EXTERNAL MODULE: ./node_modules/@material-ui/utils/esm/formatMuiErrorMessage.js var formatMuiErrorMessage = __webpack_require__(60288); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/colors/common.js var common = { black: '#000', white: '#fff' }; /* harmony default export */ var colors_common = (common); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/colors/grey.js var grey = { 50: '#fafafa', 100: '#f5f5f5', 200: '#eeeeee', 300: '#e0e0e0', 400: '#bdbdbd', 500: '#9e9e9e', 600: '#757575', 700: '#616161', 800: '#424242', 900: '#212121', A100: '#d5d5d5', A200: '#aaaaaa', A400: '#303030', A700: '#616161' }; /* harmony default export */ var colors_grey = (grey); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/colors/indigo.js var indigo = { 50: '#e8eaf6', 100: '#c5cae9', 200: '#9fa8da', 300: '#7986cb', 400: '#5c6bc0', 500: '#3f51b5', 600: '#3949ab', 700: '#303f9f', 800: '#283593', 900: '#1a237e', A100: '#8c9eff', A200: '#536dfe', A400: '#3d5afe', A700: '#304ffe' }; /* harmony default export */ var colors_indigo = (indigo); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/colors/pink.js var pink = { 50: '#fce4ec', 100: '#f8bbd0', 200: '#f48fb1', 300: '#f06292', 400: '#ec407a', 500: '#e91e63', 600: '#d81b60', 700: '#c2185b', 800: '#ad1457', 900: '#880e4f', A100: '#ff80ab', A200: '#ff4081', A400: '#f50057', A700: '#c51162' }; /* harmony default export */ var colors_pink = (pink); // EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/colors/red.js var red = __webpack_require__(20907); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/colors/orange.js var orange = { 50: '#fff3e0', 100: '#ffe0b2', 200: '#ffcc80', 300: '#ffb74d', 400: '#ffa726', 500: '#ff9800', 600: '#fb8c00', 700: '#f57c00', 800: '#ef6c00', 900: '#e65100', A100: '#ffd180', A200: '#ffab40', A400: '#ff9100', A700: '#ff6d00' }; /* harmony default export */ var colors_orange = (orange); // EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/colors/blue.js var blue = __webpack_require__(96230); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/colors/green.js var green = { 50: '#e8f5e9', 100: '#c8e6c9', 200: '#a5d6a7', 300: '#81c784', 400: '#66bb6a', 500: '#4caf50', 600: '#43a047', 700: '#388e3c', 800: '#2e7d32', 900: '#1b5e20', A100: '#b9f6ca', A200: '#69f0ae', A400: '#00e676', A700: '#00c853' }; /* harmony default export */ var colors_green = (green); // EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/styles/colorManipulator.js var colorManipulator = __webpack_require__(59693); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/createPalette.js var light = { // The colors used to style the text. text: { // The most important text. primary: 'rgba(0, 0, 0, 0.87)', // Secondary text. secondary: 'rgba(0, 0, 0, 0.54)', // Disabled text have even lower visual prominence. disabled: 'rgba(0, 0, 0, 0.38)', // Text hints. hint: 'rgba(0, 0, 0, 0.38)' }, // The color used to divide different elements. divider: 'rgba(0, 0, 0, 0.12)', // The background colors used to style the surfaces. // Consistency between these values is important. background: { paper: colors_common.white, default: colors_grey[50] }, // The colors used to style the action elements. action: { // The color of an active action like an icon button. active: 'rgba(0, 0, 0, 0.54)', // The color of an hovered action. hover: 'rgba(0, 0, 0, 0.04)', hoverOpacity: 0.04, // The color of a selected action. selected: 'rgba(0, 0, 0, 0.08)', selectedOpacity: 0.08, // The color of a disabled action. disabled: 'rgba(0, 0, 0, 0.26)', // The background color of a disabled action. disabledBackground: 'rgba(0, 0, 0, 0.12)', disabledOpacity: 0.38, focus: 'rgba(0, 0, 0, 0.12)', focusOpacity: 0.12, activatedOpacity: 0.12 } }; var dark = { text: { primary: colors_common.white, secondary: 'rgba(255, 255, 255, 0.7)', disabled: 'rgba(255, 255, 255, 0.5)', hint: 'rgba(255, 255, 255, 0.5)', icon: 'rgba(255, 255, 255, 0.5)' }, divider: 'rgba(255, 255, 255, 0.12)', background: { paper: colors_grey[800], default: '#303030' }, action: { active: colors_common.white, hover: 'rgba(255, 255, 255, 0.08)', hoverOpacity: 0.08, selected: 'rgba(255, 255, 255, 0.16)', selectedOpacity: 0.16, disabled: 'rgba(255, 255, 255, 0.3)', disabledBackground: 'rgba(255, 255, 255, 0.12)', disabledOpacity: 0.38, focus: 'rgba(255, 255, 255, 0.12)', focusOpacity: 0.12, activatedOpacity: 0.24 } }; function addLightOrDark(intent, direction, shade, tonalOffset) { var tonalOffsetLight = tonalOffset.light || tonalOffset; var tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5; if (!intent[direction]) { if (intent.hasOwnProperty(shade)) { intent[direction] = intent[shade]; } else if (direction === 'light') { intent.light = (0,colorManipulator/* lighten */.$n)(intent.main, tonalOffsetLight); } else if (direction === 'dark') { intent.dark = (0,colorManipulator/* darken */._j)(intent.main, tonalOffsetDark); } } } function createPalette(palette) { var _palette$primary = palette.primary, primary = _palette$primary === void 0 ? { light: colors_indigo[300], main: colors_indigo[500], dark: colors_indigo[700] } : _palette$primary, _palette$secondary = palette.secondary, secondary = _palette$secondary === void 0 ? { light: colors_pink.A200, main: colors_pink.A400, dark: colors_pink.A700 } : _palette$secondary, _palette$error = palette.error, error = _palette$error === void 0 ? { light: red/* default.300 */.Z[300], main: red/* default.500 */.Z[500], dark: red/* default.700 */.Z[700] } : _palette$error, _palette$warning = palette.warning, warning = _palette$warning === void 0 ? { light: colors_orange[300], main: colors_orange[500], dark: colors_orange[700] } : _palette$warning, _palette$info = palette.info, info = _palette$info === void 0 ? { light: blue/* default.300 */.Z[300], main: blue/* default.500 */.Z[500], dark: blue/* default.700 */.Z[700] } : _palette$info, _palette$success = palette.success, success = _palette$success === void 0 ? { light: colors_green[300], main: colors_green[500], dark: colors_green[700] } : _palette$success, _palette$type = palette.type, type = _palette$type === void 0 ? 'light' : _palette$type, _palette$contrastThre = palette.contrastThreshold, contrastThreshold = _palette$contrastThre === void 0 ? 3 : _palette$contrastThre, _palette$tonalOffset = palette.tonalOffset, tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset, other = (0,objectWithoutProperties/* default */.Z)(palette, ["primary", "secondary", "error", "warning", "info", "success", "type", "contrastThreshold", "tonalOffset"]); // Use the same logic as // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59 // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54 function getContrastText(background) { var contrastText = (0,colorManipulator/* getContrastRatio */.mi)(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary; if (false) { var contrast; } return contrastText; } var augmentColor = function augmentColor(color) { var mainShade = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500; var lightShade = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300; var darkShade = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 700; color = (0,esm_extends/* default */.Z)({}, color); if (!color.main && color[mainShade]) { color.main = color[mainShade]; } if (!color.main) { throw new Error( false ? 0 : (0,formatMuiErrorMessage/* default */.Z)(4, mainShade)); } if (typeof color.main !== 'string') { throw new Error( false ? 0 : (0,formatMuiErrorMessage/* default */.Z)(5, JSON.stringify(color.main))); } addLightOrDark(color, 'light', lightShade, tonalOffset); addLightOrDark(color, 'dark', darkShade, tonalOffset); if (!color.contrastText) { color.contrastText = getContrastText(color.main); } return color; }; var types = { dark: dark, light: light }; if (false) {} var paletteOutput = (0,deepmerge/* default */.Z)((0,esm_extends/* default */.Z)({ // A collection of common colors. common: colors_common, // The palette type, can be light or dark. type: type, // The colors used to represent primary interface elements for a user. primary: augmentColor(primary), // The colors used to represent secondary interface elements for a user. secondary: augmentColor(secondary, 'A400', 'A200', 'A700'), // The colors used to represent interface elements that the user should be made aware of. error: augmentColor(error), // The colors used to represent potentially dangerous actions or important messages. warning: augmentColor(warning), // The colors used to present information to the user that is neutral and not necessarily important. info: augmentColor(info), // The colors used to indicate the successful completion of an action that user triggered. success: augmentColor(success), // The grey colors. grey: colors_grey, // Used by `getContrastText()` to maximize the contrast between // the background and the text. contrastThreshold: contrastThreshold, // Takes a background color and returns the text color that maximizes the contrast. getContrastText: getContrastText, // Generate a rich color object. augmentColor: augmentColor, // Used by the functions below to shift a color's luminance by approximately // two indexes within its tonal palette. // E.g., shift from Red 500 to Red 300 or Red 700. tonalOffset: tonalOffset }, types[type]), other); return paletteOutput; } ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/createTypography.js function round(value) { return Math.round(value * 1e5) / 1e5; } var warnedOnce = false; function roundWithDeprecationWarning(value) { if (false) {} return round(value); } var caseAllCaps = { textTransform: 'uppercase' }; var defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif'; /** * @see @link{https://material.io/design/typography/the-type-system.html} * @see @link{https://material.io/design/typography/understanding-typography.html} */ function createTypography(palette, typography) { var _ref = typeof typography === 'function' ? typography(palette) : typography, _ref$fontFamily = _ref.fontFamily, fontFamily = _ref$fontFamily === void 0 ? defaultFontFamily : _ref$fontFamily, _ref$fontSize = _ref.fontSize, fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize, _ref$fontWeightLight = _ref.fontWeightLight, fontWeightLight = _ref$fontWeightLight === void 0 ? 300 : _ref$fontWeightLight, _ref$fontWeightRegula = _ref.fontWeightRegular, fontWeightRegular = _ref$fontWeightRegula === void 0 ? 400 : _ref$fontWeightRegula, _ref$fontWeightMedium = _ref.fontWeightMedium, fontWeightMedium = _ref$fontWeightMedium === void 0 ? 500 : _ref$fontWeightMedium, _ref$fontWeightBold = _ref.fontWeightBold, fontWeightBold = _ref$fontWeightBold === void 0 ? 700 : _ref$fontWeightBold, _ref$htmlFontSize = _ref.htmlFontSize, htmlFontSize = _ref$htmlFontSize === void 0 ? 16 : _ref$htmlFontSize, allVariants = _ref.allVariants, pxToRem2 = _ref.pxToRem, other = (0,objectWithoutProperties/* default */.Z)(_ref, ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"]); if (false) {} var coef = fontSize / 14; var pxToRem = pxToRem2 || function (size) { return "".concat(size / htmlFontSize * coef, "rem"); }; var buildVariant = function buildVariant(fontWeight, size, lineHeight, letterSpacing, casing) { return (0,esm_extends/* default */.Z)({ fontFamily: fontFamily, fontWeight: fontWeight, fontSize: pxToRem(size), // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/ lineHeight: lineHeight }, fontFamily === defaultFontFamily ? { letterSpacing: "".concat(round(letterSpacing / size), "em") } : {}, casing, allVariants); }; var variants = { h1: buildVariant(fontWeightLight, 96, 1.167, -1.5), h2: buildVariant(fontWeightLight, 60, 1.2, -0.5), h3: buildVariant(fontWeightRegular, 48, 1.167, 0), h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25), h5: buildVariant(fontWeightRegular, 24, 1.334, 0), h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15), subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15), subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1), body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15), body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15), button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps), caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4), overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps) }; return (0,deepmerge/* default */.Z)((0,esm_extends/* default */.Z)({ htmlFontSize: htmlFontSize, pxToRem: pxToRem, round: roundWithDeprecationWarning, // TODO v5: remove fontFamily: fontFamily, fontSize: fontSize, fontWeightLight: fontWeightLight, fontWeightRegular: fontWeightRegular, fontWeightMedium: fontWeightMedium, fontWeightBold: fontWeightBold }, variants), other, { clone: false // No need to clone deep }); } ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/shadows.js var shadowKeyUmbraOpacity = 0.2; var shadowKeyPenumbraOpacity = 0.14; var shadowAmbientShadowOpacity = 0.12; function createShadow() { return ["".concat(arguments.length <= 0 ? undefined : arguments[0], "px ").concat(arguments.length <= 1 ? undefined : arguments[1], "px ").concat(arguments.length <= 2 ? undefined : arguments[2], "px ").concat(arguments.length <= 3 ? undefined : arguments[3], "px rgba(0,0,0,").concat(shadowKeyUmbraOpacity, ")"), "".concat(arguments.length <= 4 ? undefined : arguments[4], "px ").concat(arguments.length <= 5 ? undefined : arguments[5], "px ").concat(arguments.length <= 6 ? undefined : arguments[6], "px ").concat(arguments.length <= 7 ? undefined : arguments[7], "px rgba(0,0,0,").concat(shadowKeyPenumbraOpacity, ")"), "".concat(arguments.length <= 8 ? undefined : arguments[8], "px ").concat(arguments.length <= 9 ? undefined : arguments[9], "px ").concat(arguments.length <= 10 ? undefined : arguments[10], "px ").concat(arguments.length <= 11 ? undefined : arguments[11], "px rgba(0,0,0,").concat(shadowAmbientShadowOpacity, ")")].join(','); } // Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss var shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)]; /* harmony default export */ var styles_shadows = (shadows); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/shape.js var shape = { borderRadius: 4 }; /* harmony default export */ var styles_shape = (shape); // EXTERNAL MODULE: ./node_modules/@material-ui/system/esm/spacing.js + 1 modules var esm_spacing = __webpack_require__(27122); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/createSpacing.js var warnOnce; function createSpacing() { var spacingInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 8; // Already transformed. if (spacingInput.mui) { return spacingInput; } // Material Design layouts are visually balanced. Most measurements align to an 8dp grid applied, which aligns both spacing and the overall layout. // Smaller components, such as icons and type, can align to a 4dp grid. // https://material.io/design/layout/understanding-layout.html#usage var transform = (0,esm_spacing/* createUnarySpacing */.h)({ spacing: spacingInput }); var spacing = function spacing() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (false) {} if (args.length === 0) { return transform(1); } if (args.length === 1) { return transform(args[0]); } return args.map(function (argument) { if (typeof argument === 'string') { return argument; } var output = transform(argument); return typeof output === 'number' ? "".concat(output, "px") : output; }).join(' '); }; // Backward compatibility, to remove in v5. Object.defineProperty(spacing, 'unit', { get: function get() { if (false) {} return spacingInput; } }); spacing.mui = true; return spacing; } // EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/styles/transitions.js var transitions = __webpack_require__(43366); // EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/styles/zIndex.js var zIndex = __webpack_require__(92781); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/createTheme.js function createTheme() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$breakpoints = options.breakpoints, breakpointsInput = _options$breakpoints === void 0 ? {} : _options$breakpoints, _options$mixins = options.mixins, mixinsInput = _options$mixins === void 0 ? {} : _options$mixins, _options$palette = options.palette, paletteInput = _options$palette === void 0 ? {} : _options$palette, spacingInput = options.spacing, _options$typography = options.typography, typographyInput = _options$typography === void 0 ? {} : _options$typography, other = (0,objectWithoutProperties/* default */.Z)(options, ["breakpoints", "mixins", "palette", "spacing", "typography"]); var palette = createPalette(paletteInput); var breakpoints = (0,createBreakpoints/* default */.Z)(breakpointsInput); var spacing = createSpacing(spacingInput); var muiTheme = (0,deepmerge/* default */.Z)({ breakpoints: breakpoints, direction: 'ltr', mixins: createMixins(breakpoints, spacing, mixinsInput), overrides: {}, // Inject custom styles palette: palette, props: {}, // Provide default props shadows: styles_shadows, typography: createTypography(palette, typographyInput), spacing: spacing, shape: styles_shape, transitions: transitions/* default */.ZP, zIndex: zIndex/* default */.Z }, other); for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } muiTheme = args.reduce(function (acc, argument) { return (0,deepmerge/* default */.Z)(acc, argument); }, muiTheme); if (false) { var traverse, pseudoClasses; } return muiTheme; } var createTheme_warnedOnce = false; function createMuiTheme() { if (false) {} return createTheme.apply(void 0, arguments); } /* harmony default export */ var styles_createTheme = (createTheme); /***/ }), /***/ 99700: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _createTheme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47823); var defaultTheme = (0,_createTheme__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(); /* harmony default export */ __webpack_exports__["Z"] = (defaultTheme); /***/ }), /***/ 41120: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87462); /* harmony import */ var _material_ui_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11719); /* harmony import */ var _defaultTheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99700); function makeStyles(stylesOrCreator) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return (0,_material_ui_styles__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(stylesOrCreator, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)({ defaultTheme: _defaultTheme__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z }, options)); } /* harmony default export */ __webpack_exports__["Z"] = (makeStyles); /***/ }), /***/ 43366: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Ui": function() { return /* binding */ easing; }, /* harmony export */ "x9": function() { return /* binding */ duration; } /* harmony export */ }); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45987); // Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves // to learn the context in which each easing should be used. var easing = { // This is the most common easing curve. easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)', // Objects enter the screen at full velocity from off-screen and // slowly decelerate to a resting point. easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)', // Objects leave the screen at full velocity. They do not decelerate when off-screen. easeIn: 'cubic-bezier(0.4, 0, 1, 1)', // The sharp curve is used by objects that may return to the screen at any time. sharp: 'cubic-bezier(0.4, 0, 0.6, 1)' }; // Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations // to learn when use what timing var duration = { shortest: 150, shorter: 200, short: 250, // most basic recommended timing standard: 300, // this is to be used in complex animations complex: 375, // recommended when something is entering screen enteringScreen: 225, // recommended when something is leaving screen leavingScreen: 195 }; function formatMs(milliseconds) { return "".concat(Math.round(milliseconds), "ms"); } /** * @param {string|Array} props * @param {object} param * @param {string} param.prop * @param {number} param.duration * @param {string} param.easing * @param {number} param.delay */ /* harmony default export */ __webpack_exports__["ZP"] = ({ easing: easing, duration: duration, create: function create() { var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['all']; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$duration = options.duration, durationOption = _options$duration === void 0 ? duration.standard : _options$duration, _options$easing = options.easing, easingOption = _options$easing === void 0 ? easing.easeInOut : _options$easing, _options$delay = options.delay, delay = _options$delay === void 0 ? 0 : _options$delay, other = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(options, ["duration", "easing", "delay"]); if (false) { var isNumber, isString; } return (Array.isArray(props) ? props : [props]).map(function (animatedProp) { return "".concat(animatedProp, " ").concat(typeof durationOption === 'string' ? durationOption : formatMs(durationOption), " ").concat(easingOption, " ").concat(typeof delay === 'string' ? delay : formatMs(delay)); }).join(','); }, getAutoHeightDuration: function getAutoHeightDuration(height) { if (!height) { return 0; } var constant = height / 36; // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10 return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10); } }); /***/ }), /***/ 8920: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ useTheme; } /* harmony export */ }); /* harmony import */ var _material_ui_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony import */ var _defaultTheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99700); function useTheme() { var theme = (0,_material_ui_styles__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)() || _defaultTheme__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z; if (false) {} return theme; } /***/ }), /***/ 1591: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "Z": function() { return /* binding */ styles_withStyles; } }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(87462); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(45987); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(67294); // EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js var hoist_non_react_statics_cjs = __webpack_require__(8679); var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs); // EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/makeStyles/makeStyles.js + 4 modules var makeStyles = __webpack_require__(11719); // EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/getThemeProps/getThemeProps.js var getThemeProps = __webpack_require__(93869); // EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/useTheme/useTheme.js var useTheme = __webpack_require__(159); ;// CONCATENATED MODULE: ./node_modules/@material-ui/styles/esm/withStyles/withStyles.js // Link a style sheet with a component. // It does not modify the component passed to it; // instead, it returns a new component, with a `classes` property. var withStyles = function withStyles(stylesOrCreator) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return function (Component) { var defaultTheme = options.defaultTheme, _options$withTheme = options.withTheme, withTheme = _options$withTheme === void 0 ? false : _options$withTheme, name = options.name, stylesOptions = (0,objectWithoutProperties/* default */.Z)(options, ["defaultTheme", "withTheme", "name"]); if (false) {} var classNamePrefix = name; if (false) { var displayName; } var useStyles = (0,makeStyles/* default */.Z)(stylesOrCreator, (0,esm_extends/* default */.Z)({ defaultTheme: defaultTheme, Component: Component, name: name || Component.displayName, classNamePrefix: classNamePrefix }, stylesOptions)); var WithStyles = /*#__PURE__*/react.forwardRef(function WithStyles(props, ref) { var classesProp = props.classes, innerRef = props.innerRef, other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "innerRef"]); // The wrapper receives only user supplied props, which could be a subset of // the actual props Component might receive due to merging with defaultProps. // So copying it here would give us the same result in the wrapper as well. var classes = useStyles((0,esm_extends/* default */.Z)({}, Component.defaultProps, props)); var theme; var more = other; if (typeof name === 'string' || withTheme) { // name and withTheme are invariant in the outer scope // eslint-disable-next-line react-hooks/rules-of-hooks theme = (0,useTheme/* default */.Z)() || defaultTheme; if (name) { more = (0,getThemeProps/* default */.Z)({ theme: theme, name: name, props: other }); } // Provide the theme to the wrapped component. // So we don't have to use the `withTheme()` Higher-order Component. if (withTheme && !more.theme) { more.theme = theme; } } return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({ ref: innerRef || ref, classes: classes }, more)); }); false ? 0 : void 0; if (false) {} hoist_non_react_statics_cjs_default()(WithStyles, Component); if (false) {} return WithStyles; }; }; /* harmony default export */ var withStyles_withStyles = (withStyles); // EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/styles/defaultTheme.js var defaultTheme = __webpack_require__(99700); ;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/withStyles.js function styles_withStyles_withStyles(stylesOrCreator, options) { return withStyles_withStyles(stylesOrCreator, (0,esm_extends/* default */.Z)({ defaultTheme: defaultTheme/* default */.Z }, options)); } /* harmony default export */ var styles_withStyles = (styles_withStyles_withStyles); /***/ }), /***/ 92781: /***/ (function(__unused_webpack_module, __webpack_exports__) { "use strict"; // We need to centralize the zIndex definitions as they work // like global values in the browser. var zIndex = { mobileStepper: 1000, speedDial: 1050, appBar: 1100, drawer: 1200, modal: 1300, snackbar: 1400, tooltip: 1500 }; /* harmony default export */ __webpack_exports__["Z"] = (zIndex); /***/ }), /***/ 5653: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "C": function() { return /* binding */ getTransitionProps; }, /* harmony export */ "n": function() { return /* binding */ reflow; } /* harmony export */ }); var reflow = function reflow(node) { return node.scrollTop; }; function getTransitionProps(props, options) { var timeout = props.timeout, _props$style = props.style, style = _props$style === void 0 ? {} : _props$style; return { duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0, delay: style.transitionDelay }; } /***/ }), /***/ 93871: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ capitalize; } /* harmony export */ }); /* harmony import */ var _material_ui_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60288); // It should to be noted that this function isn't equivalent to `text-transform: capitalize`. // // A strict capitalization should uppercase the first letter of each word a the sentence. // We only handle the first word. function capitalize(string) { if (typeof string !== 'string') { throw new Error( false ? 0 : (0,_material_ui_utils__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(7)); } return string.charAt(0).toUpperCase() + string.slice(1); } /***/ }), /***/ 79437: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ debounce; } /* harmony export */ }); // Corresponds to 10 frames at 60 Hz. // A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B. function debounce(func) { var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166; var timeout; function debounced() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // eslint-disable-next-line consistent-this var that = this; var later = function later() { func.apply(that, args); }; clearTimeout(timeout); timeout = setTimeout(later, wait); } debounced.clear = function () { clearTimeout(timeout); }; return debounced; } /***/ }), /***/ 30626: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ ownerDocument; } /* harmony export */ }); function ownerDocument(node) { return node && node.ownerDocument || document; } /***/ }), /***/ 34236: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ setRef; } /* harmony export */ }); // TODO v5: consider to make it private function setRef(ref, value) { if (typeof ref === 'function') { ref(value); } else if (ref) { ref.current = value; } } /***/ }), /***/ 55192: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ useEventCallback; } /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); var useEnhancedEffect = typeof window !== 'undefined' ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect; /** * https://github.com/facebook/react/issues/14099#issuecomment-440013892 * * @param {function} fn */ function useEventCallback(fn) { var ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef(fn); useEnhancedEffect(function () { ref.current = fn; }); return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function () { return (0, ref.current).apply(void 0, arguments); }, []); } /***/ }), /***/ 17294: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ useForkRef; } /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony import */ var _setRef__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34236); function useForkRef(refA, refB) { /** * This will create a new function if the ref props change and are defined. * This means react will call the old forkRef with `null` and the new forkRef * with the ref. Cleanup naturally emerges from this behavior */ return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(function () { if (refA == null && refB == null) { return null; } return function (refValue) { (0,_setRef__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(refA, refValue); (0,_setRef__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(refB, refValue); }; }, [refA, refB]); } /***/ }), /***/ 26975: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "NU": function() { return /* binding */ StylesContext; }, /* harmony export */ "ZP": function() { return /* binding */ StylesProvider; } /* harmony export */ }); /* unused harmony export sheetsManager */ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87462); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45987); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony import */ var _createGenerateClassName__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5034); /* harmony import */ var jss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54013); /* harmony import */ var _jssPreset__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94237); // Default JSS instance. var jss = (0,jss__WEBPACK_IMPORTED_MODULE_1__/* .create */ .Ue)((0,_jssPreset__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)()); // Use a singleton or the provided one by the context. // // The counter-based approach doesn't tolerate any mistake. // It's much safer to use the same counter everywhere. var generateClassName = (0,_createGenerateClassName__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(); // Exported for test purposes var sheetsManager = new Map(); var defaultOptions = { disableGeneration: false, generateClassName: generateClassName, jss: jss, sheetsCache: null, sheetsManager: sheetsManager, sheetsRegistry: null }; var StylesContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(defaultOptions); if (false) {} var injectFirstNode; function StylesProvider(props) { var children = props.children, _props$injectFirst = props.injectFirst, injectFirst = _props$injectFirst === void 0 ? false : _props$injectFirst, _props$disableGenerat = props.disableGeneration, disableGeneration = _props$disableGenerat === void 0 ? false : _props$disableGenerat, localOptions = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(props, ["children", "injectFirst", "disableGeneration"]); var outerOptions = react__WEBPACK_IMPORTED_MODULE_0__.useContext(StylesContext); var context = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)({}, outerOptions, { disableGeneration: disableGeneration }, localOptions); if (false) {} if (false) {} if (false) {} if (!context.jss.options.insertionPoint && injectFirst && typeof window !== 'undefined') { if (!injectFirstNode) { var head = document.head; injectFirstNode = document.createComment('mui-inject-first'); head.insertBefore(injectFirstNode, head.firstChild); } context.jss = (0,jss__WEBPACK_IMPORTED_MODULE_1__/* .create */ .Ue)({ plugins: (0,_jssPreset__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)().plugins, insertionPoint: injectFirstNode }); } return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(StylesContext.Provider, { value: context }, children); } false ? 0 : void 0; if (false) {} /***/ }), /***/ 13457: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87462); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony import */ var _useTheme_ThemeContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83800); /* harmony import */ var _useTheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(159); /* harmony import */ var _nested__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17076); // To support composition of theme. function mergeOuterLocalTheme(outerTheme, localTheme) { if (typeof localTheme === 'function') { var mergedTheme = localTheme(outerTheme); if (false) {} return mergedTheme; } return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)({}, outerTheme, localTheme); } /** * This component takes a `theme` prop. * It makes the `theme` available down the React tree thanks to React context. * This component should preferably be used at **the root of your component tree**. */ function ThemeProvider(props) { var children = props.children, localTheme = props.theme; var outerTheme = (0,_useTheme__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(); if (false) {} var theme = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(function () { var output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme); if (output != null) { output[_nested__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z] = outerTheme !== null; } return output; }, [localTheme, outerTheme]); return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_useTheme_ThemeContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"].Provider */ .Z.Provider, { value: theme }, children); } false ? 0 : void 0; if (false) {} /* harmony default export */ __webpack_exports__["Z"] = (ThemeProvider); /***/ }), /***/ 17076: /***/ (function(__unused_webpack_module, __webpack_exports__) { "use strict"; var hasSymbol = typeof Symbol === 'function' && Symbol.for; /* harmony default export */ __webpack_exports__["Z"] = (hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__'); /***/ }), /***/ 5034: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ createGenerateClassName; } /* harmony export */ }); /* harmony import */ var _ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17076); /** * This is the list of the style rule name we use as drop in replacement for the built-in * pseudo classes (:checked, :disabled, :focused, etc.). * * Why do they exist in the first place? * These classes are used at a specificity of 2. * It allows them to override previously definied styles as well as * being untouched by simple user overrides. */ var pseudoClasses = ['checked', 'disabled', 'error', 'focused', 'focusVisible', 'required', 'expanded', 'selected']; // Returns a function which generates unique class names based on counters. // When new generator function is created, rule counter is reset. // We need to reset the rule counter for SSR for each request. // // It's inspired by // https://github.com/cssinjs/jss/blob/4e6a05dd3f7b6572fdd3ab216861d9e446c20331/src/utils/createGenerateClassName.js function createGenerateClassName() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$disableGloba = options.disableGlobal, disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba, _options$productionPr = options.productionPrefix, productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr, _options$seed = options.seed, seed = _options$seed === void 0 ? '' : _options$seed; var seedPrefix = seed === '' ? '' : "".concat(seed, "-"); var ruleCounter = 0; var getNextCounterId = function getNextCounterId() { ruleCounter += 1; if (false) {} return ruleCounter; }; return function (rule, styleSheet) { var name = styleSheet.options.name; // Is a global static MUI style? if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) { // We can use a shorthand class name, we never use the keys to style the components. if (pseudoClasses.indexOf(rule.key) !== -1) { return "Mui-".concat(rule.key); } var prefix = "".concat(seedPrefix).concat(name, "-").concat(rule.key); if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z] || seed !== '') { return prefix; } return "".concat(prefix, "-").concat(getNextCounterId()); } if (true) { return "".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId()); } var suffix = "".concat(rule.key, "-").concat(getNextCounterId()); // Help with debuggability. if (styleSheet.options.classNamePrefix) { return "".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, "-").concat(suffix); } return "".concat(seedPrefix).concat(suffix); }; } /***/ }), /***/ 10150: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ createStyles; } /* harmony export */ }); function createStyles(styles) { return styles; } /***/ }), /***/ 93869: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ getThemeProps; } /* harmony export */ }); /* eslint-disable no-restricted-syntax */ function getThemeProps(params) { var theme = params.theme, name = params.name, props = params.props; if (!theme || !theme.props || !theme.props[name]) { return props; } // Resolve default props, code borrow from React source. // https://github.com/facebook/react/blob/15a8f031838a553e41c0b66eb1bcf1da8448104d/packages/react/src/ReactElement.js#L221 var defaultProps = theme.props[name]; var propName; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } return props; } /***/ }), /***/ 94237: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "Z": function() { return /* binding */ jssPreset; } }); // EXTERNAL MODULE: ./node_modules/jss/dist/jss.esm.js var jss_esm = __webpack_require__(54013); ;// CONCATENATED MODULE: ./node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js var now = Date.now(); var fnValuesNs = "fnValues" + now; var fnRuleNs = "fnStyle" + ++now; var functionPlugin = function functionPlugin() { return { onCreateRule: function onCreateRule(name, decl, options) { if (typeof decl !== 'function') return null; var rule = (0,jss_esm/* createRule */.JH)(name, {}, options); rule[fnRuleNs] = decl; return rule; }, onProcessStyle: function onProcessStyle(style, rule) { // We need to extract function values from the declaration, so that we can keep core unaware of them. // We need to do that only once. // We don't need to extract functions on each style update, since this can happen only once. // We don't support function values inside of function rules. if (fnValuesNs in rule || fnRuleNs in rule) return style; var fnValues = {}; for (var prop in style) { var value = style[prop]; if (typeof value !== 'function') continue; delete style[prop]; fnValues[prop] = value; } rule[fnValuesNs] = fnValues; return style; }, onUpdate: function onUpdate(data, rule, sheet, options) { var styleRule = rule; var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object // will be returned from that function. if (fnRule) { // Empty object will remove all currently defined props // in case function rule returns a falsy value. styleRule.style = fnRule(data) || {}; if (false) { var prop; } } var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values. if (fnValues) { for (var _prop in fnValues) { styleRule.prop(_prop, fnValues[_prop](data), options); } } } }; }; /* harmony default export */ var jss_plugin_rule_value_function_esm = (functionPlugin); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(87462); ;// CONCATENATED MODULE: ./node_modules/jss-plugin-global/dist/jss-plugin-global.esm.js var at = '@global'; var atPrefix = '@global '; var GlobalContainerRule = /*#__PURE__*/ function () { function GlobalContainerRule(key, styles, options) { this.type = 'global'; this.at = at; this.isProcessed = false; this.key = key; this.options = options; this.rules = new jss_esm/* RuleList */.RB((0,esm_extends/* default */.Z)({}, options, { parent: this })); for (var selector in styles) { this.rules.add(selector, styles[selector]); } this.rules.process(); } /** * Get a rule. */ var _proto = GlobalContainerRule.prototype; _proto.getRule = function getRule(name) { return this.rules.get(name); } /** * Create and register rule, run plugins. */ ; _proto.addRule = function addRule(name, style, options) { var rule = this.rules.add(name, style, options); if (rule) this.options.jss.plugins.onProcessRule(rule); return rule; } /** * Replace rule, run plugins. */ ; _proto.replaceRule = function replaceRule(name, style, options) { var newRule = this.rules.replace(name, style, options); if (newRule) this.options.jss.plugins.onProcessRule(newRule); return newRule; } /** * Get index of a rule. */ ; _proto.indexOf = function indexOf(rule) { return this.rules.indexOf(rule); } /** * Generates a CSS string. */ ; _proto.toString = function toString(options) { return this.rules.toString(options); }; return GlobalContainerRule; }(); var GlobalPrefixedRule = /*#__PURE__*/ function () { function GlobalPrefixedRule(key, style, options) { this.type = 'global'; this.at = at; this.isProcessed = false; this.key = key; this.options = options; var selector = key.substr(atPrefix.length); this.rule = options.jss.createRule(selector, style, (0,esm_extends/* default */.Z)({}, options, { parent: this })); } var _proto2 = GlobalPrefixedRule.prototype; _proto2.toString = function toString(options) { return this.rule ? this.rule.toString(options) : ''; }; return GlobalPrefixedRule; }(); var separatorRegExp = /\s*,\s*/g; function addScope(selector, scope) { var parts = selector.split(separatorRegExp); var scoped = ''; for (var i = 0; i < parts.length; i++) { scoped += scope + " " + parts[i].trim(); if (parts[i + 1]) scoped += ', '; } return scoped; } function handleNestedGlobalContainerRule(rule, sheet) { var options = rule.options, style = rule.style; var rules = style ? style[at] : null; if (!rules) return; for (var name in rules) { sheet.addRule(name, rules[name], (0,esm_extends/* default */.Z)({}, options, { selector: addScope(name, rule.selector) })); } delete style[at]; } function handlePrefixedGlobalRule(rule, sheet) { var options = rule.options, style = rule.style; for (var prop in style) { if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue; var selector = addScope(prop.substr(at.length), rule.selector); sheet.addRule(selector, style[prop], (0,esm_extends/* default */.Z)({}, options, { selector: selector })); delete style[prop]; } } /** * Convert nested rules to separate, remove them from original styles. */ function jssGlobal() { function onCreateRule(name, styles, options) { if (!name) return null; if (name === at) { return new GlobalContainerRule(name, styles, options); } if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) { return new GlobalPrefixedRule(name, styles, options); } var parent = options.parent; if (parent) { if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') { options.scoped = false; } } if (!options.selector && options.scoped === false) { options.selector = name; } return null; } function onProcessRule(rule, sheet) { if (rule.type !== 'style' || !sheet) return; handleNestedGlobalContainerRule(rule, sheet); handlePrefixedGlobalRule(rule, sheet); } return { onCreateRule: onCreateRule, onProcessRule: onProcessRule }; } /* harmony default export */ var jss_plugin_global_esm = (jssGlobal); ;// CONCATENATED MODULE: ./node_modules/jss-plugin-nested/dist/jss-plugin-nested.esm.js var jss_plugin_nested_esm_separatorRegExp = /\s*,\s*/g; var parentRegExp = /&/g; var refRegExp = /\$([\w-]+)/g; /** * Convert nested rules to separate, remove them from original styles. */ function jssNested() { // Get a function to be used for $ref replacement. function getReplaceRef(container, sheet) { return function (match, key) { var rule = container.getRule(key) || sheet && sheet.getRule(key); if (rule) { return rule.selector; } false ? 0 : void 0; return key; }; } function replaceParentRefs(nestedProp, parentProp) { var parentSelectors = parentProp.split(jss_plugin_nested_esm_separatorRegExp); var nestedSelectors = nestedProp.split(jss_plugin_nested_esm_separatorRegExp); var result = ''; for (var i = 0; i < parentSelectors.length; i++) { var parent = parentSelectors[i]; for (var j = 0; j < nestedSelectors.length; j++) { var nested = nestedSelectors[j]; if (result) result += ', '; // Replace all & by the parent or prefix & with the parent. result += nested.indexOf('&') !== -1 ? nested.replace(parentRegExp, parent) : parent + " " + nested; } } return result; } function getOptions(rule, container, prevOptions) { // Options has been already created, now we only increase index. if (prevOptions) return (0,esm_extends/* default */.Z)({}, prevOptions, { index: prevOptions.index + 1 }); var nestingLevel = rule.options.nestingLevel; nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1; var options = (0,esm_extends/* default */.Z)({}, rule.options, { nestingLevel: nestingLevel, index: container.indexOf(rule) + 1 // We don't need the parent name to be set options for chlid. }); delete options.name; return options; } function onProcessStyle(style, rule, sheet) { if (rule.type !== 'style') return style; var styleRule = rule; var container = styleRule.options.parent; var options; var replaceRef; for (var prop in style) { var isNested = prop.indexOf('&') !== -1; var isNestedConditional = prop[0] === '@'; if (!isNested && !isNestedConditional) continue; options = getOptions(styleRule, container, options); if (isNested) { var selector = replaceParentRefs(prop, styleRule.selector); // Lazily create the ref replacer function just once for // all nested rules within the sheet. if (!replaceRef) replaceRef = getReplaceRef(container, sheet); // Replace all $refs. selector = selector.replace(refRegExp, replaceRef); var name = styleRule.key + "-" + prop; if ('replaceRule' in container) { // for backward compatibility container.replaceRule(name, style[prop], (0,esm_extends/* default */.Z)({}, options, { selector: selector })); } else { container.addRule(name, style[prop], (0,esm_extends/* default */.Z)({}, options, { selector: selector })); } } else if (isNestedConditional) { // Place conditional right after the parent rule to ensure right ordering. container.addRule(prop, {}, options).addRule(styleRule.key, style[prop], { selector: styleRule.selector }); } delete style[prop]; } return style; } return { onProcessStyle: onProcessStyle }; } /* harmony default export */ var jss_plugin_nested_esm = (jssNested); ;// CONCATENATED MODULE: ./node_modules/hyphenate-style-name/index.js /* eslint-disable no-var, prefer-template */ var uppercasePattern = /[A-Z]/g var msPattern = /^ms-/ var cache = {} function toHyphenLower(match) { return '-' + match.toLowerCase() } function hyphenateStyleName(name) { if (cache.hasOwnProperty(name)) { return cache[name] } var hName = name.replace(uppercasePattern, toHyphenLower) return (cache[name] = msPattern.test(hName) ? '-' + hName : hName) } /* harmony default export */ var hyphenate_style_name = (hyphenateStyleName); ;// CONCATENATED MODULE: ./node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js /** * Convert camel cased property names to dash separated. */ function convertCase(style) { var converted = {}; for (var prop in style) { var key = prop.indexOf('--') === 0 ? prop : hyphenate_style_name(prop); converted[key] = style[prop]; } if (style.fallbacks) { if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks); } return converted; } /** * Allow camel cased property names by converting them back to dasherized. */ function camelCase() { function onProcessStyle(style) { if (Array.isArray(style)) { // Handle rules like @font-face, which can have multiple styles in an array for (var index = 0; index < style.length; index++) { style[index] = convertCase(style[index]); } return style; } return convertCase(style); } function onChangeValue(value, prop, rule) { if (prop.indexOf('--') === 0) { return value; } var hyphenatedProp = hyphenate_style_name(prop); // There was no camel case in place if (prop === hyphenatedProp) return value; rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above. return null; } return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; } /* harmony default export */ var jss_plugin_camel_case_esm = (camelCase); ;// CONCATENATED MODULE: ./node_modules/jss-plugin-default-unit/dist/jss-plugin-default-unit.esm.js var px = jss_esm/* hasCSSTOMSupport */.HZ && CSS ? CSS.px : 'px'; var ms = jss_esm/* hasCSSTOMSupport */.HZ && CSS ? CSS.ms : 'ms'; var percent = jss_esm/* hasCSSTOMSupport */.HZ && CSS ? CSS.percent : '%'; /** * Generated jss-plugin-default-unit CSS property units */ var defaultUnits = { // Animation properties 'animation-delay': ms, 'animation-duration': ms, // Background properties 'background-position': px, 'background-position-x': px, 'background-position-y': px, 'background-size': px, // Border Properties border: px, 'border-bottom': px, 'border-bottom-left-radius': px, 'border-bottom-right-radius': px, 'border-bottom-width': px, 'border-left': px, 'border-left-width': px, 'border-radius': px, 'border-right': px, 'border-right-width': px, 'border-top': px, 'border-top-left-radius': px, 'border-top-right-radius': px, 'border-top-width': px, 'border-width': px, 'border-block': px, 'border-block-end': px, 'border-block-end-width': px, 'border-block-start': px, 'border-block-start-width': px, 'border-block-width': px, 'border-inline': px, 'border-inline-end': px, 'border-inline-end-width': px, 'border-inline-start': px, 'border-inline-start-width': px, 'border-inline-width': px, 'border-start-start-radius': px, 'border-start-end-radius': px, 'border-end-start-radius': px, 'border-end-end-radius': px, // Margin properties margin: px, 'margin-bottom': px, 'margin-left': px, 'margin-right': px, 'margin-top': px, 'margin-block': px, 'margin-block-end': px, 'margin-block-start': px, 'margin-inline': px, 'margin-inline-end': px, 'margin-inline-start': px, // Padding properties padding: px, 'padding-bottom': px, 'padding-left': px, 'padding-right': px, 'padding-top': px, 'padding-block': px, 'padding-block-end': px, 'padding-block-start': px, 'padding-inline': px, 'padding-inline-end': px, 'padding-inline-start': px, // Mask properties 'mask-position-x': px, 'mask-position-y': px, 'mask-size': px, // Width and height properties height: px, width: px, 'min-height': px, 'max-height': px, 'min-width': px, 'max-width': px, // Position properties bottom: px, left: px, top: px, right: px, inset: px, 'inset-block': px, 'inset-block-end': px, 'inset-block-start': px, 'inset-inline': px, 'inset-inline-end': px, 'inset-inline-start': px, // Shadow properties 'box-shadow': px, 'text-shadow': px, // Column properties 'column-gap': px, 'column-rule': px, 'column-rule-width': px, 'column-width': px, // Font and text properties 'font-size': px, 'font-size-delta': px, 'letter-spacing': px, 'text-decoration-thickness': px, 'text-indent': px, 'text-stroke': px, 'text-stroke-width': px, 'word-spacing': px, // Motion properties motion: px, 'motion-offset': px, // Outline properties outline: px, 'outline-offset': px, 'outline-width': px, // Perspective properties perspective: px, 'perspective-origin-x': percent, 'perspective-origin-y': percent, // Transform properties 'transform-origin': percent, 'transform-origin-x': percent, 'transform-origin-y': percent, 'transform-origin-z': percent, // Transition properties 'transition-delay': ms, 'transition-duration': ms, // Alignment properties 'vertical-align': px, 'flex-basis': px, // Some random properties 'shape-margin': px, size: px, gap: px, // Grid properties grid: px, 'grid-gap': px, 'row-gap': px, 'grid-row-gap': px, 'grid-column-gap': px, 'grid-template-rows': px, 'grid-template-columns': px, 'grid-auto-rows': px, 'grid-auto-columns': px, // Not existing properties. // Used to avoid issues with jss-plugin-expand integration. 'box-shadow-x': px, 'box-shadow-y': px, 'box-shadow-blur': px, 'box-shadow-spread': px, 'font-line-height': px, 'text-shadow-x': px, 'text-shadow-y': px, 'text-shadow-blur': px }; /** * Clones the object and adds a camel cased property version. */ function addCamelCasedVersion(obj) { var regExp = /(-[a-z])/g; var replace = function replace(str) { return str[1].toUpperCase(); }; var newObj = {}; for (var key in obj) { newObj[key] = obj[key]; newObj[key.replace(regExp, replace)] = obj[key]; } return newObj; } var units = addCamelCasedVersion(defaultUnits); /** * Recursive deep style passing function */ function iterate(prop, value, options) { if (value == null) return value; if (Array.isArray(value)) { for (var i = 0; i < value.length; i++) { value[i] = iterate(prop, value[i], options); } } else if (typeof value === 'object') { if (prop === 'fallbacks') { for (var innerProp in value) { value[innerProp] = iterate(innerProp, value[innerProp], options); } } else { for (var _innerProp in value) { value[_innerProp] = iterate(prop + "-" + _innerProp, value[_innerProp], options); } } // eslint-disable-next-line no-restricted-globals } else if (typeof value === 'number' && isNaN(value) === false) { var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px. if (unit && !(value === 0 && unit === px)) { return typeof unit === 'function' ? unit(value).toString() : "" + value + unit; } return value.toString(); } return value; } /** * Add unit to numeric values. */ function defaultUnit(options) { if (options === void 0) { options = {}; } var camelCasedOptions = addCamelCasedVersion(options); function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; for (var prop in style) { style[prop] = iterate(prop, style[prop], camelCasedOptions); } return style; } function onChangeValue(value, prop) { return iterate(prop, value, camelCasedOptions); } return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; } /* harmony default export */ var jss_plugin_default_unit_esm = (defaultUnit); // EXTERNAL MODULE: ./node_modules/is-in-browser/dist/module.js var dist_module = __webpack_require__(33827); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules var toConsumableArray = __webpack_require__(41451); ;// CONCATENATED MODULE: ./node_modules/css-vendor/dist/css-vendor.esm.js // Export javascript style and css style vendor prefixes. var js = ''; var css = ''; var vendor = ''; var browser = ''; var isTouch = dist_module/* default */.Z && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside. if (dist_module/* default */.Z) { // Order matters. We need to check Webkit the last one because // other vendors use to add Webkit prefixes to some properties var jsCssMap = { Moz: '-moz-', ms: '-ms-', O: '-o-', Webkit: '-webkit-' }; var _document$createEleme = document.createElement('p'), style = _document$createEleme.style; var testProp = 'Transform'; for (var key in jsCssMap) { if (key + testProp in style) { js = key; css = jsCssMap[key]; break; } } // Correctly detect the Edge browser. if (js === 'Webkit' && 'msHyphens' in style) { js = 'ms'; css = jsCssMap.ms; browser = 'edge'; } // Correctly detect the Safari browser. if (js === 'Webkit' && '-apple-trailing-word' in style) { vendor = 'apple'; } } /** * Vendor prefix string for the current browser. * * @type {{js: String, css: String, vendor: String, browser: String}} * @api public */ var prefix = { js: js, css: css, vendor: vendor, browser: browser, isTouch: isTouch }; /** * Test if a keyframe at-rule should be prefixed or not * * @param {String} vendor prefix string for the current browser. * @return {String} * @api public */ function supportedKeyframes(key) { // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a' if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules. // https://caniuse.com/#search=keyframes if (prefix.js === 'ms') return key; return "@" + prefix.css + "keyframes" + key.substr(10); } // https://caniuse.com/#search=appearance var appearence = { noPrefill: ['appearance'], supportedProperty: function supportedProperty(prop) { if (prop !== 'appearance') return false; if (prefix.js === 'ms') return "-webkit-" + prop; return prefix.css + prop; } }; // https://caniuse.com/#search=color-adjust var colorAdjust = { noPrefill: ['color-adjust'], supportedProperty: function supportedProperty(prop) { if (prop !== 'color-adjust') return false; if (prefix.js === 'Webkit') return prefix.css + "print-" + prop; return prop; } }; var regExp = /[-\s]+(.)?/g; /** * Replaces the letter with the capital letter * * @param {String} match * @param {String} c * @return {String} * @api private */ function toUpper(match, c) { return c ? c.toUpperCase() : ''; } /** * Convert dash separated strings to camel-cased. * * @param {String} str * @return {String} * @api private */ function camelize(str) { return str.replace(regExp, toUpper); } /** * Convert dash separated strings to pascal cased. * * @param {String} str * @return {String} * @api private */ function pascalize(str) { return camelize("-" + str); } // but we can use a longhand property instead. // https://caniuse.com/#search=mask var mask = { noPrefill: ['mask'], supportedProperty: function supportedProperty(prop, style) { if (!/^mask/.test(prop)) return false; if (prefix.js === 'Webkit') { var longhand = 'mask-image'; if (camelize(longhand) in style) { return prop; } if (prefix.js + pascalize(longhand) in style) { return prefix.css + prop; } } return prop; } }; // https://caniuse.com/#search=text-orientation var textOrientation = { noPrefill: ['text-orientation'], supportedProperty: function supportedProperty(prop) { if (prop !== 'text-orientation') return false; if (prefix.vendor === 'apple' && !prefix.isTouch) { return prefix.css + prop; } return prop; } }; // https://caniuse.com/#search=transform var transform = { noPrefill: ['transform'], supportedProperty: function supportedProperty(prop, style, options) { if (prop !== 'transform') return false; if (options.transform) { return prop; } return prefix.css + prop; } }; // https://caniuse.com/#search=transition var transition = { noPrefill: ['transition'], supportedProperty: function supportedProperty(prop, style, options) { if (prop !== 'transition') return false; if (options.transition) { return prop; } return prefix.css + prop; } }; // https://caniuse.com/#search=writing-mode var writingMode = { noPrefill: ['writing-mode'], supportedProperty: function supportedProperty(prop) { if (prop !== 'writing-mode') return false; if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') { return prefix.css + prop; } return prop; } }; // https://caniuse.com/#search=user-select var userSelect = { noPrefill: ['user-select'], supportedProperty: function supportedProperty(prop) { if (prop !== 'user-select') return false; if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') { return prefix.css + prop; } return prop; } }; // https://caniuse.com/#search=multicolumn // https://github.com/postcss/autoprefixer/issues/491 // https://github.com/postcss/autoprefixer/issues/177 var breakPropsOld = { supportedProperty: function supportedProperty(prop, style) { if (!/^break-/.test(prop)) return false; if (prefix.js === 'Webkit') { var jsProp = "WebkitColumn" + pascalize(prop); return jsProp in style ? prefix.css + "column-" + prop : false; } if (prefix.js === 'Moz') { var _jsProp = "page" + pascalize(prop); return _jsProp in style ? "page-" + prop : false; } return false; } }; // See https://github.com/postcss/autoprefixer/issues/324. var inlineLogicalOld = { supportedProperty: function supportedProperty(prop, style) { if (!/^(border|margin|padding)-inline/.test(prop)) return false; if (prefix.js === 'Moz') return prop; var newProp = prop.replace('-inline', ''); return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false; } }; // Camelization is required because we can't test using. // CSS syntax for e.g. in FF. var unprefixed = { supportedProperty: function supportedProperty(prop, style) { return camelize(prop) in style ? prop : false; } }; var prefixed = { supportedProperty: function supportedProperty(prop, style) { var pascalized = pascalize(prop); // Return custom CSS variable without prefixing. if (prop[0] === '-') return prop; // Return already prefixed value without prefixing. if (prop[0] === '-' && prop[1] === '-') return prop; if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback. if (prefix.js !== 'Webkit' && "Webkit" + pascalized in style) return "-webkit-" + prop; return false; } }; // https://caniuse.com/#search=scroll-snap var scrollSnap = { supportedProperty: function supportedProperty(prop) { if (prop.substring(0, 11) !== 'scroll-snap') return false; if (prefix.js === 'ms') { return "" + prefix.css + prop; } return prop; } }; // https://caniuse.com/#search=overscroll-behavior var overscrollBehavior = { supportedProperty: function supportedProperty(prop) { if (prop !== 'overscroll-behavior') return false; if (prefix.js === 'ms') { return prefix.css + "scroll-chaining"; } return prop; } }; var propMap = { 'flex-grow': 'flex-positive', 'flex-shrink': 'flex-negative', 'flex-basis': 'flex-preferred-size', 'justify-content': 'flex-pack', order: 'flex-order', 'align-items': 'flex-align', 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin. }; // Support old flex spec from 2012. var flex2012 = { supportedProperty: function supportedProperty(prop, style) { var newProp = propMap[prop]; if (!newProp) return false; return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false; } }; var propMap$1 = { flex: 'box-flex', 'flex-grow': 'box-flex', 'flex-direction': ['box-orient', 'box-direction'], order: 'box-ordinal-group', 'align-items': 'box-align', 'flex-flow': ['box-orient', 'box-direction'], 'justify-content': 'box-pack' }; var propKeys = Object.keys(propMap$1); var prefixCss = function prefixCss(p) { return prefix.css + p; }; // Support old flex spec from 2009. var flex2009 = { supportedProperty: function supportedProperty(prop, style, _ref) { var multiple = _ref.multiple; if (propKeys.indexOf(prop) > -1) { var newProp = propMap$1[prop]; if (!Array.isArray(newProp)) { return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false; } if (!multiple) return false; for (var i = 0; i < newProp.length; i++) { if (!(prefix.js + pascalize(newProp[0]) in style)) { return false; } } return newProp.map(prefixCss); } return false; } }; // plugins = [ // ...plugins, // breakPropsOld, // inlineLogicalOld, // unprefixed, // prefixed, // scrollSnap, // flex2012, // flex2009 // ] // Plugins without 'noPrefill' value, going last. // 'flex-*' plugins should be at the bottom. // 'flex2009' going after 'flex2012'. // 'prefixed' going after 'unprefixed' var plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009]; var propertyDetectors = plugins.filter(function (p) { return p.supportedProperty; }).map(function (p) { return p.supportedProperty; }); var noPrefill = plugins.filter(function (p) { return p.noPrefill; }).reduce(function (a, p) { a.push.apply(a, (0,toConsumableArray/* default */.Z)(p.noPrefill)); return a; }, []); var el; var css_vendor_esm_cache = {}; if (dist_module/* default */.Z) { el = document.createElement('p'); // We test every property on vendor prefix requirement. // Once tested, result is cached. It gives us up to 70% perf boost. // http://jsperf.com/element-style-object-access-vs-plain-object // // Prefill cache with known css properties to reduce amount of // properties we need to feature test at runtime. // http://davidwalsh.name/vendor-prefix var computed = window.getComputedStyle(document.documentElement, ''); for (var key$1 in computed) { // eslint-disable-next-line no-restricted-globals if (!isNaN(key$1)) css_vendor_esm_cache[computed[key$1]] = computed[key$1]; } // Properties that cannot be correctly detected using the // cache prefill method. noPrefill.forEach(function (x) { return delete css_vendor_esm_cache[x]; }); } /** * Test if a property is supported, returns supported property with vendor * prefix if required. Returns `false` if not supported. * * @param {String} prop dash separated * @param {Object} [options] * @return {String|Boolean} * @api public */ function supportedProperty(prop, options) { if (options === void 0) { options = {}; } // For server-side rendering. if (!el) return prop; // Remove cache for benchmark tests or return property from the cache. if ( true && css_vendor_esm_cache[prop] != null) { return css_vendor_esm_cache[prop]; } // Check if 'transition' or 'transform' natively supported in browser. if (prop === 'transition' || prop === 'transform') { options[prop] = prop in el.style; } // Find a plugin for current prefix property. for (var i = 0; i < propertyDetectors.length; i++) { css_vendor_esm_cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found. if (css_vendor_esm_cache[prop]) break; } // Reset styles for current property. // Firefox can even throw an error for invalid properties, e.g., "0". try { el.style[prop] = ''; } catch (err) { return false; } return css_vendor_esm_cache[prop]; } var cache$1 = {}; var transitionProperties = { transition: 1, 'transition-property': 1, '-webkit-transition': 1, '-webkit-transition-property': 1 }; var transPropsRegExp = /(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g; var el$1; /** * Returns prefixed value transition/transform if needed. * * @param {String} match * @param {String} p1 * @param {String} p2 * @return {String} * @api private */ function prefixTransitionCallback(match, p1, p2) { if (p1 === 'var') return 'var'; if (p1 === 'all') return 'all'; if (p2 === 'all') return ', all'; var prefixedValue = p1 ? supportedProperty(p1) : ", " + supportedProperty(p2); if (!prefixedValue) return p1 || p2; return prefixedValue; } if (dist_module/* default */.Z) el$1 = document.createElement('p'); /** * Returns prefixed value if needed. Returns `false` if value is not supported. * * @param {String} property * @param {String} value * @return {String|Boolean} * @api public */ function supportedValue(property, value) { // For server-side rendering. var prefixedValue = value; if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'. // We want only prefixable values here. // eslint-disable-next-line no-restricted-globals if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) { return prefixedValue; } // Create cache key for current value. var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache. if ( true && cache$1[cacheKey] != null) { return cache$1[cacheKey]; } // IE can even throw an error in some cases, for e.g. style.content = 'bar'. try { // Test value as it is. el$1.style[property] = prefixedValue; } catch (err) { // Return false if value not supported. cache$1[cacheKey] = false; return false; } // If 'transition' or 'transition-property' property. if (transitionProperties[property]) { prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback); } else if (el$1.style[property] === '') { // Value with a vendor prefix. prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10. if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value. el$1.style[property] = prefixedValue; // Return false if value not supported. if (el$1.style[property] === '') { cache$1[cacheKey] = false; return false; } } // Reset styles for current property. el$1.style[property] = ''; // Write current value to cache. cache$1[cacheKey] = prefixedValue; return cache$1[cacheKey]; } ;// CONCATENATED MODULE: ./node_modules/jss-plugin-vendor-prefixer/dist/jss-plugin-vendor-prefixer.esm.js /** * Add vendor prefix to a property name when needed. */ function jssVendorPrefixer() { function onProcessRule(rule) { if (rule.type === 'keyframes') { var atRule = rule; atRule.at = supportedKeyframes(atRule.at); } } function prefixStyle(style) { for (var prop in style) { var value = style[prop]; if (prop === 'fallbacks' && Array.isArray(value)) { style[prop] = value.map(prefixStyle); continue; } var changeProp = false; var supportedProp = supportedProperty(prop); if (supportedProp && supportedProp !== prop) changeProp = true; var changeValue = false; var supportedValue$1 = supportedValue(supportedProp, (0,jss_esm/* toCssValue */.EK)(value)); if (supportedValue$1 && supportedValue$1 !== value) changeValue = true; if (changeProp || changeValue) { if (changeProp) delete style[prop]; style[supportedProp || prop] = supportedValue$1 || value; } } return style; } function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; return prefixStyle(style); } function onChangeValue(value, prop) { return supportedValue(prop, (0,jss_esm/* toCssValue */.EK)(value)) || value; } return { onProcessRule: onProcessRule, onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; } /* harmony default export */ var jss_plugin_vendor_prefixer_esm = (jssVendorPrefixer); ;// CONCATENATED MODULE: ./node_modules/jss-plugin-props-sort/dist/jss-plugin-props-sort.esm.js /** * Sort props by length. */ function jssPropsSort() { var sort = function sort(prop0, prop1) { if (prop0.length === prop1.length) { return prop0 > prop1 ? 1 : -1; } return prop0.length - prop1.length; }; return { onProcessStyle: function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; var newStyle = {}; var props = Object.keys(style).sort(sort); for (var i = 0; i < props.length; i++) { newStyle[props[i]] = style[props[i]]; } return newStyle; } }; } /* harmony default export */ var jss_plugin_props_sort_esm = (jssPropsSort); ;// CONCATENATED MODULE: ./node_modules/@material-ui/styles/esm/jssPreset/jssPreset.js // Subset of jss-preset-default with only the plugins the Material-UI components are using. function jssPreset() { return { plugins: [jss_plugin_rule_value_function_esm(), jss_plugin_global_esm(), jss_plugin_nested_esm(), jss_plugin_camel_case_esm(), jss_plugin_default_unit_esm(), // Disable the vendor prefixer server-side, it does nothing. // This way, we can get a performance boost. // In the documentation, we are using `autoprefixer` to solve this problem. typeof window === 'undefined' ? null : jss_plugin_vendor_prefixer_esm(), jss_plugin_props_sort_esm()] }; } /***/ }), /***/ 11719: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "Z": function() { return /* binding */ makeStyles; } }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(45987); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(87462); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(67294); // EXTERNAL MODULE: ./node_modules/jss/dist/jss.esm.js var jss_esm = __webpack_require__(54013); // EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/mergeClasses/mergeClasses.js var mergeClasses = __webpack_require__(65835); ;// CONCATENATED MODULE: ./node_modules/@material-ui/styles/esm/makeStyles/multiKeyStore.js // Used https://github.com/thinkloop/multi-key-cache as inspiration var multiKeyStore = { set: function set(cache, key1, key2, value) { var subCache = cache.get(key1); if (!subCache) { subCache = new Map(); cache.set(key1, subCache); } subCache.set(key2, value); }, get: function get(cache, key1, key2) { var subCache = cache.get(key1); return subCache ? subCache.get(key2) : undefined; }, delete: function _delete(cache, key1, key2) { var subCache = cache.get(key1); subCache.delete(key2); } }; /* harmony default export */ var makeStyles_multiKeyStore = (multiKeyStore); // EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/useTheme/useTheme.js var useTheme = __webpack_require__(159); // EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/StylesProvider/StylesProvider.js var StylesProvider = __webpack_require__(26975); ;// CONCATENATED MODULE: ./node_modules/@material-ui/styles/esm/makeStyles/indexCounter.js /* eslint-disable import/prefer-default-export */ // Global index counter to preserve source order. // We create the style sheet during the creation of the component, // children are handled after the parents, so the order of style elements would be parent->child. // It is a problem though when a parent passes a className // which needs to override any child's styles. // StyleSheet of the child has a higher specificity, because of the source order. // So our solution is to render sheets them in the reverse order child->sheet, so // that parent has a higher specificity. var indexCounter = -1e9; function increment() { indexCounter += 1; if (false) {} return indexCounter; } // EXTERNAL MODULE: ./node_modules/@material-ui/utils/esm/deepmerge.js var deepmerge = __webpack_require__(35953); ;// CONCATENATED MODULE: ./node_modules/@material-ui/styles/esm/getStylesCreator/getStylesCreator.js function getStylesCreator(stylesOrCreator) { var themingEnabled = typeof stylesOrCreator === 'function'; if (false) {} return { create: function create(theme, name) { var styles; try { styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator; } catch (err) { if (false) {} throw err; } if (!name || !theme.overrides || !theme.overrides[name]) { return styles; } var overrides = theme.overrides[name]; var stylesWithOverrides = (0,esm_extends/* default */.Z)({}, styles); Object.keys(overrides).forEach(function (key) { if (false) {} stylesWithOverrides[key] = (0,deepmerge/* default */.Z)(stylesWithOverrides[key], overrides[key]); }); return stylesWithOverrides; }, options: {} }; } ;// CONCATENATED MODULE: ./node_modules/@material-ui/styles/esm/getStylesCreator/noopTheme.js // We use the same empty object to ref count the styles that don't need a theme object. var noopTheme = {}; /* harmony default export */ var getStylesCreator_noopTheme = (noopTheme); ;// CONCATENATED MODULE: ./node_modules/@material-ui/styles/esm/makeStyles/makeStyles.js function getClasses(_ref, classes, Component) { var state = _ref.state, stylesOptions = _ref.stylesOptions; if (stylesOptions.disableGeneration) { return classes || {}; } if (!state.cacheClasses) { state.cacheClasses = { // Cache for the finalized classes value. value: null, // Cache for the last used classes prop pointer. lastProp: null, // Cache for the last used rendered classes pointer. lastJSS: {} }; } // Tracks if either the rendered classes or classes prop has changed, // requiring the generation of a new finalized classes object. var generate = false; if (state.classes !== state.cacheClasses.lastJSS) { state.cacheClasses.lastJSS = state.classes; generate = true; } if (classes !== state.cacheClasses.lastProp) { state.cacheClasses.lastProp = classes; generate = true; } if (generate) { state.cacheClasses.value = (0,mergeClasses/* default */.Z)({ baseClasses: state.cacheClasses.lastJSS, newClasses: classes, Component: Component }); } return state.cacheClasses.value; } function attach(_ref2, props) { var state = _ref2.state, theme = _ref2.theme, stylesOptions = _ref2.stylesOptions, stylesCreator = _ref2.stylesCreator, name = _ref2.name; if (stylesOptions.disableGeneration) { return; } var sheetManager = makeStyles_multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme); if (!sheetManager) { sheetManager = { refs: 0, staticSheet: null, dynamicStyles: null }; makeStyles_multiKeyStore.set(stylesOptions.sheetsManager, stylesCreator, theme, sheetManager); } var options = (0,esm_extends/* default */.Z)({}, stylesCreator.options, stylesOptions, { theme: theme, flip: typeof stylesOptions.flip === 'boolean' ? stylesOptions.flip : theme.direction === 'rtl' }); options.generateId = options.serverGenerateClassName || options.generateClassName; var sheetsRegistry = stylesOptions.sheetsRegistry; if (sheetManager.refs === 0) { var staticSheet; if (stylesOptions.sheetsCache) { staticSheet = makeStyles_multiKeyStore.get(stylesOptions.sheetsCache, stylesCreator, theme); } var styles = stylesCreator.create(theme, name); if (!staticSheet) { staticSheet = stylesOptions.jss.createStyleSheet(styles, (0,esm_extends/* default */.Z)({ link: false }, options)); staticSheet.attach(); if (stylesOptions.sheetsCache) { makeStyles_multiKeyStore.set(stylesOptions.sheetsCache, stylesCreator, theme, staticSheet); } } if (sheetsRegistry) { sheetsRegistry.add(staticSheet); } sheetManager.staticSheet = staticSheet; sheetManager.dynamicStyles = (0,jss_esm/* getDynamicStyles */._$)(styles); } if (sheetManager.dynamicStyles) { var dynamicSheet = stylesOptions.jss.createStyleSheet(sheetManager.dynamicStyles, (0,esm_extends/* default */.Z)({ link: true }, options)); dynamicSheet.update(props); dynamicSheet.attach(); state.dynamicSheet = dynamicSheet; state.classes = (0,mergeClasses/* default */.Z)({ baseClasses: sheetManager.staticSheet.classes, newClasses: dynamicSheet.classes }); if (sheetsRegistry) { sheetsRegistry.add(dynamicSheet); } } else { state.classes = sheetManager.staticSheet.classes; } sheetManager.refs += 1; } function update(_ref3, props) { var state = _ref3.state; if (state.dynamicSheet) { state.dynamicSheet.update(props); } } function detach(_ref4) { var state = _ref4.state, theme = _ref4.theme, stylesOptions = _ref4.stylesOptions, stylesCreator = _ref4.stylesCreator; if (stylesOptions.disableGeneration) { return; } var sheetManager = makeStyles_multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme); sheetManager.refs -= 1; var sheetsRegistry = stylesOptions.sheetsRegistry; if (sheetManager.refs === 0) { makeStyles_multiKeyStore["delete"](stylesOptions.sheetsManager, stylesCreator, theme); stylesOptions.jss.removeStyleSheet(sheetManager.staticSheet); if (sheetsRegistry) { sheetsRegistry.remove(sheetManager.staticSheet); } } if (state.dynamicSheet) { stylesOptions.jss.removeStyleSheet(state.dynamicSheet); if (sheetsRegistry) { sheetsRegistry.remove(state.dynamicSheet); } } } function useSynchronousEffect(func, values) { var key = react.useRef([]); var output; // Store "generation" key. Just returns a new object every time var currentKey = react.useMemo(function () { return {}; }, values); // eslint-disable-line react-hooks/exhaustive-deps // "the first render", or "memo dropped the value" if (key.current !== currentKey) { key.current = currentKey; output = func(); } react.useEffect(function () { return function () { if (output) { output(); } }; }, [currentKey] // eslint-disable-line react-hooks/exhaustive-deps ); } function makeStyles(stylesOrCreator) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var name = options.name, classNamePrefixOption = options.classNamePrefix, Component = options.Component, _options$defaultTheme = options.defaultTheme, defaultTheme = _options$defaultTheme === void 0 ? getStylesCreator_noopTheme : _options$defaultTheme, stylesOptions2 = (0,objectWithoutProperties/* default */.Z)(options, ["name", "classNamePrefix", "Component", "defaultTheme"]); var stylesCreator = getStylesCreator(stylesOrCreator); var classNamePrefix = name || classNamePrefixOption || 'makeStyles'; stylesCreator.options = { index: increment(), name: name, meta: classNamePrefix, classNamePrefix: classNamePrefix }; var useStyles = function useStyles() { var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var theme = (0,useTheme/* default */.Z)() || defaultTheme; var stylesOptions = (0,esm_extends/* default */.Z)({}, react.useContext(StylesProvider/* StylesContext */.NU), stylesOptions2); var instance = react.useRef(); var shouldUpdate = react.useRef(); useSynchronousEffect(function () { var current = { name: name, state: {}, stylesCreator: stylesCreator, stylesOptions: stylesOptions, theme: theme }; attach(current, props); shouldUpdate.current = false; instance.current = current; return function () { detach(current); }; }, [theme, stylesCreator]); react.useEffect(function () { if (shouldUpdate.current) { update(instance.current, props); } shouldUpdate.current = true; }); var classes = getClasses(instance.current, props.classes, Component); if (false) {} return classes; }; return useStyles; } /***/ }), /***/ 65835: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ mergeClasses; } /* harmony export */ }); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87462); function mergeClasses() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var baseClasses = options.baseClasses, newClasses = options.newClasses, Component = options.Component; if (!newClasses) { return baseClasses; } var nextClasses = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, baseClasses); if (false) {} Object.keys(newClasses).forEach(function (key) { if (false) {} if (newClasses[key]) { nextClasses[key] = "".concat(baseClasses[key], " ").concat(newClasses[key]); } }); return nextClasses; } /***/ }), /***/ 83800: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); var ThemeContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); if (false) {} /* harmony default export */ __webpack_exports__["Z"] = (ThemeContext); /***/ }), /***/ 159: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ useTheme; } /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony import */ var _ThemeContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83800); function useTheme() { var theme = react__WEBPACK_IMPORTED_MODULE_0__.useContext(_ThemeContext__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z); if (false) {} return theme; } /***/ }), /***/ 71410: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "k": function() { return /* binding */ handleBreakpoints; } /* harmony export */ }); /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71002); // The breakpoint **start** at this value. // For instance with the first breakpoint xs: [xs, sm[. var values = { xs: 0, sm: 600, md: 960, lg: 1280, xl: 1920 }; var defaultBreakpoints = { // Sorted ASC by size. That's important. // It can't be configured as it's used statically for propTypes. keys: ['xs', 'sm', 'md', 'lg', 'xl'], up: function up(key) { return "@media (min-width:".concat(values[key], "px)"); } }; function handleBreakpoints(props, propValue, styleFromPropValue) { if (false) {} if (Array.isArray(propValue)) { var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints; return propValue.reduce(function (acc, item, index) { acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]); return acc; }, {}); } if ((0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(propValue) === 'object') { var _themeBreakpoints = props.theme.breakpoints || defaultBreakpoints; return Object.keys(propValue).reduce(function (acc, breakpoint) { acc[_themeBreakpoints.up(breakpoint)] = styleFromPropValue(propValue[breakpoint]); return acc; }, {}); } var output = styleFromPropValue(propValue); return output; } function breakpoints(styleFunction) { var newStyleFunction = function newStyleFunction(props) { var base = styleFunction(props); var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints; var extended = themeBreakpoints.keys.reduce(function (acc, key) { if (props[key]) { acc = acc || {}; acc[themeBreakpoints.up(key)] = styleFunction(_extends({ theme: props.theme }, props[key])); } return acc; }, null); return merge(base, extended); }; newStyleFunction.propTypes = false ? 0 : {}; newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl'].concat(_toConsumableArray(styleFunction.filterProps)); return newStyleFunction; } /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (breakpoints))); /***/ }), /***/ 19668: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _material_ui_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35953); function merge(acc, item) { if (!item) { return acc; } return (0,_material_ui_utils__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(acc, item, { clone: false // No need to clone deep, it's way faster. }); } /* harmony default export */ __webpack_exports__["Z"] = (merge); /***/ }), /***/ 27122: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "h": function() { return /* binding */ createUnarySpacing; }, "Z": function() { return /* binding */ esm_spacing; } }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules var slicedToArray = __webpack_require__(86854); // EXTERNAL MODULE: ./node_modules/@material-ui/system/esm/breakpoints.js var breakpoints = __webpack_require__(71410); // EXTERNAL MODULE: ./node_modules/@material-ui/system/esm/merge.js var merge = __webpack_require__(19668); ;// CONCATENATED MODULE: ./node_modules/@material-ui/system/esm/memoize.js function memoize(fn) { var cache = {}; return function (arg) { if (cache[arg] === undefined) { cache[arg] = fn(arg); } return cache[arg]; }; } ;// CONCATENATED MODULE: ./node_modules/@material-ui/system/esm/spacing.js var properties = { m: 'margin', p: 'padding' }; var directions = { t: 'Top', r: 'Right', b: 'Bottom', l: 'Left', x: ['Left', 'Right'], y: ['Top', 'Bottom'] }; var aliases = { marginX: 'mx', marginY: 'my', paddingX: 'px', paddingY: 'py' }; // memoize() impact: // From 300,000 ops/sec // To 350,000 ops/sec var getCssProperties = memoize(function (prop) { // It's not a shorthand notation. if (prop.length > 2) { if (aliases[prop]) { prop = aliases[prop]; } else { return [prop]; } } var _prop$split = prop.split(''), _prop$split2 = (0,slicedToArray/* default */.Z)(_prop$split, 2), a = _prop$split2[0], b = _prop$split2[1]; var property = properties[a]; var direction = directions[b] || ''; return Array.isArray(direction) ? direction.map(function (dir) { return property + dir; }) : [property + direction]; }); var spacingKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY']; function createUnarySpacing(theme) { var themeSpacing = theme.spacing || 8; if (typeof themeSpacing === 'number') { return function (abs) { if (false) {} return themeSpacing * abs; }; } if (Array.isArray(themeSpacing)) { return function (abs) { if (false) {} return themeSpacing[abs]; }; } if (typeof themeSpacing === 'function') { return themeSpacing; } if (false) {} return function () { return undefined; }; } function getValue(transformer, propValue) { if (typeof propValue === 'string' || propValue == null) { return propValue; } var abs = Math.abs(propValue); var transformed = transformer(abs); if (propValue >= 0) { return transformed; } if (typeof transformed === 'number') { return -transformed; } return "-".concat(transformed); } function getStyleFromPropValue(cssProperties, transformer) { return function (propValue) { return cssProperties.reduce(function (acc, cssProperty) { acc[cssProperty] = getValue(transformer, propValue); return acc; }, {}); }; } function spacing(props) { var theme = props.theme; var transformer = createUnarySpacing(theme); return Object.keys(props).map(function (prop) { // Using a hash computation over an array iteration could be faster, but with only 28 items, // it's doesn't worth the bundle size. if (spacingKeys.indexOf(prop) === -1) { return null; } var cssProperties = getCssProperties(prop); var styleFromPropValue = getStyleFromPropValue(cssProperties, transformer); var propValue = props[prop]; return (0,breakpoints/* handleBreakpoints */.k)(props, propValue, styleFromPropValue); }).reduce(merge/* default */.Z, {}); } spacing.propTypes = false ? 0 : {}; spacing.filterProps = spacingKeys; /* harmony default export */ var esm_spacing = (spacing); /***/ }), /***/ 35953: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ deepmerge; } /* harmony export */ }); /* unused harmony export isPlainObject */ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87462); /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71002); function isPlainObject(item) { return item && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(item) === 'object' && item.constructor === Object; } function deepmerge(target, source) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { clone: true }; var output = options.clone ? (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)({}, target) : target; if (isPlainObject(target) && isPlainObject(source)) { Object.keys(source).forEach(function (key) { // Avoid prototype pollution if (key === '__proto__') { return; } if (isPlainObject(source[key]) && key in target) { output[key] = deepmerge(target[key], source[key], options); } else { output[key] = source[key]; } }); } return output; } /***/ }), /***/ 60288: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ formatMuiErrorMessage; } /* harmony export */ }); /** * WARNING: Don't import this directly. * Use `MuiError` from `@material-ui/utils/macros/MuiError.macro` instead. * @param {number} code */ function formatMuiErrorMessage(code) { // Apply babel-plugin-transform-template-literals in loose mode // loose mode is safe iff we're concatenating primitives // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose /* eslint-disable prefer-template */ var url = 'https://mui.com/production-error/?code=' + code; for (var i = 1; i < arguments.length; i += 1) { // rest params over-transpile for this case // eslint-disable-next-line prefer-rest-params url += '&args[]=' + encodeURIComponent(arguments[i]); } return 'Minified Material-UI error #' + code + '; visit ' + url + ' for the full message.'; /* eslint-enable prefer-template */ } /***/ }), /***/ 32092: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ useCallbackRef; } /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /** * A convenience hook around `useState` designed to be paired with * the component [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) api. * Callback refs are useful over `useRef()` when you need to respond to the ref being set * instead of lazily accessing it in an effect. * * ```ts * const [element, attachRef] = useCallbackRef() * * useEffect(() => { * if (!element) return * * const calendar = new FullCalendar.Calendar(element) * * return () => { * calendar.destroy() * } * }, [element]) * * return
* ``` * * @category refs */ function useCallbackRef() { return (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); } /***/ }), /***/ 92029: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /** * Creates a `Ref` whose value is updated in an effect, ensuring the most recent * value is the one rendered with. Generally only required for Concurrent mode usage * where previous work in `render()` may be discarded before being used. * * This is safe to access in an event handler. * * @param value The `Ref` value */ function useCommittedRef(value) { var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value); (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { ref.current = value; }, [value]); return ref; } /* harmony default export */ __webpack_exports__["Z"] = (useCommittedRef); /***/ }), /***/ 78146: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ useEventCallback; } /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony import */ var _useCommittedRef__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(92029); function useEventCallback(fn) { var ref = (0,_useCommittedRef__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(fn); return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () { return ref.current && ref.current.apply(ref, arguments); }, [ref]); } /***/ }), /***/ 99585: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); var isReactNative = typeof __webpack_require__.g !== 'undefined' && // @ts-ignore __webpack_require__.g.navigator && // @ts-ignore __webpack_require__.g.navigator.product === 'ReactNative'; var isDOM = typeof document !== 'undefined'; /** * Is `useLayoutEffect` in a DOM or React Native environment, otherwise resolves to useEffect * Only useful to avoid the console warning. * * PREFER `useEffect` UNLESS YOU KNOW WHAT YOU ARE DOING. * * @category effects */ /* harmony default export */ __webpack_exports__["Z"] = (isDOM || isReactNative ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect); /***/ }), /***/ 35654: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export mergeRefs */ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); var toFnRef = function toFnRef(ref) { return !ref || typeof ref === 'function' ? ref : function (value) { ref.current = value; }; }; function mergeRefs(refA, refB) { var a = toFnRef(refA); var b = toFnRef(refB); return function (value) { if (a) a(value); if (b) b(value); }; } /** * Create and returns a single callback ref composed from two other Refs. * * ```tsx * const Button = React.forwardRef((props, ref) => { * const [element, attachRef] = useCallbackRef(); * const mergedRef = useMergedRefs(ref, attachRef); * * return *
* ); * } * ``` * * When the button is clicked the component will shift to the `'entering'` state * and stay there for 500ms (the value of `timeout`) before it finally switches * to `'entered'`. * * When `in` is `false` the same thing happens except the state moves from * `'exiting'` to `'exited'`. */ var Transition = /*#__PURE__*/function (_React$Component) { (0,inheritsLoose/* default */.Z)(Transition, _React$Component); function Transition(props, context) { var _this; _this = _React$Component.call(this, props, context) || this; var parentGroup = context; // In the context of a TransitionGroup all enters are really appears var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear; var initialStatus; _this.appearStatus = null; if (props.in) { if (appear) { initialStatus = EXITED; _this.appearStatus = ENTERING; } else { initialStatus = ENTERED; } } else { if (props.unmountOnExit || props.mountOnEnter) { initialStatus = UNMOUNTED; } else { initialStatus = EXITED; } } _this.state = { status: initialStatus }; _this.nextCallback = null; return _this; } Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) { var nextIn = _ref.in; if (nextIn && prevState.status === UNMOUNTED) { return { status: EXITED }; } return null; } // getSnapshotBeforeUpdate(prevProps) { // let nextStatus = null // if (prevProps !== this.props) { // const { status } = this.state // if (this.props.in) { // if (status !== ENTERING && status !== ENTERED) { // nextStatus = ENTERING // } // } else { // if (status === ENTERING || status === ENTERED) { // nextStatus = EXITING // } // } // } // return { nextStatus } // } ; var _proto = Transition.prototype; _proto.componentDidMount = function componentDidMount() { this.updateStatus(true, this.appearStatus); }; _proto.componentDidUpdate = function componentDidUpdate(prevProps) { var nextStatus = null; if (prevProps !== this.props) { var status = this.state.status; if (this.props.in) { if (status !== ENTERING && status !== ENTERED) { nextStatus = ENTERING; } } else { if (status === ENTERING || status === ENTERED) { nextStatus = EXITING; } } } this.updateStatus(false, nextStatus); }; _proto.componentWillUnmount = function componentWillUnmount() { this.cancelNextCallback(); }; _proto.getTimeouts = function getTimeouts() { var timeout = this.props.timeout; var exit, enter, appear; exit = enter = appear = timeout; if (timeout != null && typeof timeout !== 'number') { exit = timeout.exit; enter = timeout.enter; // TODO: remove fallback for next major appear = timeout.appear !== undefined ? timeout.appear : enter; } return { exit: exit, enter: enter, appear: appear }; }; _proto.updateStatus = function updateStatus(mounting, nextStatus) { if (mounting === void 0) { mounting = false; } if (nextStatus !== null) { // nextStatus will always be ENTERING or EXITING. this.cancelNextCallback(); if (nextStatus === ENTERING) { if (this.props.unmountOnExit || this.props.mountOnEnter) { var node = this.props.nodeRef ? this.props.nodeRef.current : react_dom.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749 // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`. // To make the animation happen, we have to separate each rendering and avoid being processed as batched. if (node) forceReflow(node); } this.performEnter(mounting); } else { this.performExit(); } } else if (this.props.unmountOnExit && this.state.status === EXITED) { this.setState({ status: UNMOUNTED }); } }; _proto.performEnter = function performEnter(mounting) { var _this2 = this; var enter = this.props.enter; var appearing = this.context ? this.context.isMounting : mounting; var _ref2 = this.props.nodeRef ? [appearing] : [react_dom.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1]; var timeouts = this.getTimeouts(); var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED // if we are mounting and running this it means appear _must_ be set if (!mounting && !enter || config.disabled) { this.safeSetState({ status: ENTERED }, function () { _this2.props.onEntered(maybeNode); }); return; } this.props.onEnter(maybeNode, maybeAppearing); this.safeSetState({ status: ENTERING }, function () { _this2.props.onEntering(maybeNode, maybeAppearing); _this2.onTransitionEnd(enterTimeout, function () { _this2.safeSetState({ status: ENTERED }, function () { _this2.props.onEntered(maybeNode, maybeAppearing); }); }); }); }; _proto.performExit = function performExit() { var _this3 = this; var exit = this.props.exit; var timeouts = this.getTimeouts(); var maybeNode = this.props.nodeRef ? undefined : react_dom.findDOMNode(this); // no exit animation skip right to EXITED if (!exit || config.disabled) { this.safeSetState({ status: EXITED }, function () { _this3.props.onExited(maybeNode); }); return; } this.props.onExit(maybeNode); this.safeSetState({ status: EXITING }, function () { _this3.props.onExiting(maybeNode); _this3.onTransitionEnd(timeouts.exit, function () { _this3.safeSetState({ status: EXITED }, function () { _this3.props.onExited(maybeNode); }); }); }); }; _proto.cancelNextCallback = function cancelNextCallback() { if (this.nextCallback !== null) { this.nextCallback.cancel(); this.nextCallback = null; } }; _proto.safeSetState = function safeSetState(nextState, callback) { // This shouldn't be necessary, but there are weird race conditions with // setState callbacks and unmounting in testing, so always make sure that // we can cancel any pending setState callbacks after we unmount. callback = this.setNextCallback(callback); this.setState(nextState, callback); }; _proto.setNextCallback = function setNextCallback(callback) { var _this4 = this; var active = true; this.nextCallback = function (event) { if (active) { active = false; _this4.nextCallback = null; callback(event); } }; this.nextCallback.cancel = function () { active = false; }; return this.nextCallback; }; _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) { this.setNextCallback(handler); var node = this.props.nodeRef ? this.props.nodeRef.current : react_dom.findDOMNode(this); var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener; if (!node || doesNotHaveTimeoutOrListener) { setTimeout(this.nextCallback, 0); return; } if (this.props.addEndListener) { var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1]; this.props.addEndListener(maybeNode, maybeNextCallback); } if (timeout != null) { setTimeout(this.nextCallback, timeout); } }; _proto.render = function render() { var status = this.state.status; if (status === UNMOUNTED) { return null; } var _this$props = this.props, children = _this$props.children, _in = _this$props.in, _mountOnEnter = _this$props.mountOnEnter, _unmountOnExit = _this$props.unmountOnExit, _appear = _this$props.appear, _enter = _this$props.enter, _exit = _this$props.exit, _timeout = _this$props.timeout, _addEndListener = _this$props.addEndListener, _onEnter = _this$props.onEnter, _onEntering = _this$props.onEntering, _onEntered = _this$props.onEntered, _onExit = _this$props.onExit, _onExiting = _this$props.onExiting, _onExited = _this$props.onExited, _nodeRef = _this$props.nodeRef, childProps = (0,objectWithoutPropertiesLoose/* default */.Z)(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]); return ( /*#__PURE__*/ // allows for nested Transitions react.createElement(TransitionGroupContext/* default.Provider */.Z.Provider, { value: null }, typeof children === 'function' ? children(status, childProps) : react.cloneElement(react.Children.only(children), childProps)) ); }; return Transition; }(react.Component); Transition.contextType = TransitionGroupContext/* default */.Z; Transition.propTypes = false ? 0 : {}; // Name the function so it is clearer in the documentation function noop() {} Transition.defaultProps = { in: false, mountOnEnter: false, unmountOnExit: false, appear: false, enter: true, exit: true, onEnter: noop, onEntering: noop, onEntered: noop, onExit: noop, onExiting: noop, onExited: noop }; Transition.UNMOUNTED = UNMOUNTED; Transition.EXITED = EXITED; Transition.ENTERING = ENTERING; Transition.ENTERED = ENTERED; Transition.EXITING = EXITING; /* harmony default export */ var esm_Transition = (Transition); /***/ }), /***/ 220: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294); /* harmony default export */ __webpack_exports__["Z"] = (react__WEBPACK_IMPORTED_MODULE_0__.createContext(null)); /***/ }), /***/ 47150: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "Ch": function() { return /* reexport */ useUncontrolled; }, "$c": function() { return /* reexport */ useUncontrolledProp; } }); // UNUSED EXPORTS: uncontrollable // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(87462); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js var objectWithoutPropertiesLoose = __webpack_require__(63366); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(67294); // EXTERNAL MODULE: ./node_modules/invariant/browser.js var browser = __webpack_require__(41143); ;// CONCATENATED MODULE: ./node_modules/uncontrollable/lib/esm/utils.js var noop = function noop() {}; function readOnlyPropType(handler, name) { return function (props, propName) { if (props[propName] !== undefined) { if (!props[handler]) { return new Error("You have provided a `" + propName + "` prop to `" + name + "` " + ("without an `" + handler + "` handler prop. This will render a read-only field. ") + ("If the field should be mutable use `" + defaultKey(propName) + "`. ") + ("Otherwise, set `" + handler + "`.")); } } }; } function uncontrolledPropTypes(controlledValues, displayName) { var propTypes = {}; Object.keys(controlledValues).forEach(function (prop) { // add default propTypes for folks that use runtime checks propTypes[defaultKey(prop)] = noop; if (false) { var handler; } }); return propTypes; } function isProp(props, prop) { return props[prop] !== undefined; } function defaultKey(key) { return 'default' + key.charAt(0).toUpperCase() + key.substr(1); } /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ function canAcceptRef(component) { return !!component && (typeof component !== 'function' || component.prototype && component.prototype.isReactComponent); } ;// CONCATENATED MODULE: ./node_modules/uncontrollable/lib/esm/hook.js function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function useUncontrolledProp(propValue, defaultValue, handler) { var wasPropRef = (0,react.useRef)(propValue !== undefined); var _useState = (0,react.useState)(defaultValue), stateValue = _useState[0], setState = _useState[1]; var isProp = propValue !== undefined; var wasProp = wasPropRef.current; wasPropRef.current = isProp; /** * If a prop switches from controlled to Uncontrolled * reset its value to the defaultValue */ if (!isProp && wasProp && stateValue !== defaultValue) { setState(defaultValue); } return [isProp ? propValue : stateValue, (0,react.useCallback)(function (value) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (handler) handler.apply(void 0, [value].concat(args)); setState(value); }, [handler])]; } function useUncontrolled(props, config) { return Object.keys(config).reduce(function (result, fieldName) { var _extends2; var _ref = result, defaultValue = _ref[defaultKey(fieldName)], propsValue = _ref[fieldName], rest = (0,objectWithoutPropertiesLoose/* default */.Z)(_ref, [defaultKey(fieldName), fieldName].map(_toPropertyKey)); var handlerName = config[fieldName]; var _useUncontrolledProp = useUncontrolledProp(propsValue, defaultValue, props[handlerName]), value = _useUncontrolledProp[0], handler = _useUncontrolledProp[1]; return (0,esm_extends/* default */.Z)({}, rest, (_extends2 = {}, _extends2[fieldName] = value, _extends2[handlerName] = handler, _extends2)); }, props); } ;// CONCATENATED MODULE: ./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ function componentWillMount() { // Call this.constructor.gDSFP to support sub-classes. var state = this.constructor.getDerivedStateFromProps(this.props, this.state); if (state !== null && state !== undefined) { this.setState(state); } } function componentWillReceiveProps(nextProps) { // Call this.constructor.gDSFP to support sub-classes. // Use the setState() updater to ensure state isn't stale in certain edge cases. function updater(prevState) { var state = this.constructor.getDerivedStateFromProps(nextProps, prevState); return state !== null && state !== undefined ? state : null; } // Binding "this" is important for shallow renderer support. this.setState(updater.bind(this)); } function componentWillUpdate(nextProps, nextState) { try { var prevProps = this.props; var prevState = this.state; this.props = nextProps; this.state = nextState; this.__reactInternalSnapshotFlag = true; this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate( prevProps, prevState ); } finally { this.props = prevProps; this.state = prevState; } } // React may warn about cWM/cWRP/cWU methods being deprecated. // Add a flag to suppress these warnings for this special case. componentWillMount.__suppressDeprecationWarning = true; componentWillReceiveProps.__suppressDeprecationWarning = true; componentWillUpdate.__suppressDeprecationWarning = true; function react_lifecycles_compat_es_polyfill(Component) { var prototype = Component.prototype; if (!prototype || !prototype.isReactComponent) { throw new Error('Can only polyfill class components'); } if ( typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function' ) { return Component; } // If new component APIs are defined, "unsafe" lifecycles won't be called. // Error if any of these lifecycles are present, // Because they would work differently between older and newer (16.3+) versions of React. var foundWillMountName = null; var foundWillReceivePropsName = null; var foundWillUpdateName = null; if (typeof prototype.componentWillMount === 'function') { foundWillMountName = 'componentWillMount'; } else if (typeof prototype.UNSAFE_componentWillMount === 'function') { foundWillMountName = 'UNSAFE_componentWillMount'; } if (typeof prototype.componentWillReceiveProps === 'function') { foundWillReceivePropsName = 'componentWillReceiveProps'; } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') { foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; } if (typeof prototype.componentWillUpdate === 'function') { foundWillUpdateName = 'componentWillUpdate'; } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') { foundWillUpdateName = 'UNSAFE_componentWillUpdate'; } if ( foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null ) { var componentName = Component.displayName || Component.name; var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; throw Error( 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks' ); } // React <= 16.2 does not support static getDerivedStateFromProps. // As a workaround, use cWM and cWRP to invoke the new static lifecycle. // Newer versions of React will ignore these lifecycles if gDSFP exists. if (typeof Component.getDerivedStateFromProps === 'function') { prototype.componentWillMount = componentWillMount; prototype.componentWillReceiveProps = componentWillReceiveProps; } // React <= 16.2 does not support getSnapshotBeforeUpdate. // As a workaround, use cWU to invoke the new lifecycle. // Newer versions of React will ignore that lifecycle if gSBU exists. if (typeof prototype.getSnapshotBeforeUpdate === 'function') { if (typeof prototype.componentDidUpdate !== 'function') { throw new Error( 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype' ); } prototype.componentWillUpdate = componentWillUpdate; var componentDidUpdate = prototype.componentDidUpdate; prototype.componentDidUpdate = function componentDidUpdatePolyfill( prevProps, prevState, maybeSnapshot ) { // 16.3+ will not execute our will-update method; // It will pass a snapshot value to did-update though. // Older versions will require our polyfilled will-update value. // We need to handle both cases, but can't just check for the presence of "maybeSnapshot", // Because for <= 15.x versions this might be a "prevContext" object. // We also can't just check "__reactInternalSnapshot", // Because get-snapshot might return a falsy value. // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior. var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot; componentDidUpdate.call(this, prevProps, prevState, snapshot); }; } return Component; } ;// CONCATENATED MODULE: ./node_modules/uncontrollable/lib/esm/uncontrollable.js var _jsxFileName = "/Users/jquense/src/uncontrollable/src/uncontrollable.js"; function uncontrollable(Component, controlledValues, methods) { if (methods === void 0) { methods = []; } var displayName = Component.displayName || Component.name || 'Component'; var canAcceptRef = Utils.canAcceptRef(Component); var controlledProps = Object.keys(controlledValues); var PROPS_TO_OMIT = controlledProps.map(Utils.defaultKey); !(canAcceptRef || !methods.length) ? false ? 0 : invariant(false) : void 0; var UncontrolledComponent = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(UncontrolledComponent, _React$Component); function UncontrolledComponent() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this.handlers = Object.create(null); controlledProps.forEach(function (propName) { var handlerName = controlledValues[propName]; var handleChange = function handleChange(value) { if (_this.props[handlerName]) { var _this$props; _this._notifying = true; for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } (_this$props = _this.props)[handlerName].apply(_this$props, [value].concat(args)); _this._notifying = false; } if (!_this.unmounted) _this.setState(function (_ref) { var _extends2; var values = _ref.values; return { values: _extends(Object.create(null), values, (_extends2 = {}, _extends2[propName] = value, _extends2)) }; }); }; _this.handlers[handlerName] = handleChange; }); if (methods.length) _this.attachRef = function (ref) { _this.inner = ref; }; var values = Object.create(null); controlledProps.forEach(function (key) { values[key] = _this.props[Utils.defaultKey(key)]; }); _this.state = { values: values, prevProps: {} }; return _this; } var _proto = UncontrolledComponent.prototype; _proto.shouldComponentUpdate = function shouldComponentUpdate() { //let setState trigger the update return !this._notifying; }; UncontrolledComponent.getDerivedStateFromProps = function getDerivedStateFromProps(props, _ref2) { var values = _ref2.values, prevProps = _ref2.prevProps; var nextState = { values: _extends(Object.create(null), values), prevProps: {} }; controlledProps.forEach(function (key) { /** * If a prop switches from controlled to Uncontrolled * reset its value to the defaultValue */ nextState.prevProps[key] = props[key]; if (!Utils.isProp(props, key) && Utils.isProp(prevProps, key)) { nextState.values[key] = props[Utils.defaultKey(key)]; } }); return nextState; }; _proto.componentWillUnmount = function componentWillUnmount() { this.unmounted = true; }; _proto.render = function render() { var _this2 = this; var _this$props2 = this.props, innerRef = _this$props2.innerRef, props = _objectWithoutPropertiesLoose(_this$props2, ["innerRef"]); PROPS_TO_OMIT.forEach(function (prop) { delete props[prop]; }); var newProps = {}; controlledProps.forEach(function (propName) { var propValue = _this2.props[propName]; newProps[propName] = propValue !== undefined ? propValue : _this2.state.values[propName]; }); return React.createElement(Component, _extends({}, props, newProps, this.handlers, { ref: innerRef || this.attachRef })); }; return UncontrolledComponent; }(React.Component); polyfill(UncontrolledComponent); UncontrolledComponent.displayName = "Uncontrolled(" + displayName + ")"; UncontrolledComponent.propTypes = _extends({ innerRef: function innerRef() {} }, Utils.uncontrolledPropTypes(controlledValues, displayName)); methods.forEach(function (method) { UncontrolledComponent.prototype[method] = function $proxiedMethod() { var _this$inner; return (_this$inner = this.inner)[method].apply(_this$inner, arguments); }; }); var WrappedComponent = UncontrolledComponent; if (React.forwardRef) { WrappedComponent = React.forwardRef(function (props, ref) { return React.createElement(UncontrolledComponent, _extends({}, props, { innerRef: ref, __source: { fileName: _jsxFileName, lineNumber: 128 }, __self: this })); }); WrappedComponent.propTypes = UncontrolledComponent.propTypes; } WrappedComponent.ControlledComponent = Component; /** * useful when wrapping a Component and you want to control * everything */ WrappedComponent.deferControlTo = function (newComponent, additions, nextMethods) { if (additions === void 0) { additions = {}; } return uncontrollable(newComponent, _extends({}, controlledValues, additions), nextMethods); }; return WrappedComponent; } ;// CONCATENATED MODULE: ./node_modules/uncontrollable/lib/esm/index.js /***/ }), /***/ 24782: /***/ (function(__unused_webpack_module, exports) { "use strict"; exports.byteLength = byteLength exports.toByteArray = toByteArray exports.fromByteArray = fromByteArray var lookup = [] var revLookup = [] var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' for (var i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i] revLookup[code.charCodeAt(i)] = i } // Support decoding URL-safe base64 strings, as Node.js does. // See: https://en.wikipedia.org/wiki/Base64#URL_applications revLookup['-'.charCodeAt(0)] = 62 revLookup['_'.charCodeAt(0)] = 63 function getLens (b64) { var len = b64.length if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 var validLen = b64.indexOf('=') if (validLen === -1) validLen = len var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4) return [validLen, placeHoldersLen] } // base64 is 4/3 + up to two characters of the original data function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function _byteLength (b64, validLen, placeHoldersLen) { return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function toByteArray (b64) { var tmp var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) var curByte = 0 // if there are placeholders, only get up to the last complete 4 chars var len = placeHoldersLen > 0 ? validLen - 4 : validLen var i for (i = 0; i < len; i += 4) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[curByte++] = (tmp >> 16) & 0xFF arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 2) { tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 1) { tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) output.push(tripletToBase64(tmp)) } return output.join('') } function fromByteArray (uint8) { var tmp var len = uint8.length var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes var parts = [] var maxChunkLength = 16383 // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] parts.push( lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3F] + '==' ) } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1] parts.push( lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3F] + lookup[(tmp << 2) & 0x3F] + '=' ) } return parts.join('') } /***/ }), /***/ 30816: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __webpack_unused_export__; /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ var base64 = __webpack_require__(24782) var ieee754 = __webpack_require__(78898) var customInspectSymbol = (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation : null exports.lW = Buffer __webpack_unused_export__ = SlowBuffer exports.h2 = 50 var K_MAX_LENGTH = 0x7fffffff __webpack_unused_export__ = K_MAX_LENGTH /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Print warning and recommend using `buffer` v4.x which has an Object * implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * We report that the browser does not support typed arrays if the are not subclassable * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support * for __proto__ and has a buggy typed array implementation. */ Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { console.error( 'This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' ) } function typedArraySupport () { // Can typed array instances can be augmented? try { var arr = new Uint8Array(1) var proto = { foo: function () { return 42 } } Object.setPrototypeOf(proto, Uint8Array.prototype) Object.setPrototypeOf(arr, proto) return arr.foo() === 42 } catch (e) { return false } } Object.defineProperty(Buffer.prototype, 'parent', { enumerable: true, get: function () { if (!Buffer.isBuffer(this)) return undefined return this.buffer } }) Object.defineProperty(Buffer.prototype, 'offset', { enumerable: true, get: function () { if (!Buffer.isBuffer(this)) return undefined return this.byteOffset } }) function createBuffer (length) { if (length > K_MAX_LENGTH) { throw new RangeError('The value "' + length + '" is invalid for option "size"') } // Return an augmented `Uint8Array` instance var buf = new Uint8Array(length) Object.setPrototypeOf(buf, Buffer.prototype) return buf } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new TypeError( 'The "string" argument must be of type string. Received type number' ) } return allocUnsafe(arg) } return from(arg, encodingOrOffset, length) } Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) { if (typeof value === 'string') { return fromString(value, encodingOrOffset) } if (ArrayBuffer.isView(value)) { return fromArrayView(value) } if (value == null) { throw new TypeError( 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + (typeof value) ) } if (isInstance(value, ArrayBuffer) || (value && isInstance(value.buffer, ArrayBuffer))) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || (value && isInstance(value.buffer, SharedArrayBuffer)))) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof value === 'number') { throw new TypeError( 'The "value" argument must not be of type number. Received type number' ) } var valueOf = value.valueOf && value.valueOf() if (valueOf != null && valueOf !== value) { return Buffer.from(valueOf, encodingOrOffset, length) } var b = fromObject(value) if (b) return b if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { return Buffer.from( value[Symbol.toPrimitive]('string'), encodingOrOffset, length ) } throw new TypeError( 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + (typeof value) ) } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(value, encodingOrOffset, length) } // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: // https://github.com/feross/buffer/pull/148 Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype) Object.setPrototypeOf(Buffer, Uint8Array) function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be of type number') } else if (size < 0) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } } function alloc (size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(size) } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpreted as a start offset. return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill) } return createBuffer(size) } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(size, fill, encoding) } function allocUnsafe (size) { assertSize(size) return createBuffer(size < 0 ? 0 : checked(size) | 0) } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(size) } /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(size) } function fromString (string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } var length = byteLength(string, encoding) | 0 var buf = createBuffer(length) var actual = buf.write(string, encoding) if (actual !== length) { // Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') buf = buf.slice(0, actual) } return buf } function fromArrayLike (array) { var length = array.length < 0 ? 0 : checked(array.length) | 0 var buf = createBuffer(length) for (var i = 0; i < length; i += 1) { buf[i] = array[i] & 255 } return buf } function fromArrayView (arrayView) { if (isInstance(arrayView, Uint8Array)) { var copy = new Uint8Array(arrayView) return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) } return fromArrayLike(arrayView) } function fromArrayBuffer (array, byteOffset, length) { if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('"offset" is outside of buffer bounds') } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('"length" is outside of buffer bounds') } var buf if (byteOffset === undefined && length === undefined) { buf = new Uint8Array(array) } else if (length === undefined) { buf = new Uint8Array(array, byteOffset) } else { buf = new Uint8Array(array, byteOffset, length) } // Return an augmented `Uint8Array` instance Object.setPrototypeOf(buf, Buffer.prototype) return buf } function fromObject (obj) { if (Buffer.isBuffer(obj)) { var len = checked(obj.length) | 0 var buf = createBuffer(len) if (buf.length === 0) { return buf } obj.copy(buf, 0, 0, len) return buf } if (obj.length !== undefined) { if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { return createBuffer(0) } return fromArrayLike(obj) } if (obj.type === 'Buffer' && Array.isArray(obj.data)) { return fromArrayLike(obj.data) } } function checked (length) { // Note: cannot use `length < K_MAX_LENGTH` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= K_MAX_LENGTH) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') } return length | 0 } function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { return b != null && b._isBuffer === true && b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } Buffer.compare = function compare (a, b) { if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' ) } if (a === b) return 0 var x = a.length var y = b.length for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function isEncoding (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function concat (list, length) { if (!Array.isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers') } if (list.length === 0) { return Buffer.alloc(0) } var i if (length === undefined) { length = 0 for (i = 0; i < list.length; ++i) { length += list[i].length } } var buffer = Buffer.allocUnsafe(length) var pos = 0 for (i = 0; i < list.length; ++i) { var buf = list[i] if (isInstance(buf, Uint8Array)) { if (pos + buf.length > buffer.length) { Buffer.from(buf).copy(buffer, pos) } else { Uint8Array.prototype.set.call( buffer, buf, pos ) } } else if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers') } else { buf.copy(buffer, pos) } pos += buf.length } return buffer } function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { throw new TypeError( 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof string ) } var len = string.length var mustMatch = (arguments.length > 2 && arguments[2] === true) if (!mustMatch && len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false for (;;) { switch (encoding) { case 'ascii': case 'latin1': case 'binary': return len case 'utf8': case 'utf-8': return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2 case 'hex': return len >>> 1 case 'base64': return base64ToBytes(string).length default: if (loweredCase) { return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 } encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.byteLength = byteLength function slowToString (encoding, start, end) { var loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0 } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return '' } if (end === undefined || end > this.length) { end = this.length } if (end <= 0) { return '' } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0 start >>>= 0 if (end <= start) { return '' } if (!encoding) encoding = 'utf8' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'latin1': case 'binary': return latin1Slice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) // to detect a Buffer instance. It's not possible to use `instanceof Buffer` // reliably in a browserify context because there could be multiple different // copies of the 'buffer' package in use. This method works even for Buffer // instances that were created from another copy of the `buffer` package. // See: https://github.com/feross/buffer/issues/154 Buffer.prototype._isBuffer = true function swap (b, n, m) { var i = b[n] b[n] = b[m] b[m] = i } Buffer.prototype.swap16 = function swap16 () { var len = this.length if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits') } for (var i = 0; i < len; i += 2) { swap(this, i, i + 1) } return this } Buffer.prototype.swap32 = function swap32 () { var len = this.length if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits') } for (var i = 0; i < len; i += 4) { swap(this, i, i + 3) swap(this, i + 1, i + 2) } return this } Buffer.prototype.swap64 = function swap64 () { var len = this.length if (len % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits') } for (var i = 0; i < len; i += 8) { swap(this, i, i + 7) swap(this, i + 1, i + 6) swap(this, i + 2, i + 5) swap(this, i + 3, i + 4) } return this } Buffer.prototype.toString = function toString () { var length = this.length if (length === 0) return '' if (arguments.length === 0) return utf8Slice(this, 0, length) return slowToString.apply(this, arguments) } Buffer.prototype.toLocaleString = Buffer.prototype.toString Buffer.prototype.equals = function equals (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (this === b) return true return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.h2 str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() if (this.length > max) str += ' ... ' return '' } if (customInspectSymbol) { Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (isInstance(target, Uint8Array)) { target = Buffer.from(target, target.offset, target.byteLength) } if (!Buffer.isBuffer(target)) { throw new TypeError( 'The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + (typeof target) ) } if (start === undefined) { start = 0 } if (end === undefined) { end = target ? target.length : 0 } if (thisStart === undefined) { thisStart = 0 } if (thisEnd === undefined) { thisEnd = this.length } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index') } if (thisStart >= thisEnd && start >= end) { return 0 } if (thisStart >= thisEnd) { return -1 } if (start >= end) { return 1 } start >>>= 0 end >>>= 0 thisStart >>>= 0 thisEnd >>>= 0 if (this === target) return 0 var x = thisEnd - thisStart var y = end - start var len = Math.min(x, y) var thisCopy = this.slice(thisStart, thisEnd) var targetCopy = target.slice(start, end) for (var i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i] y = targetCopy[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset = +byteOffset // Coerce to Number. if (numberIsNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset if (byteOffset >= buffer.length) { if (dir) return -1 else byteOffset = buffer.length - 1 } else if (byteOffset < 0) { if (dir) byteOffset = 0 else return -1 } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding) } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(buffer, val, byteOffset, encoding, dir) } else if (typeof val === 'number') { val = val & 0xFF // Search for a byte value [0-255] if (typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) } throw new TypeError('val must be string, number or Buffer') } function arrayIndexOf (arr, val, byteOffset, encoding, dir) { var indexSize = 1 var arrLength = arr.length var valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toLowerCase() if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1 } indexSize = 2 arrLength /= 2 valLength /= 2 byteOffset /= 2 } } function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } } var i if (dir) { var foundIndex = -1 for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i if (i - foundIndex + 1 === valLength) return foundIndex * indexSize } else { if (foundIndex !== -1) i -= i - foundIndex foundIndex = -1 } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength for (i = byteOffset; i >= 0; i--) { var found = true for (var j = 0; j < valLength; j++) { if (read(arr, i + j) !== read(val, j)) { found = false break } } if (found) return i } } return -1 } Buffer.prototype.includes = function includes (val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1 } Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } var strLen = string.length if (length > strLen / 2) { length = strLen / 2 } for (var i = 0; i < length; ++i) { var parsed = parseInt(string.substr(i * 2, 2), 16) if (numberIsNaN(parsed)) return i buf[offset + i] = parsed } return i } function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } Buffer.prototype.write = function write (string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8' length = this.length offset = 0 // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset length = this.length offset = 0 // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset >>> 0 if (isFinite(length)) { length = length >>> 0 if (encoding === undefined) encoding = 'utf8' } else { encoding = length length = undefined } } else { throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) } var remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' var loweredCase = false for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length) case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length) case 'ascii': case 'latin1': case 'binary': return asciiWrite(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.prototype.toJSON = function toJSON () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) var res = [] var i = start while (i < end) { var firstByte = buf[i] var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 : (firstByte > 0xBF) ? 2 : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte } break case 2: secondByte = buf[i + 1] if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) if (tempCodePoint > 0x7F) { codePoint = tempCodePoint } } break case 3: secondByte = buf[i + 1] thirdByte = buf[i + 2] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint } } break case 4: secondByte = buf[i + 1] thirdByte = buf[i + 2] fourthByte = buf[i + 3] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD bytesPerSequence = 1 } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000 res.push(codePoint >>> 10 & 0x3FF | 0xD800) codePoint = 0xDC00 | codePoint & 0x3FF } res.push(codePoint) i += bytesPerSequence } return decodeCodePointsArray(res) } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety var MAX_ARGUMENTS_LENGTH = 0x1000 function decodeCodePointsArray (codePoints) { var len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". var res = '' var i = 0 while (i < len) { res += String.fromCharCode.apply( String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) ) } return res } function asciiSlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F) } return ret } function latin1Slice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]) } return ret } function hexSlice (buf, start, end) { var len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len var out = '' for (var i = start; i < end; ++i) { out += hexSliceLookupTable[buf[i]] } return out } function utf16leSlice (buf, start, end) { var bytes = buf.slice(start, end) var res = '' // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) for (var i = 0; i < bytes.length - 1; i += 2) { res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) } return res } Buffer.prototype.slice = function slice (start, end) { var len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start var newBuf = this.subarray(start, end) // Return an augmented `Uint8Array` instance Object.setPrototypeOf(newBuf, Buffer.prototype) return newBuf } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } return val } Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { checkOffset(offset, byteLength, this.length) } var val = this[offset + --byteLength] var mul = 1 while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul } return val } Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000) } Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]) } Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var i = byteLength var mul = 1 var val = this[offset + --i] while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return (this[offset]) return ((0xff - this[offset] + 1) * -1) } Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset] | (this[offset + 1] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset + 1] | (this[offset] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24) } Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]) } Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var mul = 1 var i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var i = byteLength - 1 var mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) return offset + 2 } Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) return offset + 2 } Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) this[offset] = (value & 0xff) return offset + 4 } Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) return offset + 4 } Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { var limit = Math.pow(2, (8 * byteLength) - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = 0 var mul = 1 var sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { var limit = Math.pow(2, (8 * byteLength) - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = byteLength - 1 var mul = 1 var sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (value < 0) value = 0xff + value + 1 this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) return offset + 2 } Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) return offset + 2 } Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) return offset + 4 } Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) return offset + 4 } function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') if (!start) start = 0 if (!end && end !== 0) end = this.length if (targetStart >= target.length) targetStart = target.length if (!targetStart) targetStart = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || this.length === 0) return 0 // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds') } if (start < 0 || start >= this.length) throw new RangeError('Index out of range') if (end < 0) throw new RangeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - targetStart < end - start) { end = target.length - targetStart + start } var len = end - start if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { // Use built-in when available, missing from IE11 this.copyWithin(targetStart, start, end) } else { Uint8Array.prototype.set.call( target, this.subarray(start, end), targetStart ) } return len } // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill (val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = this.length } else if (typeof end === 'string') { encoding = end end = this.length } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } if (val.length === 1) { var code = val.charCodeAt(0) if ((encoding === 'utf8' && code < 128) || encoding === 'latin1') { // Fast path: If `val` fits into a single byte, use that numeric value. val = code } } } else if (typeof val === 'number') { val = val & 255 } else if (typeof val === 'boolean') { val = Number(val) } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index') } if (end <= start) { return this } start = start >>> 0 end = end === undefined ? this.length : end >>> 0 if (!val) val = 0 var i if (typeof val === 'number') { for (i = start; i < end; ++i) { this[i] = val } } else { var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding) var len = bytes.length if (len === 0) { throw new TypeError('The value "' + val + '" is invalid for argument "value"') } for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len] } } return this } // HELPER FUNCTIONS // ================ var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g function base64clean (str) { // Node takes equal signs as end of the Base64 encoding str = str.split('=')[0] // Node strips out invalid characters like \n and \t from the string, base64-js does not str = str.trim().replace(INVALID_BASE64_RE, '') // Node converts strings with length < 2 to '' if (str.length < 2) return '' // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function utf8ToBytes (string, units) { units = units || Infinity var codePoint var length = string.length var leadSurrogate = null var bytes = [] for (var i = 0; i < length; ++i) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead leadSurrogate = codePoint continue } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } leadSurrogate = null // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break bytes.push(codePoint) } else if (codePoint < 0x800) { if ((units -= 2) < 0) break bytes.push( codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break bytes.push( codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break bytes.push( codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else { throw new Error('Invalid code point') } } return bytes } function asciiToBytes (str) { var byteArray = [] for (var i = 0; i < str.length; ++i) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str, units) { var c, hi, lo var byteArray = [] for (var i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } function blitBuffer (src, dst, offset, length) { for (var i = 0; i < length; ++i) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass // the `instanceof` check but they should be treated as of that type. // See: https://github.com/feross/buffer/issues/166 function isInstance (obj, type) { return obj instanceof type || (obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name) } function numberIsNaN (obj) { // For IE11 support return obj !== obj // eslint-disable-line no-self-compare } // Create lookup table for `toString('hex')` // See: https://github.com/feross/buffer/issues/219 var hexSliceLookupTable = (function () { var alphabet = '0123456789abcdef' var table = new Array(256) for (var i = 0; i < 16; ++i) { var i16 = i * 16 for (var j = 0; j < 16; ++j) { table[i16 + j] = alphabet[i] + alphabet[j] } } return table })() /***/ }), /***/ 78898: /***/ (function(__unused_webpack_module, exports) { /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var nBits = -7 var i = isLE ? (nBytes - 1) : 0 var d = isLE ? -1 : 1 var s = buffer[offset + i] i += d e = s & ((1 << (-nBits)) - 1) s >>= (-nBits) nBits += eLen for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1) e >>= (-nBits) nBits += mLen for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity) } else { m = m + Math.pow(2, mLen) e = e - eBias } return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { var e, m, c var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) var i = isLE ? 0 : (nBytes - 1) var d = isLE ? 1 : -1 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 value = Math.abs(value) if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0 e = eMax } else { e = Math.floor(Math.log(value) / Math.LN2) if (value * (c = Math.pow(2, -e)) < 1) { e-- c *= 2 } if (e + eBias >= 1) { value += rt / c } else { value += rt * Math.pow(2, 1 - eBias) } if (value * c >= 2) { e++ c /= 2 } if (e + eBias >= eMax) { m = 0 e = eMax } else if (e + eBias >= 1) { m = ((value * c) - 1) * Math.pow(2, mLen) e = e + eBias } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) e = 0 } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m eLen += mLen for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128 } /***/ }), /***/ 30907: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _arrayLikeToArray; } /* harmony export */ }); function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /***/ }), /***/ 97326: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _assertThisInitialized; } /* harmony export */ }); function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } /***/ }), /***/ 43144: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _createClass; } /* harmony export */ }); function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } /***/ }), /***/ 4942: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _defineProperty; } /* harmony export */ }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /***/ }), /***/ 87462: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _extends; } /* harmony export */ }); function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /***/ }), /***/ 75068: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "Z": function() { return /* binding */ _inheritsLoose; } }); ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } /***/ }), /***/ 45987: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _objectWithoutProperties; } /* harmony export */ }); /* harmony import */ var _objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63366); function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = (0,_objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } /***/ }), /***/ 63366: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _objectWithoutPropertiesLoose; } /* harmony export */ }); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /***/ }), /***/ 86854: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "Z": function() { return /* binding */ _slicedToArray; } }); ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js var unsupportedIterableToArray = __webpack_require__(40181); ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || (0,unsupportedIterableToArray/* default */.Z)(arr, i) || _nonIterableRest(); } /***/ }), /***/ 41451: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "Z": function() { return /* binding */ _toConsumableArray; } }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js var arrayLikeToArray = __webpack_require__(30907); ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return (0,arrayLikeToArray/* default */.Z)(arr); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js var unsupportedIterableToArray = __webpack_require__(40181); ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || (0,unsupportedIterableToArray/* default */.Z)(arr) || _nonIterableSpread(); } /***/ }), /***/ 71002: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _typeof; } /* harmony export */ }); function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /***/ }), /***/ 40181: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _unsupportedIterableToArray; } /* harmony export */ }); /* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30907); function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(o, minLen); } /***/ }), /***/ 20943: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _arrayLikeToArray; } /* harmony export */ }); function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /***/ }), /***/ 47568: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _asyncToGenerator; } /* harmony export */ }); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /***/ }), /***/ 51438: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _classCallCheck; } /* harmony export */ }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /***/ }), /***/ 14924: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _defineProperty; } /* harmony export */ }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /***/ }), /***/ 13375: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _iterableToArray; } /* harmony export */ }); function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } /***/ }), /***/ 26042: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _objectSpread; } /* harmony export */ }); /* harmony import */ var _define_property_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14924); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { (0,_define_property_mjs__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(target, key, source[key]); }); } return target; } /***/ }), /***/ 828: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { "Z": function() { return /* binding */ _slicedToArray; } }); ;// CONCATENATED MODULE: ./node_modules/@swc/helpers/src/_array_with_holes.mjs function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // EXTERNAL MODULE: ./node_modules/@swc/helpers/src/_iterable_to_array.mjs var _iterable_to_array = __webpack_require__(13375); ;// CONCATENATED MODULE: ./node_modules/@swc/helpers/src/_non_iterable_rest.mjs function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } // EXTERNAL MODULE: ./node_modules/@swc/helpers/src/_unsupported_iterable_to_array.mjs var _unsupported_iterable_to_array = __webpack_require__(91566); ;// CONCATENATED MODULE: ./node_modules/@swc/helpers/src/_sliced_to_array.mjs function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || (0,_iterable_to_array/* default */.Z)(arr, i) || (0,_unsupported_iterable_to_array/* default */.Z)(arr, i) || _nonIterableRest(); } /***/ }), /***/ 91566: /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": function() { return /* binding */ _unsupportedIterableToArray; } /* harmony export */ }); /* harmony import */ var _array_like_to_array_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20943); function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return (0,_array_like_to_array_mjs__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0,_array_like_to_array_mjs__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(o, minLen); } /***/ }) }, /******/ function(__webpack_require__) { // webpackRuntimeModules /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); } /******/ __webpack_require__.O(0, [9774,179], function() { return __webpack_exec__(51278), __webpack_exec__(6840), __webpack_exec__(90387); }); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]);