diff --git a/versions/dev/code.js b/versions/dev/code.js new file mode 100644 index 0000000..751234f --- /dev/null +++ b/versions/dev/code.js @@ -0,0 +1,7843 @@ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/blakejs/blake2b.js": +/*!*****************************************!*\ + !*** ./node_modules/blakejs/blake2b.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// Blake2B in pure Javascript +// Adapted from the reference implementation in RFC7693 +// Ported to Javascript by DC - https://github.com/dcposch + +const util = __webpack_require__(/*! ./util */ "./node_modules/blakejs/util.js") + +// 64-bit unsigned addition +// Sets v[a,a+1] += v[b,b+1] +// v should be a Uint32Array +function ADD64AA (v, a, b) { + const o0 = v[a] + v[b] + let o1 = v[a + 1] + v[b + 1] + if (o0 >= 0x100000000) { + o1++ + } + v[a] = o0 + v[a + 1] = o1 +} + +// 64-bit unsigned addition +// Sets v[a,a+1] += b +// b0 is the low 32 bits of b, b1 represents the high 32 bits +function ADD64AC (v, a, b0, b1) { + let o0 = v[a] + b0 + if (b0 < 0) { + o0 += 0x100000000 + } + let o1 = v[a + 1] + b1 + if (o0 >= 0x100000000) { + o1++ + } + v[a] = o0 + v[a + 1] = o1 +} + +// Little-endian byte access +function B2B_GET32 (arr, i) { + return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24) +} + +// G Mixing function +// The ROTRs are inlined for speed +function B2B_G (a, b, c, d, ix, iy) { + const x0 = m[ix] + const x1 = m[ix + 1] + const y0 = m[iy] + const y1 = m[iy + 1] + + ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s + ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits + + // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits + let xor0 = v[d] ^ v[a] + let xor1 = v[d + 1] ^ v[a + 1] + v[d] = xor1 + v[d + 1] = xor0 + + ADD64AA(v, c, d) + + // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits + xor0 = v[b] ^ v[c] + xor1 = v[b + 1] ^ v[c + 1] + v[b] = (xor0 >>> 24) ^ (xor1 << 8) + v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8) + + ADD64AA(v, a, b) + ADD64AC(v, a, y0, y1) + + // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits + xor0 = v[d] ^ v[a] + xor1 = v[d + 1] ^ v[a + 1] + v[d] = (xor0 >>> 16) ^ (xor1 << 16) + v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16) + + ADD64AA(v, c, d) + + // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits + xor0 = v[b] ^ v[c] + xor1 = v[b + 1] ^ v[c + 1] + v[b] = (xor1 >>> 31) ^ (xor0 << 1) + v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1) +} + +// Initialization Vector +const BLAKE2B_IV32 = new Uint32Array([ + 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, + 0x5f1d36f1, 0xa54ff53a, 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, + 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19 +]) + +const SIGMA8 = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, + 6, 1, 12, 0, 2, 11, 7, 5, 3, 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, + 9, 4, 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, 9, 0, 5, 7, 2, 4, + 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, + 15, 14, 1, 9, 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, 13, 11, 7, + 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, + 13, 7, 1, 4, 10, 5, 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, 6, + 1, 12, 0, 2, 11, 7, 5, 3 +] + +// These are offsets into a uint64 buffer. +// Multiply them all by 2 to make them offsets into a uint32 buffer, +// because this is Javascript and we don't have uint64s +const SIGMA82 = new Uint8Array( + SIGMA8.map(function (x) { + return x * 2 + }) +) + +// Compression function. 'last' flag indicates last block. +// Note we're representing 16 uint64s as 32 uint32s +const v = new Uint32Array(32) +const m = new Uint32Array(32) +function blake2bCompress (ctx, last) { + let i = 0 + + // init work variables + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i] + v[i + 16] = BLAKE2B_IV32[i] + } + + // low 64 bits of offset + v[24] = v[24] ^ ctx.t + v[25] = v[25] ^ (ctx.t / 0x100000000) + // high 64 bits not supported, offset may not be higher than 2**53-1 + + // last block flag set ? + if (last) { + v[28] = ~v[28] + v[29] = ~v[29] + } + + // get little-endian words + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i) + } + + // twelve rounds of mixing + // uncomment the DebugPrint calls to log the computation + // and match the RFC sample documentation + // util.debugPrint(' m[16]', m, 64) + for (i = 0; i < 12; i++) { + // util.debugPrint(' (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64) + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]) + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]) + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]) + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]) + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]) + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]) + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]) + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]) + } + // util.debugPrint(' (i=12) v[16]', v, 64) + + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16] + } + // util.debugPrint('h[8]', ctx.h, 64) +} + +// reusable parameterBlock +const parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, // 0: outlen, keylen, fanout, depth + 0, + 0, + 0, + 0, // 4: leaf length, sequential mode + 0, + 0, + 0, + 0, // 8: node offset + 0, + 0, + 0, + 0, // 12: node offset + 0, + 0, + 0, + 0, // 16: node depth, inner length, rfu + 0, + 0, + 0, + 0, // 20: rfu + 0, + 0, + 0, + 0, // 24: rfu + 0, + 0, + 0, + 0, // 28: rfu + 0, + 0, + 0, + 0, // 32: salt + 0, + 0, + 0, + 0, // 36: salt + 0, + 0, + 0, + 0, // 40: salt + 0, + 0, + 0, + 0, // 44: salt + 0, + 0, + 0, + 0, // 48: personal + 0, + 0, + 0, + 0, // 52: personal + 0, + 0, + 0, + 0, // 56: personal + 0, + 0, + 0, + 0 // 60: personal +]) + +// Creates a BLAKE2b hashing context +// Requires an output length between 1 and 64 bytes +// Takes an optional Uint8Array key +// Takes an optinal Uint8Array salt +// Takes an optinal Uint8Array personal +function blake2bInit (outlen, key, salt, personal) { + if (outlen === 0 || outlen > 64) { + throw new Error('Illegal output length, expected 0 < length <= 64') + } + if (key && key.length > 64) { + throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64') + } + if (salt && salt.length !== 16) { + throw new Error('Illegal salt, expected Uint8Array with length is 16') + } + if (personal && personal.length !== 16) { + throw new Error('Illegal personal, expected Uint8Array with length is 16') + } + + // state, 'param block' + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, // input count + c: 0, // pointer within buffer + outlen: outlen // output length in bytes + } + + // initialize parameterBlock before usage + parameterBlock.fill(0) + parameterBlock[0] = outlen + if (key) parameterBlock[1] = key.length + parameterBlock[2] = 1 // fanout + parameterBlock[3] = 1 // depth + if (salt) parameterBlock.set(salt, 32) + if (personal) parameterBlock.set(personal, 48) + + // initialize hash state + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4) + } + + // key the hash, if applicable + if (key) { + blake2bUpdate(ctx, key) + // at the end + ctx.c = 128 + } + + return ctx +} + +// Updates a BLAKE2b streaming hash +// Requires hash context and Uint8Array (byte array) +function blake2bUpdate (ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + // buffer full ? + ctx.t += ctx.c // add counters + blake2bCompress(ctx, false) // compress (not last) + ctx.c = 0 // counter to zero + } + ctx.b[ctx.c++] = input[i] + } +} + +// Completes a BLAKE2b streaming hash +// Returns a Uint8Array containing the message digest +function blake2bFinal (ctx) { + ctx.t += ctx.c // mark last block offset + + while (ctx.c < 128) { + // fill up with zeros + ctx.b[ctx.c++] = 0 + } + blake2bCompress(ctx, true) // final block flag = 1 + + // little endian convert and store + const out = new Uint8Array(ctx.outlen) + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> (8 * (i & 3)) + } + return out +} + +// Computes the BLAKE2B hash of a string or byte array, and returns a Uint8Array +// +// Returns a n-byte Uint8Array +// +// Parameters: +// - input - the input bytes, as a string, Buffer or Uint8Array +// - key - optional key Uint8Array, up to 64 bytes +// - outlen - optional output length in bytes, default 64 +// - salt - optional salt bytes, string, Buffer or Uint8Array +// - personal - optional personal bytes, string, Buffer or Uint8Array +function blake2b (input, key, outlen, salt, personal) { + // preprocess inputs + outlen = outlen || 64 + input = util.normalizeInput(input) + if (salt) { + salt = util.normalizeInput(salt) + } + if (personal) { + personal = util.normalizeInput(personal) + } + + // do the math + const ctx = blake2bInit(outlen, key, salt, personal) + blake2bUpdate(ctx, input) + return blake2bFinal(ctx) +} + +// Computes the BLAKE2B hash of a string or byte array +// +// Returns an n-byte hash in hex, all lowercase +// +// Parameters: +// - input - the input bytes, as a string, Buffer, or Uint8Array +// - key - optional key Uint8Array, up to 64 bytes +// - outlen - optional output length in bytes, default 64 +// - salt - optional salt bytes, string, Buffer or Uint8Array +// - personal - optional personal bytes, string, Buffer or Uint8Array +function blake2bHex (input, key, outlen, salt, personal) { + const output = blake2b(input, key, outlen, salt, personal) + return util.toHex(output) +} + +module.exports = { + blake2b: blake2b, + blake2bHex: blake2bHex, + blake2bInit: blake2bInit, + blake2bUpdate: blake2bUpdate, + blake2bFinal: blake2bFinal +} + + +/***/ }), + +/***/ "./node_modules/blakejs/blake2s.js": +/*!*****************************************!*\ + !*** ./node_modules/blakejs/blake2s.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// BLAKE2s hash function in pure Javascript +// Adapted from the reference implementation in RFC7693 +// Ported to Javascript by DC - https://github.com/dcposch + +const util = __webpack_require__(/*! ./util */ "./node_modules/blakejs/util.js") + +// Little-endian byte access. +// Expects a Uint8Array and an index +// Returns the little-endian uint32 at v[i..i+3] +function B2S_GET32 (v, i) { + return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24) +} + +// Mixing function G. +function B2S_G (a, b, c, d, x, y) { + v[a] = v[a] + v[b] + x + v[d] = ROTR32(v[d] ^ v[a], 16) + v[c] = v[c] + v[d] + v[b] = ROTR32(v[b] ^ v[c], 12) + v[a] = v[a] + v[b] + y + v[d] = ROTR32(v[d] ^ v[a], 8) + v[c] = v[c] + v[d] + v[b] = ROTR32(v[b] ^ v[c], 7) +} + +// 32-bit right rotation +// x should be a uint32 +// y must be between 1 and 31, inclusive +function ROTR32 (x, y) { + return (x >>> y) ^ (x << (32 - y)) +} + +// Initialization Vector. +const BLAKE2S_IV = new Uint32Array([ + 0x6a09e667, + 0xbb67ae85, + 0x3c6ef372, + 0xa54ff53a, + 0x510e527f, + 0x9b05688c, + 0x1f83d9ab, + 0x5be0cd19 +]) + +const SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 +]) + +// Compression function. "last" flag indicates last block +const v = new Uint32Array(16) +const m = new Uint32Array(16) +function blake2sCompress (ctx, last) { + let i = 0 + for (i = 0; i < 8; i++) { + // init work variables + v[i] = ctx.h[i] + v[i + 8] = BLAKE2S_IV[i] + } + + v[12] ^= ctx.t // low 32 bits of offset + v[13] ^= ctx.t / 0x100000000 // high 32 bits + if (last) { + // last block flag set ? + v[14] = ~v[14] + } + + for (i = 0; i < 16; i++) { + // get little-endian words + m[i] = B2S_GET32(ctx.b, 4 * i) + } + + // ten rounds of mixing + // uncomment the DebugPrint calls to log the computation + // and match the RFC sample documentation + // util.debugPrint(' m[16]', m, 32) + for (i = 0; i < 10; i++) { + // util.debugPrint(' (i=' + i + ') v[16]', v, 32) + B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]]) + B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]]) + B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]]) + B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]]) + B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]]) + B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]]) + B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]]) + B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]]) + } + // util.debugPrint(' (i=10) v[16]', v, 32) + + for (i = 0; i < 8; i++) { + ctx.h[i] ^= v[i] ^ v[i + 8] + } + // util.debugPrint('h[8]', ctx.h, 32) +} + +// Creates a BLAKE2s hashing context +// Requires an output length between 1 and 32 bytes +// Takes an optional Uint8Array key +function blake2sInit (outlen, key) { + if (!(outlen > 0 && outlen <= 32)) { + throw new Error('Incorrect output length, should be in [1, 32]') + } + const keylen = key ? key.length : 0 + if (key && !(keylen > 0 && keylen <= 32)) { + throw new Error('Incorrect key length, should be in [1, 32]') + } + + const ctx = { + h: new Uint32Array(BLAKE2S_IV), // hash state + b: new Uint8Array(64), // input block + c: 0, // pointer within block + t: 0, // input count + outlen: outlen // output length in bytes + } + ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen + + if (keylen > 0) { + blake2sUpdate(ctx, key) + ctx.c = 64 // at the end + } + + return ctx +} + +// Updates a BLAKE2s streaming hash +// Requires hash context and Uint8Array (byte array) +function blake2sUpdate (ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + // buffer full ? + ctx.t += ctx.c // add counters + blake2sCompress(ctx, false) // compress (not last) + ctx.c = 0 // counter to zero + } + ctx.b[ctx.c++] = input[i] + } +} + +// Completes a BLAKE2s streaming hash +// Returns a Uint8Array containing the message digest +function blake2sFinal (ctx) { + ctx.t += ctx.c // mark last block offset + while (ctx.c < 64) { + // fill up with zeros + ctx.b[ctx.c++] = 0 + } + blake2sCompress(ctx, true) // final block flag = 1 + + // little endian convert and store + const out = new Uint8Array(ctx.outlen) + for (let i = 0; i < ctx.outlen; i++) { + out[i] = (ctx.h[i >> 2] >> (8 * (i & 3))) & 0xff + } + return out +} + +// Computes the BLAKE2S hash of a string or byte array, and returns a Uint8Array +// +// Returns a n-byte Uint8Array +// +// Parameters: +// - input - the input bytes, as a string, Buffer, or Uint8Array +// - key - optional key Uint8Array, up to 32 bytes +// - outlen - optional output length in bytes, default 64 +function blake2s (input, key, outlen) { + // preprocess inputs + outlen = outlen || 32 + input = util.normalizeInput(input) + + // do the math + const ctx = blake2sInit(outlen, key) + blake2sUpdate(ctx, input) + return blake2sFinal(ctx) +} + +// Computes the BLAKE2S hash of a string or byte array +// +// Returns an n-byte hash in hex, all lowercase +// +// Parameters: +// - input - the input bytes, as a string, Buffer, or Uint8Array +// - key - optional key Uint8Array, up to 32 bytes +// - outlen - optional output length in bytes, default 64 +function blake2sHex (input, key, outlen) { + const output = blake2s(input, key, outlen) + return util.toHex(output) +} + +module.exports = { + blake2s: blake2s, + blake2sHex: blake2sHex, + blake2sInit: blake2sInit, + blake2sUpdate: blake2sUpdate, + blake2sFinal: blake2sFinal +} + + +/***/ }), + +/***/ "./node_modules/blakejs/index.js": +/*!***************************************!*\ + !*** ./node_modules/blakejs/index.js ***! + \***************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const b2b = __webpack_require__(/*! ./blake2b */ "./node_modules/blakejs/blake2b.js") +const b2s = __webpack_require__(/*! ./blake2s */ "./node_modules/blakejs/blake2s.js") + +module.exports = { + blake2b: b2b.blake2b, + blake2bHex: b2b.blake2bHex, + blake2bInit: b2b.blake2bInit, + blake2bUpdate: b2b.blake2bUpdate, + blake2bFinal: b2b.blake2bFinal, + blake2s: b2s.blake2s, + blake2sHex: b2s.blake2sHex, + blake2sInit: b2s.blake2sInit, + blake2sUpdate: b2s.blake2sUpdate, + blake2sFinal: b2s.blake2sFinal +} + + +/***/ }), + +/***/ "./node_modules/blakejs/util.js": +/*!**************************************!*\ + !*** ./node_modules/blakejs/util.js ***! + \**************************************/ +/***/ ((module) => { + +const ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array' + +// For convenience, let people hash a string, not just a Uint8Array +function normalizeInput (input) { + let ret + if (input instanceof Uint8Array) { + ret = input + } else if (typeof input === 'string') { + const encoder = new TextEncoder() + ret = encoder.encode(input) + } else { + throw new Error(ERROR_MSG_INPUT) + } + return ret +} + +// Converts a Uint8Array to a hexadecimal string +// For example, toHex([255, 0, 255]) returns "ff00ff" +function toHex (bytes) { + return Array.prototype.map + .call(bytes, function (n) { + return (n < 16 ? '0' : '') + n.toString(16) + }) + .join('') +} + +// Converts any value in [0...2^32-1] to an 8-character hex string +function uint32ToHex (val) { + return (0x100000000 + val).toString(16).substring(1) +} + +// For debugging: prints out hash state in the same format as the RFC +// sample computation exactly, so that you can diff +function debugPrint (label, arr, size) { + let msg = '\n' + label + ' = ' + for (let i = 0; i < arr.length; i += 2) { + if (size === 32) { + msg += uint32ToHex(arr[i]).toUpperCase() + msg += ' ' + msg += uint32ToHex(arr[i + 1]).toUpperCase() + } else if (size === 64) { + msg += uint32ToHex(arr[i + 1]).toUpperCase() + msg += uint32ToHex(arr[i]).toUpperCase() + } else throw new Error('Invalid size ' + size) + if (i % 6 === 4) { + msg += '\n' + new Array(label.length + 4).join(' ') + } else if (i < arr.length - 2) { + msg += ' ' + } + } + console.log(msg) +} + +// For performance testing: generates N bytes of input, hashes M times +// Measures and prints MB/second hash performance each time +function testSpeed (hashFn, N, M) { + let startMs = new Date().getTime() + + const input = new Uint8Array(N) + for (let i = 0; i < N; i++) { + input[i] = i % 256 + } + const genMs = new Date().getTime() + console.log('Generated random input in ' + (genMs - startMs) + 'ms') + startMs = genMs + + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input) + const hashMs = new Date().getTime() + const ms = hashMs - startMs + startMs = hashMs + console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...') + console.log( + Math.round((N / (1 << 20) / (ms / 1000)) * 100) / 100 + ' MB PER SECOND' + ) + } +} + +module.exports = { + normalizeInput: normalizeInput, + toHex: toHex, + debugPrint: debugPrint, + testSpeed: testSpeed +} + + +/***/ }), + +/***/ "./node_modules/text-encoding/index.js": +/*!*********************************************!*\ + !*** ./node_modules/text-encoding/index.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// This is free and unencumbered software released into the public domain. +// See LICENSE.md for more information. + +var encoding = __webpack_require__(/*! ./lib/encoding.js */ "./node_modules/text-encoding/lib/encoding.js"); + +module.exports = { + TextEncoder: encoding.TextEncoder, + TextDecoder: encoding.TextDecoder, +}; + + +/***/ }), + +/***/ "./node_modules/text-encoding/lib/encoding-indexes.js": +/*!************************************************************!*\ + !*** ./node_modules/text-encoding/lib/encoding-indexes.js ***! + \************************************************************/ +/***/ (function(module) { + +(function(global) { + 'use strict'; + + if ( true && module.exports) { + module.exports = global; + } + + global["encoding-indexes"] = +{ + "big5":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,17392,19506,17923,17830,17784,160359,19831,17843,162993,19682,163013,15253,18230,18244,19527,19520,148159,144919,160594,159371,159954,19543,172881,18255,17882,19589,162924,19719,19108,18081,158499,29221,154196,137827,146950,147297,26189,22267,null,32149,22813,166841,15860,38708,162799,23515,138590,23204,13861,171696,23249,23479,23804,26478,34195,170309,29793,29853,14453,138579,145054,155681,16108,153822,15093,31484,40855,147809,166157,143850,133770,143966,17162,33924,40854,37935,18736,34323,22678,38730,37400,31184,31282,26208,27177,34973,29772,31685,26498,31276,21071,36934,13542,29636,155065,29894,40903,22451,18735,21580,16689,145038,22552,31346,162661,35727,18094,159368,16769,155033,31662,140476,40904,140481,140489,140492,40905,34052,144827,16564,40906,17633,175615,25281,28782,40907,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,12736,12737,12738,12739,12740,131340,12741,131281,131277,12742,12743,131275,139240,12744,131274,12745,12746,12747,12748,131342,12749,12750,256,193,461,192,274,201,282,200,332,211,465,210,null,7870,null,7872,202,257,225,462,224,593,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,null,7871,null,7873,234,609,9178,9179,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,172969,135493,null,25866,null,null,20029,28381,40270,37343,null,null,161589,25745,20250,20264,20392,20822,20852,20892,20964,21153,21160,21307,21326,21457,21464,22242,22768,22788,22791,22834,22836,23398,23454,23455,23706,24198,24635,25993,26622,26628,26725,27982,28860,30005,32420,32428,32442,32455,32463,32479,32518,32567,33402,33487,33647,35270,35774,35810,36710,36711,36718,29713,31996,32205,26950,31433,21031,null,null,null,null,37260,30904,37214,32956,null,36107,33014,133607,null,null,32927,40647,19661,40393,40460,19518,171510,159758,40458,172339,13761,null,28314,33342,29977,null,18705,39532,39567,40857,31111,164972,138698,132560,142054,20004,20097,20096,20103,20159,20203,20279,13388,20413,15944,20483,20616,13437,13459,13477,20870,22789,20955,20988,20997,20105,21113,21136,21287,13767,21417,13649,21424,13651,21442,21539,13677,13682,13953,21651,21667,21684,21689,21712,21743,21784,21795,21800,13720,21823,13733,13759,21975,13765,163204,21797,null,134210,134421,151851,21904,142534,14828,131905,36422,150968,169189,16467,164030,30586,142392,14900,18389,164189,158194,151018,25821,134524,135092,134357,135412,25741,36478,134806,134155,135012,142505,164438,148691,null,134470,170573,164073,18420,151207,142530,39602,14951,169460,16365,13574,152263,169940,161992,142660,40302,38933,null,17369,155813,25780,21731,142668,142282,135287,14843,135279,157402,157462,162208,25834,151634,134211,36456,139681,166732,132913,null,18443,131497,16378,22643,142733,null,148936,132348,155799,134988,134550,21881,16571,17338,null,19124,141926,135325,33194,39157,134556,25465,14846,141173,36288,22177,25724,15939,null,173569,134665,142031,142537,null,135368,145858,14738,14854,164507,13688,155209,139463,22098,134961,142514,169760,13500,27709,151099,null,null,161140,142987,139784,173659,167117,134778,134196,157724,32659,135375,141315,141625,13819,152035,134796,135053,134826,16275,134960,134471,135503,134732,null,134827,134057,134472,135360,135485,16377,140950,25650,135085,144372,161337,142286,134526,134527,142417,142421,14872,134808,135367,134958,173618,158544,167122,167321,167114,38314,21708,33476,21945,null,171715,39974,39606,161630,142830,28992,33133,33004,23580,157042,33076,14231,21343,164029,37302,134906,134671,134775,134907,13789,151019,13833,134358,22191,141237,135369,134672,134776,135288,135496,164359,136277,134777,151120,142756,23124,135197,135198,135413,135414,22428,134673,161428,164557,135093,134779,151934,14083,135094,135552,152280,172733,149978,137274,147831,164476,22681,21096,13850,153405,31666,23400,18432,19244,40743,18919,39967,39821,154484,143677,22011,13810,22153,20008,22786,138177,194680,38737,131206,20059,20155,13630,23587,24401,24516,14586,25164,25909,27514,27701,27706,28780,29227,20012,29357,149737,32594,31035,31993,32595,156266,13505,null,156491,32770,32896,157202,158033,21341,34916,35265,161970,35744,36125,38021,38264,38271,38376,167439,38886,39029,39118,39134,39267,170000,40060,40479,40644,27503,63751,20023,131207,38429,25143,38050,null,20539,28158,171123,40870,15817,34959,147790,28791,23797,19232,152013,13657,154928,24866,166450,36775,37366,29073,26393,29626,144001,172295,15499,137600,19216,30948,29698,20910,165647,16393,27235,172730,16931,34319,133743,31274,170311,166634,38741,28749,21284,139390,37876,30425,166371,40871,30685,20131,20464,20668,20015,20247,40872,21556,32139,22674,22736,138678,24210,24217,24514,141074,25995,144377,26905,27203,146531,27903,null,29184,148741,29580,16091,150035,23317,29881,35715,154788,153237,31379,31724,31939,32364,33528,34199,40873,34960,40874,36537,40875,36815,34143,39392,37409,40876,167353,136255,16497,17058,23066,null,null,null,39016,26475,17014,22333,null,34262,149883,33471,160013,19585,159092,23931,158485,159678,40877,40878,23446,40879,26343,32347,28247,31178,15752,17603,143958,141206,17306,17718,null,23765,146202,35577,23672,15634,144721,23928,40882,29015,17752,147692,138787,19575,14712,13386,131492,158785,35532,20404,131641,22975,33132,38998,170234,24379,134047,null,139713,166253,16642,18107,168057,16135,40883,172469,16632,14294,18167,158790,16764,165554,160767,17773,14548,152730,17761,17691,19849,19579,19830,17898,16328,150287,13921,17630,17597,16877,23870,23880,23894,15868,14351,23972,23993,14368,14392,24130,24253,24357,24451,14600,14612,14655,14669,24791,24893,23781,14729,25015,25017,25039,14776,25132,25232,25317,25368,14840,22193,14851,25570,25595,25607,25690,14923,25792,23829,22049,40863,14999,25990,15037,26111,26195,15090,26258,15138,26390,15170,26532,26624,15192,26698,26756,15218,15217,15227,26889,26947,29276,26980,27039,27013,15292,27094,15325,27237,27252,27249,27266,15340,27289,15346,27307,27317,27348,27382,27521,27585,27626,27765,27818,15563,27906,27910,27942,28033,15599,28068,28081,28181,28184,28201,28294,166336,28347,28386,28378,40831,28392,28393,28452,28468,15686,147265,28545,28606,15722,15733,29111,23705,15754,28716,15761,28752,28756,28783,28799,28809,131877,17345,13809,134872,147159,22462,159443,28990,153568,13902,27042,166889,23412,31305,153825,169177,31333,31357,154028,31419,31408,31426,31427,29137,156813,16842,31450,31453,31466,16879,21682,154625,31499,31573,31529,152334,154878,31650,31599,33692,154548,158847,31696,33825,31634,31672,154912,15789,154725,33938,31738,31750,31797,154817,31812,31875,149634,31910,26237,148856,31945,31943,31974,31860,31987,31989,31950,32359,17693,159300,32093,159446,29837,32137,32171,28981,32179,32210,147543,155689,32228,15635,32245,137209,32229,164717,32285,155937,155994,32366,32402,17195,37996,32295,32576,32577,32583,31030,156368,39393,32663,156497,32675,136801,131176,17756,145254,17667,164666,32762,156809,32773,32776,32797,32808,32815,172167,158915,32827,32828,32865,141076,18825,157222,146915,157416,26405,32935,166472,33031,33050,22704,141046,27775,156824,151480,25831,136330,33304,137310,27219,150117,150165,17530,33321,133901,158290,146814,20473,136445,34018,33634,158474,149927,144688,137075,146936,33450,26907,194964,16859,34123,33488,33562,134678,137140,14017,143741,144730,33403,33506,33560,147083,159139,158469,158615,144846,15807,33565,21996,33669,17675,159141,33708,33729,33747,13438,159444,27223,34138,13462,159298,143087,33880,154596,33905,15827,17636,27303,33866,146613,31064,33960,158614,159351,159299,34014,33807,33681,17568,33939,34020,154769,16960,154816,17731,34100,23282,159385,17703,34163,17686,26559,34326,165413,165435,34241,159880,34306,136578,159949,194994,17770,34344,13896,137378,21495,160666,34430,34673,172280,34798,142375,34737,34778,34831,22113,34412,26710,17935,34885,34886,161248,146873,161252,34910,34972,18011,34996,34997,25537,35013,30583,161551,35207,35210,35238,35241,35239,35260,166437,35303,162084,162493,35484,30611,37374,35472,162393,31465,162618,147343,18195,162616,29052,35596,35615,152624,152933,35647,35660,35661,35497,150138,35728,35739,35503,136927,17941,34895,35995,163156,163215,195028,14117,163155,36054,163224,163261,36114,36099,137488,36059,28764,36113,150729,16080,36215,36265,163842,135188,149898,15228,164284,160012,31463,36525,36534,36547,37588,36633,36653,164709,164882,36773,37635,172703,133712,36787,18730,166366,165181,146875,24312,143970,36857,172052,165564,165121,140069,14720,159447,36919,165180,162494,36961,165228,165387,37032,165651,37060,165606,37038,37117,37223,15088,37289,37316,31916,166195,138889,37390,27807,37441,37474,153017,37561,166598,146587,166668,153051,134449,37676,37739,166625,166891,28815,23235,166626,166629,18789,37444,166892,166969,166911,37747,37979,36540,38277,38310,37926,38304,28662,17081,140922,165592,135804,146990,18911,27676,38523,38550,16748,38563,159445,25050,38582,30965,166624,38589,21452,18849,158904,131700,156688,168111,168165,150225,137493,144138,38705,34370,38710,18959,17725,17797,150249,28789,23361,38683,38748,168405,38743,23370,168427,38751,37925,20688,143543,143548,38793,38815,38833,38846,38848,38866,38880,152684,38894,29724,169011,38911,38901,168989,162170,19153,38964,38963,38987,39014,15118,160117,15697,132656,147804,153350,39114,39095,39112,39111,19199,159015,136915,21936,39137,39142,39148,37752,39225,150057,19314,170071,170245,39413,39436,39483,39440,39512,153381,14020,168113,170965,39648,39650,170757,39668,19470,39700,39725,165376,20532,39732,158120,14531,143485,39760,39744,171326,23109,137315,39822,148043,39938,39935,39948,171624,40404,171959,172434,172459,172257,172323,172511,40318,40323,172340,40462,26760,40388,139611,172435,172576,137531,172595,40249,172217,172724,40592,40597,40606,40610,19764,40618,40623,148324,40641,15200,14821,15645,20274,14270,166955,40706,40712,19350,37924,159138,40727,40726,40761,22175,22154,40773,39352,168075,38898,33919,40802,40809,31452,40846,29206,19390,149877,149947,29047,150008,148296,150097,29598,166874,137466,31135,166270,167478,37737,37875,166468,37612,37761,37835,166252,148665,29207,16107,30578,31299,28880,148595,148472,29054,137199,28835,137406,144793,16071,137349,152623,137208,14114,136955,137273,14049,137076,137425,155467,14115,136896,22363,150053,136190,135848,136134,136374,34051,145062,34051,33877,149908,160101,146993,152924,147195,159826,17652,145134,170397,159526,26617,14131,15381,15847,22636,137506,26640,16471,145215,147681,147595,147727,158753,21707,22174,157361,22162,135135,134056,134669,37830,166675,37788,20216,20779,14361,148534,20156,132197,131967,20299,20362,153169,23144,131499,132043,14745,131850,132116,13365,20265,131776,167603,131701,35546,131596,20120,20685,20749,20386,20227,150030,147082,20290,20526,20588,20609,20428,20453,20568,20732,20825,20827,20829,20830,28278,144789,147001,147135,28018,137348,147081,20904,20931,132576,17629,132259,132242,132241,36218,166556,132878,21081,21156,133235,21217,37742,18042,29068,148364,134176,149932,135396,27089,134685,29817,16094,29849,29716,29782,29592,19342,150204,147597,21456,13700,29199,147657,21940,131909,21709,134086,22301,37469,38644,37734,22493,22413,22399,13886,22731,23193,166470,136954,137071,136976,23084,22968,37519,23166,23247,23058,153926,137715,137313,148117,14069,27909,29763,23073,155267,23169,166871,132115,37856,29836,135939,28933,18802,37896,166395,37821,14240,23582,23710,24158,24136,137622,137596,146158,24269,23375,137475,137476,14081,137376,14045,136958,14035,33066,166471,138682,144498,166312,24332,24334,137511,137131,23147,137019,23364,34324,161277,34912,24702,141408,140843,24539,16056,140719,140734,168072,159603,25024,131134,131142,140827,24985,24984,24693,142491,142599,149204,168269,25713,149093,142186,14889,142114,144464,170218,142968,25399,173147,25782,25393,25553,149987,142695,25252,142497,25659,25963,26994,15348,143502,144045,149897,144043,21773,144096,137433,169023,26318,144009,143795,15072,16784,152964,166690,152975,136956,152923,152613,30958,143619,137258,143924,13412,143887,143746,148169,26254,159012,26219,19347,26160,161904,138731,26211,144082,144097,26142,153714,14545,145466,145340,15257,145314,144382,29904,15254,26511,149034,26806,26654,15300,27326,14435,145365,148615,27187,27218,27337,27397,137490,25873,26776,27212,15319,27258,27479,147392,146586,37792,37618,166890,166603,37513,163870,166364,37991,28069,28427,149996,28007,147327,15759,28164,147516,23101,28170,22599,27940,30786,28987,148250,148086,28913,29264,29319,29332,149391,149285,20857,150180,132587,29818,147192,144991,150090,149783,155617,16134,16049,150239,166947,147253,24743,16115,29900,29756,37767,29751,17567,159210,17745,30083,16227,150745,150790,16216,30037,30323,173510,15129,29800,166604,149931,149902,15099,15821,150094,16127,149957,149747,37370,22322,37698,166627,137316,20703,152097,152039,30584,143922,30478,30479,30587,149143,145281,14942,149744,29752,29851,16063,150202,150215,16584,150166,156078,37639,152961,30750,30861,30856,30930,29648,31065,161601,153315,16654,31131,33942,31141,27181,147194,31290,31220,16750,136934,16690,37429,31217,134476,149900,131737,146874,137070,13719,21867,13680,13994,131540,134157,31458,23129,141045,154287,154268,23053,131675,30960,23082,154566,31486,16889,31837,31853,16913,154547,155324,155302,31949,150009,137136,31886,31868,31918,27314,32220,32263,32211,32590,156257,155996,162632,32151,155266,17002,158581,133398,26582,131150,144847,22468,156690,156664,149858,32733,31527,133164,154345,154947,31500,155150,39398,34373,39523,27164,144447,14818,150007,157101,39455,157088,33920,160039,158929,17642,33079,17410,32966,33033,33090,157620,39107,158274,33378,33381,158289,33875,159143,34320,160283,23174,16767,137280,23339,137377,23268,137432,34464,195004,146831,34861,160802,23042,34926,20293,34951,35007,35046,35173,35149,153219,35156,161669,161668,166901,166873,166812,166393,16045,33955,18165,18127,14322,35389,35356,169032,24397,37419,148100,26068,28969,28868,137285,40301,35999,36073,163292,22938,30659,23024,17262,14036,36394,36519,150537,36656,36682,17140,27736,28603,140065,18587,28537,28299,137178,39913,14005,149807,37051,37015,21873,18694,37307,37892,166475,16482,166652,37927,166941,166971,34021,35371,38297,38311,38295,38294,167220,29765,16066,149759,150082,148458,16103,143909,38543,167655,167526,167525,16076,149997,150136,147438,29714,29803,16124,38721,168112,26695,18973,168083,153567,38749,37736,166281,166950,166703,156606,37562,23313,35689,18748,29689,147995,38811,38769,39224,134950,24001,166853,150194,38943,169178,37622,169431,37349,17600,166736,150119,166756,39132,166469,16128,37418,18725,33812,39227,39245,162566,15869,39323,19311,39338,39516,166757,153800,27279,39457,23294,39471,170225,19344,170312,39356,19389,19351,37757,22642,135938,22562,149944,136424,30788,141087,146872,26821,15741,37976,14631,24912,141185,141675,24839,40015,40019,40059,39989,39952,39807,39887,171565,39839,172533,172286,40225,19630,147716,40472,19632,40204,172468,172269,172275,170287,40357,33981,159250,159711,158594,34300,17715,159140,159364,159216,33824,34286,159232,145367,155748,31202,144796,144960,18733,149982,15714,37851,37566,37704,131775,30905,37495,37965,20452,13376,36964,152925,30781,30804,30902,30795,137047,143817,149825,13978,20338,28634,28633,28702,28702,21524,147893,22459,22771,22410,40214,22487,28980,13487,147884,29163,158784,151447,23336,137141,166473,24844,23246,23051,17084,148616,14124,19323,166396,37819,37816,137430,134941,33906,158912,136211,148218,142374,148417,22932,146871,157505,32168,155995,155812,149945,149899,166394,37605,29666,16105,29876,166755,137375,16097,150195,27352,29683,29691,16086,150078,150164,137177,150118,132007,136228,149989,29768,149782,28837,149878,37508,29670,37727,132350,37681,166606,166422,37766,166887,153045,18741,166530,29035,149827,134399,22180,132634,134123,134328,21762,31172,137210,32254,136898,150096,137298,17710,37889,14090,166592,149933,22960,137407,137347,160900,23201,14050,146779,14000,37471,23161,166529,137314,37748,15565,133812,19094,14730,20724,15721,15692,136092,29045,17147,164376,28175,168164,17643,27991,163407,28775,27823,15574,147437,146989,28162,28428,15727,132085,30033,14012,13512,18048,16090,18545,22980,37486,18750,36673,166940,158656,22546,22472,14038,136274,28926,148322,150129,143331,135856,140221,26809,26983,136088,144613,162804,145119,166531,145366,144378,150687,27162,145069,158903,33854,17631,17614,159014,159057,158850,159710,28439,160009,33597,137018,33773,158848,159827,137179,22921,23170,137139,23137,23153,137477,147964,14125,23023,137020,14023,29070,37776,26266,148133,23150,23083,148115,27179,147193,161590,148571,148170,28957,148057,166369,20400,159016,23746,148686,163405,148413,27148,148054,135940,28838,28979,148457,15781,27871,194597,150095,32357,23019,23855,15859,24412,150109,137183,32164,33830,21637,146170,144128,131604,22398,133333,132633,16357,139166,172726,28675,168283,23920,29583,31955,166489,168992,20424,32743,29389,29456,162548,29496,29497,153334,29505,29512,16041,162584,36972,29173,149746,29665,33270,16074,30476,16081,27810,22269,29721,29726,29727,16098,16112,16116,16122,29907,16142,16211,30018,30061,30066,30093,16252,30152,30172,16320,30285,16343,30324,16348,30330,151388,29064,22051,35200,22633,16413,30531,16441,26465,16453,13787,30616,16490,16495,23646,30654,30667,22770,30744,28857,30748,16552,30777,30791,30801,30822,33864,152885,31027,26627,31026,16643,16649,31121,31129,36795,31238,36796,16743,31377,16818,31420,33401,16836,31439,31451,16847,20001,31586,31596,31611,31762,31771,16992,17018,31867,31900,17036,31928,17044,31981,36755,28864,134351,32207,32212,32208,32253,32686,32692,29343,17303,32800,32805,31545,32814,32817,32852,15820,22452,28832,32951,33001,17389,33036,29482,33038,33042,30048,33044,17409,15161,33110,33113,33114,17427,22586,33148,33156,17445,33171,17453,33189,22511,33217,33252,33364,17551,33446,33398,33482,33496,33535,17584,33623,38505,27018,33797,28917,33892,24803,33928,17668,33982,34017,34040,34064,34104,34130,17723,34159,34160,34272,17783,34418,34450,34482,34543,38469,34699,17926,17943,34990,35071,35108,35143,35217,162151,35369,35384,35476,35508,35921,36052,36082,36124,18328,22623,36291,18413,20206,36410,21976,22356,36465,22005,36528,18487,36558,36578,36580,36589,36594,36791,36801,36810,36812,36915,39364,18605,39136,37395,18718,37416,37464,37483,37553,37550,37567,37603,37611,37619,37620,37629,37699,37764,37805,18757,18769,40639,37911,21249,37917,37933,37950,18794,37972,38009,38189,38306,18855,38388,38451,18917,26528,18980,38720,18997,38834,38850,22100,19172,24808,39097,19225,39153,22596,39182,39193,20916,39196,39223,39234,39261,39266,19312,39365,19357,39484,39695,31363,39785,39809,39901,39921,39924,19565,39968,14191,138178,40265,39994,40702,22096,40339,40381,40384,40444,38134,36790,40571,40620,40625,40637,40646,38108,40674,40689,40696,31432,40772,131220,131767,132000,26906,38083,22956,132311,22592,38081,14265,132565,132629,132726,136890,22359,29043,133826,133837,134079,21610,194619,134091,21662,134139,134203,134227,134245,134268,24807,134285,22138,134325,134365,134381,134511,134578,134600,26965,39983,34725,134660,134670,134871,135056,134957,134771,23584,135100,24075,135260,135247,135286,26398,135291,135304,135318,13895,135359,135379,135471,135483,21348,33965,135907,136053,135990,35713,136567,136729,137155,137159,20088,28859,137261,137578,137773,137797,138282,138352,138412,138952,25283,138965,139029,29080,26709,139333,27113,14024,139900,140247,140282,141098,141425,141647,33533,141671,141715,142037,35237,142056,36768,142094,38840,142143,38983,39613,142412,null,142472,142519,154600,142600,142610,142775,142741,142914,143220,143308,143411,143462,144159,144350,24497,26184,26303,162425,144743,144883,29185,149946,30679,144922,145174,32391,131910,22709,26382,26904,146087,161367,155618,146961,147129,161278,139418,18640,19128,147737,166554,148206,148237,147515,148276,148374,150085,132554,20946,132625,22943,138920,15294,146687,148484,148694,22408,149108,14747,149295,165352,170441,14178,139715,35678,166734,39382,149522,149755,150037,29193,150208,134264,22885,151205,151430,132985,36570,151596,21135,22335,29041,152217,152601,147274,150183,21948,152646,152686,158546,37332,13427,152895,161330,152926,18200,152930,152934,153543,149823,153693,20582,13563,144332,24798,153859,18300,166216,154286,154505,154630,138640,22433,29009,28598,155906,162834,36950,156082,151450,35682,156674,156746,23899,158711,36662,156804,137500,35562,150006,156808,147439,156946,19392,157119,157365,141083,37989,153569,24981,23079,194765,20411,22201,148769,157436,20074,149812,38486,28047,158909,13848,35191,157593,157806,156689,157790,29151,157895,31554,168128,133649,157990,37124,158009,31301,40432,158202,39462,158253,13919,156777,131105,31107,158260,158555,23852,144665,33743,158621,18128,158884,30011,34917,159150,22710,14108,140685,159819,160205,15444,160384,160389,37505,139642,160395,37680,160486,149968,27705,38047,160848,134904,34855,35061,141606,164979,137137,28344,150058,137248,14756,14009,23568,31203,17727,26294,171181,170148,35139,161740,161880,22230,16607,136714,14753,145199,164072,136133,29101,33638,162269,168360,23143,19639,159919,166315,162301,162314,162571,163174,147834,31555,31102,163849,28597,172767,27139,164632,21410,159239,37823,26678,38749,164207,163875,158133,136173,143919,163912,23941,166960,163971,22293,38947,166217,23979,149896,26046,27093,21458,150181,147329,15377,26422,163984,164084,164142,139169,164175,164233,164271,164378,164614,164655,164746,13770,164968,165546,18682,25574,166230,30728,37461,166328,17394,166375,17375,166376,166726,166868,23032,166921,36619,167877,168172,31569,168208,168252,15863,168286,150218,36816,29327,22155,169191,169449,169392,169400,169778,170193,170313,170346,170435,170536,170766,171354,171419,32415,171768,171811,19620,38215,172691,29090,172799,19857,36882,173515,19868,134300,36798,21953,36794,140464,36793,150163,17673,32383,28502,27313,20202,13540,166700,161949,14138,36480,137205,163876,166764,166809,162366,157359,15851,161365,146615,153141,153942,20122,155265,156248,22207,134765,36366,23405,147080,150686,25566,25296,137206,137339,25904,22061,154698,21530,152337,15814,171416,19581,22050,22046,32585,155352,22901,146752,34672,19996,135146,134473,145082,33047,40286,36120,30267,40005,30286,30649,37701,21554,33096,33527,22053,33074,33816,32957,21994,31074,22083,21526,134813,13774,22021,22001,26353,164578,13869,30004,22000,21946,21655,21874,134209,134294,24272,151880,134774,142434,134818,40619,32090,21982,135285,25245,38765,21652,36045,29174,37238,25596,25529,25598,21865,142147,40050,143027,20890,13535,134567,20903,21581,21790,21779,30310,36397,157834,30129,32950,34820,34694,35015,33206,33820,135361,17644,29444,149254,23440,33547,157843,22139,141044,163119,147875,163187,159440,160438,37232,135641,37384,146684,173737,134828,134905,29286,138402,18254,151490,163833,135147,16634,40029,25887,142752,18675,149472,171388,135148,134666,24674,161187,135149,null,155720,135559,29091,32398,40272,19994,19972,13687,23309,27826,21351,13996,14812,21373,13989,149016,22682,150382,33325,21579,22442,154261,133497,null,14930,140389,29556,171692,19721,39917,146686,171824,19547,151465,169374,171998,33884,146870,160434,157619,145184,25390,32037,147191,146988,14890,36872,21196,15988,13946,17897,132238,30272,23280,134838,30842,163630,22695,16575,22140,39819,23924,30292,173108,40581,19681,30201,14331,24857,143578,148466,null,22109,135849,22439,149859,171526,21044,159918,13741,27722,40316,31830,39737,22494,137068,23635,25811,169168,156469,160100,34477,134440,159010,150242,134513,null,20990,139023,23950,38659,138705,40577,36940,31519,39682,23761,31651,25192,25397,39679,31695,39722,31870,39726,31810,31878,39957,31740,39689,40727,39963,149822,40794,21875,23491,20477,40600,20466,21088,15878,21201,22375,20566,22967,24082,38856,40363,36700,21609,38836,39232,38842,21292,24880,26924,21466,39946,40194,19515,38465,27008,20646,30022,137069,39386,21107,null,37209,38529,37212,null,37201,167575,25471,159011,27338,22033,37262,30074,25221,132092,29519,31856,154657,146685,null,149785,30422,39837,20010,134356,33726,34882,null,23626,27072,20717,22394,21023,24053,20174,27697,131570,20281,21660,21722,21146,36226,13822,24332,13811,null,27474,37244,40869,39831,38958,39092,39610,40616,40580,29050,31508,null,27642,34840,32632,null,22048,173642,36471,40787,null,36308,36431,40476,36353,25218,164733,36392,36469,31443,150135,31294,30936,27882,35431,30215,166490,40742,27854,34774,30147,172722,30803,194624,36108,29410,29553,35629,29442,29937,36075,150203,34351,24506,34976,17591,null,137275,159237,null,35454,140571,null,24829,30311,39639,40260,37742,39823,34805,null,34831,36087,29484,38689,39856,13782,29362,19463,31825,39242,155993,24921,19460,40598,24957,null,22367,24943,25254,25145,25294,14940,25058,21418,144373,25444,26626,13778,23895,166850,36826,167481,null,20697,138566,30982,21298,38456,134971,16485,null,30718,null,31938,155418,31962,31277,32870,32867,32077,29957,29938,35220,33306,26380,32866,160902,32859,29936,33027,30500,35209,157644,30035,159441,34729,34766,33224,34700,35401,36013,35651,30507,29944,34010,13877,27058,36262,null,35241,29800,28089,34753,147473,29927,15835,29046,24740,24988,15569,29026,24695,null,32625,166701,29264,24809,19326,21024,15384,146631,155351,161366,152881,137540,135934,170243,159196,159917,23745,156077,166415,145015,131310,157766,151310,17762,23327,156492,40784,40614,156267,12288,65292,12289,12290,65294,8231,65307,65306,65311,65281,65072,8230,8229,65104,65105,65106,183,65108,65109,65110,65111,65372,8211,65073,8212,65075,9588,65076,65103,65288,65289,65077,65078,65371,65373,65079,65080,12308,12309,65081,65082,12304,12305,65083,65084,12298,12299,65085,65086,12296,12297,65087,65088,12300,12301,65089,65090,12302,12303,65091,65092,65113,65114,65115,65116,65117,65118,8216,8217,8220,8221,12317,12318,8245,8242,65283,65286,65290,8251,167,12291,9675,9679,9651,9650,9678,9734,9733,9671,9670,9633,9632,9661,9660,12963,8453,175,65507,65343,717,65097,65098,65101,65102,65099,65100,65119,65120,65121,65291,65293,215,247,177,8730,65308,65310,65309,8806,8807,8800,8734,8786,8801,65122,65123,65124,65125,65126,65374,8745,8746,8869,8736,8735,8895,13266,13265,8747,8750,8757,8756,9792,9794,8853,8857,8593,8595,8592,8594,8598,8599,8601,8600,8741,8739,65295,65340,8725,65128,65284,65509,12306,65504,65505,65285,65312,8451,8457,65129,65130,65131,13269,13212,13213,13214,13262,13217,13198,13199,13252,176,20825,20827,20830,20829,20833,20835,21991,29929,31950,9601,9602,9603,9604,9605,9606,9607,9608,9615,9614,9613,9612,9611,9610,9609,9532,9524,9516,9508,9500,9620,9472,9474,9621,9484,9488,9492,9496,9581,9582,9584,9583,9552,9566,9578,9569,9698,9699,9701,9700,9585,9586,9587,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,12321,12322,12323,12324,12325,12326,12327,12328,12329,21313,21316,21317,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,729,713,714,711,715,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9249,8364,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19968,20057,19969,19971,20035,20061,20102,20108,20154,20799,20837,20843,20960,20992,20993,21147,21269,21313,21340,21448,19977,19979,19976,19978,20011,20024,20961,20037,20040,20063,20062,20110,20129,20800,20995,21242,21315,21449,21475,22303,22763,22805,22823,22899,23376,23377,23379,23544,23567,23586,23608,23665,24029,24037,24049,24050,24051,24062,24178,24318,24331,24339,25165,19985,19984,19981,20013,20016,20025,20043,23609,20104,20113,20117,20114,20116,20130,20161,20160,20163,20166,20167,20173,20170,20171,20164,20803,20801,20839,20845,20846,20844,20887,20982,20998,20999,21000,21243,21246,21247,21270,21305,21320,21319,21317,21342,21380,21451,21450,21453,22764,22825,22827,22826,22829,23380,23569,23588,23610,23663,24052,24187,24319,24340,24341,24515,25096,25142,25163,25166,25903,25991,26007,26020,26041,26085,26352,26376,26408,27424,27490,27513,27595,27604,27611,27663,27700,28779,29226,29238,29243,29255,29273,29275,29356,29579,19993,19990,19989,19988,19992,20027,20045,20047,20046,20197,20184,20180,20181,20182,20183,20195,20196,20185,20190,20805,20804,20873,20874,20908,20985,20986,20984,21002,21152,21151,21253,21254,21271,21277,20191,21322,21321,21345,21344,21359,21358,21435,21487,21476,21491,21484,21486,21481,21480,21500,21496,21493,21483,21478,21482,21490,21489,21488,21477,21485,21499,22235,22234,22806,22830,22833,22900,22902,23381,23427,23612,24040,24039,24038,24066,24067,24179,24188,24321,24344,24343,24517,25098,25171,25172,25170,25169,26021,26086,26414,26412,26410,26411,26413,27491,27597,27665,27664,27704,27713,27712,27710,29359,29572,29577,29916,29926,29976,29983,29992,29993,30000,30001,30002,30003,30091,30333,30382,30399,30446,30683,30690,30707,31034,31166,31348,31435,19998,19999,20050,20051,20073,20121,20132,20134,20133,20223,20233,20249,20234,20245,20237,20240,20241,20239,20210,20214,20219,20208,20211,20221,20225,20235,20809,20807,20806,20808,20840,20849,20877,20912,21015,21009,21010,21006,21014,21155,21256,21281,21280,21360,21361,21513,21519,21516,21514,21520,21505,21515,21508,21521,21517,21512,21507,21518,21510,21522,22240,22238,22237,22323,22320,22312,22317,22316,22319,22313,22809,22810,22839,22840,22916,22904,22915,22909,22905,22914,22913,23383,23384,23431,23432,23429,23433,23546,23574,23673,24030,24070,24182,24180,24335,24347,24537,24534,25102,25100,25101,25104,25187,25179,25176,25910,26089,26088,26092,26093,26354,26355,26377,26429,26420,26417,26421,27425,27492,27515,27670,27741,27735,27737,27743,27744,27728,27733,27745,27739,27725,27726,28784,29279,29277,30334,31481,31859,31992,32566,32650,32701,32769,32771,32780,32786,32819,32895,32905,32907,32908,33251,33258,33267,33276,33292,33307,33311,33390,33394,33406,34411,34880,34892,34915,35199,38433,20018,20136,20301,20303,20295,20311,20318,20276,20315,20309,20272,20304,20305,20285,20282,20280,20291,20308,20284,20294,20323,20316,20320,20271,20302,20278,20313,20317,20296,20314,20812,20811,20813,20853,20918,20919,21029,21028,21033,21034,21032,21163,21161,21162,21164,21283,21363,21365,21533,21549,21534,21566,21542,21582,21543,21574,21571,21555,21576,21570,21531,21545,21578,21561,21563,21560,21550,21557,21558,21536,21564,21568,21553,21547,21535,21548,22250,22256,22244,22251,22346,22353,22336,22349,22343,22350,22334,22352,22351,22331,22767,22846,22941,22930,22952,22942,22947,22937,22934,22925,22948,22931,22922,22949,23389,23388,23386,23387,23436,23435,23439,23596,23616,23617,23615,23614,23696,23697,23700,23692,24043,24076,24207,24199,24202,24311,24324,24351,24420,24418,24439,24441,24536,24524,24535,24525,24561,24555,24568,24554,25106,25105,25220,25239,25238,25216,25206,25225,25197,25226,25212,25214,25209,25203,25234,25199,25240,25198,25237,25235,25233,25222,25913,25915,25912,26097,26356,26463,26446,26447,26448,26449,26460,26454,26462,26441,26438,26464,26451,26455,27493,27599,27714,27742,27801,27777,27784,27785,27781,27803,27754,27770,27792,27760,27788,27752,27798,27794,27773,27779,27762,27774,27764,27782,27766,27789,27796,27800,27778,28790,28796,28797,28792,29282,29281,29280,29380,29378,29590,29996,29995,30007,30008,30338,30447,30691,31169,31168,31167,31350,31995,32597,32918,32915,32925,32920,32923,32922,32946,33391,33426,33419,33421,35211,35282,35328,35895,35910,35925,35997,36196,36208,36275,36523,36554,36763,36784,36802,36806,36805,36804,24033,37009,37026,37034,37030,37027,37193,37318,37324,38450,38446,38449,38442,38444,20006,20054,20083,20107,20123,20126,20139,20140,20335,20381,20365,20339,20351,20332,20379,20363,20358,20355,20336,20341,20360,20329,20347,20374,20350,20367,20369,20346,20820,20818,20821,20841,20855,20854,20856,20925,20989,21051,21048,21047,21050,21040,21038,21046,21057,21182,21179,21330,21332,21331,21329,21350,21367,21368,21369,21462,21460,21463,21619,21621,21654,21624,21653,21632,21627,21623,21636,21650,21638,21628,21648,21617,21622,21644,21658,21602,21608,21643,21629,21646,22266,22403,22391,22378,22377,22369,22374,22372,22396,22812,22857,22855,22856,22852,22868,22974,22971,22996,22969,22958,22993,22982,22992,22989,22987,22995,22986,22959,22963,22994,22981,23391,23396,23395,23447,23450,23448,23452,23449,23451,23578,23624,23621,23622,23735,23713,23736,23721,23723,23729,23731,24088,24090,24086,24085,24091,24081,24184,24218,24215,24220,24213,24214,24310,24358,24359,24361,24448,24449,24447,24444,24541,24544,24573,24565,24575,24591,24596,24623,24629,24598,24618,24597,24609,24615,24617,24619,24603,25110,25109,25151,25150,25152,25215,25289,25292,25284,25279,25282,25273,25298,25307,25259,25299,25300,25291,25288,25256,25277,25276,25296,25305,25287,25293,25269,25306,25265,25304,25302,25303,25286,25260,25294,25918,26023,26044,26106,26132,26131,26124,26118,26114,26126,26112,26127,26133,26122,26119,26381,26379,26477,26507,26517,26481,26524,26483,26487,26503,26525,26519,26479,26480,26495,26505,26494,26512,26485,26522,26515,26492,26474,26482,27427,27494,27495,27519,27667,27675,27875,27880,27891,27825,27852,27877,27827,27837,27838,27836,27874,27819,27861,27859,27832,27844,27833,27841,27822,27863,27845,27889,27839,27835,27873,27867,27850,27820,27887,27868,27862,27872,28821,28814,28818,28810,28825,29228,29229,29240,29256,29287,29289,29376,29390,29401,29399,29392,29609,29608,29599,29611,29605,30013,30109,30105,30106,30340,30402,30450,30452,30693,30717,31038,31040,31041,31177,31176,31354,31353,31482,31998,32596,32652,32651,32773,32954,32933,32930,32945,32929,32939,32937,32948,32938,32943,33253,33278,33293,33459,33437,33433,33453,33469,33439,33465,33457,33452,33445,33455,33464,33443,33456,33470,33463,34382,34417,21021,34920,36555,36814,36820,36817,37045,37048,37041,37046,37319,37329,38263,38272,38428,38464,38463,38459,38468,38466,38585,38632,38738,38750,20127,20141,20142,20449,20405,20399,20415,20448,20433,20431,20445,20419,20406,20440,20447,20426,20439,20398,20432,20420,20418,20442,20430,20446,20407,20823,20882,20881,20896,21070,21059,21066,21069,21068,21067,21063,21191,21193,21187,21185,21261,21335,21371,21402,21467,21676,21696,21672,21710,21705,21688,21670,21683,21703,21698,21693,21674,21697,21700,21704,21679,21675,21681,21691,21673,21671,21695,22271,22402,22411,22432,22435,22434,22478,22446,22419,22869,22865,22863,22862,22864,23004,23000,23039,23011,23016,23043,23013,23018,23002,23014,23041,23035,23401,23459,23462,23460,23458,23461,23553,23630,23631,23629,23627,23769,23762,24055,24093,24101,24095,24189,24224,24230,24314,24328,24365,24421,24456,24453,24458,24459,24455,24460,24457,24594,24605,24608,24613,24590,24616,24653,24688,24680,24674,24646,24643,24684,24683,24682,24676,25153,25308,25366,25353,25340,25325,25345,25326,25341,25351,25329,25335,25327,25324,25342,25332,25361,25346,25919,25925,26027,26045,26082,26149,26157,26144,26151,26159,26143,26152,26161,26148,26359,26623,26579,26609,26580,26576,26604,26550,26543,26613,26601,26607,26564,26577,26548,26586,26597,26552,26575,26590,26611,26544,26585,26594,26589,26578,27498,27523,27526,27573,27602,27607,27679,27849,27915,27954,27946,27969,27941,27916,27953,27934,27927,27963,27965,27966,27958,27931,27893,27961,27943,27960,27945,27950,27957,27918,27947,28843,28858,28851,28844,28847,28845,28856,28846,28836,29232,29298,29295,29300,29417,29408,29409,29623,29642,29627,29618,29645,29632,29619,29978,29997,30031,30028,30030,30027,30123,30116,30117,30114,30115,30328,30342,30343,30344,30408,30406,30403,30405,30465,30457,30456,30473,30475,30462,30460,30471,30684,30722,30740,30732,30733,31046,31049,31048,31047,31161,31162,31185,31186,31179,31359,31361,31487,31485,31869,32002,32005,32000,32009,32007,32004,32006,32568,32654,32703,32772,32784,32781,32785,32822,32982,32997,32986,32963,32964,32972,32993,32987,32974,32990,32996,32989,33268,33314,33511,33539,33541,33507,33499,33510,33540,33509,33538,33545,33490,33495,33521,33537,33500,33492,33489,33502,33491,33503,33519,33542,34384,34425,34427,34426,34893,34923,35201,35284,35336,35330,35331,35998,36000,36212,36211,36276,36557,36556,36848,36838,36834,36842,36837,36845,36843,36836,36840,37066,37070,37057,37059,37195,37194,37325,38274,38480,38475,38476,38477,38754,38761,38859,38893,38899,38913,39080,39131,39135,39318,39321,20056,20147,20492,20493,20515,20463,20518,20517,20472,20521,20502,20486,20540,20511,20506,20498,20497,20474,20480,20500,20520,20465,20513,20491,20505,20504,20467,20462,20525,20522,20478,20523,20489,20860,20900,20901,20898,20941,20940,20934,20939,21078,21084,21076,21083,21085,21290,21375,21407,21405,21471,21736,21776,21761,21815,21756,21733,21746,21766,21754,21780,21737,21741,21729,21769,21742,21738,21734,21799,21767,21757,21775,22275,22276,22466,22484,22475,22467,22537,22799,22871,22872,22874,23057,23064,23068,23071,23067,23059,23020,23072,23075,23081,23077,23052,23049,23403,23640,23472,23475,23478,23476,23470,23477,23481,23480,23556,23633,23637,23632,23789,23805,23803,23786,23784,23792,23798,23809,23796,24046,24109,24107,24235,24237,24231,24369,24466,24465,24464,24665,24675,24677,24656,24661,24685,24681,24687,24708,24735,24730,24717,24724,24716,24709,24726,25159,25331,25352,25343,25422,25406,25391,25429,25410,25414,25423,25417,25402,25424,25405,25386,25387,25384,25421,25420,25928,25929,26009,26049,26053,26178,26185,26191,26179,26194,26188,26181,26177,26360,26388,26389,26391,26657,26680,26696,26694,26707,26681,26690,26708,26665,26803,26647,26700,26705,26685,26612,26704,26688,26684,26691,26666,26693,26643,26648,26689,27530,27529,27575,27683,27687,27688,27686,27684,27888,28010,28053,28040,28039,28006,28024,28023,27993,28051,28012,28041,28014,27994,28020,28009,28044,28042,28025,28037,28005,28052,28874,28888,28900,28889,28872,28879,29241,29305,29436,29433,29437,29432,29431,29574,29677,29705,29678,29664,29674,29662,30036,30045,30044,30042,30041,30142,30149,30151,30130,30131,30141,30140,30137,30146,30136,30347,30384,30410,30413,30414,30505,30495,30496,30504,30697,30768,30759,30776,30749,30772,30775,30757,30765,30752,30751,30770,31061,31056,31072,31071,31062,31070,31069,31063,31066,31204,31203,31207,31199,31206,31209,31192,31364,31368,31449,31494,31505,31881,32033,32023,32011,32010,32032,32034,32020,32016,32021,32026,32028,32013,32025,32027,32570,32607,32660,32709,32705,32774,32792,32789,32793,32791,32829,32831,33009,33026,33008,33029,33005,33012,33030,33016,33011,33032,33021,33034,33020,33007,33261,33260,33280,33296,33322,33323,33320,33324,33467,33579,33618,33620,33610,33592,33616,33609,33589,33588,33615,33586,33593,33590,33559,33600,33585,33576,33603,34388,34442,34474,34451,34468,34473,34444,34467,34460,34928,34935,34945,34946,34941,34937,35352,35344,35342,35340,35349,35338,35351,35347,35350,35343,35345,35912,35962,35961,36001,36002,36215,36524,36562,36564,36559,36785,36865,36870,36855,36864,36858,36852,36867,36861,36869,36856,37013,37089,37085,37090,37202,37197,37196,37336,37341,37335,37340,37337,38275,38498,38499,38497,38491,38493,38500,38488,38494,38587,39138,39340,39592,39640,39717,39730,39740,20094,20602,20605,20572,20551,20547,20556,20570,20553,20581,20598,20558,20565,20597,20596,20599,20559,20495,20591,20589,20828,20885,20976,21098,21103,21202,21209,21208,21205,21264,21263,21273,21311,21312,21310,21443,26364,21830,21866,21862,21828,21854,21857,21827,21834,21809,21846,21839,21845,21807,21860,21816,21806,21852,21804,21859,21811,21825,21847,22280,22283,22281,22495,22533,22538,22534,22496,22500,22522,22530,22581,22519,22521,22816,22882,23094,23105,23113,23142,23146,23104,23100,23138,23130,23110,23114,23408,23495,23493,23492,23490,23487,23494,23561,23560,23559,23648,23644,23645,23815,23814,23822,23835,23830,23842,23825,23849,23828,23833,23844,23847,23831,24034,24120,24118,24115,24119,24247,24248,24246,24245,24254,24373,24375,24407,24428,24425,24427,24471,24473,24478,24472,24481,24480,24476,24703,24739,24713,24736,24744,24779,24756,24806,24765,24773,24763,24757,24796,24764,24792,24789,24774,24799,24760,24794,24775,25114,25115,25160,25504,25511,25458,25494,25506,25509,25463,25447,25496,25514,25457,25513,25481,25475,25499,25451,25512,25476,25480,25497,25505,25516,25490,25487,25472,25467,25449,25448,25466,25949,25942,25937,25945,25943,21855,25935,25944,25941,25940,26012,26011,26028,26063,26059,26060,26062,26205,26202,26212,26216,26214,26206,26361,21207,26395,26753,26799,26786,26771,26805,26751,26742,26801,26791,26775,26800,26755,26820,26797,26758,26757,26772,26781,26792,26783,26785,26754,27442,27578,27627,27628,27691,28046,28092,28147,28121,28082,28129,28108,28132,28155,28154,28165,28103,28107,28079,28113,28078,28126,28153,28088,28151,28149,28101,28114,28186,28085,28122,28139,28120,28138,28145,28142,28136,28102,28100,28074,28140,28095,28134,28921,28937,28938,28925,28911,29245,29309,29313,29468,29467,29462,29459,29465,29575,29701,29706,29699,29702,29694,29709,29920,29942,29943,29980,29986,30053,30054,30050,30064,30095,30164,30165,30133,30154,30157,30350,30420,30418,30427,30519,30526,30524,30518,30520,30522,30827,30787,30798,31077,31080,31085,31227,31378,31381,31520,31528,31515,31532,31526,31513,31518,31534,31890,31895,31893,32070,32067,32113,32046,32057,32060,32064,32048,32051,32068,32047,32066,32050,32049,32573,32670,32666,32716,32718,32722,32796,32842,32838,33071,33046,33059,33067,33065,33072,33060,33282,33333,33335,33334,33337,33678,33694,33688,33656,33698,33686,33725,33707,33682,33674,33683,33673,33696,33655,33659,33660,33670,33703,34389,24426,34503,34496,34486,34500,34485,34502,34507,34481,34479,34505,34899,34974,34952,34987,34962,34966,34957,34955,35219,35215,35370,35357,35363,35365,35377,35373,35359,35355,35362,35913,35930,36009,36012,36011,36008,36010,36007,36199,36198,36286,36282,36571,36575,36889,36877,36890,36887,36899,36895,36893,36880,36885,36894,36896,36879,36898,36886,36891,36884,37096,37101,37117,37207,37326,37365,37350,37347,37351,37357,37353,38281,38506,38517,38515,38520,38512,38516,38518,38519,38508,38592,38634,38633,31456,31455,38914,38915,39770,40165,40565,40575,40613,40635,20642,20621,20613,20633,20625,20608,20630,20632,20634,26368,20977,21106,21108,21109,21097,21214,21213,21211,21338,21413,21883,21888,21927,21884,21898,21917,21912,21890,21916,21930,21908,21895,21899,21891,21939,21934,21919,21822,21938,21914,21947,21932,21937,21886,21897,21931,21913,22285,22575,22570,22580,22564,22576,22577,22561,22557,22560,22777,22778,22880,23159,23194,23167,23186,23195,23207,23411,23409,23506,23500,23507,23504,23562,23563,23601,23884,23888,23860,23879,24061,24133,24125,24128,24131,24190,24266,24257,24258,24260,24380,24429,24489,24490,24488,24785,24801,24754,24758,24800,24860,24867,24826,24853,24816,24827,24820,24936,24817,24846,24822,24841,24832,24850,25119,25161,25507,25484,25551,25536,25577,25545,25542,25549,25554,25571,25552,25569,25558,25581,25582,25462,25588,25578,25563,25682,25562,25593,25950,25958,25954,25955,26001,26000,26031,26222,26224,26228,26230,26223,26257,26234,26238,26231,26366,26367,26399,26397,26874,26837,26848,26840,26839,26885,26847,26869,26862,26855,26873,26834,26866,26851,26827,26829,26893,26898,26894,26825,26842,26990,26875,27454,27450,27453,27544,27542,27580,27631,27694,27695,27692,28207,28216,28244,28193,28210,28263,28234,28192,28197,28195,28187,28251,28248,28196,28246,28270,28205,28198,28271,28212,28237,28218,28204,28227,28189,28222,28363,28297,28185,28238,28259,28228,28274,28265,28255,28953,28954,28966,28976,28961,28982,29038,28956,29260,29316,29312,29494,29477,29492,29481,29754,29738,29747,29730,29733,29749,29750,29748,29743,29723,29734,29736,29989,29990,30059,30058,30178,30171,30179,30169,30168,30174,30176,30331,30332,30358,30355,30388,30428,30543,30701,30813,30828,30831,31245,31240,31243,31237,31232,31384,31383,31382,31461,31459,31561,31574,31558,31568,31570,31572,31565,31563,31567,31569,31903,31909,32094,32080,32104,32085,32043,32110,32114,32097,32102,32098,32112,32115,21892,32724,32725,32779,32850,32901,33109,33108,33099,33105,33102,33081,33094,33086,33100,33107,33140,33298,33308,33769,33795,33784,33805,33760,33733,33803,33729,33775,33777,33780,33879,33802,33776,33804,33740,33789,33778,33738,33848,33806,33796,33756,33799,33748,33759,34395,34527,34521,34541,34516,34523,34532,34512,34526,34903,35009,35010,34993,35203,35222,35387,35424,35413,35422,35388,35393,35412,35419,35408,35398,35380,35386,35382,35414,35937,35970,36015,36028,36019,36029,36033,36027,36032,36020,36023,36022,36031,36024,36234,36229,36225,36302,36317,36299,36314,36305,36300,36315,36294,36603,36600,36604,36764,36910,36917,36913,36920,36914,36918,37122,37109,37129,37118,37219,37221,37327,37396,37397,37411,37385,37406,37389,37392,37383,37393,38292,38287,38283,38289,38291,38290,38286,38538,38542,38539,38525,38533,38534,38541,38514,38532,38593,38597,38596,38598,38599,38639,38642,38860,38917,38918,38920,39143,39146,39151,39145,39154,39149,39342,39341,40643,40653,40657,20098,20653,20661,20658,20659,20677,20670,20652,20663,20667,20655,20679,21119,21111,21117,21215,21222,21220,21218,21219,21295,21983,21992,21971,21990,21966,21980,21959,21969,21987,21988,21999,21978,21985,21957,21958,21989,21961,22290,22291,22622,22609,22616,22615,22618,22612,22635,22604,22637,22602,22626,22610,22603,22887,23233,23241,23244,23230,23229,23228,23219,23234,23218,23913,23919,24140,24185,24265,24264,24338,24409,24492,24494,24858,24847,24904,24863,24819,24859,24825,24833,24840,24910,24908,24900,24909,24894,24884,24871,24845,24838,24887,25121,25122,25619,25662,25630,25642,25645,25661,25644,25615,25628,25620,25613,25654,25622,25623,25606,25964,26015,26032,26263,26249,26247,26248,26262,26244,26264,26253,26371,27028,26989,26970,26999,26976,26964,26997,26928,27010,26954,26984,26987,26974,26963,27001,27014,26973,26979,26971,27463,27506,27584,27583,27603,27645,28322,28335,28371,28342,28354,28304,28317,28359,28357,28325,28312,28348,28346,28331,28369,28310,28316,28356,28372,28330,28327,28340,29006,29017,29033,29028,29001,29031,29020,29036,29030,29004,29029,29022,28998,29032,29014,29242,29266,29495,29509,29503,29502,29807,29786,29781,29791,29790,29761,29759,29785,29787,29788,30070,30072,30208,30192,30209,30194,30193,30202,30207,30196,30195,30430,30431,30555,30571,30566,30558,30563,30585,30570,30572,30556,30565,30568,30562,30702,30862,30896,30871,30872,30860,30857,30844,30865,30867,30847,31098,31103,31105,33836,31165,31260,31258,31264,31252,31263,31262,31391,31392,31607,31680,31584,31598,31591,31921,31923,31925,32147,32121,32145,32129,32143,32091,32622,32617,32618,32626,32681,32680,32676,32854,32856,32902,32900,33137,33136,33144,33125,33134,33139,33131,33145,33146,33126,33285,33351,33922,33911,33853,33841,33909,33894,33899,33865,33900,33883,33852,33845,33889,33891,33897,33901,33862,34398,34396,34399,34553,34579,34568,34567,34560,34558,34555,34562,34563,34566,34570,34905,35039,35028,35033,35036,35032,35037,35041,35018,35029,35026,35228,35299,35435,35442,35443,35430,35433,35440,35463,35452,35427,35488,35441,35461,35437,35426,35438,35436,35449,35451,35390,35432,35938,35978,35977,36042,36039,36040,36036,36018,36035,36034,36037,36321,36319,36328,36335,36339,36346,36330,36324,36326,36530,36611,36617,36606,36618,36767,36786,36939,36938,36947,36930,36948,36924,36949,36944,36935,36943,36942,36941,36945,36926,36929,37138,37143,37228,37226,37225,37321,37431,37463,37432,37437,37440,37438,37467,37451,37476,37457,37428,37449,37453,37445,37433,37439,37466,38296,38552,38548,38549,38605,38603,38601,38602,38647,38651,38649,38646,38742,38772,38774,38928,38929,38931,38922,38930,38924,39164,39156,39165,39166,39347,39345,39348,39649,40169,40578,40718,40723,40736,20711,20718,20709,20694,20717,20698,20693,20687,20689,20721,20686,20713,20834,20979,21123,21122,21297,21421,22014,22016,22043,22039,22013,22036,22022,22025,22029,22030,22007,22038,22047,22024,22032,22006,22296,22294,22645,22654,22659,22675,22666,22649,22661,22653,22781,22821,22818,22820,22890,22889,23265,23270,23273,23255,23254,23256,23267,23413,23518,23527,23521,23525,23526,23528,23522,23524,23519,23565,23650,23940,23943,24155,24163,24149,24151,24148,24275,24278,24330,24390,24432,24505,24903,24895,24907,24951,24930,24931,24927,24922,24920,24949,25130,25735,25688,25684,25764,25720,25695,25722,25681,25703,25652,25709,25723,25970,26017,26071,26070,26274,26280,26269,27036,27048,27029,27073,27054,27091,27083,27035,27063,27067,27051,27060,27088,27085,27053,27084,27046,27075,27043,27465,27468,27699,28467,28436,28414,28435,28404,28457,28478,28448,28460,28431,28418,28450,28415,28399,28422,28465,28472,28466,28451,28437,28459,28463,28552,28458,28396,28417,28402,28364,28407,29076,29081,29053,29066,29060,29074,29246,29330,29334,29508,29520,29796,29795,29802,29808,29805,29956,30097,30247,30221,30219,30217,30227,30433,30435,30596,30589,30591,30561,30913,30879,30887,30899,30889,30883,31118,31119,31117,31278,31281,31402,31401,31469,31471,31649,31637,31627,31605,31639,31645,31636,31631,31672,31623,31620,31929,31933,31934,32187,32176,32156,32189,32190,32160,32202,32180,32178,32177,32186,32162,32191,32181,32184,32173,32210,32199,32172,32624,32736,32737,32735,32862,32858,32903,33104,33152,33167,33160,33162,33151,33154,33255,33274,33287,33300,33310,33355,33993,33983,33990,33988,33945,33950,33970,33948,33995,33976,33984,34003,33936,33980,34001,33994,34623,34588,34619,34594,34597,34612,34584,34645,34615,34601,35059,35074,35060,35065,35064,35069,35048,35098,35055,35494,35468,35486,35491,35469,35489,35475,35492,35498,35493,35496,35480,35473,35482,35495,35946,35981,35980,36051,36049,36050,36203,36249,36245,36348,36628,36626,36629,36627,36771,36960,36952,36956,36963,36953,36958,36962,36957,36955,37145,37144,37150,37237,37240,37239,37236,37496,37504,37509,37528,37526,37499,37523,37532,37544,37500,37521,38305,38312,38313,38307,38309,38308,38553,38556,38555,38604,38610,38656,38780,38789,38902,38935,38936,39087,39089,39171,39173,39180,39177,39361,39599,39600,39654,39745,39746,40180,40182,40179,40636,40763,40778,20740,20736,20731,20725,20729,20738,20744,20745,20741,20956,21127,21128,21129,21133,21130,21232,21426,22062,22075,22073,22066,22079,22068,22057,22099,22094,22103,22132,22070,22063,22064,22656,22687,22686,22707,22684,22702,22697,22694,22893,23305,23291,23307,23285,23308,23304,23534,23532,23529,23531,23652,23653,23965,23956,24162,24159,24161,24290,24282,24287,24285,24291,24288,24392,24433,24503,24501,24950,24935,24942,24925,24917,24962,24956,24944,24939,24958,24999,24976,25003,24974,25004,24986,24996,24980,25006,25134,25705,25711,25721,25758,25778,25736,25744,25776,25765,25747,25749,25769,25746,25774,25773,25771,25754,25772,25753,25762,25779,25973,25975,25976,26286,26283,26292,26289,27171,27167,27112,27137,27166,27161,27133,27169,27155,27146,27123,27138,27141,27117,27153,27472,27470,27556,27589,27590,28479,28540,28548,28497,28518,28500,28550,28525,28507,28536,28526,28558,28538,28528,28516,28567,28504,28373,28527,28512,28511,29087,29100,29105,29096,29270,29339,29518,29527,29801,29835,29827,29822,29824,30079,30240,30249,30239,30244,30246,30241,30242,30362,30394,30436,30606,30599,30604,30609,30603,30923,30917,30906,30922,30910,30933,30908,30928,31295,31292,31296,31293,31287,31291,31407,31406,31661,31665,31684,31668,31686,31687,31681,31648,31692,31946,32224,32244,32239,32251,32216,32236,32221,32232,32227,32218,32222,32233,32158,32217,32242,32249,32629,32631,32687,32745,32806,33179,33180,33181,33184,33178,33176,34071,34109,34074,34030,34092,34093,34067,34065,34083,34081,34068,34028,34085,34047,34054,34690,34676,34678,34656,34662,34680,34664,34649,34647,34636,34643,34907,34909,35088,35079,35090,35091,35093,35082,35516,35538,35527,35524,35477,35531,35576,35506,35529,35522,35519,35504,35542,35533,35510,35513,35547,35916,35918,35948,36064,36062,36070,36068,36076,36077,36066,36067,36060,36074,36065,36205,36255,36259,36395,36368,36381,36386,36367,36393,36383,36385,36382,36538,36637,36635,36639,36649,36646,36650,36636,36638,36645,36969,36974,36968,36973,36983,37168,37165,37159,37169,37255,37257,37259,37251,37573,37563,37559,37610,37548,37604,37569,37555,37564,37586,37575,37616,37554,38317,38321,38660,38662,38663,38665,38752,38797,38795,38799,38945,38955,38940,39091,39178,39187,39186,39192,39389,39376,39391,39387,39377,39381,39378,39385,39607,39662,39663,39719,39749,39748,39799,39791,40198,40201,40195,40617,40638,40654,22696,40786,20754,20760,20756,20752,20757,20864,20906,20957,21137,21139,21235,22105,22123,22137,22121,22116,22136,22122,22120,22117,22129,22127,22124,22114,22134,22721,22718,22727,22725,22894,23325,23348,23416,23536,23566,24394,25010,24977,25001,24970,25037,25014,25022,25034,25032,25136,25797,25793,25803,25787,25788,25818,25796,25799,25794,25805,25791,25810,25812,25790,25972,26310,26313,26297,26308,26311,26296,27197,27192,27194,27225,27243,27224,27193,27204,27234,27233,27211,27207,27189,27231,27208,27481,27511,27653,28610,28593,28577,28611,28580,28609,28583,28595,28608,28601,28598,28582,28576,28596,29118,29129,29136,29138,29128,29141,29113,29134,29145,29148,29123,29124,29544,29852,29859,29848,29855,29854,29922,29964,29965,30260,30264,30266,30439,30437,30624,30622,30623,30629,30952,30938,30956,30951,31142,31309,31310,31302,31308,31307,31418,31705,31761,31689,31716,31707,31713,31721,31718,31957,31958,32266,32273,32264,32283,32291,32286,32285,32265,32272,32633,32690,32752,32753,32750,32808,33203,33193,33192,33275,33288,33368,33369,34122,34137,34120,34152,34153,34115,34121,34157,34154,34142,34691,34719,34718,34722,34701,34913,35114,35122,35109,35115,35105,35242,35238,35558,35578,35563,35569,35584,35548,35559,35566,35582,35585,35586,35575,35565,35571,35574,35580,35947,35949,35987,36084,36420,36401,36404,36418,36409,36405,36667,36655,36664,36659,36776,36774,36981,36980,36984,36978,36988,36986,37172,37266,37664,37686,37624,37683,37679,37666,37628,37675,37636,37658,37648,37670,37665,37653,37678,37657,38331,38567,38568,38570,38613,38670,38673,38678,38669,38675,38671,38747,38748,38758,38808,38960,38968,38971,38967,38957,38969,38948,39184,39208,39198,39195,39201,39194,39405,39394,39409,39608,39612,39675,39661,39720,39825,40213,40227,40230,40232,40210,40219,40664,40660,40845,40860,20778,20767,20769,20786,21237,22158,22144,22160,22149,22151,22159,22741,22739,22737,22734,23344,23338,23332,23418,23607,23656,23996,23994,23997,23992,24171,24396,24509,25033,25026,25031,25062,25035,25138,25140,25806,25802,25816,25824,25840,25830,25836,25841,25826,25837,25986,25987,26329,26326,27264,27284,27268,27298,27292,27355,27299,27262,27287,27280,27296,27484,27566,27610,27656,28632,28657,28639,28640,28635,28644,28651,28655,28544,28652,28641,28649,28629,28654,28656,29159,29151,29166,29158,29157,29165,29164,29172,29152,29237,29254,29552,29554,29865,29872,29862,29864,30278,30274,30284,30442,30643,30634,30640,30636,30631,30637,30703,30967,30970,30964,30959,30977,31143,31146,31319,31423,31751,31757,31742,31735,31756,31712,31968,31964,31966,31970,31967,31961,31965,32302,32318,32326,32311,32306,32323,32299,32317,32305,32325,32321,32308,32313,32328,32309,32319,32303,32580,32755,32764,32881,32882,32880,32879,32883,33222,33219,33210,33218,33216,33215,33213,33225,33214,33256,33289,33393,34218,34180,34174,34204,34193,34196,34223,34203,34183,34216,34186,34407,34752,34769,34739,34770,34758,34731,34747,34746,34760,34763,35131,35126,35140,35128,35133,35244,35598,35607,35609,35611,35594,35616,35613,35588,35600,35905,35903,35955,36090,36093,36092,36088,36091,36264,36425,36427,36424,36426,36676,36670,36674,36677,36671,36991,36989,36996,36993,36994,36992,37177,37283,37278,37276,37709,37762,37672,37749,37706,37733,37707,37656,37758,37740,37723,37744,37722,37716,38346,38347,38348,38344,38342,38577,38584,38614,38684,38686,38816,38867,38982,39094,39221,39425,39423,39854,39851,39850,39853,40251,40255,40587,40655,40670,40668,40669,40667,40766,40779,21474,22165,22190,22745,22744,23352,24413,25059,25139,25844,25842,25854,25862,25850,25851,25847,26039,26332,26406,27315,27308,27331,27323,27320,27330,27310,27311,27487,27512,27567,28681,28683,28670,28678,28666,28689,28687,29179,29180,29182,29176,29559,29557,29863,29887,29973,30294,30296,30290,30653,30655,30651,30652,30990,31150,31329,31330,31328,31428,31429,31787,31783,31786,31774,31779,31777,31975,32340,32341,32350,32346,32353,32338,32345,32584,32761,32763,32887,32886,33229,33231,33290,34255,34217,34253,34256,34249,34224,34234,34233,34214,34799,34796,34802,34784,35206,35250,35316,35624,35641,35628,35627,35920,36101,36441,36451,36454,36452,36447,36437,36544,36681,36685,36999,36995,37000,37291,37292,37328,37780,37770,37782,37794,37811,37806,37804,37808,37784,37786,37783,38356,38358,38352,38357,38626,38620,38617,38619,38622,38692,38819,38822,38829,38905,38989,38991,38988,38990,38995,39098,39230,39231,39229,39214,39333,39438,39617,39683,39686,39759,39758,39757,39882,39881,39933,39880,39872,40273,40285,40288,40672,40725,40748,20787,22181,22750,22751,22754,23541,40848,24300,25074,25079,25078,25077,25856,25871,26336,26333,27365,27357,27354,27347,28699,28703,28712,28698,28701,28693,28696,29190,29197,29272,29346,29560,29562,29885,29898,29923,30087,30086,30303,30305,30663,31001,31153,31339,31337,31806,31807,31800,31805,31799,31808,32363,32365,32377,32361,32362,32645,32371,32694,32697,32696,33240,34281,34269,34282,34261,34276,34277,34295,34811,34821,34829,34809,34814,35168,35167,35158,35166,35649,35676,35672,35657,35674,35662,35663,35654,35673,36104,36106,36476,36466,36487,36470,36460,36474,36468,36692,36686,36781,37002,37003,37297,37294,37857,37841,37855,37827,37832,37852,37853,37846,37858,37837,37848,37860,37847,37864,38364,38580,38627,38698,38695,38753,38876,38907,39006,39000,39003,39100,39237,39241,39446,39449,39693,39912,39911,39894,39899,40329,40289,40306,40298,40300,40594,40599,40595,40628,21240,22184,22199,22198,22196,22204,22756,23360,23363,23421,23542,24009,25080,25082,25880,25876,25881,26342,26407,27372,28734,28720,28722,29200,29563,29903,30306,30309,31014,31018,31020,31019,31431,31478,31820,31811,31821,31983,31984,36782,32381,32380,32386,32588,32768,33242,33382,34299,34297,34321,34298,34310,34315,34311,34314,34836,34837,35172,35258,35320,35696,35692,35686,35695,35679,35691,36111,36109,36489,36481,36485,36482,37300,37323,37912,37891,37885,38369,38704,39108,39250,39249,39336,39467,39472,39479,39477,39955,39949,40569,40629,40680,40751,40799,40803,40801,20791,20792,22209,22208,22210,22804,23660,24013,25084,25086,25885,25884,26005,26345,27387,27396,27386,27570,28748,29211,29351,29910,29908,30313,30675,31824,32399,32396,32700,34327,34349,34330,34851,34850,34849,34847,35178,35180,35261,35700,35703,35709,36115,36490,36493,36491,36703,36783,37306,37934,37939,37941,37946,37944,37938,37931,38370,38712,38713,38706,38911,39015,39013,39255,39493,39491,39488,39486,39631,39764,39761,39981,39973,40367,40372,40386,40376,40605,40687,40729,40796,40806,40807,20796,20795,22216,22218,22217,23423,24020,24018,24398,25087,25892,27402,27489,28753,28760,29568,29924,30090,30318,30316,31155,31840,31839,32894,32893,33247,35186,35183,35324,35712,36118,36119,36497,36499,36705,37192,37956,37969,37970,38717,38718,38851,38849,39019,39253,39509,39501,39634,39706,40009,39985,39998,39995,40403,40407,40756,40812,40810,40852,22220,24022,25088,25891,25899,25898,26348,27408,29914,31434,31844,31843,31845,32403,32406,32404,33250,34360,34367,34865,35722,37008,37007,37987,37984,37988,38760,39023,39260,39514,39515,39511,39635,39636,39633,40020,40023,40022,40421,40607,40692,22225,22761,25900,28766,30321,30322,30679,32592,32648,34870,34873,34914,35731,35730,35734,33399,36123,37312,37994,38722,38728,38724,38854,39024,39519,39714,39768,40031,40441,40442,40572,40573,40711,40823,40818,24307,27414,28771,31852,31854,34875,35264,36513,37313,38002,38000,39025,39262,39638,39715,40652,28772,30682,35738,38007,38857,39522,39525,32412,35740,36522,37317,38013,38014,38012,40055,40056,40695,35924,38015,40474,29224,39530,39729,40475,40478,31858,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,20022,20031,20101,20128,20866,20886,20907,21241,21304,21353,21430,22794,23424,24027,12083,24191,24308,24400,24417,25908,26080,30098,30326,36789,38582,168,710,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,65339,65341,10045,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8679,8632,8633,12751,131276,20058,131210,20994,17553,40880,20872,40881,161287,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65506,65508,65287,65282,12849,8470,8481,12443,12444,11904,11908,11910,11911,11912,11914,11916,11917,11925,11932,11933,11941,11943,11946,11948,11950,11958,11964,11966,11974,11978,11980,11981,11983,11990,11991,11998,12003,null,null,null,643,592,603,596,629,339,248,331,650,618,20034,20060,20981,21274,21378,19975,19980,20039,20109,22231,64012,23662,24435,19983,20871,19982,20014,20115,20162,20169,20168,20888,21244,21356,21433,22304,22787,22828,23568,24063,26081,27571,27596,27668,29247,20017,20028,20200,20188,20201,20193,20189,20186,21004,21276,21324,22306,22307,22807,22831,23425,23428,23570,23611,23668,23667,24068,24192,24194,24521,25097,25168,27669,27702,27715,27711,27707,29358,29360,29578,31160,32906,38430,20238,20248,20268,20213,20244,20209,20224,20215,20232,20253,20226,20229,20258,20243,20228,20212,20242,20913,21011,21001,21008,21158,21282,21279,21325,21386,21511,22241,22239,22318,22314,22324,22844,22912,22908,22917,22907,22910,22903,22911,23382,23573,23589,23676,23674,23675,23678,24031,24181,24196,24322,24346,24436,24533,24532,24527,25180,25182,25188,25185,25190,25186,25177,25184,25178,25189,26095,26094,26430,26425,26424,26427,26426,26431,26428,26419,27672,27718,27730,27740,27727,27722,27732,27723,27724,28785,29278,29364,29365,29582,29994,30335,31349,32593,33400,33404,33408,33405,33407,34381,35198,37017,37015,37016,37019,37012,38434,38436,38432,38435,20310,20283,20322,20297,20307,20324,20286,20327,20306,20319,20289,20312,20269,20275,20287,20321,20879,20921,21020,21022,21025,21165,21166,21257,21347,21362,21390,21391,21552,21559,21546,21588,21573,21529,21532,21541,21528,21565,21583,21569,21544,21540,21575,22254,22247,22245,22337,22341,22348,22345,22347,22354,22790,22848,22950,22936,22944,22935,22926,22946,22928,22927,22951,22945,23438,23442,23592,23594,23693,23695,23688,23691,23689,23698,23690,23686,23699,23701,24032,24074,24078,24203,24201,24204,24200,24205,24325,24349,24440,24438,24530,24529,24528,24557,24552,24558,24563,24545,24548,24547,24570,24559,24567,24571,24576,24564,25146,25219,25228,25230,25231,25236,25223,25201,25211,25210,25200,25217,25224,25207,25213,25202,25204,25911,26096,26100,26099,26098,26101,26437,26439,26457,26453,26444,26440,26461,26445,26458,26443,27600,27673,27674,27768,27751,27755,27780,27787,27791,27761,27759,27753,27802,27757,27783,27797,27804,27750,27763,27749,27771,27790,28788,28794,29283,29375,29373,29379,29382,29377,29370,29381,29589,29591,29587,29588,29586,30010,30009,30100,30101,30337,31037,32820,32917,32921,32912,32914,32924,33424,33423,33413,33422,33425,33427,33418,33411,33412,35960,36809,36799,37023,37025,37029,37022,37031,37024,38448,38440,38447,38445,20019,20376,20348,20357,20349,20352,20359,20342,20340,20361,20356,20343,20300,20375,20330,20378,20345,20353,20344,20368,20380,20372,20382,20370,20354,20373,20331,20334,20894,20924,20926,21045,21042,21043,21062,21041,21180,21258,21259,21308,21394,21396,21639,21631,21633,21649,21634,21640,21611,21626,21630,21605,21612,21620,21606,21645,21615,21601,21600,21656,21603,21607,21604,22263,22265,22383,22386,22381,22379,22385,22384,22390,22400,22389,22395,22387,22388,22370,22376,22397,22796,22853,22965,22970,22991,22990,22962,22988,22977,22966,22972,22979,22998,22961,22973,22976,22984,22964,22983,23394,23397,23443,23445,23620,23623,23726,23716,23712,23733,23727,23720,23724,23711,23715,23725,23714,23722,23719,23709,23717,23734,23728,23718,24087,24084,24089,24360,24354,24355,24356,24404,24450,24446,24445,24542,24549,24621,24614,24601,24626,24587,24628,24586,24599,24627,24602,24606,24620,24610,24589,24592,24622,24595,24593,24588,24585,24604,25108,25149,25261,25268,25297,25278,25258,25270,25290,25262,25267,25263,25275,25257,25264,25272,25917,26024,26043,26121,26108,26116,26130,26120,26107,26115,26123,26125,26117,26109,26129,26128,26358,26378,26501,26476,26510,26514,26486,26491,26520,26502,26500,26484,26509,26508,26490,26527,26513,26521,26499,26493,26497,26488,26489,26516,27429,27520,27518,27614,27677,27795,27884,27883,27886,27865,27830,27860,27821,27879,27831,27856,27842,27834,27843,27846,27885,27890,27858,27869,27828,27786,27805,27776,27870,27840,27952,27853,27847,27824,27897,27855,27881,27857,28820,28824,28805,28819,28806,28804,28817,28822,28802,28826,28803,29290,29398,29387,29400,29385,29404,29394,29396,29402,29388,29393,29604,29601,29613,29606,29602,29600,29612,29597,29917,29928,30015,30016,30014,30092,30104,30383,30451,30449,30448,30453,30712,30716,30713,30715,30714,30711,31042,31039,31173,31352,31355,31483,31861,31997,32821,32911,32942,32931,32952,32949,32941,33312,33440,33472,33451,33434,33432,33435,33461,33447,33454,33468,33438,33466,33460,33448,33441,33449,33474,33444,33475,33462,33442,34416,34415,34413,34414,35926,36818,36811,36819,36813,36822,36821,36823,37042,37044,37039,37043,37040,38457,38461,38460,38458,38467,20429,20421,20435,20402,20425,20427,20417,20436,20444,20441,20411,20403,20443,20423,20438,20410,20416,20409,20460,21060,21065,21184,21186,21309,21372,21399,21398,21401,21400,21690,21665,21677,21669,21711,21699,33549,21687,21678,21718,21686,21701,21702,21664,21616,21692,21666,21694,21618,21726,21680,22453,22430,22431,22436,22412,22423,22429,22427,22420,22424,22415,22425,22437,22426,22421,22772,22797,22867,23009,23006,23022,23040,23025,23005,23034,23037,23036,23030,23012,23026,23031,23003,23017,23027,23029,23008,23038,23028,23021,23464,23628,23760,23768,23756,23767,23755,23771,23774,23770,23753,23751,23754,23766,23763,23764,23759,23752,23750,23758,23775,23800,24057,24097,24098,24099,24096,24100,24240,24228,24226,24219,24227,24229,24327,24366,24406,24454,24631,24633,24660,24690,24670,24645,24659,24647,24649,24667,24652,24640,24642,24671,24612,24644,24664,24678,24686,25154,25155,25295,25357,25355,25333,25358,25347,25323,25337,25359,25356,25336,25334,25344,25363,25364,25338,25365,25339,25328,25921,25923,26026,26047,26166,26145,26162,26165,26140,26150,26146,26163,26155,26170,26141,26164,26169,26158,26383,26384,26561,26610,26568,26554,26588,26555,26616,26584,26560,26551,26565,26603,26596,26591,26549,26573,26547,26615,26614,26606,26595,26562,26553,26574,26599,26608,26546,26620,26566,26605,26572,26542,26598,26587,26618,26569,26570,26563,26602,26571,27432,27522,27524,27574,27606,27608,27616,27680,27681,27944,27956,27949,27935,27964,27967,27922,27914,27866,27955,27908,27929,27962,27930,27921,27904,27933,27970,27905,27928,27959,27907,27919,27968,27911,27936,27948,27912,27938,27913,27920,28855,28831,28862,28849,28848,28833,28852,28853,28841,29249,29257,29258,29292,29296,29299,29294,29386,29412,29416,29419,29407,29418,29414,29411,29573,29644,29634,29640,29637,29625,29622,29621,29620,29675,29631,29639,29630,29635,29638,29624,29643,29932,29934,29998,30023,30024,30119,30122,30329,30404,30472,30467,30468,30469,30474,30455,30459,30458,30695,30696,30726,30737,30738,30725,30736,30735,30734,30729,30723,30739,31050,31052,31051,31045,31044,31189,31181,31183,31190,31182,31360,31358,31441,31488,31489,31866,31864,31865,31871,31872,31873,32003,32008,32001,32600,32657,32653,32702,32775,32782,32783,32788,32823,32984,32967,32992,32977,32968,32962,32976,32965,32995,32985,32988,32970,32981,32969,32975,32983,32998,32973,33279,33313,33428,33497,33534,33529,33543,33512,33536,33493,33594,33515,33494,33524,33516,33505,33522,33525,33548,33531,33526,33520,33514,33508,33504,33530,33523,33517,34423,34420,34428,34419,34881,34894,34919,34922,34921,35283,35332,35335,36210,36835,36833,36846,36832,37105,37053,37055,37077,37061,37054,37063,37067,37064,37332,37331,38484,38479,38481,38483,38474,38478,20510,20485,20487,20499,20514,20528,20507,20469,20468,20531,20535,20524,20470,20471,20503,20508,20512,20519,20533,20527,20529,20494,20826,20884,20883,20938,20932,20933,20936,20942,21089,21082,21074,21086,21087,21077,21090,21197,21262,21406,21798,21730,21783,21778,21735,21747,21732,21786,21759,21764,21768,21739,21777,21765,21745,21770,21755,21751,21752,21728,21774,21763,21771,22273,22274,22476,22578,22485,22482,22458,22470,22461,22460,22456,22454,22463,22471,22480,22457,22465,22798,22858,23065,23062,23085,23086,23061,23055,23063,23050,23070,23091,23404,23463,23469,23468,23555,23638,23636,23788,23807,23790,23793,23799,23808,23801,24105,24104,24232,24238,24234,24236,24371,24368,24423,24669,24666,24679,24641,24738,24712,24704,24722,24705,24733,24707,24725,24731,24727,24711,24732,24718,25113,25158,25330,25360,25430,25388,25412,25413,25398,25411,25572,25401,25419,25418,25404,25385,25409,25396,25432,25428,25433,25389,25415,25395,25434,25425,25400,25431,25408,25416,25930,25926,26054,26051,26052,26050,26186,26207,26183,26193,26386,26387,26655,26650,26697,26674,26675,26683,26699,26703,26646,26673,26652,26677,26667,26669,26671,26702,26692,26676,26653,26642,26644,26662,26664,26670,26701,26682,26661,26656,27436,27439,27437,27441,27444,27501,32898,27528,27622,27620,27624,27619,27618,27623,27685,28026,28003,28004,28022,27917,28001,28050,27992,28002,28013,28015,28049,28045,28143,28031,28038,27998,28007,28000,28055,28016,28028,27999,28034,28056,27951,28008,28043,28030,28032,28036,27926,28035,28027,28029,28021,28048,28892,28883,28881,28893,28875,32569,28898,28887,28882,28894,28896,28884,28877,28869,28870,28871,28890,28878,28897,29250,29304,29303,29302,29440,29434,29428,29438,29430,29427,29435,29441,29651,29657,29669,29654,29628,29671,29667,29673,29660,29650,29659,29652,29661,29658,29655,29656,29672,29918,29919,29940,29941,29985,30043,30047,30128,30145,30139,30148,30144,30143,30134,30138,30346,30409,30493,30491,30480,30483,30482,30499,30481,30485,30489,30490,30498,30503,30755,30764,30754,30773,30767,30760,30766,30763,30753,30761,30771,30762,30769,31060,31067,31055,31068,31059,31058,31057,31211,31212,31200,31214,31213,31210,31196,31198,31197,31366,31369,31365,31371,31372,31370,31367,31448,31504,31492,31507,31493,31503,31496,31498,31502,31497,31506,31876,31889,31882,31884,31880,31885,31877,32030,32029,32017,32014,32024,32022,32019,32031,32018,32015,32012,32604,32609,32606,32608,32605,32603,32662,32658,32707,32706,32704,32790,32830,32825,33018,33010,33017,33013,33025,33019,33024,33281,33327,33317,33587,33581,33604,33561,33617,33573,33622,33599,33601,33574,33564,33570,33602,33614,33563,33578,33544,33596,33613,33558,33572,33568,33591,33583,33577,33607,33605,33612,33619,33566,33580,33611,33575,33608,34387,34386,34466,34472,34454,34445,34449,34462,34439,34455,34438,34443,34458,34437,34469,34457,34465,34471,34453,34456,34446,34461,34448,34452,34883,34884,34925,34933,34934,34930,34944,34929,34943,34927,34947,34942,34932,34940,35346,35911,35927,35963,36004,36003,36214,36216,36277,36279,36278,36561,36563,36862,36853,36866,36863,36859,36868,36860,36854,37078,37088,37081,37082,37091,37087,37093,37080,37083,37079,37084,37092,37200,37198,37199,37333,37346,37338,38492,38495,38588,39139,39647,39727,20095,20592,20586,20577,20574,20576,20563,20555,20573,20594,20552,20557,20545,20571,20554,20578,20501,20549,20575,20585,20587,20579,20580,20550,20544,20590,20595,20567,20561,20944,21099,21101,21100,21102,21206,21203,21293,21404,21877,21878,21820,21837,21840,21812,21802,21841,21858,21814,21813,21808,21842,21829,21772,21810,21861,21838,21817,21832,21805,21819,21824,21835,22282,22279,22523,22548,22498,22518,22492,22516,22528,22509,22525,22536,22520,22539,22515,22479,22535,22510,22499,22514,22501,22508,22497,22542,22524,22544,22503,22529,22540,22513,22505,22512,22541,22532,22876,23136,23128,23125,23143,23134,23096,23093,23149,23120,23135,23141,23148,23123,23140,23127,23107,23133,23122,23108,23131,23112,23182,23102,23117,23097,23116,23152,23145,23111,23121,23126,23106,23132,23410,23406,23489,23488,23641,23838,23819,23837,23834,23840,23820,23848,23821,23846,23845,23823,23856,23826,23843,23839,23854,24126,24116,24241,24244,24249,24242,24243,24374,24376,24475,24470,24479,24714,24720,24710,24766,24752,24762,24787,24788,24783,24804,24793,24797,24776,24753,24795,24759,24778,24767,24771,24781,24768,25394,25445,25482,25474,25469,25533,25502,25517,25501,25495,25515,25486,25455,25479,25488,25454,25519,25461,25500,25453,25518,25468,25508,25403,25503,25464,25477,25473,25489,25485,25456,25939,26061,26213,26209,26203,26201,26204,26210,26392,26745,26759,26768,26780,26733,26734,26798,26795,26966,26735,26787,26796,26793,26741,26740,26802,26767,26743,26770,26748,26731,26738,26794,26752,26737,26750,26779,26774,26763,26784,26761,26788,26744,26747,26769,26764,26762,26749,27446,27443,27447,27448,27537,27535,27533,27534,27532,27690,28096,28075,28084,28083,28276,28076,28137,28130,28087,28150,28116,28160,28104,28128,28127,28118,28094,28133,28124,28125,28123,28148,28106,28093,28141,28144,28090,28117,28098,28111,28105,28112,28146,28115,28157,28119,28109,28131,28091,28922,28941,28919,28951,28916,28940,28912,28932,28915,28944,28924,28927,28934,28947,28928,28920,28918,28939,28930,28942,29310,29307,29308,29311,29469,29463,29447,29457,29464,29450,29448,29439,29455,29470,29576,29686,29688,29685,29700,29697,29693,29703,29696,29690,29692,29695,29708,29707,29684,29704,30052,30051,30158,30162,30159,30155,30156,30161,30160,30351,30345,30419,30521,30511,30509,30513,30514,30516,30515,30525,30501,30523,30517,30792,30802,30793,30797,30794,30796,30758,30789,30800,31076,31079,31081,31082,31075,31083,31073,31163,31226,31224,31222,31223,31375,31380,31376,31541,31559,31540,31525,31536,31522,31524,31539,31512,31530,31517,31537,31531,31533,31535,31538,31544,31514,31523,31892,31896,31894,31907,32053,32061,32056,32054,32058,32069,32044,32041,32065,32071,32062,32063,32074,32059,32040,32611,32661,32668,32669,32667,32714,32715,32717,32720,32721,32711,32719,32713,32799,32798,32795,32839,32835,32840,33048,33061,33049,33051,33069,33055,33068,33054,33057,33045,33063,33053,33058,33297,33336,33331,33338,33332,33330,33396,33680,33699,33704,33677,33658,33651,33700,33652,33679,33665,33685,33689,33653,33684,33705,33661,33667,33676,33693,33691,33706,33675,33662,33701,33711,33672,33687,33712,33663,33702,33671,33710,33654,33690,34393,34390,34495,34487,34498,34497,34501,34490,34480,34504,34489,34483,34488,34508,34484,34491,34492,34499,34493,34494,34898,34953,34965,34984,34978,34986,34970,34961,34977,34975,34968,34983,34969,34971,34967,34980,34988,34956,34963,34958,35202,35286,35289,35285,35376,35367,35372,35358,35897,35899,35932,35933,35965,36005,36221,36219,36217,36284,36290,36281,36287,36289,36568,36574,36573,36572,36567,36576,36577,36900,36875,36881,36892,36876,36897,37103,37098,37104,37108,37106,37107,37076,37099,37100,37097,37206,37208,37210,37203,37205,37356,37364,37361,37363,37368,37348,37369,37354,37355,37367,37352,37358,38266,38278,38280,38524,38509,38507,38513,38511,38591,38762,38916,39141,39319,20635,20629,20628,20638,20619,20643,20611,20620,20622,20637,20584,20636,20626,20610,20615,20831,20948,21266,21265,21412,21415,21905,21928,21925,21933,21879,22085,21922,21907,21896,21903,21941,21889,21923,21906,21924,21885,21900,21926,21887,21909,21921,21902,22284,22569,22583,22553,22558,22567,22563,22568,22517,22600,22565,22556,22555,22579,22591,22582,22574,22585,22584,22573,22572,22587,22881,23215,23188,23199,23162,23202,23198,23160,23206,23164,23205,23212,23189,23214,23095,23172,23178,23191,23171,23179,23209,23163,23165,23180,23196,23183,23187,23197,23530,23501,23499,23508,23505,23498,23502,23564,23600,23863,23875,23915,23873,23883,23871,23861,23889,23886,23893,23859,23866,23890,23869,23857,23897,23874,23865,23881,23864,23868,23858,23862,23872,23877,24132,24129,24408,24486,24485,24491,24777,24761,24780,24802,24782,24772,24852,24818,24842,24854,24837,24821,24851,24824,24828,24830,24769,24835,24856,24861,24848,24831,24836,24843,25162,25492,25521,25520,25550,25573,25576,25583,25539,25757,25587,25546,25568,25590,25557,25586,25589,25697,25567,25534,25565,25564,25540,25560,25555,25538,25543,25548,25547,25544,25584,25559,25561,25906,25959,25962,25956,25948,25960,25957,25996,26013,26014,26030,26064,26066,26236,26220,26235,26240,26225,26233,26218,26226,26369,26892,26835,26884,26844,26922,26860,26858,26865,26895,26838,26871,26859,26852,26870,26899,26896,26867,26849,26887,26828,26888,26992,26804,26897,26863,26822,26900,26872,26832,26877,26876,26856,26891,26890,26903,26830,26824,26845,26846,26854,26868,26833,26886,26836,26857,26901,26917,26823,27449,27451,27455,27452,27540,27543,27545,27541,27581,27632,27634,27635,27696,28156,28230,28231,28191,28233,28296,28220,28221,28229,28258,28203,28223,28225,28253,28275,28188,28211,28235,28224,28241,28219,28163,28206,28254,28264,28252,28257,28209,28200,28256,28273,28267,28217,28194,28208,28243,28261,28199,28280,28260,28279,28245,28281,28242,28262,28213,28214,28250,28960,28958,28975,28923,28974,28977,28963,28965,28962,28978,28959,28968,28986,28955,29259,29274,29320,29321,29318,29317,29323,29458,29451,29488,29474,29489,29491,29479,29490,29485,29478,29475,29493,29452,29742,29740,29744,29739,29718,29722,29729,29741,29745,29732,29731,29725,29737,29728,29746,29947,29999,30063,30060,30183,30170,30177,30182,30173,30175,30180,30167,30357,30354,30426,30534,30535,30532,30541,30533,30538,30542,30539,30540,30686,30700,30816,30820,30821,30812,30829,30833,30826,30830,30832,30825,30824,30814,30818,31092,31091,31090,31088,31234,31242,31235,31244,31236,31385,31462,31460,31562,31547,31556,31560,31564,31566,31552,31576,31557,31906,31902,31912,31905,32088,32111,32099,32083,32086,32103,32106,32079,32109,32092,32107,32082,32084,32105,32081,32095,32078,32574,32575,32613,32614,32674,32672,32673,32727,32849,32847,32848,33022,32980,33091,33098,33106,33103,33095,33085,33101,33082,33254,33262,33271,33272,33273,33284,33340,33341,33343,33397,33595,33743,33785,33827,33728,33768,33810,33767,33764,33788,33782,33808,33734,33736,33771,33763,33727,33793,33757,33765,33752,33791,33761,33739,33742,33750,33781,33737,33801,33807,33758,33809,33798,33730,33779,33749,33786,33735,33745,33770,33811,33731,33772,33774,33732,33787,33751,33762,33819,33755,33790,34520,34530,34534,34515,34531,34522,34538,34525,34539,34524,34540,34537,34519,34536,34513,34888,34902,34901,35002,35031,35001,35000,35008,35006,34998,35004,34999,35005,34994,35073,35017,35221,35224,35223,35293,35290,35291,35406,35405,35385,35417,35392,35415,35416,35396,35397,35410,35400,35409,35402,35404,35407,35935,35969,35968,36026,36030,36016,36025,36021,36228,36224,36233,36312,36307,36301,36295,36310,36316,36303,36309,36313,36296,36311,36293,36591,36599,36602,36601,36582,36590,36581,36597,36583,36584,36598,36587,36593,36588,36596,36585,36909,36916,36911,37126,37164,37124,37119,37116,37128,37113,37115,37121,37120,37127,37125,37123,37217,37220,37215,37218,37216,37377,37386,37413,37379,37402,37414,37391,37388,37376,37394,37375,37373,37382,37380,37415,37378,37404,37412,37401,37399,37381,37398,38267,38285,38284,38288,38535,38526,38536,38537,38531,38528,38594,38600,38595,38641,38640,38764,38768,38766,38919,39081,39147,40166,40697,20099,20100,20150,20669,20671,20678,20654,20676,20682,20660,20680,20674,20656,20673,20666,20657,20683,20681,20662,20664,20951,21114,21112,21115,21116,21955,21979,21964,21968,21963,21962,21981,21952,21972,21956,21993,21951,21970,21901,21967,21973,21986,21974,21960,22002,21965,21977,21954,22292,22611,22632,22628,22607,22605,22601,22639,22613,22606,22621,22617,22629,22619,22589,22627,22641,22780,23239,23236,23243,23226,23224,23217,23221,23216,23231,23240,23227,23238,23223,23232,23242,23220,23222,23245,23225,23184,23510,23512,23513,23583,23603,23921,23907,23882,23909,23922,23916,23902,23912,23911,23906,24048,24143,24142,24138,24141,24139,24261,24268,24262,24267,24263,24384,24495,24493,24823,24905,24906,24875,24901,24886,24882,24878,24902,24879,24911,24873,24896,25120,37224,25123,25125,25124,25541,25585,25579,25616,25618,25609,25632,25636,25651,25667,25631,25621,25624,25657,25655,25634,25635,25612,25638,25648,25640,25665,25653,25647,25610,25626,25664,25637,25639,25611,25575,25627,25646,25633,25614,25967,26002,26067,26246,26252,26261,26256,26251,26250,26265,26260,26232,26400,26982,26975,26936,26958,26978,26993,26943,26949,26986,26937,26946,26967,26969,27002,26952,26953,26933,26988,26931,26941,26981,26864,27000,26932,26985,26944,26991,26948,26998,26968,26945,26996,26956,26939,26955,26935,26972,26959,26961,26930,26962,26927,27003,26940,27462,27461,27459,27458,27464,27457,27547,64013,27643,27644,27641,27639,27640,28315,28374,28360,28303,28352,28319,28307,28308,28320,28337,28345,28358,28370,28349,28353,28318,28361,28343,28336,28365,28326,28367,28338,28350,28355,28380,28376,28313,28306,28302,28301,28324,28321,28351,28339,28368,28362,28311,28334,28323,28999,29012,29010,29027,29024,28993,29021,29026,29042,29048,29034,29025,28994,29016,28995,29003,29040,29023,29008,29011,28996,29005,29018,29263,29325,29324,29329,29328,29326,29500,29506,29499,29498,29504,29514,29513,29764,29770,29771,29778,29777,29783,29760,29775,29776,29774,29762,29766,29773,29780,29921,29951,29950,29949,29981,30073,30071,27011,30191,30223,30211,30199,30206,30204,30201,30200,30224,30203,30198,30189,30197,30205,30361,30389,30429,30549,30559,30560,30546,30550,30554,30569,30567,30548,30553,30573,30688,30855,30874,30868,30863,30852,30869,30853,30854,30881,30851,30841,30873,30848,30870,30843,31100,31106,31101,31097,31249,31256,31257,31250,31255,31253,31266,31251,31259,31248,31395,31394,31390,31467,31590,31588,31597,31604,31593,31602,31589,31603,31601,31600,31585,31608,31606,31587,31922,31924,31919,32136,32134,32128,32141,32127,32133,32122,32142,32123,32131,32124,32140,32148,32132,32125,32146,32621,32619,32615,32616,32620,32678,32677,32679,32731,32732,32801,33124,33120,33143,33116,33129,33115,33122,33138,26401,33118,33142,33127,33135,33092,33121,33309,33353,33348,33344,33346,33349,34033,33855,33878,33910,33913,33935,33933,33893,33873,33856,33926,33895,33840,33869,33917,33882,33881,33908,33907,33885,34055,33886,33847,33850,33844,33914,33859,33912,33842,33861,33833,33753,33867,33839,33858,33837,33887,33904,33849,33870,33868,33874,33903,33989,33934,33851,33863,33846,33843,33896,33918,33860,33835,33888,33876,33902,33872,34571,34564,34551,34572,34554,34518,34549,34637,34552,34574,34569,34561,34550,34573,34565,35030,35019,35021,35022,35038,35035,35034,35020,35024,35205,35227,35295,35301,35300,35297,35296,35298,35292,35302,35446,35462,35455,35425,35391,35447,35458,35460,35445,35459,35457,35444,35450,35900,35915,35914,35941,35940,35942,35974,35972,35973,36044,36200,36201,36241,36236,36238,36239,36237,36243,36244,36240,36242,36336,36320,36332,36337,36334,36304,36329,36323,36322,36327,36338,36331,36340,36614,36607,36609,36608,36613,36615,36616,36610,36619,36946,36927,36932,36937,36925,37136,37133,37135,37137,37142,37140,37131,37134,37230,37231,37448,37458,37424,37434,37478,37427,37477,37470,37507,37422,37450,37446,37485,37484,37455,37472,37479,37487,37430,37473,37488,37425,37460,37475,37456,37490,37454,37459,37452,37462,37426,38303,38300,38302,38299,38546,38547,38545,38551,38606,38650,38653,38648,38645,38771,38775,38776,38770,38927,38925,38926,39084,39158,39161,39343,39346,39344,39349,39597,39595,39771,40170,40173,40167,40576,40701,20710,20692,20695,20712,20723,20699,20714,20701,20708,20691,20716,20720,20719,20707,20704,20952,21120,21121,21225,21227,21296,21420,22055,22037,22028,22034,22012,22031,22044,22017,22035,22018,22010,22045,22020,22015,22009,22665,22652,22672,22680,22662,22657,22655,22644,22667,22650,22663,22673,22670,22646,22658,22664,22651,22676,22671,22782,22891,23260,23278,23269,23253,23274,23258,23277,23275,23283,23266,23264,23259,23276,23262,23261,23257,23272,23263,23415,23520,23523,23651,23938,23936,23933,23942,23930,23937,23927,23946,23945,23944,23934,23932,23949,23929,23935,24152,24153,24147,24280,24273,24279,24270,24284,24277,24281,24274,24276,24388,24387,24431,24502,24876,24872,24897,24926,24945,24947,24914,24915,24946,24940,24960,24948,24916,24954,24923,24933,24891,24938,24929,24918,25129,25127,25131,25643,25677,25691,25693,25716,25718,25714,25715,25725,25717,25702,25766,25678,25730,25694,25692,25675,25683,25696,25680,25727,25663,25708,25707,25689,25701,25719,25971,26016,26273,26272,26271,26373,26372,26402,27057,27062,27081,27040,27086,27030,27056,27052,27068,27025,27033,27022,27047,27021,27049,27070,27055,27071,27076,27069,27044,27092,27065,27082,27034,27087,27059,27027,27050,27041,27038,27097,27031,27024,27074,27061,27045,27078,27466,27469,27467,27550,27551,27552,27587,27588,27646,28366,28405,28401,28419,28453,28408,28471,28411,28462,28425,28494,28441,28442,28455,28440,28475,28434,28397,28426,28470,28531,28409,28398,28461,28480,28464,28476,28469,28395,28423,28430,28483,28421,28413,28406,28473,28444,28412,28474,28447,28429,28446,28424,28449,29063,29072,29065,29056,29061,29058,29071,29051,29062,29057,29079,29252,29267,29335,29333,29331,29507,29517,29521,29516,29794,29811,29809,29813,29810,29799,29806,29952,29954,29955,30077,30096,30230,30216,30220,30229,30225,30218,30228,30392,30593,30588,30597,30594,30574,30592,30575,30590,30595,30898,30890,30900,30893,30888,30846,30891,30878,30885,30880,30892,30882,30884,31128,31114,31115,31126,31125,31124,31123,31127,31112,31122,31120,31275,31306,31280,31279,31272,31270,31400,31403,31404,31470,31624,31644,31626,31633,31632,31638,31629,31628,31643,31630,31621,31640,21124,31641,31652,31618,31931,31935,31932,31930,32167,32183,32194,32163,32170,32193,32192,32197,32157,32206,32196,32198,32203,32204,32175,32185,32150,32188,32159,32166,32174,32169,32161,32201,32627,32738,32739,32741,32734,32804,32861,32860,33161,33158,33155,33159,33165,33164,33163,33301,33943,33956,33953,33951,33978,33998,33986,33964,33966,33963,33977,33972,33985,33997,33962,33946,33969,34000,33949,33959,33979,33954,33940,33991,33996,33947,33961,33967,33960,34006,33944,33974,33999,33952,34007,34004,34002,34011,33968,33937,34401,34611,34595,34600,34667,34624,34606,34590,34593,34585,34587,34627,34604,34625,34622,34630,34592,34610,34602,34605,34620,34578,34618,34609,34613,34626,34598,34599,34616,34596,34586,34608,34577,35063,35047,35057,35058,35066,35070,35054,35068,35062,35067,35056,35052,35051,35229,35233,35231,35230,35305,35307,35304,35499,35481,35467,35474,35471,35478,35901,35944,35945,36053,36047,36055,36246,36361,36354,36351,36365,36349,36362,36355,36359,36358,36357,36350,36352,36356,36624,36625,36622,36621,37155,37148,37152,37154,37151,37149,37146,37156,37153,37147,37242,37234,37241,37235,37541,37540,37494,37531,37498,37536,37524,37546,37517,37542,37530,37547,37497,37527,37503,37539,37614,37518,37506,37525,37538,37501,37512,37537,37514,37510,37516,37529,37543,37502,37511,37545,37533,37515,37421,38558,38561,38655,38744,38781,38778,38782,38787,38784,38786,38779,38788,38785,38783,38862,38861,38934,39085,39086,39170,39168,39175,39325,39324,39363,39353,39355,39354,39362,39357,39367,39601,39651,39655,39742,39743,39776,39777,39775,40177,40178,40181,40615,20735,20739,20784,20728,20742,20743,20726,20734,20747,20748,20733,20746,21131,21132,21233,21231,22088,22082,22092,22069,22081,22090,22089,22086,22104,22106,22080,22067,22077,22060,22078,22072,22058,22074,22298,22699,22685,22705,22688,22691,22703,22700,22693,22689,22783,23295,23284,23293,23287,23286,23299,23288,23298,23289,23297,23303,23301,23311,23655,23961,23959,23967,23954,23970,23955,23957,23968,23964,23969,23962,23966,24169,24157,24160,24156,32243,24283,24286,24289,24393,24498,24971,24963,24953,25009,25008,24994,24969,24987,24979,25007,25005,24991,24978,25002,24993,24973,24934,25011,25133,25710,25712,25750,25760,25733,25751,25756,25743,25739,25738,25740,25763,25759,25704,25777,25752,25974,25978,25977,25979,26034,26035,26293,26288,26281,26290,26295,26282,26287,27136,27142,27159,27109,27128,27157,27121,27108,27168,27135,27116,27106,27163,27165,27134,27175,27122,27118,27156,27127,27111,27200,27144,27110,27131,27149,27132,27115,27145,27140,27160,27173,27151,27126,27174,27143,27124,27158,27473,27557,27555,27554,27558,27649,27648,27647,27650,28481,28454,28542,28551,28614,28562,28557,28553,28556,28514,28495,28549,28506,28566,28534,28524,28546,28501,28530,28498,28496,28503,28564,28563,28509,28416,28513,28523,28541,28519,28560,28499,28555,28521,28543,28565,28515,28535,28522,28539,29106,29103,29083,29104,29088,29082,29097,29109,29085,29093,29086,29092,29089,29098,29084,29095,29107,29336,29338,29528,29522,29534,29535,29536,29533,29531,29537,29530,29529,29538,29831,29833,29834,29830,29825,29821,29829,29832,29820,29817,29960,29959,30078,30245,30238,30233,30237,30236,30243,30234,30248,30235,30364,30365,30366,30363,30605,30607,30601,30600,30925,30907,30927,30924,30929,30926,30932,30920,30915,30916,30921,31130,31137,31136,31132,31138,31131,27510,31289,31410,31412,31411,31671,31691,31678,31660,31694,31663,31673,31690,31669,31941,31944,31948,31947,32247,32219,32234,32231,32215,32225,32259,32250,32230,32246,32241,32240,32238,32223,32630,32684,32688,32685,32749,32747,32746,32748,32742,32744,32868,32871,33187,33183,33182,33173,33186,33177,33175,33302,33359,33363,33362,33360,33358,33361,34084,34107,34063,34048,34089,34062,34057,34061,34079,34058,34087,34076,34043,34091,34042,34056,34060,34036,34090,34034,34069,34039,34027,34035,34044,34066,34026,34025,34070,34046,34088,34077,34094,34050,34045,34078,34038,34097,34086,34023,34024,34032,34031,34041,34072,34080,34096,34059,34073,34095,34402,34646,34659,34660,34679,34785,34675,34648,34644,34651,34642,34657,34650,34641,34654,34669,34666,34640,34638,34655,34653,34671,34668,34682,34670,34652,34661,34639,34683,34677,34658,34663,34665,34906,35077,35084,35092,35083,35095,35096,35097,35078,35094,35089,35086,35081,35234,35236,35235,35309,35312,35308,35535,35526,35512,35539,35537,35540,35541,35515,35543,35518,35520,35525,35544,35523,35514,35517,35545,35902,35917,35983,36069,36063,36057,36072,36058,36061,36071,36256,36252,36257,36251,36384,36387,36389,36388,36398,36373,36379,36374,36369,36377,36390,36391,36372,36370,36376,36371,36380,36375,36378,36652,36644,36632,36634,36640,36643,36630,36631,36979,36976,36975,36967,36971,37167,37163,37161,37162,37170,37158,37166,37253,37254,37258,37249,37250,37252,37248,37584,37571,37572,37568,37593,37558,37583,37617,37599,37592,37609,37591,37597,37580,37615,37570,37608,37578,37576,37582,37606,37581,37589,37577,37600,37598,37607,37585,37587,37557,37601,37574,37556,38268,38316,38315,38318,38320,38564,38562,38611,38661,38664,38658,38746,38794,38798,38792,38864,38863,38942,38941,38950,38953,38952,38944,38939,38951,39090,39176,39162,39185,39188,39190,39191,39189,39388,39373,39375,39379,39380,39374,39369,39382,39384,39371,39383,39372,39603,39660,39659,39667,39666,39665,39750,39747,39783,39796,39793,39782,39798,39797,39792,39784,39780,39788,40188,40186,40189,40191,40183,40199,40192,40185,40187,40200,40197,40196,40579,40659,40719,40720,20764,20755,20759,20762,20753,20958,21300,21473,22128,22112,22126,22131,22118,22115,22125,22130,22110,22135,22300,22299,22728,22717,22729,22719,22714,22722,22716,22726,23319,23321,23323,23329,23316,23315,23312,23318,23336,23322,23328,23326,23535,23980,23985,23977,23975,23989,23984,23982,23978,23976,23986,23981,23983,23988,24167,24168,24166,24175,24297,24295,24294,24296,24293,24395,24508,24989,25000,24982,25029,25012,25030,25025,25036,25018,25023,25016,24972,25815,25814,25808,25807,25801,25789,25737,25795,25819,25843,25817,25907,25983,25980,26018,26312,26302,26304,26314,26315,26319,26301,26299,26298,26316,26403,27188,27238,27209,27239,27186,27240,27198,27229,27245,27254,27227,27217,27176,27226,27195,27199,27201,27242,27236,27216,27215,27220,27247,27241,27232,27196,27230,27222,27221,27213,27214,27206,27477,27476,27478,27559,27562,27563,27592,27591,27652,27651,27654,28589,28619,28579,28615,28604,28622,28616,28510,28612,28605,28574,28618,28584,28676,28581,28590,28602,28588,28586,28623,28607,28600,28578,28617,28587,28621,28591,28594,28592,29125,29122,29119,29112,29142,29120,29121,29131,29140,29130,29127,29135,29117,29144,29116,29126,29146,29147,29341,29342,29545,29542,29543,29548,29541,29547,29546,29823,29850,29856,29844,29842,29845,29857,29963,30080,30255,30253,30257,30269,30259,30268,30261,30258,30256,30395,30438,30618,30621,30625,30620,30619,30626,30627,30613,30617,30615,30941,30953,30949,30954,30942,30947,30939,30945,30946,30957,30943,30944,31140,31300,31304,31303,31414,31416,31413,31409,31415,31710,31715,31719,31709,31701,31717,31706,31720,31737,31700,31722,31714,31708,31723,31704,31711,31954,31956,31959,31952,31953,32274,32289,32279,32268,32287,32288,32275,32270,32284,32277,32282,32290,32267,32271,32278,32269,32276,32293,32292,32579,32635,32636,32634,32689,32751,32810,32809,32876,33201,33190,33198,33209,33205,33195,33200,33196,33204,33202,33207,33191,33266,33365,33366,33367,34134,34117,34155,34125,34131,34145,34136,34112,34118,34148,34113,34146,34116,34129,34119,34147,34110,34139,34161,34126,34158,34165,34133,34151,34144,34188,34150,34141,34132,34149,34156,34403,34405,34404,34715,34703,34711,34707,34706,34696,34689,34710,34712,34681,34695,34723,34693,34704,34705,34717,34692,34708,34716,34714,34697,35102,35110,35120,35117,35118,35111,35121,35106,35113,35107,35119,35116,35103,35313,35552,35554,35570,35572,35573,35549,35604,35556,35551,35568,35528,35550,35553,35560,35583,35567,35579,35985,35986,35984,36085,36078,36081,36080,36083,36204,36206,36261,36263,36403,36414,36408,36416,36421,36406,36412,36413,36417,36400,36415,36541,36662,36654,36661,36658,36665,36663,36660,36982,36985,36987,36998,37114,37171,37173,37174,37267,37264,37265,37261,37263,37671,37662,37640,37663,37638,37647,37754,37688,37692,37659,37667,37650,37633,37702,37677,37646,37645,37579,37661,37626,37669,37651,37625,37623,37684,37634,37668,37631,37673,37689,37685,37674,37652,37644,37643,37630,37641,37632,37627,37654,38332,38349,38334,38329,38330,38326,38335,38325,38333,38569,38612,38667,38674,38672,38809,38807,38804,38896,38904,38965,38959,38962,39204,39199,39207,39209,39326,39406,39404,39397,39396,39408,39395,39402,39401,39399,39609,39615,39604,39611,39670,39674,39673,39671,39731,39808,39813,39815,39804,39806,39803,39810,39827,39826,39824,39802,39829,39805,39816,40229,40215,40224,40222,40212,40233,40221,40216,40226,40208,40217,40223,40584,40582,40583,40622,40621,40661,40662,40698,40722,40765,20774,20773,20770,20772,20768,20777,21236,22163,22156,22157,22150,22148,22147,22142,22146,22143,22145,22742,22740,22735,22738,23341,23333,23346,23331,23340,23335,23334,23343,23342,23419,23537,23538,23991,24172,24170,24510,24507,25027,25013,25020,25063,25056,25061,25060,25064,25054,25839,25833,25827,25835,25828,25832,25985,25984,26038,26074,26322,27277,27286,27265,27301,27273,27295,27291,27297,27294,27271,27283,27278,27285,27267,27304,27300,27281,27263,27302,27290,27269,27276,27282,27483,27565,27657,28620,28585,28660,28628,28643,28636,28653,28647,28646,28638,28658,28637,28642,28648,29153,29169,29160,29170,29156,29168,29154,29555,29550,29551,29847,29874,29867,29840,29866,29869,29873,29861,29871,29968,29969,29970,29967,30084,30275,30280,30281,30279,30372,30441,30645,30635,30642,30647,30646,30644,30641,30632,30704,30963,30973,30978,30971,30972,30962,30981,30969,30974,30980,31147,31144,31324,31323,31318,31320,31316,31322,31422,31424,31425,31749,31759,31730,31744,31743,31739,31758,31732,31755,31731,31746,31753,31747,31745,31736,31741,31750,31728,31729,31760,31754,31976,32301,32316,32322,32307,38984,32312,32298,32329,32320,32327,32297,32332,32304,32315,32310,32324,32314,32581,32639,32638,32637,32756,32754,32812,33211,33220,33228,33226,33221,33223,33212,33257,33371,33370,33372,34179,34176,34191,34215,34197,34208,34187,34211,34171,34212,34202,34206,34167,34172,34185,34209,34170,34168,34135,34190,34198,34182,34189,34201,34205,34177,34210,34178,34184,34181,34169,34166,34200,34192,34207,34408,34750,34730,34733,34757,34736,34732,34745,34741,34748,34734,34761,34755,34754,34764,34743,34735,34756,34762,34740,34742,34751,34744,34749,34782,34738,35125,35123,35132,35134,35137,35154,35127,35138,35245,35247,35246,35314,35315,35614,35608,35606,35601,35589,35595,35618,35599,35602,35605,35591,35597,35592,35590,35612,35603,35610,35919,35952,35954,35953,35951,35989,35988,36089,36207,36430,36429,36435,36432,36428,36423,36675,36672,36997,36990,37176,37274,37282,37275,37273,37279,37281,37277,37280,37793,37763,37807,37732,37718,37703,37756,37720,37724,37750,37705,37712,37713,37728,37741,37775,37708,37738,37753,37719,37717,37714,37711,37745,37751,37755,37729,37726,37731,37735,37760,37710,37721,38343,38336,38345,38339,38341,38327,38574,38576,38572,38688,38687,38680,38685,38681,38810,38817,38812,38814,38813,38869,38868,38897,38977,38980,38986,38985,38981,38979,39205,39211,39212,39210,39219,39218,39215,39213,39217,39216,39320,39331,39329,39426,39418,39412,39415,39417,39416,39414,39419,39421,39422,39420,39427,39614,39678,39677,39681,39676,39752,39834,39848,39838,39835,39846,39841,39845,39844,39814,39842,39840,39855,40243,40257,40295,40246,40238,40239,40241,40248,40240,40261,40258,40259,40254,40247,40256,40253,32757,40237,40586,40585,40589,40624,40648,40666,40699,40703,40740,40739,40738,40788,40864,20785,20781,20782,22168,22172,22167,22170,22173,22169,22896,23356,23657,23658,24000,24173,24174,25048,25055,25069,25070,25073,25066,25072,25067,25046,25065,25855,25860,25853,25848,25857,25859,25852,26004,26075,26330,26331,26328,27333,27321,27325,27361,27334,27322,27318,27319,27335,27316,27309,27486,27593,27659,28679,28684,28685,28673,28677,28692,28686,28671,28672,28667,28710,28668,28663,28682,29185,29183,29177,29187,29181,29558,29880,29888,29877,29889,29886,29878,29883,29890,29972,29971,30300,30308,30297,30288,30291,30295,30298,30374,30397,30444,30658,30650,30975,30988,30995,30996,30985,30992,30994,30993,31149,31148,31327,31772,31785,31769,31776,31775,31789,31773,31782,31784,31778,31781,31792,32348,32336,32342,32355,32344,32354,32351,32337,32352,32343,32339,32693,32691,32759,32760,32885,33233,33234,33232,33375,33374,34228,34246,34240,34243,34242,34227,34229,34237,34247,34244,34239,34251,34254,34248,34245,34225,34230,34258,34340,34232,34231,34238,34409,34791,34790,34786,34779,34795,34794,34789,34783,34803,34788,34772,34780,34771,34797,34776,34787,34724,34775,34777,34817,34804,34792,34781,35155,35147,35151,35148,35142,35152,35153,35145,35626,35623,35619,35635,35632,35637,35655,35631,35644,35646,35633,35621,35639,35622,35638,35630,35620,35643,35645,35642,35906,35957,35993,35992,35991,36094,36100,36098,36096,36444,36450,36448,36439,36438,36446,36453,36455,36443,36442,36449,36445,36457,36436,36678,36679,36680,36683,37160,37178,37179,37182,37288,37285,37287,37295,37290,37813,37772,37778,37815,37787,37789,37769,37799,37774,37802,37790,37798,37781,37768,37785,37791,37773,37809,37777,37810,37796,37800,37812,37795,37797,38354,38355,38353,38579,38615,38618,24002,38623,38616,38621,38691,38690,38693,38828,38830,38824,38827,38820,38826,38818,38821,38871,38873,38870,38872,38906,38992,38993,38994,39096,39233,39228,39226,39439,39435,39433,39437,39428,39441,39434,39429,39431,39430,39616,39644,39688,39684,39685,39721,39733,39754,39756,39755,39879,39878,39875,39871,39873,39861,39864,39891,39862,39876,39865,39869,40284,40275,40271,40266,40283,40267,40281,40278,40268,40279,40274,40276,40287,40280,40282,40590,40588,40671,40705,40704,40726,40741,40747,40746,40745,40744,40780,40789,20788,20789,21142,21239,21428,22187,22189,22182,22183,22186,22188,22746,22749,22747,22802,23357,23358,23359,24003,24176,24511,25083,25863,25872,25869,25865,25868,25870,25988,26078,26077,26334,27367,27360,27340,27345,27353,27339,27359,27356,27344,27371,27343,27341,27358,27488,27568,27660,28697,28711,28704,28694,28715,28705,28706,28707,28713,28695,28708,28700,28714,29196,29194,29191,29186,29189,29349,29350,29348,29347,29345,29899,29893,29879,29891,29974,30304,30665,30666,30660,30705,31005,31003,31009,31004,30999,31006,31152,31335,31336,31795,31804,31801,31788,31803,31980,31978,32374,32373,32376,32368,32375,32367,32378,32370,32372,32360,32587,32586,32643,32646,32695,32765,32766,32888,33239,33237,33380,33377,33379,34283,34289,34285,34265,34273,34280,34266,34263,34284,34290,34296,34264,34271,34275,34268,34257,34288,34278,34287,34270,34274,34816,34810,34819,34806,34807,34825,34828,34827,34822,34812,34824,34815,34826,34818,35170,35162,35163,35159,35169,35164,35160,35165,35161,35208,35255,35254,35318,35664,35656,35658,35648,35667,35670,35668,35659,35669,35665,35650,35666,35671,35907,35959,35958,35994,36102,36103,36105,36268,36266,36269,36267,36461,36472,36467,36458,36463,36475,36546,36690,36689,36687,36688,36691,36788,37184,37183,37296,37293,37854,37831,37839,37826,37850,37840,37881,37868,37836,37849,37801,37862,37834,37844,37870,37859,37845,37828,37838,37824,37842,37863,38269,38362,38363,38625,38697,38699,38700,38696,38694,38835,38839,38838,38877,38878,38879,39004,39001,39005,38999,39103,39101,39099,39102,39240,39239,39235,39334,39335,39450,39445,39461,39453,39460,39451,39458,39456,39463,39459,39454,39452,39444,39618,39691,39690,39694,39692,39735,39914,39915,39904,39902,39908,39910,39906,39920,39892,39895,39916,39900,39897,39909,39893,39905,39898,40311,40321,40330,40324,40328,40305,40320,40312,40326,40331,40332,40317,40299,40308,40309,40304,40297,40325,40307,40315,40322,40303,40313,40319,40327,40296,40596,40593,40640,40700,40749,40768,40769,40781,40790,40791,40792,21303,22194,22197,22195,22755,23365,24006,24007,24302,24303,24512,24513,25081,25879,25878,25877,25875,26079,26344,26339,26340,27379,27376,27370,27368,27385,27377,27374,27375,28732,28725,28719,28727,28724,28721,28738,28728,28735,28730,28729,28736,28731,28723,28737,29203,29204,29352,29565,29564,29882,30379,30378,30398,30445,30668,30670,30671,30669,30706,31013,31011,31015,31016,31012,31017,31154,31342,31340,31341,31479,31817,31816,31818,31815,31813,31982,32379,32382,32385,32384,32698,32767,32889,33243,33241,33291,33384,33385,34338,34303,34305,34302,34331,34304,34294,34308,34313,34309,34316,34301,34841,34832,34833,34839,34835,34838,35171,35174,35257,35319,35680,35690,35677,35688,35683,35685,35687,35693,36270,36486,36488,36484,36697,36694,36695,36693,36696,36698,37005,37187,37185,37303,37301,37298,37299,37899,37907,37883,37920,37903,37908,37886,37909,37904,37928,37913,37901,37877,37888,37879,37895,37902,37910,37906,37882,37897,37880,37898,37887,37884,37900,37878,37905,37894,38366,38368,38367,38702,38703,38841,38843,38909,38910,39008,39010,39011,39007,39105,39106,39248,39246,39257,39244,39243,39251,39474,39476,39473,39468,39466,39478,39465,39470,39480,39469,39623,39626,39622,39696,39698,39697,39947,39944,39927,39941,39954,39928,40000,39943,39950,39942,39959,39956,39945,40351,40345,40356,40349,40338,40344,40336,40347,40352,40340,40348,40362,40343,40353,40346,40354,40360,40350,40355,40383,40361,40342,40358,40359,40601,40603,40602,40677,40676,40679,40678,40752,40750,40795,40800,40798,40797,40793,40849,20794,20793,21144,21143,22211,22205,22206,23368,23367,24011,24015,24305,25085,25883,27394,27388,27395,27384,27392,28739,28740,28746,28744,28745,28741,28742,29213,29210,29209,29566,29975,30314,30672,31021,31025,31023,31828,31827,31986,32394,32391,32392,32395,32390,32397,32589,32699,32816,33245,34328,34346,34342,34335,34339,34332,34329,34343,34350,34337,34336,34345,34334,34341,34857,34845,34843,34848,34852,34844,34859,34890,35181,35177,35182,35179,35322,35705,35704,35653,35706,35707,36112,36116,36271,36494,36492,36702,36699,36701,37190,37188,37189,37305,37951,37947,37942,37929,37949,37948,37936,37945,37930,37943,37932,37952,37937,38373,38372,38371,38709,38714,38847,38881,39012,39113,39110,39104,39256,39254,39481,39485,39494,39492,39490,39489,39482,39487,39629,39701,39703,39704,39702,39738,39762,39979,39965,39964,39980,39971,39976,39977,39972,39969,40375,40374,40380,40385,40391,40394,40399,40382,40389,40387,40379,40373,40398,40377,40378,40364,40392,40369,40365,40396,40371,40397,40370,40570,40604,40683,40686,40685,40731,40728,40730,40753,40782,40805,40804,40850,20153,22214,22213,22219,22897,23371,23372,24021,24017,24306,25889,25888,25894,25890,27403,27400,27401,27661,28757,28758,28759,28754,29214,29215,29353,29567,29912,29909,29913,29911,30317,30381,31029,31156,31344,31345,31831,31836,31833,31835,31834,31988,31985,32401,32591,32647,33246,33387,34356,34357,34355,34348,34354,34358,34860,34856,34854,34858,34853,35185,35263,35262,35323,35710,35716,35714,35718,35717,35711,36117,36501,36500,36506,36498,36496,36502,36503,36704,36706,37191,37964,37968,37962,37963,37967,37959,37957,37960,37961,37958,38719,38883,39018,39017,39115,39252,39259,39502,39507,39508,39500,39503,39496,39498,39497,39506,39504,39632,39705,39723,39739,39766,39765,40006,40008,39999,40004,39993,39987,40001,39996,39991,39988,39986,39997,39990,40411,40402,40414,40410,40395,40400,40412,40401,40415,40425,40409,40408,40406,40437,40405,40413,40630,40688,40757,40755,40754,40770,40811,40853,40866,20797,21145,22760,22759,22898,23373,24024,34863,24399,25089,25091,25092,25897,25893,26006,26347,27409,27410,27407,27594,28763,28762,29218,29570,29569,29571,30320,30676,31847,31846,32405,33388,34362,34368,34361,34364,34353,34363,34366,34864,34866,34862,34867,35190,35188,35187,35326,35724,35726,35723,35720,35909,36121,36504,36708,36707,37308,37986,37973,37981,37975,37982,38852,38853,38912,39510,39513,39710,39711,39712,40018,40024,40016,40010,40013,40011,40021,40025,40012,40014,40443,40439,40431,40419,40427,40440,40420,40438,40417,40430,40422,40434,40432,40418,40428,40436,40435,40424,40429,40642,40656,40690,40691,40710,40732,40760,40759,40758,40771,40783,40817,40816,40814,40815,22227,22221,23374,23661,25901,26349,26350,27411,28767,28769,28765,28768,29219,29915,29925,30677,31032,31159,31158,31850,32407,32649,33389,34371,34872,34871,34869,34891,35732,35733,36510,36511,36512,36509,37310,37309,37314,37995,37992,37993,38629,38726,38723,38727,38855,38885,39518,39637,39769,40035,40039,40038,40034,40030,40032,40450,40446,40455,40451,40454,40453,40448,40449,40457,40447,40445,40452,40608,40734,40774,40820,40821,40822,22228,25902,26040,27416,27417,27415,27418,28770,29222,29354,30680,30681,31033,31849,31851,31990,32410,32408,32411,32409,33248,33249,34374,34375,34376,35193,35194,35196,35195,35327,35736,35737,36517,36516,36515,37998,37997,37999,38001,38003,38729,39026,39263,40040,40046,40045,40459,40461,40464,40463,40466,40465,40609,40693,40713,40775,40824,40827,40826,40825,22302,28774,31855,34876,36274,36518,37315,38004,38008,38006,38005,39520,40052,40051,40049,40053,40468,40467,40694,40714,40868,28776,28773,31991,34410,34878,34877,34879,35742,35996,36521,36553,38731,39027,39028,39116,39265,39339,39524,39526,39527,39716,40469,40471,40776,25095,27422,29223,34380,36520,38018,38016,38017,39529,39528,39726,40473,29225,34379,35743,38019,40057,40631,30325,39531,40058,40477,28777,28778,40612,40830,40777,40856,30849,37561,35023,22715,24658,31911,23290,9556,9574,9559,9568,9580,9571,9562,9577,9565,9554,9572,9557,9566,9578,9569,9560,9575,9563,9555,9573,9558,9567,9579,9570,9561,9576,9564,9553,9552,9581,9582,9584,9583,65517,132423,37595,132575,147397,34124,17077,29679,20917,13897,149826,166372,37700,137691,33518,146632,30780,26436,25311,149811,166314,131744,158643,135941,20395,140525,20488,159017,162436,144896,150193,140563,20521,131966,24484,131968,131911,28379,132127,20605,20737,13434,20750,39020,14147,33814,149924,132231,20832,144308,20842,134143,139516,131813,140592,132494,143923,137603,23426,34685,132531,146585,20914,20920,40244,20937,20943,20945,15580,20947,150182,20915,20962,21314,20973,33741,26942,145197,24443,21003,21030,21052,21173,21079,21140,21177,21189,31765,34114,21216,34317,158483,21253,166622,21833,28377,147328,133460,147436,21299,21316,134114,27851,136998,26651,29653,24650,16042,14540,136936,29149,17570,21357,21364,165547,21374,21375,136598,136723,30694,21395,166555,21408,21419,21422,29607,153458,16217,29596,21441,21445,27721,20041,22526,21465,15019,134031,21472,147435,142755,21494,134263,21523,28793,21803,26199,27995,21613,158547,134516,21853,21647,21668,18342,136973,134877,15796,134477,166332,140952,21831,19693,21551,29719,21894,21929,22021,137431,147514,17746,148533,26291,135348,22071,26317,144010,26276,26285,22093,22095,30961,22257,38791,21502,22272,22255,22253,166758,13859,135759,22342,147877,27758,28811,22338,14001,158846,22502,136214,22531,136276,148323,22566,150517,22620,22698,13665,22752,22748,135740,22779,23551,22339,172368,148088,37843,13729,22815,26790,14019,28249,136766,23076,21843,136850,34053,22985,134478,158849,159018,137180,23001,137211,137138,159142,28017,137256,136917,23033,159301,23211,23139,14054,149929,23159,14088,23190,29797,23251,159649,140628,15749,137489,14130,136888,24195,21200,23414,25992,23420,162318,16388,18525,131588,23509,24928,137780,154060,132517,23539,23453,19728,23557,138052,23571,29646,23572,138405,158504,23625,18653,23685,23785,23791,23947,138745,138807,23824,23832,23878,138916,23738,24023,33532,14381,149761,139337,139635,33415,14390,15298,24110,27274,24181,24186,148668,134355,21414,20151,24272,21416,137073,24073,24308,164994,24313,24315,14496,24316,26686,37915,24333,131521,194708,15070,18606,135994,24378,157832,140240,24408,140401,24419,38845,159342,24434,37696,166454,24487,23990,15711,152144,139114,159992,140904,37334,131742,166441,24625,26245,137335,14691,15815,13881,22416,141236,31089,15936,24734,24740,24755,149890,149903,162387,29860,20705,23200,24932,33828,24898,194726,159442,24961,20980,132694,24967,23466,147383,141407,25043,166813,170333,25040,14642,141696,141505,24611,24924,25886,25483,131352,25285,137072,25301,142861,25452,149983,14871,25656,25592,136078,137212,25744,28554,142902,38932,147596,153373,25825,25829,38011,14950,25658,14935,25933,28438,150056,150051,25989,25965,25951,143486,26037,149824,19255,26065,16600,137257,26080,26083,24543,144384,26136,143863,143864,26180,143780,143781,26187,134773,26215,152038,26227,26228,138813,143921,165364,143816,152339,30661,141559,39332,26370,148380,150049,15147,27130,145346,26462,26471,26466,147917,168173,26583,17641,26658,28240,37436,26625,144358,159136,26717,144495,27105,27147,166623,26995,26819,144845,26881,26880,15666,14849,144956,15232,26540,26977,166474,17148,26934,27032,15265,132041,33635,20624,27129,144985,139562,27205,145155,27293,15347,26545,27336,168348,15373,27421,133411,24798,27445,27508,141261,28341,146139,132021,137560,14144,21537,146266,27617,147196,27612,27703,140427,149745,158545,27738,33318,27769,146876,17605,146877,147876,149772,149760,146633,14053,15595,134450,39811,143865,140433,32655,26679,159013,159137,159211,28054,27996,28284,28420,149887,147589,159346,34099,159604,20935,27804,28189,33838,166689,28207,146991,29779,147330,31180,28239,23185,143435,28664,14093,28573,146992,28410,136343,147517,17749,37872,28484,28508,15694,28532,168304,15675,28575,147780,28627,147601,147797,147513,147440,147380,147775,20959,147798,147799,147776,156125,28747,28798,28839,28801,28876,28885,28886,28895,16644,15848,29108,29078,148087,28971,28997,23176,29002,29038,23708,148325,29007,37730,148161,28972,148570,150055,150050,29114,166888,28861,29198,37954,29205,22801,37955,29220,37697,153093,29230,29248,149876,26813,29269,29271,15957,143428,26637,28477,29314,29482,29483,149539,165931,18669,165892,29480,29486,29647,29610,134202,158254,29641,29769,147938,136935,150052,26147,14021,149943,149901,150011,29687,29717,26883,150054,29753,132547,16087,29788,141485,29792,167602,29767,29668,29814,33721,29804,14128,29812,37873,27180,29826,18771,150156,147807,150137,166799,23366,166915,137374,29896,137608,29966,29929,29982,167641,137803,23511,167596,37765,30029,30026,30055,30062,151426,16132,150803,30094,29789,30110,30132,30210,30252,30289,30287,30319,30326,156661,30352,33263,14328,157969,157966,30369,30373,30391,30412,159647,33890,151709,151933,138780,30494,30502,30528,25775,152096,30552,144044,30639,166244,166248,136897,30708,30729,136054,150034,26826,30895,30919,30931,38565,31022,153056,30935,31028,30897,161292,36792,34948,166699,155779,140828,31110,35072,26882,31104,153687,31133,162617,31036,31145,28202,160038,16040,31174,168205,31188], + "euc-kr":[44034,44035,44037,44038,44043,44044,44045,44046,44047,44056,44062,44063,44065,44066,44067,44069,44070,44071,44072,44073,44074,44075,44078,44082,44083,44084,null,null,null,null,null,null,44085,44086,44087,44090,44091,44093,44094,44095,44097,44098,44099,44100,44101,44102,44103,44104,44105,44106,44108,44110,44111,44112,44113,44114,44115,44117,null,null,null,null,null,null,44118,44119,44121,44122,44123,44125,44126,44127,44128,44129,44130,44131,44132,44133,44134,44135,44136,44137,44138,44139,44140,44141,44142,44143,44146,44147,44149,44150,44153,44155,44156,44157,44158,44159,44162,44167,44168,44173,44174,44175,44177,44178,44179,44181,44182,44183,44184,44185,44186,44187,44190,44194,44195,44196,44197,44198,44199,44203,44205,44206,44209,44210,44211,44212,44213,44214,44215,44218,44222,44223,44224,44226,44227,44229,44230,44231,44233,44234,44235,44237,44238,44239,44240,44241,44242,44243,44244,44246,44248,44249,44250,44251,44252,44253,44254,44255,44258,44259,44261,44262,44265,44267,44269,44270,44274,44276,44279,44280,44281,44282,44283,44286,44287,44289,44290,44291,44293,44295,44296,44297,44298,44299,44302,44304,44306,44307,44308,44309,44310,44311,44313,44314,44315,44317,44318,44319,44321,44322,44323,44324,44325,44326,44327,44328,44330,44331,44334,44335,44336,44337,44338,44339,null,null,null,null,null,null,44342,44343,44345,44346,44347,44349,44350,44351,44352,44353,44354,44355,44358,44360,44362,44363,44364,44365,44366,44367,44369,44370,44371,44373,44374,44375,null,null,null,null,null,null,44377,44378,44379,44380,44381,44382,44383,44384,44386,44388,44389,44390,44391,44392,44393,44394,44395,44398,44399,44401,44402,44407,44408,44409,44410,44414,44416,44419,44420,44421,44422,44423,44426,44427,44429,44430,44431,44433,44434,44435,44436,44437,44438,44439,44440,44441,44442,44443,44446,44447,44448,44449,44450,44451,44453,44454,44455,44456,44457,44458,44459,44460,44461,44462,44463,44464,44465,44466,44467,44468,44469,44470,44472,44473,44474,44475,44476,44477,44478,44479,44482,44483,44485,44486,44487,44489,44490,44491,44492,44493,44494,44495,44498,44500,44501,44502,44503,44504,44505,44506,44507,44509,44510,44511,44513,44514,44515,44517,44518,44519,44520,44521,44522,44523,44524,44525,44526,44527,44528,44529,44530,44531,44532,44533,44534,44535,44538,44539,44541,44542,44546,44547,44548,44549,44550,44551,44554,44556,44558,44559,44560,44561,44562,44563,44565,44566,44567,44568,44569,44570,44571,44572,null,null,null,null,null,null,44573,44574,44575,44576,44577,44578,44579,44580,44581,44582,44583,44584,44585,44586,44587,44588,44589,44590,44591,44594,44595,44597,44598,44601,44603,44604,null,null,null,null,null,null,44605,44606,44607,44610,44612,44615,44616,44617,44619,44623,44625,44626,44627,44629,44631,44632,44633,44634,44635,44638,44642,44643,44644,44646,44647,44650,44651,44653,44654,44655,44657,44658,44659,44660,44661,44662,44663,44666,44670,44671,44672,44673,44674,44675,44678,44679,44680,44681,44682,44683,44685,44686,44687,44688,44689,44690,44691,44692,44693,44694,44695,44696,44697,44698,44699,44700,44701,44702,44703,44704,44705,44706,44707,44708,44709,44710,44711,44712,44713,44714,44715,44716,44717,44718,44719,44720,44721,44722,44723,44724,44725,44726,44727,44728,44729,44730,44731,44735,44737,44738,44739,44741,44742,44743,44744,44745,44746,44747,44750,44754,44755,44756,44757,44758,44759,44762,44763,44765,44766,44767,44768,44769,44770,44771,44772,44773,44774,44775,44777,44778,44780,44782,44783,44784,44785,44786,44787,44789,44790,44791,44793,44794,44795,44797,44798,44799,44800,44801,44802,44803,44804,44805,null,null,null,null,null,null,44806,44809,44810,44811,44812,44814,44815,44817,44818,44819,44820,44821,44822,44823,44824,44825,44826,44827,44828,44829,44830,44831,44832,44833,44834,44835,null,null,null,null,null,null,44836,44837,44838,44839,44840,44841,44842,44843,44846,44847,44849,44851,44853,44854,44855,44856,44857,44858,44859,44862,44864,44868,44869,44870,44871,44874,44875,44876,44877,44878,44879,44881,44882,44883,44884,44885,44886,44887,44888,44889,44890,44891,44894,44895,44896,44897,44898,44899,44902,44903,44904,44905,44906,44907,44908,44909,44910,44911,44912,44913,44914,44915,44916,44917,44918,44919,44920,44922,44923,44924,44925,44926,44927,44929,44930,44931,44933,44934,44935,44937,44938,44939,44940,44941,44942,44943,44946,44947,44948,44950,44951,44952,44953,44954,44955,44957,44958,44959,44960,44961,44962,44963,44964,44965,44966,44967,44968,44969,44970,44971,44972,44973,44974,44975,44976,44977,44978,44979,44980,44981,44982,44983,44986,44987,44989,44990,44991,44993,44994,44995,44996,44997,44998,45002,45004,45007,45008,45009,45010,45011,45013,45014,45015,45016,45017,45018,45019,45021,45022,45023,45024,45025,null,null,null,null,null,null,45026,45027,45028,45029,45030,45031,45034,45035,45036,45037,45038,45039,45042,45043,45045,45046,45047,45049,45050,45051,45052,45053,45054,45055,45058,45059,null,null,null,null,null,null,45061,45062,45063,45064,45065,45066,45067,45069,45070,45071,45073,45074,45075,45077,45078,45079,45080,45081,45082,45083,45086,45087,45088,45089,45090,45091,45092,45093,45094,45095,45097,45098,45099,45100,45101,45102,45103,45104,45105,45106,45107,45108,45109,45110,45111,45112,45113,45114,45115,45116,45117,45118,45119,45120,45121,45122,45123,45126,45127,45129,45131,45133,45135,45136,45137,45138,45142,45144,45146,45147,45148,45150,45151,45152,45153,45154,45155,45156,45157,45158,45159,45160,45161,45162,45163,45164,45165,45166,45167,45168,45169,45170,45171,45172,45173,45174,45175,45176,45177,45178,45179,45182,45183,45185,45186,45187,45189,45190,45191,45192,45193,45194,45195,45198,45200,45202,45203,45204,45205,45206,45207,45211,45213,45214,45219,45220,45221,45222,45223,45226,45232,45234,45238,45239,45241,45242,45243,45245,45246,45247,45248,45249,45250,45251,45254,45258,45259,45260,45261,45262,45263,45266,null,null,null,null,null,null,45267,45269,45270,45271,45273,45274,45275,45276,45277,45278,45279,45281,45282,45283,45284,45286,45287,45288,45289,45290,45291,45292,45293,45294,45295,45296,null,null,null,null,null,null,45297,45298,45299,45300,45301,45302,45303,45304,45305,45306,45307,45308,45309,45310,45311,45312,45313,45314,45315,45316,45317,45318,45319,45322,45325,45326,45327,45329,45332,45333,45334,45335,45338,45342,45343,45344,45345,45346,45350,45351,45353,45354,45355,45357,45358,45359,45360,45361,45362,45363,45366,45370,45371,45372,45373,45374,45375,45378,45379,45381,45382,45383,45385,45386,45387,45388,45389,45390,45391,45394,45395,45398,45399,45401,45402,45403,45405,45406,45407,45409,45410,45411,45412,45413,45414,45415,45416,45417,45418,45419,45420,45421,45422,45423,45424,45425,45426,45427,45428,45429,45430,45431,45434,45435,45437,45438,45439,45441,45443,45444,45445,45446,45447,45450,45452,45454,45455,45456,45457,45461,45462,45463,45465,45466,45467,45469,45470,45471,45472,45473,45474,45475,45476,45477,45478,45479,45481,45482,45483,45484,45485,45486,45487,45488,45489,45490,45491,45492,45493,45494,45495,45496,null,null,null,null,null,null,45497,45498,45499,45500,45501,45502,45503,45504,45505,45506,45507,45508,45509,45510,45511,45512,45513,45514,45515,45517,45518,45519,45521,45522,45523,45525,null,null,null,null,null,null,45526,45527,45528,45529,45530,45531,45534,45536,45537,45538,45539,45540,45541,45542,45543,45546,45547,45549,45550,45551,45553,45554,45555,45556,45557,45558,45559,45560,45562,45564,45566,45567,45568,45569,45570,45571,45574,45575,45577,45578,45581,45582,45583,45584,45585,45586,45587,45590,45592,45594,45595,45596,45597,45598,45599,45601,45602,45603,45604,45605,45606,45607,45608,45609,45610,45611,45612,45613,45614,45615,45616,45617,45618,45619,45621,45622,45623,45624,45625,45626,45627,45629,45630,45631,45632,45633,45634,45635,45636,45637,45638,45639,45640,45641,45642,45643,45644,45645,45646,45647,45648,45649,45650,45651,45652,45653,45654,45655,45657,45658,45659,45661,45662,45663,45665,45666,45667,45668,45669,45670,45671,45674,45675,45676,45677,45678,45679,45680,45681,45682,45683,45686,45687,45688,45689,45690,45691,45693,45694,45695,45696,45697,45698,45699,45702,45703,45704,45706,45707,45708,45709,45710,null,null,null,null,null,null,45711,45714,45715,45717,45718,45719,45723,45724,45725,45726,45727,45730,45732,45735,45736,45737,45739,45741,45742,45743,45745,45746,45747,45749,45750,45751,null,null,null,null,null,null,45752,45753,45754,45755,45756,45757,45758,45759,45760,45761,45762,45763,45764,45765,45766,45767,45770,45771,45773,45774,45775,45777,45779,45780,45781,45782,45783,45786,45788,45790,45791,45792,45793,45795,45799,45801,45802,45808,45809,45810,45814,45820,45821,45822,45826,45827,45829,45830,45831,45833,45834,45835,45836,45837,45838,45839,45842,45846,45847,45848,45849,45850,45851,45853,45854,45855,45856,45857,45858,45859,45860,45861,45862,45863,45864,45865,45866,45867,45868,45869,45870,45871,45872,45873,45874,45875,45876,45877,45878,45879,45880,45881,45882,45883,45884,45885,45886,45887,45888,45889,45890,45891,45892,45893,45894,45895,45896,45897,45898,45899,45900,45901,45902,45903,45904,45905,45906,45907,45911,45913,45914,45917,45920,45921,45922,45923,45926,45928,45930,45932,45933,45935,45938,45939,45941,45942,45943,45945,45946,45947,45948,45949,45950,45951,45954,45958,45959,45960,45961,45962,45963,45965,null,null,null,null,null,null,45966,45967,45969,45970,45971,45973,45974,45975,45976,45977,45978,45979,45980,45981,45982,45983,45986,45987,45988,45989,45990,45991,45993,45994,45995,45997,null,null,null,null,null,null,45998,45999,46000,46001,46002,46003,46004,46005,46006,46007,46008,46009,46010,46011,46012,46013,46014,46015,46016,46017,46018,46019,46022,46023,46025,46026,46029,46031,46033,46034,46035,46038,46040,46042,46044,46046,46047,46049,46050,46051,46053,46054,46055,46057,46058,46059,46060,46061,46062,46063,46064,46065,46066,46067,46068,46069,46070,46071,46072,46073,46074,46075,46077,46078,46079,46080,46081,46082,46083,46084,46085,46086,46087,46088,46089,46090,46091,46092,46093,46094,46095,46097,46098,46099,46100,46101,46102,46103,46105,46106,46107,46109,46110,46111,46113,46114,46115,46116,46117,46118,46119,46122,46124,46125,46126,46127,46128,46129,46130,46131,46133,46134,46135,46136,46137,46138,46139,46140,46141,46142,46143,46144,46145,46146,46147,46148,46149,46150,46151,46152,46153,46154,46155,46156,46157,46158,46159,46162,46163,46165,46166,46167,46169,46170,46171,46172,46173,46174,46175,46178,46180,46182,null,null,null,null,null,null,46183,46184,46185,46186,46187,46189,46190,46191,46192,46193,46194,46195,46196,46197,46198,46199,46200,46201,46202,46203,46204,46205,46206,46207,46209,46210,null,null,null,null,null,null,46211,46212,46213,46214,46215,46217,46218,46219,46220,46221,46222,46223,46224,46225,46226,46227,46228,46229,46230,46231,46232,46233,46234,46235,46236,46238,46239,46240,46241,46242,46243,46245,46246,46247,46249,46250,46251,46253,46254,46255,46256,46257,46258,46259,46260,46262,46264,46266,46267,46268,46269,46270,46271,46273,46274,46275,46277,46278,46279,46281,46282,46283,46284,46285,46286,46287,46289,46290,46291,46292,46294,46295,46296,46297,46298,46299,46302,46303,46305,46306,46309,46311,46312,46313,46314,46315,46318,46320,46322,46323,46324,46325,46326,46327,46329,46330,46331,46332,46333,46334,46335,46336,46337,46338,46339,46340,46341,46342,46343,46344,46345,46346,46347,46348,46349,46350,46351,46352,46353,46354,46355,46358,46359,46361,46362,46365,46366,46367,46368,46369,46370,46371,46374,46379,46380,46381,46382,46383,46386,46387,46389,46390,46391,46393,46394,46395,46396,46397,46398,46399,46402,46406,null,null,null,null,null,null,46407,46408,46409,46410,46414,46415,46417,46418,46419,46421,46422,46423,46424,46425,46426,46427,46430,46434,46435,46436,46437,46438,46439,46440,46441,46442,null,null,null,null,null,null,46443,46444,46445,46446,46447,46448,46449,46450,46451,46452,46453,46454,46455,46456,46457,46458,46459,46460,46461,46462,46463,46464,46465,46466,46467,46468,46469,46470,46471,46472,46473,46474,46475,46476,46477,46478,46479,46480,46481,46482,46483,46484,46485,46486,46487,46488,46489,46490,46491,46492,46493,46494,46495,46498,46499,46501,46502,46503,46505,46508,46509,46510,46511,46514,46518,46519,46520,46521,46522,46526,46527,46529,46530,46531,46533,46534,46535,46536,46537,46538,46539,46542,46546,46547,46548,46549,46550,46551,46553,46554,46555,46556,46557,46558,46559,46560,46561,46562,46563,46564,46565,46566,46567,46568,46569,46570,46571,46573,46574,46575,46576,46577,46578,46579,46580,46581,46582,46583,46584,46585,46586,46587,46588,46589,46590,46591,46592,46593,46594,46595,46596,46597,46598,46599,46600,46601,46602,46603,46604,46605,46606,46607,46610,46611,46613,46614,46615,46617,46618,46619,46620,46621,null,null,null,null,null,null,46622,46623,46624,46625,46626,46627,46628,46630,46631,46632,46633,46634,46635,46637,46638,46639,46640,46641,46642,46643,46645,46646,46647,46648,46649,46650,null,null,null,null,null,null,46651,46652,46653,46654,46655,46656,46657,46658,46659,46660,46661,46662,46663,46665,46666,46667,46668,46669,46670,46671,46672,46673,46674,46675,46676,46677,46678,46679,46680,46681,46682,46683,46684,46685,46686,46687,46688,46689,46690,46691,46693,46694,46695,46697,46698,46699,46700,46701,46702,46703,46704,46705,46706,46707,46708,46709,46710,46711,46712,46713,46714,46715,46716,46717,46718,46719,46720,46721,46722,46723,46724,46725,46726,46727,46728,46729,46730,46731,46732,46733,46734,46735,46736,46737,46738,46739,46740,46741,46742,46743,46744,46745,46746,46747,46750,46751,46753,46754,46755,46757,46758,46759,46760,46761,46762,46765,46766,46767,46768,46770,46771,46772,46773,46774,46775,46776,46777,46778,46779,46780,46781,46782,46783,46784,46785,46786,46787,46788,46789,46790,46791,46792,46793,46794,46795,46796,46797,46798,46799,46800,46801,46802,46803,46805,46806,46807,46808,46809,46810,46811,46812,46813,null,null,null,null,null,null,46814,46815,46816,46817,46818,46819,46820,46821,46822,46823,46824,46825,46826,46827,46828,46829,46830,46831,46833,46834,46835,46837,46838,46839,46841,46842,null,null,null,null,null,null,46843,46844,46845,46846,46847,46850,46851,46852,46854,46855,46856,46857,46858,46859,46860,46861,46862,46863,46864,46865,46866,46867,46868,46869,46870,46871,46872,46873,46874,46875,46876,46877,46878,46879,46880,46881,46882,46883,46884,46885,46886,46887,46890,46891,46893,46894,46897,46898,46899,46900,46901,46902,46903,46906,46908,46909,46910,46911,46912,46913,46914,46915,46917,46918,46919,46921,46922,46923,46925,46926,46927,46928,46929,46930,46931,46934,46935,46936,46937,46938,46939,46940,46941,46942,46943,46945,46946,46947,46949,46950,46951,46953,46954,46955,46956,46957,46958,46959,46962,46964,46966,46967,46968,46969,46970,46971,46974,46975,46977,46978,46979,46981,46982,46983,46984,46985,46986,46987,46990,46995,46996,46997,47002,47003,47005,47006,47007,47009,47010,47011,47012,47013,47014,47015,47018,47022,47023,47024,47025,47026,47027,47030,47031,47033,47034,47035,47036,47037,47038,47039,47040,47041,null,null,null,null,null,null,47042,47043,47044,47045,47046,47048,47050,47051,47052,47053,47054,47055,47056,47057,47058,47059,47060,47061,47062,47063,47064,47065,47066,47067,47068,47069,null,null,null,null,null,null,47070,47071,47072,47073,47074,47075,47076,47077,47078,47079,47080,47081,47082,47083,47086,47087,47089,47090,47091,47093,47094,47095,47096,47097,47098,47099,47102,47106,47107,47108,47109,47110,47114,47115,47117,47118,47119,47121,47122,47123,47124,47125,47126,47127,47130,47132,47134,47135,47136,47137,47138,47139,47142,47143,47145,47146,47147,47149,47150,47151,47152,47153,47154,47155,47158,47162,47163,47164,47165,47166,47167,47169,47170,47171,47173,47174,47175,47176,47177,47178,47179,47180,47181,47182,47183,47184,47186,47188,47189,47190,47191,47192,47193,47194,47195,47198,47199,47201,47202,47203,47205,47206,47207,47208,47209,47210,47211,47214,47216,47218,47219,47220,47221,47222,47223,47225,47226,47227,47229,47230,47231,47232,47233,47234,47235,47236,47237,47238,47239,47240,47241,47242,47243,47244,47246,47247,47248,47249,47250,47251,47252,47253,47254,47255,47256,47257,47258,47259,47260,47261,47262,47263,null,null,null,null,null,null,47264,47265,47266,47267,47268,47269,47270,47271,47273,47274,47275,47276,47277,47278,47279,47281,47282,47283,47285,47286,47287,47289,47290,47291,47292,47293,null,null,null,null,null,null,47294,47295,47298,47300,47302,47303,47304,47305,47306,47307,47309,47310,47311,47313,47314,47315,47317,47318,47319,47320,47321,47322,47323,47324,47326,47328,47330,47331,47332,47333,47334,47335,47338,47339,47341,47342,47343,47345,47346,47347,47348,47349,47350,47351,47354,47356,47358,47359,47360,47361,47362,47363,47365,47366,47367,47368,47369,47370,47371,47372,47373,47374,47375,47376,47377,47378,47379,47380,47381,47382,47383,47385,47386,47387,47388,47389,47390,47391,47393,47394,47395,47396,47397,47398,47399,47400,47401,47402,47403,47404,47405,47406,47407,47408,47409,47410,47411,47412,47413,47414,47415,47416,47417,47418,47419,47422,47423,47425,47426,47427,47429,47430,47431,47432,47433,47434,47435,47437,47438,47440,47442,47443,47444,47445,47446,47447,47450,47451,47453,47454,47455,47457,47458,47459,47460,47461,47462,47463,47466,47468,47470,47471,47472,47473,47474,47475,47478,47479,47481,47482,47483,47485,null,null,null,null,null,null,47486,47487,47488,47489,47490,47491,47494,47496,47499,47500,47503,47504,47505,47506,47507,47508,47509,47510,47511,47512,47513,47514,47515,47516,47517,47518,null,null,null,null,null,null,47519,47520,47521,47522,47523,47524,47525,47526,47527,47528,47529,47530,47531,47534,47535,47537,47538,47539,47541,47542,47543,47544,47545,47546,47547,47550,47552,47554,47555,47556,47557,47558,47559,47562,47563,47565,47571,47572,47573,47574,47575,47578,47580,47583,47584,47586,47590,47591,47593,47594,47595,47597,47598,47599,47600,47601,47602,47603,47606,47611,47612,47613,47614,47615,47618,47619,47620,47621,47622,47623,47625,47626,47627,47628,47629,47630,47631,47632,47633,47634,47635,47636,47638,47639,47640,47641,47642,47643,47644,47645,47646,47647,47648,47649,47650,47651,47652,47653,47654,47655,47656,47657,47658,47659,47660,47661,47662,47663,47664,47665,47666,47667,47668,47669,47670,47671,47674,47675,47677,47678,47679,47681,47683,47684,47685,47686,47687,47690,47692,47695,47696,47697,47698,47702,47703,47705,47706,47707,47709,47710,47711,47712,47713,47714,47715,47718,47722,47723,47724,47725,47726,47727,null,null,null,null,null,null,47730,47731,47733,47734,47735,47737,47738,47739,47740,47741,47742,47743,47744,47745,47746,47750,47752,47753,47754,47755,47757,47758,47759,47760,47761,47762,null,null,null,null,null,null,47763,47764,47765,47766,47767,47768,47769,47770,47771,47772,47773,47774,47775,47776,47777,47778,47779,47780,47781,47782,47783,47786,47789,47790,47791,47793,47795,47796,47797,47798,47799,47802,47804,47806,47807,47808,47809,47810,47811,47813,47814,47815,47817,47818,47819,47820,47821,47822,47823,47824,47825,47826,47827,47828,47829,47830,47831,47834,47835,47836,47837,47838,47839,47840,47841,47842,47843,47844,47845,47846,47847,47848,47849,47850,47851,47852,47853,47854,47855,47856,47857,47858,47859,47860,47861,47862,47863,47864,47865,47866,47867,47869,47870,47871,47873,47874,47875,47877,47878,47879,47880,47881,47882,47883,47884,47886,47888,47890,47891,47892,47893,47894,47895,47897,47898,47899,47901,47902,47903,47905,47906,47907,47908,47909,47910,47911,47912,47914,47916,47917,47918,47919,47920,47921,47922,47923,47927,47929,47930,47935,47936,47937,47938,47939,47942,47944,47946,47947,47948,47950,47953,47954,null,null,null,null,null,null,47955,47957,47958,47959,47961,47962,47963,47964,47965,47966,47967,47968,47970,47972,47973,47974,47975,47976,47977,47978,47979,47981,47982,47983,47984,47985,null,null,null,null,null,null,47986,47987,47988,47989,47990,47991,47992,47993,47994,47995,47996,47997,47998,47999,48000,48001,48002,48003,48004,48005,48006,48007,48009,48010,48011,48013,48014,48015,48017,48018,48019,48020,48021,48022,48023,48024,48025,48026,48027,48028,48029,48030,48031,48032,48033,48034,48035,48037,48038,48039,48041,48042,48043,48045,48046,48047,48048,48049,48050,48051,48053,48054,48056,48057,48058,48059,48060,48061,48062,48063,48065,48066,48067,48069,48070,48071,48073,48074,48075,48076,48077,48078,48079,48081,48082,48084,48085,48086,48087,48088,48089,48090,48091,48092,48093,48094,48095,48096,48097,48098,48099,48100,48101,48102,48103,48104,48105,48106,48107,48108,48109,48110,48111,48112,48113,48114,48115,48116,48117,48118,48119,48122,48123,48125,48126,48129,48131,48132,48133,48134,48135,48138,48142,48144,48146,48147,48153,48154,48160,48161,48162,48163,48166,48168,48170,48171,48172,48174,48175,48178,48179,48181,null,null,null,null,null,null,48182,48183,48185,48186,48187,48188,48189,48190,48191,48194,48198,48199,48200,48202,48203,48206,48207,48209,48210,48211,48212,48213,48214,48215,48216,48217,null,null,null,null,null,null,48218,48219,48220,48222,48223,48224,48225,48226,48227,48228,48229,48230,48231,48232,48233,48234,48235,48236,48237,48238,48239,48240,48241,48242,48243,48244,48245,48246,48247,48248,48249,48250,48251,48252,48253,48254,48255,48256,48257,48258,48259,48262,48263,48265,48266,48269,48271,48272,48273,48274,48275,48278,48280,48283,48284,48285,48286,48287,48290,48291,48293,48294,48297,48298,48299,48300,48301,48302,48303,48306,48310,48311,48312,48313,48314,48315,48318,48319,48321,48322,48323,48325,48326,48327,48328,48329,48330,48331,48332,48334,48338,48339,48340,48342,48343,48345,48346,48347,48349,48350,48351,48352,48353,48354,48355,48356,48357,48358,48359,48360,48361,48362,48363,48364,48365,48366,48367,48368,48369,48370,48371,48375,48377,48378,48379,48381,48382,48383,48384,48385,48386,48387,48390,48392,48394,48395,48396,48397,48398,48399,48401,48402,48403,48405,48406,48407,48408,48409,48410,48411,48412,48413,null,null,null,null,null,null,48414,48415,48416,48417,48418,48419,48421,48422,48423,48424,48425,48426,48427,48429,48430,48431,48432,48433,48434,48435,48436,48437,48438,48439,48440,48441,null,null,null,null,null,null,48442,48443,48444,48445,48446,48447,48449,48450,48451,48452,48453,48454,48455,48458,48459,48461,48462,48463,48465,48466,48467,48468,48469,48470,48471,48474,48475,48476,48477,48478,48479,48480,48481,48482,48483,48485,48486,48487,48489,48490,48491,48492,48493,48494,48495,48496,48497,48498,48499,48500,48501,48502,48503,48504,48505,48506,48507,48508,48509,48510,48511,48514,48515,48517,48518,48523,48524,48525,48526,48527,48530,48532,48534,48535,48536,48539,48541,48542,48543,48544,48545,48546,48547,48549,48550,48551,48552,48553,48554,48555,48556,48557,48558,48559,48561,48562,48563,48564,48565,48566,48567,48569,48570,48571,48572,48573,48574,48575,48576,48577,48578,48579,48580,48581,48582,48583,48584,48585,48586,48587,48588,48589,48590,48591,48592,48593,48594,48595,48598,48599,48601,48602,48603,48605,48606,48607,48608,48609,48610,48611,48612,48613,48614,48615,48616,48618,48619,48620,48621,48622,48623,48625,null,null,null,null,null,null,48626,48627,48629,48630,48631,48633,48634,48635,48636,48637,48638,48639,48641,48642,48644,48646,48647,48648,48649,48650,48651,48654,48655,48657,48658,48659,null,null,null,null,null,null,48661,48662,48663,48664,48665,48666,48667,48670,48672,48673,48674,48675,48676,48677,48678,48679,48680,48681,48682,48683,48684,48685,48686,48687,48688,48689,48690,48691,48692,48693,48694,48695,48696,48697,48698,48699,48700,48701,48702,48703,48704,48705,48706,48707,48710,48711,48713,48714,48715,48717,48719,48720,48721,48722,48723,48726,48728,48732,48733,48734,48735,48738,48739,48741,48742,48743,48745,48747,48748,48749,48750,48751,48754,48758,48759,48760,48761,48762,48766,48767,48769,48770,48771,48773,48774,48775,48776,48777,48778,48779,48782,48786,48787,48788,48789,48790,48791,48794,48795,48796,48797,48798,48799,48800,48801,48802,48803,48804,48805,48806,48807,48809,48810,48811,48812,48813,48814,48815,48816,48817,48818,48819,48820,48821,48822,48823,48824,48825,48826,48827,48828,48829,48830,48831,48832,48833,48834,48835,48836,48837,48838,48839,48840,48841,48842,48843,48844,48845,48846,48847,48850,48851,null,null,null,null,null,null,48853,48854,48857,48858,48859,48860,48861,48862,48863,48865,48866,48870,48871,48872,48873,48874,48875,48877,48878,48879,48880,48881,48882,48883,48884,48885,null,null,null,null,null,null,48886,48887,48888,48889,48890,48891,48892,48893,48894,48895,48896,48898,48899,48900,48901,48902,48903,48906,48907,48908,48909,48910,48911,48912,48913,48914,48915,48916,48917,48918,48919,48922,48926,48927,48928,48929,48930,48931,48932,48933,48934,48935,48936,48937,48938,48939,48940,48941,48942,48943,48944,48945,48946,48947,48948,48949,48950,48951,48952,48953,48954,48955,48956,48957,48958,48959,48962,48963,48965,48966,48967,48969,48970,48971,48972,48973,48974,48975,48978,48979,48980,48982,48983,48984,48985,48986,48987,48988,48989,48990,48991,48992,48993,48994,48995,48996,48997,48998,48999,49000,49001,49002,49003,49004,49005,49006,49007,49008,49009,49010,49011,49012,49013,49014,49015,49016,49017,49018,49019,49020,49021,49022,49023,49024,49025,49026,49027,49028,49029,49030,49031,49032,49033,49034,49035,49036,49037,49038,49039,49040,49041,49042,49043,49045,49046,49047,49048,49049,49050,49051,49052,49053,null,null,null,null,null,null,49054,49055,49056,49057,49058,49059,49060,49061,49062,49063,49064,49065,49066,49067,49068,49069,49070,49071,49073,49074,49075,49076,49077,49078,49079,49080,null,null,null,null,null,null,49081,49082,49083,49084,49085,49086,49087,49088,49089,49090,49091,49092,49094,49095,49096,49097,49098,49099,49102,49103,49105,49106,49107,49109,49110,49111,49112,49113,49114,49115,49117,49118,49120,49122,49123,49124,49125,49126,49127,49128,49129,49130,49131,49132,49133,49134,49135,49136,49137,49138,49139,49140,49141,49142,49143,49144,49145,49146,49147,49148,49149,49150,49151,49152,49153,49154,49155,49156,49157,49158,49159,49160,49161,49162,49163,49164,49165,49166,49167,49168,49169,49170,49171,49172,49173,49174,49175,49176,49177,49178,49179,49180,49181,49182,49183,49184,49185,49186,49187,49188,49189,49190,49191,49192,49193,49194,49195,49196,49197,49198,49199,49200,49201,49202,49203,49204,49205,49206,49207,49208,49209,49210,49211,49213,49214,49215,49216,49217,49218,49219,49220,49221,49222,49223,49224,49225,49226,49227,49228,49229,49230,49231,49232,49234,49235,49236,49237,49238,49239,49241,49242,49243,null,null,null,null,null,null,49245,49246,49247,49249,49250,49251,49252,49253,49254,49255,49258,49259,49260,49261,49262,49263,49264,49265,49266,49267,49268,49269,49270,49271,49272,49273,null,null,null,null,null,null,49274,49275,49276,49277,49278,49279,49280,49281,49282,49283,49284,49285,49286,49287,49288,49289,49290,49291,49292,49293,49294,49295,49298,49299,49301,49302,49303,49305,49306,49307,49308,49309,49310,49311,49314,49316,49318,49319,49320,49321,49322,49323,49326,49329,49330,49335,49336,49337,49338,49339,49342,49346,49347,49348,49350,49351,49354,49355,49357,49358,49359,49361,49362,49363,49364,49365,49366,49367,49370,49374,49375,49376,49377,49378,49379,49382,49383,49385,49386,49387,49389,49390,49391,49392,49393,49394,49395,49398,49400,49402,49403,49404,49405,49406,49407,49409,49410,49411,49413,49414,49415,49417,49418,49419,49420,49421,49422,49423,49425,49426,49427,49428,49430,49431,49432,49433,49434,49435,49441,49442,49445,49448,49449,49450,49451,49454,49458,49459,49460,49461,49463,49466,49467,49469,49470,49471,49473,49474,49475,49476,49477,49478,49479,49482,49486,49487,49488,49489,49490,49491,49494,49495,null,null,null,null,null,null,49497,49498,49499,49501,49502,49503,49504,49505,49506,49507,49510,49514,49515,49516,49517,49518,49519,49521,49522,49523,49525,49526,49527,49529,49530,49531,null,null,null,null,null,null,49532,49533,49534,49535,49536,49537,49538,49539,49540,49542,49543,49544,49545,49546,49547,49551,49553,49554,49555,49557,49559,49560,49561,49562,49563,49566,49568,49570,49571,49572,49574,49575,49578,49579,49581,49582,49583,49585,49586,49587,49588,49589,49590,49591,49592,49593,49594,49595,49596,49598,49599,49600,49601,49602,49603,49605,49606,49607,49609,49610,49611,49613,49614,49615,49616,49617,49618,49619,49621,49622,49625,49626,49627,49628,49629,49630,49631,49633,49634,49635,49637,49638,49639,49641,49642,49643,49644,49645,49646,49647,49650,49652,49653,49654,49655,49656,49657,49658,49659,49662,49663,49665,49666,49667,49669,49670,49671,49672,49673,49674,49675,49678,49680,49682,49683,49684,49685,49686,49687,49690,49691,49693,49694,49697,49698,49699,49700,49701,49702,49703,49706,49708,49710,49712,49715,49717,49718,49719,49720,49721,49722,49723,49724,49725,49726,49727,49728,49729,49730,49731,49732,49733,null,null,null,null,null,null,49734,49735,49737,49738,49739,49740,49741,49742,49743,49746,49747,49749,49750,49751,49753,49754,49755,49756,49757,49758,49759,49761,49762,49763,49764,49766,null,null,null,null,null,null,49767,49768,49769,49770,49771,49774,49775,49777,49778,49779,49781,49782,49783,49784,49785,49786,49787,49790,49792,49794,49795,49796,49797,49798,49799,49802,49803,49804,49805,49806,49807,49809,49810,49811,49812,49813,49814,49815,49817,49818,49820,49822,49823,49824,49825,49826,49827,49830,49831,49833,49834,49835,49838,49839,49840,49841,49842,49843,49846,49848,49850,49851,49852,49853,49854,49855,49856,49857,49858,49859,49860,49861,49862,49863,49864,49865,49866,49867,49868,49869,49870,49871,49872,49873,49874,49875,49876,49877,49878,49879,49880,49881,49882,49883,49886,49887,49889,49890,49893,49894,49895,49896,49897,49898,49902,49904,49906,49907,49908,49909,49911,49914,49917,49918,49919,49921,49922,49923,49924,49925,49926,49927,49930,49931,49934,49935,49936,49937,49938,49942,49943,49945,49946,49947,49949,49950,49951,49952,49953,49954,49955,49958,49959,49962,49963,49964,49965,49966,49967,49968,49969,49970,null,null,null,null,null,null,49971,49972,49973,49974,49975,49976,49977,49978,49979,49980,49981,49982,49983,49984,49985,49986,49987,49988,49990,49991,49992,49993,49994,49995,49996,49997,null,null,null,null,null,null,49998,49999,50000,50001,50002,50003,50004,50005,50006,50007,50008,50009,50010,50011,50012,50013,50014,50015,50016,50017,50018,50019,50020,50021,50022,50023,50026,50027,50029,50030,50031,50033,50035,50036,50037,50038,50039,50042,50043,50046,50047,50048,50049,50050,50051,50053,50054,50055,50057,50058,50059,50061,50062,50063,50064,50065,50066,50067,50068,50069,50070,50071,50072,50073,50074,50075,50076,50077,50078,50079,50080,50081,50082,50083,50084,50085,50086,50087,50088,50089,50090,50091,50092,50093,50094,50095,50096,50097,50098,50099,50100,50101,50102,50103,50104,50105,50106,50107,50108,50109,50110,50111,50113,50114,50115,50116,50117,50118,50119,50120,50121,50122,50123,50124,50125,50126,50127,50128,50129,50130,50131,50132,50133,50134,50135,50138,50139,50141,50142,50145,50147,50148,50149,50150,50151,50154,50155,50156,50158,50159,50160,50161,50162,50163,50166,50167,50169,50170,50171,50172,50173,50174,null,null,null,null,null,null,50175,50176,50177,50178,50179,50180,50181,50182,50183,50185,50186,50187,50188,50189,50190,50191,50193,50194,50195,50196,50197,50198,50199,50200,50201,50202,null,null,null,null,null,null,50203,50204,50205,50206,50207,50208,50209,50210,50211,50213,50214,50215,50216,50217,50218,50219,50221,50222,50223,50225,50226,50227,50229,50230,50231,50232,50233,50234,50235,50238,50239,50240,50241,50242,50243,50244,50245,50246,50247,50249,50250,50251,50252,50253,50254,50255,50256,50257,50258,50259,50260,50261,50262,50263,50264,50265,50266,50267,50268,50269,50270,50271,50272,50273,50274,50275,50278,50279,50281,50282,50283,50285,50286,50287,50288,50289,50290,50291,50294,50295,50296,50298,50299,50300,50301,50302,50303,50305,50306,50307,50308,50309,50310,50311,50312,50313,50314,50315,50316,50317,50318,50319,50320,50321,50322,50323,50325,50326,50327,50328,50329,50330,50331,50333,50334,50335,50336,50337,50338,50339,50340,50341,50342,50343,50344,50345,50346,50347,50348,50349,50350,50351,50352,50353,50354,50355,50356,50357,50358,50359,50361,50362,50363,50365,50366,50367,50368,50369,50370,50371,50372,50373,null,null,null,null,null,null,50374,50375,50376,50377,50378,50379,50380,50381,50382,50383,50384,50385,50386,50387,50388,50389,50390,50391,50392,50393,50394,50395,50396,50397,50398,50399,null,null,null,null,null,null,50400,50401,50402,50403,50404,50405,50406,50407,50408,50410,50411,50412,50413,50414,50415,50418,50419,50421,50422,50423,50425,50427,50428,50429,50430,50434,50435,50436,50437,50438,50439,50440,50441,50442,50443,50445,50446,50447,50449,50450,50451,50453,50454,50455,50456,50457,50458,50459,50461,50462,50463,50464,50465,50466,50467,50468,50469,50470,50471,50474,50475,50477,50478,50479,50481,50482,50483,50484,50485,50486,50487,50490,50492,50494,50495,50496,50497,50498,50499,50502,50503,50507,50511,50512,50513,50514,50518,50522,50523,50524,50527,50530,50531,50533,50534,50535,50537,50538,50539,50540,50541,50542,50543,50546,50550,50551,50552,50553,50554,50555,50558,50559,50561,50562,50563,50565,50566,50568,50569,50570,50571,50574,50576,50578,50579,50580,50582,50585,50586,50587,50589,50590,50591,50593,50594,50595,50596,50597,50598,50599,50600,50602,50603,50604,50605,50606,50607,50608,50609,50610,50611,50614,null,null,null,null,null,null,50615,50618,50623,50624,50625,50626,50627,50635,50637,50639,50642,50643,50645,50646,50647,50649,50650,50651,50652,50653,50654,50655,50658,50660,50662,50663,null,null,null,null,null,null,50664,50665,50666,50667,50671,50673,50674,50675,50677,50680,50681,50682,50683,50690,50691,50692,50697,50698,50699,50701,50702,50703,50705,50706,50707,50708,50709,50710,50711,50714,50717,50718,50719,50720,50721,50722,50723,50726,50727,50729,50730,50731,50735,50737,50738,50742,50744,50746,50748,50749,50750,50751,50754,50755,50757,50758,50759,50761,50762,50763,50764,50765,50766,50767,50770,50774,50775,50776,50777,50778,50779,50782,50783,50785,50786,50787,50788,50789,50790,50791,50792,50793,50794,50795,50797,50798,50800,50802,50803,50804,50805,50806,50807,50810,50811,50813,50814,50815,50817,50818,50819,50820,50821,50822,50823,50826,50828,50830,50831,50832,50833,50834,50835,50838,50839,50841,50842,50843,50845,50846,50847,50848,50849,50850,50851,50854,50856,50858,50859,50860,50861,50862,50863,50866,50867,50869,50870,50871,50875,50876,50877,50878,50879,50882,50884,50886,50887,50888,50889,50890,50891,50894,null,null,null,null,null,null,50895,50897,50898,50899,50901,50902,50903,50904,50905,50906,50907,50910,50911,50914,50915,50916,50917,50918,50919,50922,50923,50925,50926,50927,50929,50930,null,null,null,null,null,null,50931,50932,50933,50934,50935,50938,50939,50940,50942,50943,50944,50945,50946,50947,50950,50951,50953,50954,50955,50957,50958,50959,50960,50961,50962,50963,50966,50968,50970,50971,50972,50973,50974,50975,50978,50979,50981,50982,50983,50985,50986,50987,50988,50989,50990,50991,50994,50996,50998,51000,51001,51002,51003,51006,51007,51009,51010,51011,51013,51014,51015,51016,51017,51019,51022,51024,51033,51034,51035,51037,51038,51039,51041,51042,51043,51044,51045,51046,51047,51049,51050,51052,51053,51054,51055,51056,51057,51058,51059,51062,51063,51065,51066,51067,51071,51072,51073,51074,51078,51083,51084,51085,51087,51090,51091,51093,51097,51099,51100,51101,51102,51103,51106,51111,51112,51113,51114,51115,51118,51119,51121,51122,51123,51125,51126,51127,51128,51129,51130,51131,51134,51138,51139,51140,51141,51142,51143,51146,51147,51149,51151,51153,51154,51155,51156,51157,51158,51159,51161,51162,51163,51164,null,null,null,null,null,null,51166,51167,51168,51169,51170,51171,51173,51174,51175,51177,51178,51179,51181,51182,51183,51184,51185,51186,51187,51188,51189,51190,51191,51192,51193,51194,null,null,null,null,null,null,51195,51196,51197,51198,51199,51202,51203,51205,51206,51207,51209,51211,51212,51213,51214,51215,51218,51220,51223,51224,51225,51226,51227,51230,51231,51233,51234,51235,51237,51238,51239,51240,51241,51242,51243,51246,51248,51250,51251,51252,51253,51254,51255,51257,51258,51259,51261,51262,51263,51265,51266,51267,51268,51269,51270,51271,51274,51275,51278,51279,51280,51281,51282,51283,51285,51286,51287,51288,51289,51290,51291,51292,51293,51294,51295,51296,51297,51298,51299,51300,51301,51302,51303,51304,51305,51306,51307,51308,51309,51310,51311,51314,51315,51317,51318,51319,51321,51323,51324,51325,51326,51327,51330,51332,51336,51337,51338,51342,51343,51344,51345,51346,51347,51349,51350,51351,51352,51353,51354,51355,51356,51358,51360,51362,51363,51364,51365,51366,51367,51369,51370,51371,51372,51373,51374,51375,51376,51377,51378,51379,51380,51381,51382,51383,51384,51385,51386,51387,51390,51391,51392,51393,null,null,null,null,null,null,51394,51395,51397,51398,51399,51401,51402,51403,51405,51406,51407,51408,51409,51410,51411,51414,51416,51418,51419,51420,51421,51422,51423,51426,51427,51429,null,null,null,null,null,null,51430,51431,51432,51433,51434,51435,51436,51437,51438,51439,51440,51441,51442,51443,51444,51446,51447,51448,51449,51450,51451,51454,51455,51457,51458,51459,51463,51464,51465,51466,51467,51470,12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,177,215,247,8800,8804,8805,8734,8756,176,8242,8243,8451,8491,65504,65505,65509,9794,9792,8736,8869,8978,8706,8711,8801,8786,167,8251,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8594,8592,8593,8595,8596,12307,8810,8811,8730,8765,8733,8757,8747,8748,8712,8715,8838,8839,8834,8835,8746,8745,8743,8744,65506,51472,51474,51475,51476,51477,51478,51479,51481,51482,51483,51484,51485,51486,51487,51488,51489,51490,51491,51492,51493,51494,51495,51496,51497,51498,51499,null,null,null,null,null,null,51501,51502,51503,51504,51505,51506,51507,51509,51510,51511,51512,51513,51514,51515,51516,51517,51518,51519,51520,51521,51522,51523,51524,51525,51526,51527,null,null,null,null,null,null,51528,51529,51530,51531,51532,51533,51534,51535,51538,51539,51541,51542,51543,51545,51546,51547,51548,51549,51550,51551,51554,51556,51557,51558,51559,51560,51561,51562,51563,51565,51566,51567,8658,8660,8704,8707,180,65374,711,728,733,730,729,184,731,161,191,720,8750,8721,8719,164,8457,8240,9665,9664,9655,9654,9828,9824,9825,9829,9831,9827,8857,9672,9635,9680,9681,9618,9636,9637,9640,9639,9638,9641,9832,9743,9742,9756,9758,182,8224,8225,8597,8599,8601,8598,8600,9837,9833,9834,9836,12927,12828,8470,13255,8482,13250,13272,8481,8364,174,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51569,51570,51571,51573,51574,51575,51576,51577,51578,51579,51581,51582,51583,51584,51585,51586,51587,51588,51589,51590,51591,51594,51595,51597,51598,51599,null,null,null,null,null,null,51601,51602,51603,51604,51605,51606,51607,51610,51612,51614,51615,51616,51617,51618,51619,51620,51621,51622,51623,51624,51625,51626,51627,51628,51629,51630,null,null,null,null,null,null,51631,51632,51633,51634,51635,51636,51637,51638,51639,51640,51641,51642,51643,51644,51645,51646,51647,51650,51651,51653,51654,51657,51659,51660,51661,51662,51663,51666,51668,51671,51672,51675,65281,65282,65283,65284,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65510,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,51678,51679,51681,51683,51685,51686,51688,51689,51690,51691,51694,51698,51699,51700,51701,51702,51703,51706,51707,51709,51710,51711,51713,51714,51715,51716,null,null,null,null,null,null,51717,51718,51719,51722,51726,51727,51728,51729,51730,51731,51733,51734,51735,51737,51738,51739,51740,51741,51742,51743,51744,51745,51746,51747,51748,51749,null,null,null,null,null,null,51750,51751,51752,51754,51755,51756,51757,51758,51759,51760,51761,51762,51763,51764,51765,51766,51767,51768,51769,51770,51771,51772,51773,51774,51775,51776,51777,51778,51779,51780,51781,51782,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,51783,51784,51785,51786,51787,51790,51791,51793,51794,51795,51797,51798,51799,51800,51801,51802,51803,51806,51810,51811,51812,51813,51814,51815,51817,51818,null,null,null,null,null,null,51819,51820,51821,51822,51823,51824,51825,51826,51827,51828,51829,51830,51831,51832,51833,51834,51835,51836,51838,51839,51840,51841,51842,51843,51845,51846,null,null,null,null,null,null,51847,51848,51849,51850,51851,51852,51853,51854,51855,51856,51857,51858,51859,51860,51861,51862,51863,51865,51866,51867,51868,51869,51870,51871,51872,51873,51874,51875,51876,51877,51878,51879,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,null,null,null,null,null,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,51880,51881,51882,51883,51884,51885,51886,51887,51888,51889,51890,51891,51892,51893,51894,51895,51896,51897,51898,51899,51902,51903,51905,51906,51907,51909,null,null,null,null,null,null,51910,51911,51912,51913,51914,51915,51918,51920,51922,51924,51925,51926,51927,51930,51931,51932,51933,51934,51935,51937,51938,51939,51940,51941,51942,51943,null,null,null,null,null,null,51944,51945,51946,51947,51949,51950,51951,51952,51953,51954,51955,51957,51958,51959,51960,51961,51962,51963,51964,51965,51966,51967,51968,51969,51970,51971,51972,51973,51974,51975,51977,51978,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,9490,9489,9498,9497,9494,9493,9486,9485,9502,9503,9505,9506,9510,9511,9513,9514,9517,9518,9521,9522,9525,9526,9529,9530,9533,9534,9536,9537,9539,9540,9541,9542,9543,9544,9545,9546,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,51979,51980,51981,51982,51983,51985,51986,51987,51989,51990,51991,51993,51994,51995,51996,51997,51998,51999,52002,52003,52004,52005,52006,52007,52008,52009,null,null,null,null,null,null,52010,52011,52012,52013,52014,52015,52016,52017,52018,52019,52020,52021,52022,52023,52024,52025,52026,52027,52028,52029,52030,52031,52032,52034,52035,52036,null,null,null,null,null,null,52037,52038,52039,52042,52043,52045,52046,52047,52049,52050,52051,52052,52053,52054,52055,52058,52059,52060,52062,52063,52064,52065,52066,52067,52069,52070,52071,52072,52073,52074,52075,52076,13205,13206,13207,8467,13208,13252,13219,13220,13221,13222,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13258,13197,13198,13199,13263,13192,13193,13256,13223,13224,13232,13233,13234,13235,13236,13237,13238,13239,13240,13241,13184,13185,13186,13187,13188,13242,13243,13244,13245,13246,13247,13200,13201,13202,13203,13204,8486,13248,13249,13194,13195,13196,13270,13253,13229,13230,13231,13275,13225,13226,13227,13228,13277,13264,13267,13251,13257,13276,13254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52077,52078,52079,52080,52081,52082,52083,52084,52085,52086,52087,52090,52091,52092,52093,52094,52095,52096,52097,52098,52099,52100,52101,52102,52103,52104,null,null,null,null,null,null,52105,52106,52107,52108,52109,52110,52111,52112,52113,52114,52115,52116,52117,52118,52119,52120,52121,52122,52123,52125,52126,52127,52128,52129,52130,52131,null,null,null,null,null,null,52132,52133,52134,52135,52136,52137,52138,52139,52140,52141,52142,52143,52144,52145,52146,52147,52148,52149,52150,52151,52153,52154,52155,52156,52157,52158,52159,52160,52161,52162,52163,52164,198,208,170,294,null,306,null,319,321,216,338,186,222,358,330,null,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,189,8531,8532,188,190,8539,8540,8541,8542,52165,52166,52167,52168,52169,52170,52171,52172,52173,52174,52175,52176,52177,52178,52179,52181,52182,52183,52184,52185,52186,52187,52188,52189,52190,52191,null,null,null,null,null,null,52192,52193,52194,52195,52197,52198,52200,52202,52203,52204,52205,52206,52207,52208,52209,52210,52211,52212,52213,52214,52215,52216,52217,52218,52219,52220,null,null,null,null,null,null,52221,52222,52223,52224,52225,52226,52227,52228,52229,52230,52231,52232,52233,52234,52235,52238,52239,52241,52242,52243,52245,52246,52247,52248,52249,52250,52251,52254,52255,52256,52259,52260,230,273,240,295,305,307,312,320,322,248,339,223,254,359,331,329,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,12827,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,185,178,179,8308,8319,8321,8322,8323,8324,52261,52262,52266,52267,52269,52271,52273,52274,52275,52276,52277,52278,52279,52282,52287,52288,52289,52290,52291,52294,52295,52297,52298,52299,52301,52302,null,null,null,null,null,null,52303,52304,52305,52306,52307,52310,52314,52315,52316,52317,52318,52319,52321,52322,52323,52325,52327,52329,52330,52331,52332,52333,52334,52335,52337,52338,null,null,null,null,null,null,52339,52340,52342,52343,52344,52345,52346,52347,52348,52349,52350,52351,52352,52353,52354,52355,52356,52357,52358,52359,52360,52361,52362,52363,52364,52365,52366,52367,52368,52369,52370,52371,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,52372,52373,52374,52375,52378,52379,52381,52382,52383,52385,52386,52387,52388,52389,52390,52391,52394,52398,52399,52400,52401,52402,52403,52406,52407,52409,null,null,null,null,null,null,52410,52411,52413,52414,52415,52416,52417,52418,52419,52422,52424,52426,52427,52428,52429,52430,52431,52433,52434,52435,52437,52438,52439,52440,52441,52442,null,null,null,null,null,null,52443,52444,52445,52446,52447,52448,52449,52450,52451,52453,52454,52455,52456,52457,52458,52459,52461,52462,52463,52465,52466,52467,52468,52469,52470,52471,52472,52473,52474,52475,52476,52477,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,52478,52479,52480,52482,52483,52484,52485,52486,52487,52490,52491,52493,52494,52495,52497,52498,52499,52500,52501,52502,52503,52506,52508,52510,52511,52512,null,null,null,null,null,null,52513,52514,52515,52517,52518,52519,52521,52522,52523,52525,52526,52527,52528,52529,52530,52531,52532,52533,52534,52535,52536,52538,52539,52540,52541,52542,null,null,null,null,null,null,52543,52544,52545,52546,52547,52548,52549,52550,52551,52552,52553,52554,52555,52556,52557,52558,52559,52560,52561,52562,52563,52564,52565,52566,52567,52568,52569,52570,52571,52573,52574,52575,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,52577,52578,52579,52581,52582,52583,52584,52585,52586,52587,52590,52592,52594,52595,52596,52597,52598,52599,52601,52602,52603,52604,52605,52606,52607,52608,null,null,null,null,null,null,52609,52610,52611,52612,52613,52614,52615,52617,52618,52619,52620,52621,52622,52623,52624,52625,52626,52627,52630,52631,52633,52634,52635,52637,52638,52639,null,null,null,null,null,null,52640,52641,52642,52643,52646,52648,52650,52651,52652,52653,52654,52655,52657,52658,52659,52660,52661,52662,52663,52664,52665,52666,52667,52668,52669,52670,52671,52672,52673,52674,52675,52677,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52678,52679,52680,52681,52682,52683,52685,52686,52687,52689,52690,52691,52692,52693,52694,52695,52696,52697,52698,52699,52700,52701,52702,52703,52704,52705,null,null,null,null,null,null,52706,52707,52708,52709,52710,52711,52713,52714,52715,52717,52718,52719,52721,52722,52723,52724,52725,52726,52727,52730,52732,52734,52735,52736,52737,52738,null,null,null,null,null,null,52739,52741,52742,52743,52745,52746,52747,52749,52750,52751,52752,52753,52754,52755,52757,52758,52759,52760,52762,52763,52764,52765,52766,52767,52770,52771,52773,52774,52775,52777,52778,52779,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52780,52781,52782,52783,52786,52788,52790,52791,52792,52793,52794,52795,52796,52797,52798,52799,52800,52801,52802,52803,52804,52805,52806,52807,52808,52809,null,null,null,null,null,null,52810,52811,52812,52813,52814,52815,52816,52817,52818,52819,52820,52821,52822,52823,52826,52827,52829,52830,52834,52835,52836,52837,52838,52839,52842,52844,null,null,null,null,null,null,52846,52847,52848,52849,52850,52851,52854,52855,52857,52858,52859,52861,52862,52863,52864,52865,52866,52867,52870,52872,52874,52875,52876,52877,52878,52879,52882,52883,52885,52886,52887,52889,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,52890,52891,52892,52893,52894,52895,52898,52902,52903,52904,52905,52906,52907,52910,52911,52912,52913,52914,52915,52916,52917,52918,52919,52920,52921,52922,null,null,null,null,null,null,52923,52924,52925,52926,52927,52928,52930,52931,52932,52933,52934,52935,52936,52937,52938,52939,52940,52941,52942,52943,52944,52945,52946,52947,52948,52949,null,null,null,null,null,null,52950,52951,52952,52953,52954,52955,52956,52957,52958,52959,52960,52961,52962,52963,52966,52967,52969,52970,52973,52974,52975,52976,52977,52978,52979,52982,52986,52987,52988,52989,52990,52991,44032,44033,44036,44039,44040,44041,44042,44048,44049,44050,44051,44052,44053,44054,44055,44057,44058,44059,44060,44061,44064,44068,44076,44077,44079,44080,44081,44088,44089,44092,44096,44107,44109,44116,44120,44124,44144,44145,44148,44151,44152,44154,44160,44161,44163,44164,44165,44166,44169,44170,44171,44172,44176,44180,44188,44189,44191,44192,44193,44200,44201,44202,44204,44207,44208,44216,44217,44219,44220,44221,44225,44228,44232,44236,44245,44247,44256,44257,44260,44263,44264,44266,44268,44271,44272,44273,44275,44277,44278,44284,44285,44288,44292,44294,52994,52995,52997,52998,52999,53001,53002,53003,53004,53005,53006,53007,53010,53012,53014,53015,53016,53017,53018,53019,53021,53022,53023,53025,53026,53027,null,null,null,null,null,null,53029,53030,53031,53032,53033,53034,53035,53038,53042,53043,53044,53045,53046,53047,53049,53050,53051,53052,53053,53054,53055,53056,53057,53058,53059,53060,null,null,null,null,null,null,53061,53062,53063,53064,53065,53066,53067,53068,53069,53070,53071,53072,53073,53074,53075,53078,53079,53081,53082,53083,53085,53086,53087,53088,53089,53090,53091,53094,53096,53098,53099,53100,44300,44301,44303,44305,44312,44316,44320,44329,44332,44333,44340,44341,44344,44348,44356,44357,44359,44361,44368,44372,44376,44385,44387,44396,44397,44400,44403,44404,44405,44406,44411,44412,44413,44415,44417,44418,44424,44425,44428,44432,44444,44445,44452,44471,44480,44481,44484,44488,44496,44497,44499,44508,44512,44516,44536,44537,44540,44543,44544,44545,44552,44553,44555,44557,44564,44592,44593,44596,44599,44600,44602,44608,44609,44611,44613,44614,44618,44620,44621,44622,44624,44628,44630,44636,44637,44639,44640,44641,44645,44648,44649,44652,44656,44664,53101,53102,53103,53106,53107,53109,53110,53111,53113,53114,53115,53116,53117,53118,53119,53121,53122,53123,53124,53126,53127,53128,53129,53130,53131,53133,null,null,null,null,null,null,53134,53135,53136,53137,53138,53139,53140,53141,53142,53143,53144,53145,53146,53147,53148,53149,53150,53151,53152,53154,53155,53156,53157,53158,53159,53161,null,null,null,null,null,null,53162,53163,53164,53165,53166,53167,53169,53170,53171,53172,53173,53174,53175,53176,53177,53178,53179,53180,53181,53182,53183,53184,53185,53186,53187,53189,53190,53191,53192,53193,53194,53195,44665,44667,44668,44669,44676,44677,44684,44732,44733,44734,44736,44740,44748,44749,44751,44752,44753,44760,44761,44764,44776,44779,44781,44788,44792,44796,44807,44808,44813,44816,44844,44845,44848,44850,44852,44860,44861,44863,44865,44866,44867,44872,44873,44880,44892,44893,44900,44901,44921,44928,44932,44936,44944,44945,44949,44956,44984,44985,44988,44992,44999,45000,45001,45003,45005,45006,45012,45020,45032,45033,45040,45041,45044,45048,45056,45057,45060,45068,45072,45076,45084,45085,45096,45124,45125,45128,45130,45132,45134,45139,45140,45141,45143,45145,53196,53197,53198,53199,53200,53201,53202,53203,53204,53205,53206,53207,53208,53209,53210,53211,53212,53213,53214,53215,53218,53219,53221,53222,53223,53225,null,null,null,null,null,null,53226,53227,53228,53229,53230,53231,53234,53236,53238,53239,53240,53241,53242,53243,53245,53246,53247,53249,53250,53251,53253,53254,53255,53256,53257,53258,null,null,null,null,null,null,53259,53260,53261,53262,53263,53264,53266,53267,53268,53269,53270,53271,53273,53274,53275,53276,53277,53278,53279,53280,53281,53282,53283,53284,53285,53286,53287,53288,53289,53290,53291,53292,45149,45180,45181,45184,45188,45196,45197,45199,45201,45208,45209,45210,45212,45215,45216,45217,45218,45224,45225,45227,45228,45229,45230,45231,45233,45235,45236,45237,45240,45244,45252,45253,45255,45256,45257,45264,45265,45268,45272,45280,45285,45320,45321,45323,45324,45328,45330,45331,45336,45337,45339,45340,45341,45347,45348,45349,45352,45356,45364,45365,45367,45368,45369,45376,45377,45380,45384,45392,45393,45396,45397,45400,45404,45408,45432,45433,45436,45440,45442,45448,45449,45451,45453,45458,45459,45460,45464,45468,45480,45516,45520,45524,45532,45533,53294,53295,53296,53297,53298,53299,53302,53303,53305,53306,53307,53309,53310,53311,53312,53313,53314,53315,53318,53320,53322,53323,53324,53325,53326,53327,null,null,null,null,null,null,53329,53330,53331,53333,53334,53335,53337,53338,53339,53340,53341,53342,53343,53345,53346,53347,53348,53349,53350,53351,53352,53353,53354,53355,53358,53359,null,null,null,null,null,null,53361,53362,53363,53365,53366,53367,53368,53369,53370,53371,53374,53375,53376,53378,53379,53380,53381,53382,53383,53384,53385,53386,53387,53388,53389,53390,53391,53392,53393,53394,53395,53396,45535,45544,45545,45548,45552,45561,45563,45565,45572,45573,45576,45579,45580,45588,45589,45591,45593,45600,45620,45628,45656,45660,45664,45672,45673,45684,45685,45692,45700,45701,45705,45712,45713,45716,45720,45721,45722,45728,45729,45731,45733,45734,45738,45740,45744,45748,45768,45769,45772,45776,45778,45784,45785,45787,45789,45794,45796,45797,45798,45800,45803,45804,45805,45806,45807,45811,45812,45813,45815,45816,45817,45818,45819,45823,45824,45825,45828,45832,45840,45841,45843,45844,45845,45852,45908,45909,45910,45912,45915,45916,45918,45919,45924,45925,53397,53398,53399,53400,53401,53402,53403,53404,53405,53406,53407,53408,53409,53410,53411,53414,53415,53417,53418,53419,53421,53422,53423,53424,53425,53426,null,null,null,null,null,null,53427,53430,53432,53434,53435,53436,53437,53438,53439,53442,53443,53445,53446,53447,53450,53451,53452,53453,53454,53455,53458,53462,53463,53464,53465,53466,null,null,null,null,null,null,53467,53470,53471,53473,53474,53475,53477,53478,53479,53480,53481,53482,53483,53486,53490,53491,53492,53493,53494,53495,53497,53498,53499,53500,53501,53502,53503,53504,53505,53506,53507,53508,45927,45929,45931,45934,45936,45937,45940,45944,45952,45953,45955,45956,45957,45964,45968,45972,45984,45985,45992,45996,46020,46021,46024,46027,46028,46030,46032,46036,46037,46039,46041,46043,46045,46048,46052,46056,46076,46096,46104,46108,46112,46120,46121,46123,46132,46160,46161,46164,46168,46176,46177,46179,46181,46188,46208,46216,46237,46244,46248,46252,46261,46263,46265,46272,46276,46280,46288,46293,46300,46301,46304,46307,46308,46310,46316,46317,46319,46321,46328,46356,46357,46360,46363,46364,46372,46373,46375,46376,46377,46378,46384,46385,46388,46392,53509,53510,53511,53512,53513,53514,53515,53516,53518,53519,53520,53521,53522,53523,53524,53525,53526,53527,53528,53529,53530,53531,53532,53533,53534,53535,null,null,null,null,null,null,53536,53537,53538,53539,53540,53541,53542,53543,53544,53545,53546,53547,53548,53549,53550,53551,53554,53555,53557,53558,53559,53561,53563,53564,53565,53566,null,null,null,null,null,null,53567,53570,53574,53575,53576,53577,53578,53579,53582,53583,53585,53586,53587,53589,53590,53591,53592,53593,53594,53595,53598,53600,53602,53603,53604,53605,53606,53607,53609,53610,53611,53613,46400,46401,46403,46404,46405,46411,46412,46413,46416,46420,46428,46429,46431,46432,46433,46496,46497,46500,46504,46506,46507,46512,46513,46515,46516,46517,46523,46524,46525,46528,46532,46540,46541,46543,46544,46545,46552,46572,46608,46609,46612,46616,46629,46636,46644,46664,46692,46696,46748,46749,46752,46756,46763,46764,46769,46804,46832,46836,46840,46848,46849,46853,46888,46889,46892,46895,46896,46904,46905,46907,46916,46920,46924,46932,46933,46944,46948,46952,46960,46961,46963,46965,46972,46973,46976,46980,46988,46989,46991,46992,46993,46994,46998,46999,53614,53615,53616,53617,53618,53619,53620,53621,53622,53623,53624,53625,53626,53627,53629,53630,53631,53632,53633,53634,53635,53637,53638,53639,53641,53642,null,null,null,null,null,null,53643,53644,53645,53646,53647,53648,53649,53650,53651,53652,53653,53654,53655,53656,53657,53658,53659,53660,53661,53662,53663,53666,53667,53669,53670,53671,null,null,null,null,null,null,53673,53674,53675,53676,53677,53678,53679,53682,53684,53686,53687,53688,53689,53691,53693,53694,53695,53697,53698,53699,53700,53701,53702,53703,53704,53705,53706,53707,53708,53709,53710,53711,47000,47001,47004,47008,47016,47017,47019,47020,47021,47028,47029,47032,47047,47049,47084,47085,47088,47092,47100,47101,47103,47104,47105,47111,47112,47113,47116,47120,47128,47129,47131,47133,47140,47141,47144,47148,47156,47157,47159,47160,47161,47168,47172,47185,47187,47196,47197,47200,47204,47212,47213,47215,47217,47224,47228,47245,47272,47280,47284,47288,47296,47297,47299,47301,47308,47312,47316,47325,47327,47329,47336,47337,47340,47344,47352,47353,47355,47357,47364,47384,47392,47420,47421,47424,47428,47436,47439,47441,47448,47449,47452,47456,47464,47465,53712,53713,53714,53715,53716,53717,53718,53719,53721,53722,53723,53724,53725,53726,53727,53728,53729,53730,53731,53732,53733,53734,53735,53736,53737,53738,null,null,null,null,null,null,53739,53740,53741,53742,53743,53744,53745,53746,53747,53749,53750,53751,53753,53754,53755,53756,53757,53758,53759,53760,53761,53762,53763,53764,53765,53766,null,null,null,null,null,null,53768,53770,53771,53772,53773,53774,53775,53777,53778,53779,53780,53781,53782,53783,53784,53785,53786,53787,53788,53789,53790,53791,53792,53793,53794,53795,53796,53797,53798,53799,53800,53801,47467,47469,47476,47477,47480,47484,47492,47493,47495,47497,47498,47501,47502,47532,47533,47536,47540,47548,47549,47551,47553,47560,47561,47564,47566,47567,47568,47569,47570,47576,47577,47579,47581,47582,47585,47587,47588,47589,47592,47596,47604,47605,47607,47608,47609,47610,47616,47617,47624,47637,47672,47673,47676,47680,47682,47688,47689,47691,47693,47694,47699,47700,47701,47704,47708,47716,47717,47719,47720,47721,47728,47729,47732,47736,47747,47748,47749,47751,47756,47784,47785,47787,47788,47792,47794,47800,47801,47803,47805,47812,47816,47832,47833,47868,53802,53803,53806,53807,53809,53810,53811,53813,53814,53815,53816,53817,53818,53819,53822,53824,53826,53827,53828,53829,53830,53831,53833,53834,53835,53836,null,null,null,null,null,null,53837,53838,53839,53840,53841,53842,53843,53844,53845,53846,53847,53848,53849,53850,53851,53853,53854,53855,53856,53857,53858,53859,53861,53862,53863,53864,null,null,null,null,null,null,53865,53866,53867,53868,53869,53870,53871,53872,53873,53874,53875,53876,53877,53878,53879,53880,53881,53882,53883,53884,53885,53886,53887,53890,53891,53893,53894,53895,53897,53898,53899,53900,47872,47876,47885,47887,47889,47896,47900,47904,47913,47915,47924,47925,47926,47928,47931,47932,47933,47934,47940,47941,47943,47945,47949,47951,47952,47956,47960,47969,47971,47980,48008,48012,48016,48036,48040,48044,48052,48055,48064,48068,48072,48080,48083,48120,48121,48124,48127,48128,48130,48136,48137,48139,48140,48141,48143,48145,48148,48149,48150,48151,48152,48155,48156,48157,48158,48159,48164,48165,48167,48169,48173,48176,48177,48180,48184,48192,48193,48195,48196,48197,48201,48204,48205,48208,48221,48260,48261,48264,48267,48268,48270,48276,48277,48279,53901,53902,53903,53906,53907,53908,53910,53911,53912,53913,53914,53915,53917,53918,53919,53921,53922,53923,53925,53926,53927,53928,53929,53930,53931,53933,null,null,null,null,null,null,53934,53935,53936,53938,53939,53940,53941,53942,53943,53946,53947,53949,53950,53953,53955,53956,53957,53958,53959,53962,53964,53965,53966,53967,53968,53969,null,null,null,null,null,null,53970,53971,53973,53974,53975,53977,53978,53979,53981,53982,53983,53984,53985,53986,53987,53990,53991,53992,53993,53994,53995,53996,53997,53998,53999,54002,54003,54005,54006,54007,54009,54010,48281,48282,48288,48289,48292,48295,48296,48304,48305,48307,48308,48309,48316,48317,48320,48324,48333,48335,48336,48337,48341,48344,48348,48372,48373,48374,48376,48380,48388,48389,48391,48393,48400,48404,48420,48428,48448,48456,48457,48460,48464,48472,48473,48484,48488,48512,48513,48516,48519,48520,48521,48522,48528,48529,48531,48533,48537,48538,48540,48548,48560,48568,48596,48597,48600,48604,48617,48624,48628,48632,48640,48643,48645,48652,48653,48656,48660,48668,48669,48671,48708,48709,48712,48716,48718,48724,48725,48727,48729,48730,48731,48736,48737,48740,54011,54012,54013,54014,54015,54018,54020,54022,54023,54024,54025,54026,54027,54031,54033,54034,54035,54037,54039,54040,54041,54042,54043,54046,54050,54051,null,null,null,null,null,null,54052,54054,54055,54058,54059,54061,54062,54063,54065,54066,54067,54068,54069,54070,54071,54074,54078,54079,54080,54081,54082,54083,54086,54087,54088,54089,null,null,null,null,null,null,54090,54091,54092,54093,54094,54095,54096,54097,54098,54099,54100,54101,54102,54103,54104,54105,54106,54107,54108,54109,54110,54111,54112,54113,54114,54115,54116,54117,54118,54119,54120,54121,48744,48746,48752,48753,48755,48756,48757,48763,48764,48765,48768,48772,48780,48781,48783,48784,48785,48792,48793,48808,48848,48849,48852,48855,48856,48864,48867,48868,48869,48876,48897,48904,48905,48920,48921,48923,48924,48925,48960,48961,48964,48968,48976,48977,48981,49044,49072,49093,49100,49101,49104,49108,49116,49119,49121,49212,49233,49240,49244,49248,49256,49257,49296,49297,49300,49304,49312,49313,49315,49317,49324,49325,49327,49328,49331,49332,49333,49334,49340,49341,49343,49344,49345,49349,49352,49353,49356,49360,49368,49369,49371,49372,49373,49380,54122,54123,54124,54125,54126,54127,54128,54129,54130,54131,54132,54133,54134,54135,54136,54137,54138,54139,54142,54143,54145,54146,54147,54149,54150,54151,null,null,null,null,null,null,54152,54153,54154,54155,54158,54162,54163,54164,54165,54166,54167,54170,54171,54173,54174,54175,54177,54178,54179,54180,54181,54182,54183,54186,54188,54190,null,null,null,null,null,null,54191,54192,54193,54194,54195,54197,54198,54199,54201,54202,54203,54205,54206,54207,54208,54209,54210,54211,54214,54215,54218,54219,54220,54221,54222,54223,54225,54226,54227,54228,54229,54230,49381,49384,49388,49396,49397,49399,49401,49408,49412,49416,49424,49429,49436,49437,49438,49439,49440,49443,49444,49446,49447,49452,49453,49455,49456,49457,49462,49464,49465,49468,49472,49480,49481,49483,49484,49485,49492,49493,49496,49500,49508,49509,49511,49512,49513,49520,49524,49528,49541,49548,49549,49550,49552,49556,49558,49564,49565,49567,49569,49573,49576,49577,49580,49584,49597,49604,49608,49612,49620,49623,49624,49632,49636,49640,49648,49649,49651,49660,49661,49664,49668,49676,49677,49679,49681,49688,49689,49692,49695,49696,49704,49705,49707,49709,54231,54233,54234,54235,54236,54237,54238,54239,54240,54242,54244,54245,54246,54247,54248,54249,54250,54251,54254,54255,54257,54258,54259,54261,54262,54263,null,null,null,null,null,null,54264,54265,54266,54267,54270,54272,54274,54275,54276,54277,54278,54279,54281,54282,54283,54284,54285,54286,54287,54288,54289,54290,54291,54292,54293,54294,null,null,null,null,null,null,54295,54296,54297,54298,54299,54300,54302,54303,54304,54305,54306,54307,54308,54309,54310,54311,54312,54313,54314,54315,54316,54317,54318,54319,54320,54321,54322,54323,54324,54325,54326,54327,49711,49713,49714,49716,49736,49744,49745,49748,49752,49760,49765,49772,49773,49776,49780,49788,49789,49791,49793,49800,49801,49808,49816,49819,49821,49828,49829,49832,49836,49837,49844,49845,49847,49849,49884,49885,49888,49891,49892,49899,49900,49901,49903,49905,49910,49912,49913,49915,49916,49920,49928,49929,49932,49933,49939,49940,49941,49944,49948,49956,49957,49960,49961,49989,50024,50025,50028,50032,50034,50040,50041,50044,50045,50052,50056,50060,50112,50136,50137,50140,50143,50144,50146,50152,50153,50157,50164,50165,50168,50184,50192,50212,50220,50224,54328,54329,54330,54331,54332,54333,54334,54335,54337,54338,54339,54341,54342,54343,54344,54345,54346,54347,54348,54349,54350,54351,54352,54353,54354,54355,null,null,null,null,null,null,54356,54357,54358,54359,54360,54361,54362,54363,54365,54366,54367,54369,54370,54371,54373,54374,54375,54376,54377,54378,54379,54380,54382,54384,54385,54386,null,null,null,null,null,null,54387,54388,54389,54390,54391,54394,54395,54397,54398,54401,54403,54404,54405,54406,54407,54410,54412,54414,54415,54416,54417,54418,54419,54421,54422,54423,54424,54425,54426,54427,54428,54429,50228,50236,50237,50248,50276,50277,50280,50284,50292,50293,50297,50304,50324,50332,50360,50364,50409,50416,50417,50420,50424,50426,50431,50432,50433,50444,50448,50452,50460,50472,50473,50476,50480,50488,50489,50491,50493,50500,50501,50504,50505,50506,50508,50509,50510,50515,50516,50517,50519,50520,50521,50525,50526,50528,50529,50532,50536,50544,50545,50547,50548,50549,50556,50557,50560,50564,50567,50572,50573,50575,50577,50581,50583,50584,50588,50592,50601,50612,50613,50616,50617,50619,50620,50621,50622,50628,50629,50630,50631,50632,50633,50634,50636,50638,54430,54431,54432,54433,54434,54435,54436,54437,54438,54439,54440,54442,54443,54444,54445,54446,54447,54448,54449,54450,54451,54452,54453,54454,54455,54456,null,null,null,null,null,null,54457,54458,54459,54460,54461,54462,54463,54464,54465,54466,54467,54468,54469,54470,54471,54472,54473,54474,54475,54477,54478,54479,54481,54482,54483,54485,null,null,null,null,null,null,54486,54487,54488,54489,54490,54491,54493,54494,54496,54497,54498,54499,54500,54501,54502,54503,54505,54506,54507,54509,54510,54511,54513,54514,54515,54516,54517,54518,54519,54521,54522,54524,50640,50641,50644,50648,50656,50657,50659,50661,50668,50669,50670,50672,50676,50678,50679,50684,50685,50686,50687,50688,50689,50693,50694,50695,50696,50700,50704,50712,50713,50715,50716,50724,50725,50728,50732,50733,50734,50736,50739,50740,50741,50743,50745,50747,50752,50753,50756,50760,50768,50769,50771,50772,50773,50780,50781,50784,50796,50799,50801,50808,50809,50812,50816,50824,50825,50827,50829,50836,50837,50840,50844,50852,50853,50855,50857,50864,50865,50868,50872,50873,50874,50880,50881,50883,50885,50892,50893,50896,50900,50908,50909,50912,50913,50920,54526,54527,54528,54529,54530,54531,54533,54534,54535,54537,54538,54539,54541,54542,54543,54544,54545,54546,54547,54550,54552,54553,54554,54555,54556,54557,null,null,null,null,null,null,54558,54559,54560,54561,54562,54563,54564,54565,54566,54567,54568,54569,54570,54571,54572,54573,54574,54575,54576,54577,54578,54579,54580,54581,54582,54583,null,null,null,null,null,null,54584,54585,54586,54587,54590,54591,54593,54594,54595,54597,54598,54599,54600,54601,54602,54603,54606,54608,54610,54611,54612,54613,54614,54615,54618,54619,54621,54622,54623,54625,54626,54627,50921,50924,50928,50936,50937,50941,50948,50949,50952,50956,50964,50965,50967,50969,50976,50977,50980,50984,50992,50993,50995,50997,50999,51004,51005,51008,51012,51018,51020,51021,51023,51025,51026,51027,51028,51029,51030,51031,51032,51036,51040,51048,51051,51060,51061,51064,51068,51069,51070,51075,51076,51077,51079,51080,51081,51082,51086,51088,51089,51092,51094,51095,51096,51098,51104,51105,51107,51108,51109,51110,51116,51117,51120,51124,51132,51133,51135,51136,51137,51144,51145,51148,51150,51152,51160,51165,51172,51176,51180,51200,51201,51204,51208,51210,54628,54630,54631,54634,54636,54638,54639,54640,54641,54642,54643,54646,54647,54649,54650,54651,54653,54654,54655,54656,54657,54658,54659,54662,54666,54667,null,null,null,null,null,null,54668,54669,54670,54671,54673,54674,54675,54676,54677,54678,54679,54680,54681,54682,54683,54684,54685,54686,54687,54688,54689,54690,54691,54692,54694,54695,null,null,null,null,null,null,54696,54697,54698,54699,54700,54701,54702,54703,54704,54705,54706,54707,54708,54709,54710,54711,54712,54713,54714,54715,54716,54717,54718,54719,54720,54721,54722,54723,54724,54725,54726,54727,51216,51217,51219,51221,51222,51228,51229,51232,51236,51244,51245,51247,51249,51256,51260,51264,51272,51273,51276,51277,51284,51312,51313,51316,51320,51322,51328,51329,51331,51333,51334,51335,51339,51340,51341,51348,51357,51359,51361,51368,51388,51389,51396,51400,51404,51412,51413,51415,51417,51424,51425,51428,51445,51452,51453,51456,51460,51461,51462,51468,51469,51471,51473,51480,51500,51508,51536,51537,51540,51544,51552,51553,51555,51564,51568,51572,51580,51592,51593,51596,51600,51608,51609,51611,51613,51648,51649,51652,51655,51656,51658,51664,51665,51667,54730,54731,54733,54734,54735,54737,54739,54740,54741,54742,54743,54746,54748,54750,54751,54752,54753,54754,54755,54758,54759,54761,54762,54763,54765,54766,null,null,null,null,null,null,54767,54768,54769,54770,54771,54774,54776,54778,54779,54780,54781,54782,54783,54786,54787,54789,54790,54791,54793,54794,54795,54796,54797,54798,54799,54802,null,null,null,null,null,null,54806,54807,54808,54809,54810,54811,54813,54814,54815,54817,54818,54819,54821,54822,54823,54824,54825,54826,54827,54828,54830,54831,54832,54833,54834,54835,54836,54837,54838,54839,54842,54843,51669,51670,51673,51674,51676,51677,51680,51682,51684,51687,51692,51693,51695,51696,51697,51704,51705,51708,51712,51720,51721,51723,51724,51725,51732,51736,51753,51788,51789,51792,51796,51804,51805,51807,51808,51809,51816,51837,51844,51864,51900,51901,51904,51908,51916,51917,51919,51921,51923,51928,51929,51936,51948,51956,51976,51984,51988,51992,52000,52001,52033,52040,52041,52044,52048,52056,52057,52061,52068,52088,52089,52124,52152,52180,52196,52199,52201,52236,52237,52240,52244,52252,52253,52257,52258,52263,52264,52265,52268,52270,52272,52280,52281,52283,54845,54846,54847,54849,54850,54851,54852,54854,54855,54858,54860,54862,54863,54864,54866,54867,54870,54871,54873,54874,54875,54877,54878,54879,54880,54881,null,null,null,null,null,null,54882,54883,54884,54885,54886,54888,54890,54891,54892,54893,54894,54895,54898,54899,54901,54902,54903,54904,54905,54906,54907,54908,54909,54910,54911,54912,null,null,null,null,null,null,54913,54914,54916,54918,54919,54920,54921,54922,54923,54926,54927,54929,54930,54931,54933,54934,54935,54936,54937,54938,54939,54940,54942,54944,54946,54947,54948,54949,54950,54951,54953,54954,52284,52285,52286,52292,52293,52296,52300,52308,52309,52311,52312,52313,52320,52324,52326,52328,52336,52341,52376,52377,52380,52384,52392,52393,52395,52396,52397,52404,52405,52408,52412,52420,52421,52423,52425,52432,52436,52452,52460,52464,52481,52488,52489,52492,52496,52504,52505,52507,52509,52516,52520,52524,52537,52572,52576,52580,52588,52589,52591,52593,52600,52616,52628,52629,52632,52636,52644,52645,52647,52649,52656,52676,52684,52688,52712,52716,52720,52728,52729,52731,52733,52740,52744,52748,52756,52761,52768,52769,52772,52776,52784,52785,52787,52789,54955,54957,54958,54959,54961,54962,54963,54964,54965,54966,54967,54968,54970,54972,54973,54974,54975,54976,54977,54978,54979,54982,54983,54985,54986,54987,null,null,null,null,null,null,54989,54990,54991,54992,54994,54995,54997,54998,55000,55002,55003,55004,55005,55006,55007,55009,55010,55011,55013,55014,55015,55017,55018,55019,55020,55021,null,null,null,null,null,null,55022,55023,55025,55026,55027,55028,55030,55031,55032,55033,55034,55035,55038,55039,55041,55042,55043,55045,55046,55047,55048,55049,55050,55051,55052,55053,55054,55055,55056,55058,55059,55060,52824,52825,52828,52831,52832,52833,52840,52841,52843,52845,52852,52853,52856,52860,52868,52869,52871,52873,52880,52881,52884,52888,52896,52897,52899,52900,52901,52908,52909,52929,52964,52965,52968,52971,52972,52980,52981,52983,52984,52985,52992,52993,52996,53000,53008,53009,53011,53013,53020,53024,53028,53036,53037,53039,53040,53041,53048,53076,53077,53080,53084,53092,53093,53095,53097,53104,53105,53108,53112,53120,53125,53132,53153,53160,53168,53188,53216,53217,53220,53224,53232,53233,53235,53237,53244,53248,53252,53265,53272,53293,53300,53301,53304,53308,55061,55062,55063,55066,55067,55069,55070,55071,55073,55074,55075,55076,55077,55078,55079,55082,55084,55086,55087,55088,55089,55090,55091,55094,55095,55097,null,null,null,null,null,null,55098,55099,55101,55102,55103,55104,55105,55106,55107,55109,55110,55112,55114,55115,55116,55117,55118,55119,55122,55123,55125,55130,55131,55132,55133,55134,null,null,null,null,null,null,55135,55138,55140,55142,55143,55144,55146,55147,55149,55150,55151,55153,55154,55155,55157,55158,55159,55160,55161,55162,55163,55166,55167,55168,55170,55171,55172,55173,55174,55175,55178,55179,53316,53317,53319,53321,53328,53332,53336,53344,53356,53357,53360,53364,53372,53373,53377,53412,53413,53416,53420,53428,53429,53431,53433,53440,53441,53444,53448,53449,53456,53457,53459,53460,53461,53468,53469,53472,53476,53484,53485,53487,53488,53489,53496,53517,53552,53553,53556,53560,53562,53568,53569,53571,53572,53573,53580,53581,53584,53588,53596,53597,53599,53601,53608,53612,53628,53636,53640,53664,53665,53668,53672,53680,53681,53683,53685,53690,53692,53696,53720,53748,53752,53767,53769,53776,53804,53805,53808,53812,53820,53821,53823,53825,53832,53852,55181,55182,55183,55185,55186,55187,55188,55189,55190,55191,55194,55196,55198,55199,55200,55201,55202,55203,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,53860,53888,53889,53892,53896,53904,53905,53909,53916,53920,53924,53932,53937,53944,53945,53948,53951,53952,53954,53960,53961,53963,53972,53976,53980,53988,53989,54000,54001,54004,54008,54016,54017,54019,54021,54028,54029,54030,54032,54036,54038,54044,54045,54047,54048,54049,54053,54056,54057,54060,54064,54072,54073,54075,54076,54077,54084,54085,54140,54141,54144,54148,54156,54157,54159,54160,54161,54168,54169,54172,54176,54184,54185,54187,54189,54196,54200,54204,54212,54213,54216,54217,54224,54232,54241,54243,54252,54253,54256,54260,54268,54269,54271,54273,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54280,54301,54336,54340,54364,54368,54372,54381,54383,54392,54393,54396,54399,54400,54402,54408,54409,54411,54413,54420,54441,54476,54480,54484,54492,54495,54504,54508,54512,54520,54523,54525,54532,54536,54540,54548,54549,54551,54588,54589,54592,54596,54604,54605,54607,54609,54616,54617,54620,54624,54629,54632,54633,54635,54637,54644,54645,54648,54652,54660,54661,54663,54664,54665,54672,54693,54728,54729,54732,54736,54738,54744,54745,54747,54749,54756,54757,54760,54764,54772,54773,54775,54777,54784,54785,54788,54792,54800,54801,54803,54804,54805,54812,54816,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,54820,54829,54840,54841,54844,54848,54853,54856,54857,54859,54861,54865,54868,54869,54872,54876,54887,54889,54896,54897,54900,54915,54917,54924,54925,54928,54932,54941,54943,54945,54952,54956,54960,54969,54971,54980,54981,54984,54988,54993,54996,54999,55001,55008,55012,55016,55024,55029,55036,55037,55040,55044,55057,55064,55065,55068,55072,55080,55081,55083,55085,55092,55093,55096,55100,55108,55111,55113,55120,55121,55124,55126,55127,55128,55129,55136,55137,55139,55141,55145,55148,55152,55156,55164,55165,55169,55176,55177,55180,55184,55192,55193,55195,55197,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20285,20339,20551,20729,21152,21487,21621,21733,22025,23233,23478,26247,26550,26551,26607,27468,29634,30146,31292,33499,33540,34903,34952,35382,36040,36303,36603,36838,39381,21051,21364,21508,24682,24932,27580,29647,33050,35258,35282,38307,20355,21002,22718,22904,23014,24178,24185,25031,25536,26438,26604,26751,28567,30286,30475,30965,31240,31487,31777,32925,33390,33393,35563,38291,20075,21917,26359,28212,30883,31469,33883,35088,34638,38824,21208,22350,22570,23884,24863,25022,25121,25954,26577,27204,28187,29976,30131,30435,30640,32058,37039,37969,37970,40853,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21283,23724,30002,32987,37440,38296,21083,22536,23004,23713,23831,24247,24378,24394,24951,27743,30074,30086,31968,32115,32177,32652,33108,33313,34193,35137,35611,37628,38477,40007,20171,20215,20491,20977,22607,24887,24894,24936,25913,27114,28433,30117,30342,30422,31623,33445,33995,63744,37799,38283,21888,23458,22353,63745,31923,32697,37301,20520,21435,23621,24040,25298,25454,25818,25831,28192,28844,31067,36317,36382,63746,36989,37445,37624,20094,20214,20581,24062,24314,24838,26967,33137,34388,36423,37749,39467,20062,20625,26480,26688,20745,21133,21138,27298,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30652,37392,40660,21163,24623,36850,20552,25001,25581,25802,26684,27268,28608,33160,35233,38548,22533,29309,29356,29956,32121,32365,32937,35211,35700,36963,40273,25225,27770,28500,32080,32570,35363,20860,24906,31645,35609,37463,37772,20140,20435,20510,20670,20742,21185,21197,21375,22384,22659,24218,24465,24950,25004,25806,25964,26223,26299,26356,26775,28039,28805,28913,29855,29861,29898,30169,30828,30956,31455,31478,32069,32147,32789,32831,33051,33686,35686,36629,36885,37857,38915,38968,39514,39912,20418,21843,22586,22865,23395,23622,24760,25106,26690,26800,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26856,28330,30028,30328,30926,31293,31995,32363,32380,35336,35489,35903,38542,40388,21476,21481,21578,21617,22266,22993,23396,23611,24235,25335,25911,25925,25970,26272,26543,27073,27837,30204,30352,30590,31295,32660,32771,32929,33167,33510,33533,33776,34241,34865,34996,35493,63747,36764,37678,38599,39015,39640,40723,21741,26011,26354,26767,31296,35895,40288,22256,22372,23825,26118,26801,26829,28414,29736,34974,39908,27752,63748,39592,20379,20844,20849,21151,23380,24037,24656,24685,25329,25511,25915,29657,31354,34467,36002,38799,20018,23521,25096,26524,29916,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31185,33747,35463,35506,36328,36942,37707,38982,24275,27112,34303,37101,63749,20896,23448,23532,24931,26874,27454,28748,29743,29912,31649,32592,33733,35264,36011,38364,39208,21038,24669,25324,36866,20362,20809,21281,22745,24291,26336,27960,28826,29378,29654,31568,33009,37979,21350,25499,32619,20054,20608,22602,22750,24618,24871,25296,27088,39745,23439,32024,32945,36703,20132,20689,21676,21932,23308,23968,24039,25898,25934,26657,27211,29409,30350,30703,32094,32761,33184,34126,34527,36611,36686,37066,39171,39509,39851,19992,20037,20061,20167,20465,20855,21246,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21312,21475,21477,21646,22036,22389,22434,23495,23943,24272,25084,25304,25937,26552,26601,27083,27472,27590,27628,27714,28317,28792,29399,29590,29699,30655,30697,31350,32127,32777,33276,33285,33290,33503,34914,35635,36092,36544,36881,37041,37476,37558,39378,39493,40169,40407,40860,22283,23616,33738,38816,38827,40628,21531,31384,32676,35033,36557,37089,22528,23624,25496,31391,23470,24339,31353,31406,33422,36524,20518,21048,21240,21367,22280,25331,25458,27402,28099,30519,21413,29527,34152,36470,38357,26426,27331,28528,35437,36556,39243,63750,26231,27512,36020,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,39740,63751,21483,22317,22862,25542,27131,29674,30789,31418,31429,31998,33909,35215,36211,36917,38312,21243,22343,30023,31584,33740,37406,63752,27224,20811,21067,21127,25119,26840,26997,38553,20677,21156,21220,25027,26020,26681,27135,29822,31563,33465,33771,35250,35641,36817,39241,63753,20170,22935,25810,26129,27278,29748,31105,31165,33449,34942,34943,35167,63754,37670,20235,21450,24613,25201,27762,32026,32102,20120,20834,30684,32943,20225,20238,20854,20864,21980,22120,22331,22522,22524,22804,22855,22931,23492,23696,23822,24049,24190,24524,25216,26071,26083,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26398,26399,26462,26827,26820,27231,27450,27683,27773,27778,28103,29592,29734,29738,29826,29859,30072,30079,30849,30959,31041,31047,31048,31098,31637,32000,32186,32648,32774,32813,32908,35352,35663,35912,36215,37665,37668,39138,39249,39438,39439,39525,40594,32202,20342,21513,25326,26708,37329,21931,20794,63755,63756,23068,25062,63757,25295,25343,63758,63759,63760,63761,63762,63763,37027,63764,63765,63766,63767,63768,35582,63769,63770,63771,63772,26262,63773,29014,63774,63775,38627,63776,25423,25466,21335,63777,26511,26976,28275,63778,30007,63779,63780,63781,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32013,63782,63783,34930,22218,23064,63784,63785,63786,63787,63788,20035,63789,20839,22856,26608,32784,63790,22899,24180,25754,31178,24565,24684,25288,25467,23527,23511,21162,63791,22900,24361,24594,63792,63793,63794,29785,63795,63796,63797,63798,63799,63800,39377,63801,63802,63803,63804,63805,63806,63807,63808,63809,63810,63811,28611,63812,63813,33215,36786,24817,63814,63815,33126,63816,63817,23615,63818,63819,63820,63821,63822,63823,63824,63825,23273,35365,26491,32016,63826,63827,63828,63829,63830,63831,33021,63832,63833,23612,27877,21311,28346,22810,33590,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20025,20150,20294,21934,22296,22727,24406,26039,26086,27264,27573,28237,30701,31471,31774,32222,34507,34962,37170,37723,25787,28606,29562,30136,36948,21846,22349,25018,25812,26311,28129,28251,28525,28601,30192,32835,33213,34113,35203,35527,35674,37663,27795,30035,31572,36367,36957,21776,22530,22616,24162,25095,25758,26848,30070,31958,34739,40680,20195,22408,22382,22823,23565,23729,24118,24453,25140,25825,29619,33274,34955,36024,38538,40667,23429,24503,24755,20498,20992,21040,22294,22581,22615,23566,23648,23798,23947,24230,24466,24764,25361,25481,25623,26691,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26873,27330,28120,28193,28372,28644,29182,30428,30585,31153,31291,33796,35241,36077,36339,36424,36867,36884,36947,37117,37709,38518,38876,27602,28678,29272,29346,29544,30563,31167,31716,32411,35712,22697,24775,25958,26109,26302,27788,28958,29129,35930,38931,20077,31361,20189,20908,20941,21205,21516,24999,26481,26704,26847,27934,28540,30140,30643,31461,33012,33891,37509,20828,26007,26460,26515,30168,31431,33651,63834,35910,36887,38957,23663,33216,33434,36929,36975,37389,24471,23965,27225,29128,30331,31561,34276,35588,37159,39472,21895,25078,63835,30313,32645,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34367,34746,35064,37007,63836,27931,28889,29662,32097,33853,63837,37226,39409,63838,20098,21365,27396,27410,28734,29211,34349,40478,21068,36771,23888,25829,25900,27414,28651,31811,32412,34253,35172,35261,25289,33240,34847,24266,26391,28010,29436,29701,29807,34690,37086,20358,23821,24480,33802,20919,25504,30053,20142,20486,20841,20937,26753,27153,31918,31921,31975,33391,35538,36635,37327,20406,20791,21237,21570,24300,24942,25150,26053,27354,28670,31018,34268,34851,38317,39522,39530,40599,40654,21147,26310,27511,28701,31019,36706,38722,24976,25088,25891,28451,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29001,29833,32244,32879,34030,36646,36899,37706,20925,21015,21155,27916,28872,35010,24265,25986,27566,28610,31806,29557,20196,20278,22265,63839,23738,23994,24604,29618,31533,32666,32718,32838,36894,37428,38646,38728,38936,40801,20363,28583,31150,37300,38583,21214,63840,25736,25796,27347,28510,28696,29200,30439,32769,34310,34396,36335,36613,38706,39791,40442,40565,30860,31103,32160,33737,37636,40575,40595,35542,22751,24324,26407,28711,29903,31840,32894,20769,28712,29282,30922,36034,36058,36084,38647,20102,20698,23534,24278,26009,29134,30274,30637,32842,34044,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36988,39719,40845,22744,23105,23650,27155,28122,28431,30267,32047,32311,34078,35128,37860,38475,21129,26066,26611,27060,27969,28316,28687,29705,29792,30041,30244,30827,35628,39006,20845,25134,38520,20374,20523,23833,28138,32184,36650,24459,24900,26647,63841,38534,21202,32907,20956,20940,26974,31260,32190,33777,38517,20442,21033,21400,21519,21774,23653,24743,26446,26792,28012,29313,29432,29702,29827,63842,30178,31852,32633,32696,33673,35023,35041,37324,37328,38626,39881,21533,28542,29136,29848,34298,36522,38563,40023,40607,26519,28107,29747,33256,38678,30764,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31435,31520,31890,25705,29802,30194,30908,30952,39340,39764,40635,23518,24149,28448,33180,33707,37000,19975,21325,23081,24018,24398,24930,25405,26217,26364,28415,28459,28771,30622,33836,34067,34875,36627,39237,39995,21788,25273,26411,27819,33545,35178,38778,20129,22916,24536,24537,26395,32178,32596,33426,33579,33725,36638,37017,22475,22969,23186,23504,26151,26522,26757,27599,29028,32629,36023,36067,36993,39749,33032,35978,38476,39488,40613,23391,27667,29467,30450,30431,33804,20906,35219,20813,20885,21193,26825,27796,30468,30496,32191,32236,38754,40629,28357,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,34065,20901,21517,21629,26126,26269,26919,28319,30399,30609,33559,33986,34719,37225,37528,40180,34946,20398,20882,21215,22982,24125,24917,25720,25721,26286,26576,27169,27597,27611,29279,29281,29761,30520,30683,32791,33468,33541,35584,35624,35980,26408,27792,29287,30446,30566,31302,40361,27519,27794,22818,26406,33945,21359,22675,22937,24287,25551,26164,26483,28218,29483,31447,33495,37672,21209,24043,25006,25035,25098,25287,25771,26080,26969,27494,27595,28961,29687,30045,32326,33310,33538,34154,35491,36031,38695,40289,22696,40664,20497,21006,21563,21839,25991,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27766,32010,32011,32862,34442,38272,38639,21247,27797,29289,21619,23194,23614,23883,24396,24494,26410,26806,26979,28220,28228,30473,31859,32654,34183,35598,36855,38753,40692,23735,24758,24845,25003,25935,26107,26108,27665,27887,29599,29641,32225,38292,23494,34588,35600,21085,21338,25293,25615,25778,26420,27192,27850,29632,29854,31636,31893,32283,33162,33334,34180,36843,38649,39361,20276,21322,21453,21467,25292,25644,25856,26001,27075,27886,28504,29677,30036,30242,30436,30460,30928,30971,31020,32070,33324,34784,36820,38930,39151,21187,25300,25765,28196,28497,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30332,36299,37297,37474,39662,39747,20515,20621,22346,22952,23592,24135,24439,25151,25918,26041,26049,26121,26507,27036,28354,30917,32033,32938,33152,33323,33459,33953,34444,35370,35607,37030,38450,40848,20493,20467,63843,22521,24472,25308,25490,26479,28227,28953,30403,32972,32986,35060,35061,35097,36064,36649,37197,38506,20271,20336,24091,26575,26658,30333,30334,39748,24161,27146,29033,29140,30058,63844,32321,34115,34281,39132,20240,31567,32624,38309,20961,24070,26805,27710,27726,27867,29359,31684,33539,27861,29754,20731,21128,22721,25816,27287,29863,30294,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,30887,34327,38370,38713,63845,21342,24321,35722,36776,36783,37002,21029,30629,40009,40712,19993,20482,20853,23643,24183,26142,26170,26564,26821,28851,29953,30149,31177,31453,36647,39200,39432,20445,22561,22577,23542,26222,27493,27921,28282,28541,29668,29995,33769,35036,35091,35676,36628,20239,20693,21264,21340,23443,24489,26381,31119,33145,33583,34068,35079,35206,36665,36667,39333,39954,26412,20086,20472,22857,23553,23791,23792,25447,26834,28925,29090,29739,32299,34028,34562,36898,37586,40179,19981,20184,20463,20613,21078,21103,21542,21648,22496,22827,23142,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23386,23413,23500,24220,63846,25206,25975,26023,28014,28325,29238,31526,31807,32566,33104,33105,33178,33344,33433,33705,35331,36000,36070,36091,36212,36282,37096,37340,38428,38468,39385,40167,21271,20998,21545,22132,22707,22868,22894,24575,24996,25198,26128,27774,28954,30406,31881,31966,32027,33452,36033,38640,63847,20315,24343,24447,25282,23849,26379,26842,30844,32323,40300,19989,20633,21269,21290,21329,22915,23138,24199,24754,24970,25161,25209,26000,26503,27047,27604,27606,27607,27608,27832,63848,29749,30202,30738,30865,31189,31192,31875,32203,32737,32933,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,33086,33218,33778,34586,35048,35513,35692,36027,37145,38750,39131,40763,22188,23338,24428,25996,27315,27567,27996,28657,28693,29277,29613,36007,36051,38971,24977,27703,32856,39425,20045,20107,20123,20181,20282,20284,20351,20447,20735,21490,21496,21766,21987,22235,22763,22882,23057,23531,23546,23556,24051,24107,24473,24605,25448,26012,26031,26614,26619,26797,27515,27801,27863,28195,28681,29509,30722,31038,31040,31072,31169,31721,32023,32114,32902,33293,33678,34001,34503,35039,35408,35422,35613,36060,36198,36781,37034,39164,39391,40605,21066,63849,26388,63850,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20632,21034,23665,25955,27733,29642,29987,30109,31639,33948,37240,38704,20087,25746,27578,29022,34217,19977,63851,26441,26862,28183,33439,34072,34923,25591,28545,37394,39087,19978,20663,20687,20767,21830,21930,22039,23360,23577,23776,24120,24202,24224,24258,24819,26705,27233,28248,29245,29248,29376,30456,31077,31665,32724,35059,35316,35443,35937,36062,38684,22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989,63853,31513,22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257,26329,26360,26646,26866,29312,29790,31598,32110,32214,32626,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32997,33298,34223,35199,35475,36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512,27728,28101,28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307,23459,25159,25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218,32341,32680,33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245,39854,21352,23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634,40807,21089,26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854,22478,22995,23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32854,32882,33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855,36016,21484,22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803,27836,28040,28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787,32032,32057,34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439,23660,26463,28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956,39137,29575,23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753,30862,37782,34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723,23744,24101,24833,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929,28465,29159,29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143,32172,32353,32670,33065,33585,33936,34010,34282,34966,35504,35728,36664,36930,36995,37228,37526,37561,38539,38567,38568,38614,38656,38920,39318,39635,39706,21460,22654,22809,23408,23487,28113,28506,29087,29729,29881,32901,33789,24033,24455,24490,24642,26092,26642,26991,27219,27529,27957,28147,29667,30462,30636,31565,32020,33059,33308,33600,34036,34147,35426,35524,37255,37662,38918,39348,25100,34899,36848,37477,23815,23847,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,23913,29791,33181,34664,28629,25342,32722,35126,35186,19998,20056,20711,21213,21319,25215,26119,32361,34821,38494,20365,21273,22070,22987,23204,23608,23630,23629,24066,24337,24643,26045,26159,26178,26558,26612,29468,30690,31034,32709,33940,33997,35222,35430,35433,35553,35925,35962,22516,23508,24335,24687,25325,26893,27542,28252,29060,31698,34645,35672,36606,39135,39166,20280,20353,20449,21627,23072,23480,24892,26032,26216,29180,30003,31070,32051,33102,33251,33688,34218,34254,34563,35338,36523,36763,63857,36805,22833,23460,23526,24713,23529,23563,24515,27777,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63858,28145,28683,29978,33455,35574,20160,21313,63859,38617,27663,20126,20420,20818,21854,23077,23784,25105,29273,33469,33706,34558,34905,35357,38463,38597,39187,40201,40285,22538,23731,23997,24132,24801,24853,25569,27138,28197,37122,37716,38990,39952,40823,23433,23736,25353,26191,26696,30524,38593,38797,38996,39839,26017,35585,36555,38332,21813,23721,24022,24245,26263,30284,33780,38343,22739,25276,29390,40232,20208,22830,24591,26171,27523,31207,40230,21395,21696,22467,23830,24859,26326,28079,30861,33406,38552,38724,21380,25212,25494,28082,32266,33099,38989,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,27387,32588,40367,40474,20063,20539,20918,22812,24825,25590,26928,29242,32822,63860,37326,24369,63861,63862,32004,33509,33903,33979,34277,36493,63863,20335,63864,63865,22756,23363,24665,25562,25880,25965,26264,63866,26954,27171,27915,28673,29036,30162,30221,31155,31344,63867,32650,63868,35140,63869,35731,37312,38525,63870,39178,22276,24481,26044,28417,30208,31142,35486,39341,39770,40812,20740,25014,25233,27277,33222,20547,22576,24422,28937,35328,35578,23420,34326,20474,20796,22196,22852,25513,28153,23978,26989,20870,20104,20313,63871,63872,63873,22914,63874,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63875,27487,27741,63876,29877,30998,63877,33287,33349,33593,36671,36701,63878,39192,63879,63880,63881,20134,63882,22495,24441,26131,63883,63884,30123,32377,35695,63885,36870,39515,22181,22567,23032,23071,23476,63886,24310,63887,63888,25424,25403,63889,26941,27783,27839,28046,28051,28149,28436,63890,28895,28982,29017,63891,29123,29141,63892,30799,30831,63893,31605,32227,63894,32303,63895,34893,36575,63896,63897,63898,37467,63899,40182,63900,63901,63902,24709,28037,63903,29105,63904,63905,38321,21421,63906,63907,63908,26579,63909,28814,28976,29744,33398,33490,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63910,38331,39653,40573,26308,63911,29121,33865,63912,63913,22603,63914,63915,23992,24433,63916,26144,26254,27001,27054,27704,27891,28214,28481,28634,28699,28719,29008,29151,29552,63917,29787,63918,29908,30408,31310,32403,63919,63920,33521,35424,36814,63921,37704,63922,38681,63923,63924,20034,20522,63925,21000,21473,26355,27757,28618,29450,30591,31330,33454,34269,34306,63926,35028,35427,35709,35947,63927,37555,63928,38675,38928,20116,20237,20425,20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735,63929,25034,25942,26111,26212,26791,27738,28595,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28879,29100,29522,31613,34568,35492,39986,40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277,34314,20800,22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926,31401,31402,33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609,29715,29740,30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448,26106,26505,27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031,63930,63931,20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303,25622,25747,25854,63934,26332,63935,27208,63936,29183,29796,63937,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31368,31407,32327,32350,32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958,27442,28020,32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248,24898,27029,28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362,37780,37854,63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588,24858,24962,26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419,34261,34398,36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161,26671,29020,31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464,34131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36939,38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729,22291,22290,22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304,29232,29503,29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234,37470,20301,20553,20702,21361,22285,22996,23041,23561,24944,26256,28205,29234,29771,32239,32963,33806,33894,34111,34655,34907,35096,35586,36949,38859,39759,20083,20369,20754,20842,63943,21807,21929,23418,23461,24188,24189,24254,24736,24799,24840,24841,25540,25912,26377,63944,26580,26586,63945,26977,26978,27833,27943,63946,28216,63947,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,28641,29494,29495,63948,29788,30001,63949,30290,63950,63951,32173,33278,33848,35029,35480,35547,35565,36400,36418,36938,36926,36986,37193,37321,37742,63952,63953,22537,63954,27603,32905,32946,63955,63956,20801,22891,23609,63957,63958,28516,29607,32996,36103,63959,37399,38287,63960,63961,63962,63963,32895,25102,28700,32104,34701,63964,22432,24681,24903,27575,35518,37504,38577,20057,21535,28139,34093,38512,38899,39150,25558,27875,37009,20957,25033,33210,40441,20381,20506,20736,23452,24847,25087,25836,26885,27589,30097,30691,32681,33380,34191,34811,34915,35516,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,35696,37291,20108,20197,20234,63965,63966,22839,23016,63967,24050,24347,24411,24609,63968,63969,63970,63971,29246,29669,63972,30064,30157,63973,31227,63974,32780,32819,32900,33505,33617,63975,63976,36029,36019,36999,63977,63978,39156,39180,63979,63980,28727,30410,32714,32716,32764,35610,20154,20161,20995,21360,63981,21693,22240,23035,23493,24341,24525,28270,63982,63983,32106,33589,63984,34451,35469,63985,38765,38775,63986,63987,19968,20314,20350,22777,26085,28322,36920,37808,39353,20219,22764,22922,23001,24641,63988,63989,31252,63990,33615,36035,20837,21316,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,63991,63992,63993,20173,21097,23381,33471,20180,21050,21672,22985,23039,23376,23383,23388,24675,24904,28363,28825,29038,29574,29943,30133,30913,32043,32773,33258,33576,34071,34249,35566,36039,38604,20316,21242,22204,26027,26152,28796,28856,29237,32189,33421,37196,38592,40306,23409,26855,27544,28538,30430,23697,26283,28507,31668,31786,34870,38620,19976,20183,21280,22580,22715,22767,22892,23559,24115,24196,24373,25484,26290,26454,27167,27299,27404,28479,29254,63994,29520,29835,31456,31911,33144,33247,33255,33674,33900,34083,34196,34255,35037,36115,37292,38263,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38556,20877,21705,22312,23472,25165,26448,26685,26771,28221,28371,28797,32289,35009,36001,36617,40779,40782,29229,31631,35533,37658,20295,20302,20786,21632,22992,24213,25269,26485,26990,27159,27822,28186,29401,29482,30141,31672,32053,33511,33785,33879,34295,35419,36015,36487,36889,37048,38606,40799,21219,21514,23265,23490,25688,25973,28404,29380,63995,30340,31309,31515,31821,32318,32735,33659,35627,36042,36196,36321,36447,36842,36857,36969,37841,20291,20346,20659,20840,20856,21069,21098,22625,22652,22880,23560,23637,24283,24731,25136,26643,27583,27656,28593,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29006,29728,30000,30008,30033,30322,31564,31627,31661,31686,32399,35438,36670,36681,37439,37523,37666,37931,38651,39002,39019,39198,20999,25130,25240,27993,30308,31434,31680,32118,21344,23742,24215,28472,28857,31896,38673,39822,40670,25509,25722,34678,19969,20117,20141,20572,20597,21576,22979,23450,24128,24237,24311,24449,24773,25402,25919,25972,26060,26230,26232,26622,26984,27273,27491,27712,28096,28136,28191,28254,28702,28833,29582,29693,30010,30555,30855,31118,31243,31357,31934,32142,33351,35330,35562,35998,37165,37194,37336,37478,37580,37664,38662,38742,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38748,38914,40718,21046,21137,21884,22564,24093,24351,24716,25552,26799,28639,31085,31532,33229,34234,35069,35576,36420,37261,38500,38555,38717,38988,40778,20430,20806,20939,21161,22066,24340,24427,25514,25805,26089,26177,26362,26361,26397,26781,26839,27133,28437,28526,29031,29157,29226,29866,30522,31062,31066,31199,31264,31381,31895,31967,32068,32368,32903,34299,34468,35412,35519,36249,36481,36896,36973,37347,38459,38613,40165,26063,31751,36275,37827,23384,23562,21330,25305,29469,20519,23447,24478,24752,24939,26837,28121,29742,31278,32066,32156,32305,33131,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36394,36405,37758,37912,20304,22352,24038,24231,25387,32618,20027,20303,20367,20570,23005,32964,21610,21608,22014,22863,23449,24030,24282,26205,26417,26609,26666,27880,27954,28234,28557,28855,29664,30087,31820,32002,32044,32162,33311,34523,35387,35461,36208,36490,36659,36913,37198,37202,37956,39376,31481,31909,20426,20737,20934,22472,23535,23803,26201,27197,27994,28310,28652,28940,30063,31459,34850,36897,36981,38603,39423,33537,20013,20210,34886,37325,21373,27355,26987,27713,33914,22686,24974,26366,25327,28893,29969,30151,32338,33976,35657,36104,20043,21482,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21675,22320,22336,24535,25345,25351,25711,25903,26088,26234,26525,26547,27490,27744,27802,28460,30693,30757,31049,31063,32025,32930,33026,33267,33437,33463,34584,35468,63996,36100,36286,36978,30452,31257,31287,32340,32887,21767,21972,22645,25391,25634,26185,26187,26733,27035,27524,27941,28337,29645,29800,29857,30043,30137,30433,30494,30603,31206,32265,32285,33275,34095,34967,35386,36049,36587,36784,36914,37805,38499,38515,38663,20356,21489,23018,23241,24089,26702,29894,30142,31209,31378,33187,34541,36074,36300,36845,26015,26389,63997,22519,28503,32221,36655,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37878,38598,24501,25074,28548,19988,20376,20511,21449,21983,23919,24046,27425,27492,30923,31642,63998,36425,36554,36974,25417,25662,30528,31364,37679,38015,40810,25776,28591,29158,29864,29914,31428,31762,32386,31922,32408,35738,36106,38013,39184,39244,21049,23519,25830,26413,32046,20717,21443,22649,24920,24921,25082,26028,31449,35730,35734,20489,20513,21109,21809,23100,24288,24432,24884,25950,26124,26166,26274,27085,28356,28466,29462,30241,31379,33081,33369,33750,33980,20661,22512,23488,23528,24425,25505,30758,32181,33756,34081,37319,37365,20874,26613,31574,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36012,20932,22971,24765,34389,20508,63999,21076,23610,24957,25114,25299,25842,26021,28364,30240,33034,36448,38495,38587,20191,21315,21912,22825,24029,25797,27849,28154,29588,31359,33307,34214,36068,36368,36983,37351,38369,38433,38854,20984,21746,21894,24505,25764,28552,32180,36639,36685,37941,20681,23574,27838,28155,29979,30651,31805,31844,35449,35522,22558,22974,24086,25463,29266,30090,30571,35548,36028,36626,24307,26228,28152,32893,33729,35531,38737,39894,64000,21059,26367,28053,28399,32224,35558,36910,36958,39636,21021,21119,21736,24980,25220,25307,26786,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,26898,26970,27189,28818,28966,30813,30977,30990,31186,31245,32918,33400,33493,33609,34121,35970,36229,37218,37259,37294,20419,22225,29165,30679,34560,35320,23544,24534,26449,37032,21474,22618,23541,24740,24961,25696,32317,32880,34085,37507,25774,20652,23828,26368,22684,25277,25512,26894,27000,27166,28267,30394,31179,33467,33833,35535,36264,36861,37138,37195,37276,37648,37656,37786,38619,39478,39949,19985,30044,31069,31482,31569,31689,32302,33988,36441,36468,36600,36880,26149,26943,29763,20986,26414,40668,20805,24544,27798,34802,34909,34935,24756,33205,33795,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,36101,21462,21561,22068,23094,23601,28810,32736,32858,33030,33261,36259,37257,39519,40434,20596,20164,21408,24827,28204,23652,20360,20516,21988,23769,24159,24677,26772,27835,28100,29118,30164,30196,30305,31258,31305,32199,32251,32622,33268,34473,36636,38601,39347,40786,21063,21189,39149,35242,19971,26578,28422,20405,23522,26517,27784,28024,29723,30759,37341,37756,34756,31204,31281,24555,20182,21668,21822,22702,22949,24816,25171,25302,26422,26965,33333,38464,39345,39389,20524,21331,21828,22396,64001,25176,64002,25826,26219,26589,28609,28655,29730,29752,35351,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,37944,21585,22022,22374,24392,24986,27470,28760,28845,32187,35477,22890,33067,25506,30472,32829,36010,22612,25645,27067,23445,24081,28271,64003,34153,20812,21488,22826,24608,24907,27526,27760,27888,31518,32974,33492,36294,37040,39089,64004,25799,28580,25745,25860,20814,21520,22303,35342,24927,26742,64005,30171,31570,32113,36890,22534,27084,33151,35114,36864,38969,20600,22871,22956,25237,36879,39722,24925,29305,38358,22369,23110,24052,25226,25773,25850,26487,27874,27966,29228,29750,30772,32631,33453,36315,38935,21028,22338,26495,29256,29923,36009,36774,37393,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,38442,20843,21485,25420,20329,21764,24726,25943,27803,28031,29260,29437,31255,35207,35997,24429,28558,28921,33192,24846,20415,20559,25153,29255,31687,32232,32745,36941,38829,39449,36022,22378,24179,26544,33805,35413,21536,23318,24163,24290,24330,25987,32954,34109,38281,38491,20296,21253,21261,21263,21638,21754,22275,24067,24598,25243,25265,25429,64006,27873,28006,30129,30770,32990,33071,33502,33889,33970,34957,35090,36875,37610,39165,39825,24133,26292,26333,28689,29190,64007,20469,21117,24426,24915,26451,27161,28418,29922,31080,34920,35961,39111,39108,39491,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,21697,31263,26963,35575,35914,39080,39342,24444,25259,30130,30382,34987,36991,38466,21305,24380,24517,27852,29644,30050,30091,31558,33534,39325,20047,36924,19979,20309,21414,22799,24264,26160,27827,29781,33655,34662,36032,36944,38686,39957,22737,23416,34384,35604,40372,23506,24680,24717,26097,27735,28450,28579,28698,32597,32752,38289,38290,38480,38867,21106,36676,20989,21547,21688,21859,21898,27323,28085,32216,33382,37532,38519,40569,21512,21704,30418,34532,38308,38356,38492,20130,20233,23022,23270,24055,24658,25239,26477,26689,27782,28207,32568,32923,33322,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,64008,64009,38917,20133,20565,21683,22419,22874,23401,23475,25032,26999,28023,28707,34809,35299,35442,35559,36994,39405,39608,21182,26680,20502,24184,26447,33607,34892,20139,21521,22190,29670,37141,38911,39177,39255,39321,22099,22687,34395,35377,25010,27382,29563,36562,27463,38570,39511,22869,29184,36203,38761,20436,23796,24358,25080,26203,27883,28843,29572,29625,29694,30505,30541,32067,32098,32291,33335,34898,64010,36066,37449,39023,23377,31348,34880,38913,23244,20448,21332,22846,23805,25406,28025,29433,33029,33031,33698,37583,38960,20136,20804,21009,22411,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24418,27842,28366,28677,28752,28847,29074,29673,29801,33610,34722,34913,36872,37026,37795,39336,20846,24407,24800,24935,26291,34137,36426,37295,38795,20046,20114,21628,22741,22778,22909,23733,24359,25142,25160,26122,26215,27627,28009,28111,28246,28408,28564,28640,28649,28765,29392,29733,29786,29920,30355,31068,31946,32286,32993,33446,33899,33983,34382,34399,34676,35703,35946,37804,38912,39013,24785,25110,37239,23130,26127,28151,28222,29759,39746,24573,24794,31503,21700,24344,27742,27859,27946,28888,32005,34425,35340,40251,21270,21644,23301,27194,28779,30069,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,31117,31166,33457,33775,35441,35649,36008,38772,64011,25844,25899,30906,30907,31339,20024,21914,22864,23462,24187,24739,25563,27489,26213,26707,28185,29029,29872,32008,36996,39529,39973,27963,28369,29502,35905,38346,20976,24140,24488,24653,24822,24880,24908,26179,26180,27045,27841,28255,28361,28514,29004,29852,30343,31681,31783,33618,34647,36945,38541,40643,21295,22238,24315,24458,24674,24724,25079,26214,26371,27292,28142,28590,28784,29546,32362,33214,33588,34516,35496,36036,21123,29554,23446,27243,37892,21742,22150,23389,25928,25989,26313,26783,28045,28102,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,29243,32948,37237,39501,20399,20505,21402,21518,21564,21897,21957,24127,24460,26429,29030,29661,36869,21211,21235,22628,22734,28932,29071,29179,34224,35347,26248,34216,21927,26244,29002,33841,21321,21913,27585,24409,24509,25582,26249,28999,35569,36637,40638,20241,25658,28875,30054,34407,24676,35662,40440,20807,20982,21256,27958,33016,40657,26133,27427,28824,30165,21507,23673,32007,35350,27424,27453,27462,21560,24688,27965,32725,33288,20694,20958,21916,22123,22221,23020,23305,24076,24985,24984,25137,26206,26342,29081,29113,29114,29351,31143,31232,32690,35440,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], + "gb18030":[19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,20112,20118,20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,20151,20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,20188,20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,20218,20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,20242,20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,20270,20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,20293,20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,20328,20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,20352,20353,20354,20357,20358,20359,20362,20364,20366,20368,20370,20371,20373,20374,20376,20377,20378,20380,20382,20383,20385,20386,20388,20395,20397,20400,20401,20402,20403,20404,20406,20407,20408,20409,20410,20411,20412,20413,20414,20416,20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,20437,20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,20468,20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,20484,20485,20486,20487,20488,20489,20490,20491,20494,20496,20497,20499,20501,20502,20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,20544,20545,20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,20563,20564,20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,20579,20580,20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,20594,20595,20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,20614,20615,20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,20629,20630,20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20644,20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,20662,20663,20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678,20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,20691,20692,20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,20706,20707,20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,20726,20727,20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,20744,20745,20746,20748,20749,20750,20751,20752,20753,20755,20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798,20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,20824,20825,20827,20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,20842,20847,20850,20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,20879,20880,20881,20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,20903,20904,20905,20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,20930,20931,20933,20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,20951,20952,20953,20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,20969,20970,20972,20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,21004,21007,21008,21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,21030,21031,21034,21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,21062,21063,21064,21065,21067,21070,21071,21074,21075,21077,21079,21080,21081,21082,21083,21085,21087,21088,21090,21091,21092,21094,21096,21099,21100,21101,21102,21104,21105,21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21118,21120,21123,21124,21125,21126,21127,21129,21130,21131,21132,21133,21134,21135,21137,21138,21140,21141,21142,21143,21144,21145,21146,21148,21156,21157,21158,21159,21166,21167,21168,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21184,21185,21186,21188,21189,21190,21192,21194,21196,21197,21198,21199,21201,21203,21204,21205,21207,21209,21210,21211,21212,21213,21214,21216,21217,21218,21219,21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21233,21234,21235,21236,21237,21238,21239,21240,21243,21244,21245,21249,21250,21251,21252,21255,21257,21258,21259,21260,21262,21265,21266,21267,21268,21272,21275,21276,21278,21279,21282,21284,21285,21287,21288,21289,21291,21292,21293,21295,21296,21297,21298,21299,21300,21301,21302,21303,21304,21308,21309,21312,21314,21316,21318,21323,21324,21325,21328,21332,21336,21337,21339,21341,21349,21352,21354,21356,21357,21362,21366,21369,21371,21372,21373,21374,21376,21377,21379,21383,21384,21386,21390,21391,21392,21393,21394,21395,21396,21398,21399,21401,21403,21404,21406,21408,21409,21412,21415,21418,21419,21420,21421,21423,21424,21425,21426,21427,21428,21429,21431,21432,21433,21434,21436,21437,21438,21440,21443,21444,21445,21446,21447,21454,21455,21456,21458,21459,21461,21466,21468,21469,21470,21473,21474,21479,21492,21498,21502,21503,21504,21506,21509,21511,21515,21524,21528,21529,21530,21532,21538,21540,21541,21546,21552,21555,21558,21559,21562,21565,21567,21569,21570,21572,21573,21575,21577,21580,21581,21582,21583,21585,21594,21597,21598,21599,21600,21601,21603,21605,21607,21609,21610,21611,21612,21613,21614,21615,21616,21620,21625,21626,21630,21631,21633,21635,21637,21639,21640,21641,21642,21645,21649,21651,21655,21656,21660,21662,21663,21664,21665,21666,21669,21678,21680,21682,21685,21686,21687,21689,21690,21692,21694,21699,21701,21706,21707,21718,21720,21723,21728,21729,21730,21731,21732,21739,21740,21743,21744,21745,21748,21749,21750,21751,21752,21753,21755,21758,21760,21762,21763,21764,21765,21768,21770,21771,21772,21773,21774,21778,21779,21781,21782,21783,21784,21785,21786,21788,21789,21790,21791,21793,21797,21798,21800,21801,21803,21805,21810,21812,21813,21814,21816,21817,21818,21819,21821,21824,21826,21829,21831,21832,21835,21836,21837,21838,21839,21841,21842,21843,21844,21847,21848,21849,21850,21851,21853,21854,21855,21856,21858,21859,21864,21865,21867,21871,21872,21873,21874,21875,21876,21881,21882,21885,21887,21893,21894,21900,21901,21902,21904,21906,21907,21909,21910,21911,21914,21915,21918,21920,21921,21922,21923,21924,21925,21926,21928,21929,21930,21931,21932,21933,21934,21935,21936,21938,21940,21942,21944,21946,21948,21951,21952,21953,21954,21955,21958,21959,21960,21962,21963,21966,21967,21968,21973,21975,21976,21977,21978,21979,21982,21984,21986,21991,21993,21997,21998,22000,22001,22004,22006,22008,22009,22010,22011,22012,22015,22018,22019,22020,22021,22022,22023,22026,22027,22029,22032,22033,22034,22035,22036,22037,22038,22039,22041,22042,22044,22045,22048,22049,22050,22053,22054,22056,22057,22058,22059,22062,22063,22064,22067,22069,22071,22072,22074,22076,22077,22078,22080,22081,22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22095,22096,22097,22098,22099,22101,22102,22106,22107,22109,22110,22111,22112,22113,22115,22117,22118,22119,22125,22126,22127,22128,22130,22131,22132,22133,22135,22136,22137,22138,22141,22142,22143,22144,22145,22146,22147,22148,22151,22152,22153,22154,22155,22156,22157,22160,22161,22162,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174,22175,22176,22177,22178,22180,22181,22182,22183,22184,22185,22186,22187,22188,22189,22190,22192,22193,22194,22195,22196,22197,22198,22200,22201,22202,22203,22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217,22219,22220,22221,22222,22223,22224,22225,22226,22227,22229,22230,22232,22233,22236,22243,22245,22246,22247,22248,22249,22250,22252,22254,22255,22258,22259,22262,22263,22264,22267,22268,22272,22273,22274,22277,22279,22283,22284,22285,22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,22299,22301,22302,22304,22305,22306,22308,22309,22310,22311,22315,22321,22322,22324,22325,22326,22327,22328,22332,22333,22335,22337,22339,22340,22341,22342,22344,22345,22347,22354,22355,22356,22357,22358,22360,22361,22370,22371,22373,22375,22380,22382,22384,22385,22386,22388,22389,22392,22393,22394,22397,22398,22399,22400,22401,22407,22408,22409,22410,22413,22414,22415,22416,22417,22420,22421,22422,22423,22424,22425,22426,22428,22429,22430,22431,22437,22440,22442,22444,22447,22448,22449,22451,22453,22454,22455,22457,22458,22459,22460,22461,22462,22463,22464,22465,22468,22469,22470,22471,22472,22473,22474,22476,22477,22480,22481,22483,22486,22487,22491,22492,22494,22497,22498,22499,22501,22502,22503,22504,22505,22506,22507,22508,22510,22512,22513,22514,22515,22517,22518,22519,22523,22524,22526,22527,22529,22531,22532,22533,22536,22537,22538,22540,22542,22543,22544,22546,22547,22548,22550,22551,22552,22554,22555,22556,22557,22559,22562,22563,22565,22566,22567,22568,22569,22571,22572,22573,22574,22575,22577,22578,22579,22580,22582,22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,22597,22598,22599,22600,22601,22602,22603,22606,22607,22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623,22624,22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639,22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653,22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671,22672,22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690,22691,22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719,22720,22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765,22767,22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783,22784,22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801,22802,22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824,22828,22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853,22854,22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879,22881,22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921,22923,22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941,22943,22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965,22966,22967,22968,22970,22972,22973,22975,22976,22977,22978,22979,22980,22981,22983,22984,22985,22988,22989,22990,22991,22997,22998,23001,23003,23006,23007,23008,23009,23010,23012,23014,23015,23017,23018,23019,23021,23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23034,23036,23037,23038,23040,23042,23050,23051,23053,23054,23055,23056,23058,23060,23061,23062,23063,23065,23066,23067,23069,23070,23073,23074,23076,23078,23079,23080,23082,23083,23084,23085,23086,23087,23088,23091,23093,23095,23096,23097,23098,23099,23101,23102,23103,23105,23106,23107,23108,23109,23111,23112,23115,23116,23117,23118,23119,23120,23121,23122,23123,23124,23126,23127,23128,23129,23131,23132,23133,23134,23135,23136,23137,23139,23140,23141,23142,23144,23145,23147,23148,23149,23150,23151,23152,23153,23154,23155,23160,23161,23163,23164,23165,23166,23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,23187,23188,23189,23190,23191,23192,23193,23196,23197,23198,23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23211,23212,23213,23214,23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229,23231,23232,23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247,23248,23249,23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268,23269,23271,23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285,23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,23299,23300,23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312,23313,23314,23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327,23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,23341,23342,23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356,23357,23358,23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,23371,23372,23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403,23405,23406,23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423,23426,23430,23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464,23465,23468,23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489,23491,23496,23497,23498,23499,23501,23502,23503,23505,23508,23509,23510,23511,23512,23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531,23532,23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552,23554,23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575,23577,23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597,23598,23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628,23629,23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650,23652,23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669,23670,23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687,23689,23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713,23716,23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737,23738,23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754,23756,23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,23771,23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,23791,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,23806,23807,23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053,24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075,24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,24101,24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,24121,24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,24141,24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,24157,24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173,24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,24200,24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,24232,24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,24252,24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,24268,24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,24301,24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,24325,24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,24348,24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368,24370,24371,24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24401,24404,24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,24427,24430,24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,24454,24461,24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,24480,24482,24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,24498,24499,24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,24519,24520,24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,24546,24547,24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,24567,24569,24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,24600,24602,24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,24627,24628,24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,24647,24648,24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,24667,24668,24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,24695,24702,24704,24705,24706,24709,24710,24711,24712,24714,24715,24718,24719,24720,24721,24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,24741,24743,24745,24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,24766,24767,24768,24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,24783,24784,24786,24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,24804,24805,24810,24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,24834,24835,24836,24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,24854,24855,24856,24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,24874,24876,24877,24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890,24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,24902,24903,24905,24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,24921,24922,24923,24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,24938,24939,24940,24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,24954,24955,24956,24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,24970,24972,24973,24975,24976,24977,24978,24979,24981,24982,24983,24984,24985,24986,24987,24988,24990,24991,24992,24993,24994,24995,24996,24997,24998,25002,25003,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25016,25017,25018,25019,25020,25021,25023,25024,25025,25027,25028,25029,25030,25031,25033,25036,25037,25038,25039,25040,25043,25045,25046,25047,25048,25049,25050,25051,25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25063,25064,25065,25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25078,25079,25080,25081,25082,25083,25084,25085,25086,25088,25089,25090,25091,25092,25093,25095,25097,25107,25108,25113,25116,25117,25118,25120,25123,25126,25127,25128,25129,25131,25133,25135,25136,25137,25138,25141,25142,25144,25145,25146,25147,25148,25154,25156,25157,25158,25162,25167,25168,25173,25174,25175,25177,25178,25180,25181,25182,25183,25184,25185,25186,25188,25189,25192,25201,25202,25204,25205,25207,25208,25210,25211,25213,25217,25218,25219,25221,25222,25223,25224,25227,25228,25229,25230,25231,25232,25236,25241,25244,25245,25246,25251,25254,25255,25257,25258,25261,25262,25263,25264,25266,25267,25268,25270,25271,25272,25274,25278,25280,25281,25283,25291,25295,25297,25301,25309,25310,25312,25313,25316,25322,25323,25328,25330,25333,25336,25337,25338,25339,25344,25347,25348,25349,25350,25354,25355,25356,25357,25359,25360,25362,25363,25364,25365,25367,25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395,25396,25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415,25416,25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436,25437,25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459,25460,25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478,25483,25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502,25503,25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533,25535,25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555,25556,25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573,25574,25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593,25594,25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614,25617,25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636,25637,25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654,25655,25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677,25678,25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693,25695,25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710,25711,25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726,25727,25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743,25744,25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762,25763,25765,25766,25767,25768,25770,25771,25775,25777,25778,25779,25780,25782,25785,25787,25789,25790,25791,25793,25795,25796,25798,25799,25800,25801,25802,25803,25804,25807,25809,25811,25812,25813,25814,25817,25818,25819,25820,25821,25823,25824,25825,25827,25829,25831,25832,25833,25834,25835,25836,25837,25838,25839,25840,25841,25842,25843,25844,25845,25846,25847,25848,25849,25850,25851,25852,25853,25854,25855,25857,25858,25859,25860,25861,25862,25863,25864,25866,25867,25868,25869,25870,25871,25872,25873,25875,25876,25877,25878,25879,25881,25882,25883,25884,25885,25886,25887,25888,25889,25890,25891,25892,25894,25895,25896,25897,25898,25900,25901,25904,25905,25906,25907,25911,25914,25916,25917,25920,25921,25922,25923,25924,25926,25927,25930,25931,25933,25934,25936,25938,25939,25940,25943,25944,25946,25948,25951,25952,25953,25956,25957,25959,25960,25961,25962,25965,25966,25967,25969,25971,25973,25974,25976,25977,25978,25979,25980,25981,25982,25983,25984,25985,25986,25987,25988,25989,25990,25992,25993,25994,25997,25998,25999,26002,26004,26005,26006,26008,26010,26013,26014,26016,26018,26019,26022,26024,26026,26028,26030,26033,26034,26035,26036,26037,26038,26039,26040,26042,26043,26046,26047,26048,26050,26055,26056,26057,26058,26061,26064,26065,26067,26068,26069,26072,26073,26074,26075,26076,26077,26078,26079,26081,26083,26084,26090,26091,26098,26099,26100,26101,26104,26105,26107,26108,26109,26110,26111,26113,26116,26117,26119,26120,26121,26123,26125,26128,26129,26130,26134,26135,26136,26138,26139,26140,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26162,26163,26167,26168,26169,26170,26171,26173,26175,26176,26178,26180,26181,26182,26183,26184,26185,26186,26189,26190,26192,26193,26200,26201,26203,26204,26205,26206,26208,26210,26211,26213,26215,26217,26218,26219,26220,26221,26225,26226,26227,26229,26232,26233,26235,26236,26237,26239,26240,26241,26243,26245,26246,26248,26249,26250,26251,26253,26254,26255,26256,26258,26259,26260,26261,26264,26265,26266,26267,26268,26270,26271,26272,26273,26274,26275,26276,26277,26278,26281,26282,26283,26284,26285,26287,26288,26289,26290,26291,26293,26294,26295,26296,26298,26299,26300,26301,26303,26304,26305,26306,26307,26308,26309,26310,26311,26312,26313,26314,26315,26316,26317,26318,26319,26320,26321,26322,26323,26324,26325,26326,26327,26328,26330,26334,26335,26336,26337,26338,26339,26340,26341,26343,26344,26346,26347,26348,26349,26350,26351,26353,26357,26358,26360,26362,26363,26365,26369,26370,26371,26372,26373,26374,26375,26380,26382,26383,26385,26386,26387,26390,26392,26393,26394,26396,26398,26400,26401,26402,26403,26404,26405,26407,26409,26414,26416,26418,26419,26422,26423,26424,26425,26427,26428,26430,26431,26433,26436,26437,26439,26442,26443,26445,26450,26452,26453,26455,26456,26457,26458,26459,26461,26466,26467,26468,26470,26471,26475,26476,26478,26481,26484,26486,26488,26489,26490,26491,26493,26496,26498,26499,26501,26502,26504,26506,26508,26509,26510,26511,26513,26514,26515,26516,26518,26521,26523,26527,26528,26529,26532,26534,26537,26540,26542,26545,26546,26548,26553,26554,26555,26556,26557,26558,26559,26560,26562,26565,26566,26567,26568,26569,26570,26571,26572,26573,26574,26581,26582,26583,26587,26591,26593,26595,26596,26598,26599,26600,26602,26603,26605,26606,26610,26613,26614,26615,26616,26617,26618,26619,26620,26622,26625,26626,26627,26628,26630,26637,26640,26642,26644,26645,26648,26649,26650,26651,26652,26654,26655,26656,26658,26659,26660,26661,26662,26663,26664,26667,26668,26669,26670,26671,26672,26673,26676,26677,26678,26682,26683,26687,26695,26699,26701,26703,26706,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26730,26732,26733,26734,26735,26736,26737,26738,26739,26741,26744,26745,26746,26747,26748,26749,26750,26751,26752,26754,26756,26759,26760,26761,26762,26763,26764,26765,26766,26768,26769,26770,26772,26773,26774,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26787,26788,26789,26793,26794,26795,26796,26798,26801,26802,26804,26806,26807,26808,26809,26810,26811,26812,26813,26814,26815,26817,26819,26820,26821,26822,26823,26824,26826,26828,26830,26831,26832,26833,26835,26836,26838,26839,26841,26843,26844,26845,26846,26847,26849,26850,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26863,26866,26867,26868,26870,26871,26872,26875,26877,26878,26879,26880,26882,26883,26884,26886,26887,26888,26889,26890,26892,26895,26897,26899,26900,26901,26902,26903,26904,26905,26906,26907,26908,26909,26910,26913,26914,26915,26917,26918,26919,26920,26921,26922,26923,26924,26926,26927,26929,26930,26931,26933,26934,26935,26936,26938,26939,26940,26942,26944,26945,26947,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26965,26966,26968,26969,26971,26972,26975,26977,26978,26980,26981,26983,26984,26985,26986,26988,26989,26991,26992,26994,26995,26996,26997,26998,27002,27003,27005,27006,27007,27009,27011,27013,27018,27019,27020,27022,27023,27024,27025,27026,27027,27030,27031,27033,27034,27037,27038,27039,27040,27041,27042,27043,27044,27045,27046,27049,27050,27052,27054,27055,27056,27058,27059,27061,27062,27064,27065,27066,27068,27069,27070,27071,27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085,27087,27089,27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102,27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118,27119,27120,27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,27134,27136,27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148,27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163,27164,27165,27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180,27181,27182,27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196,27199,27200,27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213,27214,27215,27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230,27231,27232,27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245,27246,27247,27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261,27262,27263,27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276,27277,27279,27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293,27294,27295,27297,27298,27299,27300,27301,27302,27303,27304,27306,27309,27310,27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323,27324,27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336,27337,27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362,27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375,27376,27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388,27389,27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,27402,27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414,27415,27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433,27434,27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448,27451,27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469,27470,27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483,27484,27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503,27504,27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519,27520,27525,27528,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545,27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561,27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579,27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598,27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866,27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903,27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923,27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942,27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968,27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001,28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021,28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039,28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066,28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,28092,28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,28114,28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,28136,28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,28158,28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,28178,28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,28202,28204,28206,28208,28209,28211,28213,28214,28215,28217,28219,28220,28221,28222,28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,28236,28239,28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,28272,28273,28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28288,28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,28306,28307,28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,28323,28324,28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,28345,28348,28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,28365,28366,28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,28395,28396,28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,28410,28411,28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,28426,28427,28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,28443,28444,28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,28462,28464,28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,28480,28481,28482,28483,28484,28485,28488,28489,28490,28492,28494,28495,28496,28497,28498,28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,28512,28513,28515,28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,28529,28531,28533,28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,28547,28549,28550,28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,28566,28567,28568,28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,28581,28582,28584,28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,28596,28597,28599,28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,28613,28614,28615,28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,28629,28630,28631,28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,28645,28646,28647,28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,28660,28661,28662,28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,28673,28674,28675,28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,28686,28687,28688,28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,28702,28703,28704,28705,28706,28708,28709,28710,28711,28712,28713,28714,28715,28716,28717,28718,28719,28720,28721,28722,28723,28724,28726,28727,28728,28730,28731,28732,28733,28734,28735,28736,28737,28738,28739,28740,28741,28742,28743,28744,28745,28746,28747,28749,28750,28752,28753,28754,28755,28756,28757,28758,28759,28760,28761,28762,28763,28764,28765,28767,28768,28769,28770,28771,28772,28773,28774,28775,28776,28777,28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797,28801,28802,28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817,28819,28823,28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837,28838,28839,28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863,28868,28869,28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882,28883,28884,28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899,28901,28906,28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923,28924,28926,28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939,28940,28941,28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959,28960,28961,28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973,28974,28978,28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990,28991,28992,28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007,29008,29009,29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021,29023,29024,29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040,29041,29044,29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058,29059,29061,29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074,29075,29077,29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092,29093,29094,29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108,29110,29111,29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124,29125,29126,29127,29128,29129,29130,29131,29132,29133,29135,29136,29137,29138,29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151,29153,29154,29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168,29169,29170,29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182,29183,29184,29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196,29197,29198,29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209,29210,29211,29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223,29225,29227,29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249,29250,29251,29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267,29268,29269,29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290,29291,29292,29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309,29314,29315,29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332,29333,29334,29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346,29347,29348,29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363,29365,29370,29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386,29387,29388,29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567,58568,58569,58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580,58581,58582,58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593,58594,58595,58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606,58607,58608,58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619,58620,58621,58622,58623,58624,58625,58626,58627,58628,58629,58630,58631,58632,58633,58634,58635,58636,58637,58638,58639,58640,58641,58642,58643,58644,58645,58646,58647,58648,58649,58650,58651,58652,58653,58654,58655,58656,58657,58658,58659,58660,58661,12288,12289,12290,183,713,711,168,12291,12293,8212,65374,8214,8230,8216,8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712,8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800,8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164,65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,8251,8594,8592,8593,8595,12307,58662,58663,58664,58665,58666,58667,58668,58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681,58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694,58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,58721,58722,58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733,58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,58746,58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,59238,59239,59240,59241,59242,59243,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765,58766,58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778,58779,58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791,58792,58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804,58805,58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817,58818,58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830,58831,58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843,58844,58845,58846,58847,58848,58849,58850,58851,58852,12288,65281,65282,65283,65509,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,58854,58855,58856,58857,58858,58859,58860,58861,58862,58863,58864,58865,58866,58867,58868,58869,58870,58871,58872,58873,58874,58875,58876,58877,58878,58879,58880,58881,58882,58883,58884,58885,58886,58887,58888,58889,58890,58891,58892,58893,58894,58895,58896,58897,58898,58899,58900,58901,58902,58903,58904,58905,58906,58907,58908,58909,58910,58911,58912,58913,58914,58915,58916,58917,58918,58919,58920,58921,58922,58923,58924,58925,58926,58927,58928,58929,58930,58931,58932,58933,58934,58935,58936,58937,58938,58939,58940,58941,58942,58943,58944,58945,58946,58947,58948,58949,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,59250,59251,59252,59253,59254,59255,59256,59257,59258,59259,59260,58950,58951,58952,58953,58954,58955,58956,58957,58958,58959,58960,58961,58962,58963,58964,58965,58966,58967,58968,58969,58970,58971,58972,58973,58974,58975,58976,58977,58978,58979,58980,58981,58982,58983,58984,58985,58986,58987,58988,58989,58990,58991,58992,58993,58994,58995,58996,58997,58998,58999,59000,59001,59002,59003,59004,59005,59006,59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59017,59018,59019,59020,59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032,59033,59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265,59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,59108,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120,59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133,59134,59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269,59270,59271,59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,59277,59278,59279,59280,59281,59282,59283,65077,65078,65081,65082,65087,65088,65085,65086,65089,65090,65091,65092,59284,59285,65083,65084,65079,65080,65073,59286,65075,65076,59287,59288,59289,59290,59291,59292,59293,59294,59295,59142,59143,59144,59145,59146,59147,59148,59149,59150,59151,59152,59153,59154,59155,59156,59157,59158,59159,59160,59161,59162,59163,59164,59165,59166,59167,59168,59169,59170,59171,59172,59173,59174,59175,59176,59177,59178,59179,59180,59181,59182,59183,59184,59185,59186,59187,59188,59189,59190,59191,59192,59193,59194,59195,59196,59197,59198,59199,59200,59201,59202,59203,59204,59205,59206,59207,59208,59209,59210,59211,59212,59213,59214,59215,59216,59217,59218,59219,59220,59221,59222,59223,59224,59225,59226,59227,59228,59229,59230,59231,59232,59233,59234,59235,59236,59237,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,59296,59297,59298,59299,59300,59301,59302,59303,59304,59305,59306,59307,59308,59309,59310,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,59311,59312,59313,59314,59315,59316,59317,59318,59319,59320,59321,59322,59323,714,715,729,8211,8213,8229,8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701,9737,8853,12306,12317,12318,59324,59325,59326,59327,59328,59329,59330,59331,59332,59333,59334,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,249,470,472,474,476,252,234,593,7743,324,328,505,609,59337,59338,59339,59340,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,59341,59342,59343,59344,59345,59346,59347,59348,59349,59350,59351,59352,59353,59354,59355,59356,59357,59358,59359,59360,59361,12321,12322,12323,12324,12325,12326,12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252,13262,13265,13266,13269,65072,65506,65508,59362,8481,12849,59363,8208,59364,59365,59366,12540,12443,12444,12541,12542,12294,12445,12446,65097,65098,65099,65100,65101,65102,65103,65104,65105,65106,65108,65109,65110,65111,65113,65114,65115,65116,65117,65118,65119,65120,65121,65122,65123,65124,65125,65126,65128,65129,65130,65131,12350,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12295,59380,59381,59382,59383,59384,59385,59386,59387,59388,59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397,59398,59399,59400,59401,59402,59403,59404,59405,59406,59407,29404,29405,29407,29410,29411,29412,29413,29414,29415,29418,29419,29429,29430,29433,29437,29438,29439,29440,29442,29444,29445,29446,29447,29448,29449,29451,29452,29453,29455,29456,29457,29458,29460,29464,29465,29466,29471,29472,29475,29476,29478,29479,29480,29485,29487,29488,29490,29491,29493,29494,29498,29499,29500,29501,29504,29505,29506,29507,29508,29509,29510,29511,29512,29513,29514,29515,29516,29518,29519,29521,29523,29524,29525,29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538,29539,29540,29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,57344,57345,57346,57347,57348,57349,57350,57351,57352,57353,57354,57355,57356,57357,57358,57359,57360,57361,57362,57363,57364,57365,57366,57367,57368,57369,57370,57371,57372,57373,57374,57375,57376,57377,57378,57379,57380,57381,57382,57383,57384,57385,57386,57387,57388,57389,57390,57391,57392,57393,57394,57395,57396,57397,57398,57399,57400,57401,57402,57403,57404,57405,57406,57407,57408,57409,57410,57411,57412,57413,57414,57415,57416,57417,57418,57419,57420,57421,57422,57423,57424,57425,57426,57427,57428,57429,57430,57431,57432,57433,57434,57435,57436,57437,29554,29555,29556,29557,29558,29559,29560,29561,29562,29563,29564,29565,29567,29568,29569,29570,29571,29573,29574,29576,29578,29580,29581,29583,29584,29586,29587,29588,29589,29591,29592,29593,29594,29596,29597,29598,29600,29601,29603,29604,29605,29606,29607,29608,29610,29612,29613,29617,29620,29621,29622,29624,29625,29628,29629,29630,29631,29633,29635,29636,29637,29638,29639,29643,29644,29646,29650,29651,29652,29653,29654,29655,29656,29658,29659,29660,29661,29663,29665,29666,29667,29668,29670,29672,29674,29675,29676,29678,29679,29680,29681,29683,29684,29685,29686,29687,57438,57439,57440,57441,57442,57443,57444,57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456,57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469,57470,57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482,57483,57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495,57496,57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508,57509,57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521,57522,57523,57524,57525,57526,57527,57528,57529,57530,57531,29688,29689,29690,29691,29692,29693,29694,29695,29696,29697,29698,29700,29703,29704,29707,29708,29709,29710,29713,29714,29715,29716,29717,29718,29719,29720,29721,29724,29725,29726,29727,29728,29729,29731,29732,29735,29737,29739,29741,29743,29745,29746,29751,29752,29753,29754,29755,29757,29758,29759,29760,29762,29763,29764,29765,29766,29767,29768,29769,29770,29771,29772,29773,29774,29775,29776,29777,29778,29779,29780,29782,29784,29789,29792,29793,29794,29795,29796,29797,29798,29799,29800,29801,29802,29803,29804,29806,29807,29809,29810,29811,29812,29813,29816,29817,29818,57532,57533,57534,57535,57536,57537,57538,57539,57540,57541,57542,57543,57544,57545,57546,57547,57548,57549,57550,57551,57552,57553,57554,57555,57556,57557,57558,57559,57560,57561,57562,57563,57564,57565,57566,57567,57568,57569,57570,57571,57572,57573,57574,57575,57576,57577,57578,57579,57580,57581,57582,57583,57584,57585,57586,57587,57588,57589,57590,57591,57592,57593,57594,57595,57596,57597,57598,57599,57600,57601,57602,57603,57604,57605,57606,57607,57608,57609,57610,57611,57612,57613,57614,57615,57616,57617,57618,57619,57620,57621,57622,57623,57624,57625,29819,29820,29821,29823,29826,29828,29829,29830,29832,29833,29834,29836,29837,29839,29841,29842,29843,29844,29845,29846,29847,29848,29849,29850,29851,29853,29855,29856,29857,29858,29859,29860,29861,29862,29866,29867,29868,29869,29870,29871,29872,29873,29874,29875,29876,29877,29878,29879,29880,29881,29883,29884,29885,29886,29887,29888,29889,29890,29891,29892,29893,29894,29895,29896,29897,29898,29899,29900,29901,29902,29903,29904,29905,29907,29908,29909,29910,29911,29912,29913,29914,29915,29917,29919,29921,29925,29927,29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628,57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641,57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654,57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667,57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680,57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693,57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706,57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719,29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955,29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973,29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994,29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023,30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046,30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062,30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080,30081,30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727,57728,57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,57741,57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,57754,57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,57767,57768,57769,57770,57771,57772,57773,57774,57775,57776,57777,57778,57779,57780,57781,57782,57783,57784,57785,57786,57787,57788,57789,57790,57791,57792,57793,57794,57795,57796,57797,57798,57799,57800,57801,57802,57803,57804,57805,57806,57807,57808,57809,57810,57811,57812,57813,30088,30089,30090,30092,30093,30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121,30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158,30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181,30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203,30205,30206,30210,30212,30214,30215,30216,30217,30219,30221,30222,30223,30225,30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,30252,30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,30276,57814,57815,57816,57817,57818,57819,57820,57821,57822,57823,57824,57825,57826,57827,57828,57829,57830,57831,57832,57833,57834,57835,57836,57837,57838,57839,57840,57841,57842,57843,57844,57845,57846,57847,57848,57849,57850,57851,57852,57853,57854,57855,57856,57857,57858,57859,57860,57861,57862,57863,57864,57865,57866,57867,57868,57869,57870,57871,57872,57873,57874,57875,57876,57877,57878,57879,57880,57881,57882,57883,57884,57885,57886,57887,57888,57889,57890,57891,57892,57893,57894,57895,57896,57897,57898,57899,57900,57901,57902,57903,57904,57905,57906,57907,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288,30289,30290,30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305,30306,30308,30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321,30322,30323,30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339,30341,30345,30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362,30363,30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376,30377,30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393,30394,30395,30396,30397,30398,30400,30401,30403,21834,38463,22467,25384,21710,21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,23433,20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,32753,34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,30116,24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,30334,25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,29256,25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,32465,26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,30404,30407,30409,30411,30412,30419,30421,30425,30426,30428,30429,30430,30432,30433,30434,30435,30436,30438,30439,30440,30441,30442,30443,30444,30445,30448,30451,30453,30454,30455,30458,30459,30461,30463,30464,30466,30467,30469,30470,30474,30476,30478,30479,30480,30481,30482,30483,30484,30485,30486,30487,30488,30491,30492,30493,30494,30497,30499,30500,30501,30503,30506,30507,30508,30510,30512,30513,30514,30515,30516,30521,30523,30525,30526,30527,30530,30532,30533,30534,30536,30537,30538,30539,30540,30541,30542,30543,30546,30547,30548,30549,30550,30551,30552,30553,30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961,40077,29190,26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384,22791,24811,28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454,36856,36924,40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606,24065,24199,30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829,36793,32534,36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426,33176,34920,40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853,20912,26564,19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569,30570,30573,30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584,30586,30587,30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607,30608,30611,30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622,30625,30627,30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646,30647,30648,30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662,30663,30664,30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676,30677,30678,30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182,29627,33760,25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091,33334,33046,33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067,27493,31807,37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319,24425,33756,34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179,27815,34255,25805,31961,27133,26361,33609,21397,31574,20391,20876,27979,23618,36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046,35815,25286,26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416,39076,26124,29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711,30713,30714,30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734,30735,30736,30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762,30763,30766,30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787,30788,30790,30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809,30810,30811,30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823,30824,30825,30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842,30843,30845,30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607,32928,21378,25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818,36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785,38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548,35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536,32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456,25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021,20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853,30854,30856,30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878,30880,30882,30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901,30902,30903,30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,30918,30919,30920,30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,30938,30939,30940,30941,30942,30943,30944,30945,30946,30947,30948,30949,30950,30951,30953,30954,30955,30957,30958,30959,30960,30961,30963,30965,30966,30968,30969,30971,30972,30973,30974,30975,30976,30978,30979,30980,30982,30983,30984,30985,30986,30987,30988,30784,20648,30679,25616,35302,22788,25571,24029,31359,26941,20256,33337,21912,20018,30126,31383,24162,24202,38383,21019,21561,28810,25462,38180,22402,26149,26943,37255,21767,28147,32431,34850,25139,32496,30133,33576,30913,38604,36766,24904,29943,35789,27492,21050,36176,27425,32874,33905,22257,21254,20174,19995,20945,31895,37259,31751,20419,36479,31713,31388,25703,23828,20652,33030,30209,31929,28140,32736,26449,23384,23544,30923,25774,25619,25514,25387,38169,25645,36798,31572,30249,25171,22823,21574,27513,20643,25140,24102,27526,20195,36151,34955,24453,36910,30989,30990,30991,30992,30993,30994,30996,30997,30998,30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,31013,31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,31026,31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,31047,31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,31065,31073,31075,31076,31078,31081,31082,31083,31084,31086,31088,31089,31090,31091,31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,31110,31111,31112,31113,31115,31116,31117,31118,31120,31121,31122,24608,32829,25285,20025,21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,34507,24403,25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,21040,31291,24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,20979,37011,22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,24213,22320,33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,20856,38747,22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,38613,20939,20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,21472,31123,31124,31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,31138,31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,31152,31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,31175,31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,31195,31196,31197,31198,31200,31201,31202,31205,31208,31210,31212,31214,31217,31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,31256,31257,31259,31260,19969,30447,21486,38025,39030,40718,38189,23450,35746,20002,19996,20908,33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,26007,38497,35910,36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,36172,26460,38208,32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,22534,20817,38431,23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,25479,21702,22810,22842,22427,36530,26421,36346,33333,21057,24816,22549,34558,23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295,24681,32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268,31269,31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301,31303,31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316,31317,31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31345,31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371,31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,36144,21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763,27146,30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867,22346,33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750,21857,39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545,27675,20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016,23553,26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857,20964,20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526,20239,20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409,31410,31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424,31425,31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438,31439,31440,31441,31442,31443,31444,31445,31447,31448,31450,31451,31452,31453,31457,31458,31460,31463,31464,31465,31466,31467,31468,31470,31472,31473,31474,31475,31476,31477,31478,31479,31480,31483,31484,31486,31488,31489,31490,31493,31495,31497,31500,31501,31502,31504,31506,31507,31510,31511,31512,31514,31516,31517,31519,31521,31522,31523,31527,31529,31533,28014,28074,31119,34993,24343,29995,25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171,22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648,22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487,32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703,28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733,27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548,38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,31535,31536,31538,31540,31541,31542,31543,31545,31547,31549,31551,31552,31553,31554,31555,31556,31558,31560,31562,31565,31566,31571,31573,31575,31577,31580,31582,31583,31585,31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31599,31600,31603,31604,31606,31608,31610,31612,31613,31615,31617,31618,31619,31620,31622,31623,31624,31625,31626,31627,31628,31630,31631,31633,31634,31635,31638,31640,31641,31642,31643,31646,31647,31648,31651,31652,31653,31662,31663,31664,31666,31667,31669,31670,31671,31673,31674,31675,31676,31677,31678,31679,31680,31682,31683,31684,22466,32831,26775,24037,25915,21151,24685,40858,20379,36524,20844,23467,24339,24041,27742,25329,36129,20849,38057,21246,27807,33503,29399,22434,26500,36141,22815,36764,33735,21653,31629,20272,27837,23396,22993,40723,21476,34506,39592,35895,32929,25925,39038,22266,38599,21038,29916,21072,23521,25346,35074,20054,25296,24618,26874,20851,23448,20896,35266,31649,39302,32592,24815,28748,36143,20809,24191,36891,29808,35268,22317,30789,24402,40863,38394,36712,39740,35809,30328,26690,26588,36330,36149,21053,36746,28378,26829,38149,37101,22269,26524,35065,36807,21704,31685,31688,31689,31690,31691,31693,31694,31695,31696,31698,31700,31701,31702,31703,31704,31707,31708,31710,31711,31712,31714,31715,31716,31719,31720,31721,31723,31724,31725,31727,31728,31730,31731,31732,31733,31734,31736,31737,31738,31739,31741,31743,31744,31745,31746,31747,31748,31749,31750,31752,31753,31754,31757,31758,31760,31761,31762,31763,31764,31765,31767,31768,31769,31770,31771,31772,31773,31774,31776,31777,31778,31779,31780,31781,31784,31785,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796,31797,31798,31799,31801,31802,31803,31804,31805,31806,31810,39608,23401,28023,27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,23506,20989,21898,32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,22831,26477,33322,22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,21917,33655,33743,26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,36203,35088,40548,36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,34913,24658,36720,21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,29492,21564,21402,20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,29392,31946,28246,31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,31823,31824,31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837,31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,31849,31850,31851,31852,31853,31854,31855,31856,31857,31858,31861,31862,31863,31864,31865,31866,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,31880,31882,31883,31884,31885,31886,31887,31888,31891,31892,31894,31897,31898,31899,31904,31905,31907,31910,31911,31912,31913,31915,31916,31917,31919,31920,31924,31925,31926,31927,31928,31930,31931,24359,34382,21804,25252,20114,27818,25143,33457,21719,21326,29502,28369,30011,21010,21270,35805,27088,24458,24576,28142,22351,27426,29615,26707,36824,32531,25442,24739,21796,30186,35938,28949,28067,23462,24187,33618,24908,40644,30970,34647,31783,30343,20976,24822,29004,26179,24140,24653,35854,28784,25381,36745,24509,24674,34516,22238,27585,24724,24935,21321,24800,26214,36159,31229,20250,28905,27719,35763,35826,32472,33636,26127,23130,39746,27985,28151,35905,27963,20249,28779,33719,25110,24785,38669,36135,31096,20987,22334,22522,26426,30072,31293,31215,31637,31935,31936,31938,31939,31940,31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963,31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980,31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996,31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,32038,32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,32054,32908,39269,36857,28608,35749,40481,23020,32489,32521,21513,26497,26840,36753,31821,38598,21450,24613,30142,27762,21363,23241,32423,25380,20960,33034,24049,34015,25216,20864,23395,20238,31085,21058,24760,27982,23492,23490,35745,35760,26082,24524,38469,22931,32487,32426,22025,26551,22841,20339,23478,21152,33626,39050,36158,30002,38078,20551,31292,20215,26550,39550,23233,27516,30417,22362,23574,31546,38388,29006,20860,32937,33392,22904,32516,33575,26816,26604,30897,30839,25315,25441,31616,20461,21098,20943,33616,27099,37492,36341,36145,35265,38190,31661,20214,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,32104,32105,32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117,32118,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,20581,33328,21073,39279,28176,28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,35762,21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,23047,22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,25945,37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,21163,33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,33445,30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,35167,32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,32153,32154,32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32167,32168,32169,32170,32171,32172,32173,32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,23613,21170,33606,20834,33550,30555,26230,40120,20140,24778,31934,31923,32463,20117,35686,26223,39048,38745,22659,25964,38236,24452,30153,38742,31455,31454,20928,28847,31384,25578,31350,32416,29590,38893,20037,28792,20061,37202,21417,25937,26087,33276,33285,21646,23601,30106,38816,25304,29401,30141,23621,39545,33738,23616,21632,30697,20030,27822,32858,25298,25454,24040,20855,36317,36382,38191,20465,21477,24807,28844,21095,25424,40515,23071,20518,30519,21367,32482,25733,25899,25225,25496,20500,29237,35273,20915,35776,32477,22343,33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324,32325,32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459,27994,37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002,22570,21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771,25335,28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487,28212,20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656,23380,25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044,22840,22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568,29378,26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745,20608,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388,32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,32402,32403,32404,32405,32406,32407,32408,32409,32410,32412,32413,32414,32430,32436,32443,32444,32470,32484,32492,32505,32522,32528,32542,32567,32569,32571,32572,32573,32574,32575,32576,32577,32579,32582,32583,32584,32585,32586,32587,32588,32589,32590,32591,32594,32595,39304,24871,28291,22372,26118,25414,22256,25324,25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469,36182,34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042,32518,28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282,32769,20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047,20769,22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654,31729,29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647,20029,21385,21169,30782,21382,21033,20616,20363,20432,32598,32601,32603,32604,32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,32621,32623,32624,32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,32640,32642,32643,32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,32657,32658,32659,32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,32677,32678,32680,32681,32682,32683,32684,32685,32686,32689,32691,32692,32693,32694,32695,32698,32699,32702,32704,32706,32707,32708,32710,32711,32712,32713,32715,32717,32719,32720,32721,32722,32723,32726,32727,32729,32730,32731,32732,32733,32734,32738,32739,30178,31435,31890,27813,38582,21147,29827,21737,20457,32852,33714,36830,38256,24265,24604,28063,24088,25947,33080,38142,24651,28860,32451,31918,20937,26753,31921,33391,20004,36742,37327,26238,20142,35845,25769,32842,20698,30103,29134,23525,36797,28518,20102,25730,38243,24278,26009,21015,35010,28872,21155,29454,29747,26519,30967,38678,20020,37051,40158,28107,20955,36161,21533,25294,29618,33777,38646,40836,38083,20278,32666,20940,28789,38517,23725,39046,21478,20196,28316,29705,27060,30827,39311,30041,21016,30244,27969,26611,20845,40857,32843,21657,31548,31423,32740,32743,32744,32746,32747,32748,32749,32751,32754,32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,32776,32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,32803,32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,32830,32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,32853,32854,32855,32857,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868,32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,32883,32884,32885,32886,32887,32888,32889,32890,32891,32892,32893,38534,22404,25314,38471,27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,25523,21348,34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,38470,25134,39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,29575,28388,32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,20262,20177,27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,33853,27931,39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,22475,20080,40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,28459,32894,32897,32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,32919,32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,32953,32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,32980,32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,33022,33023,33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047,33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,33083,33084,33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541,38170,27611,30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,26757,37238,38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,23194,38376,38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,37274,38753,31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,26825,30496,32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,31186,28218,24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,34719,40483,38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093,33095,33097,33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,33119,33121,33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,33141,33142,33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,33165,33166,33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,33184,33185,33186,33188,33189,33191,33193,33195,33196,33197,33198,33199,33200,33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220,33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,25721,34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664,27819,28448,23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675,26286,24149,21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048,37027,23068,32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376,33041,24700,38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877,23612,25311,20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467,24565,23064,37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744,26592,29406,20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244,33245,33246,33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262,33263,33264,33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283,33287,33288,33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304,33305,33306,33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340,33341,33343,33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358,33360,33361,33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374,33376,33377,33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197,38062,32445,33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062,31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228,24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928,30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846,34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943,30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527,25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,33386,33387,33388,33389,33393,33397,33398,33399,33400,33403,33404,33408,33409,33411,33413,33414,33415,33417,33420,33424,33427,33428,33429,33430,33434,33435,33438,33440,33442,33443,33447,33458,33461,33462,33466,33467,33468,33471,33472,33474,33475,33477,33478,33481,33488,33494,33497,33498,33501,33506,33511,33512,33513,33514,33516,33517,33518,33520,33522,33523,33525,33526,33528,33530,33532,33533,33534,33535,33536,33546,33547,33549,33552,33554,33555,33558,33560,33561,33565,33566,33567,33568,33569,33570,33571,33572,33573,33574,33577,33578,33582,33584,33586,33591,33595,33597,21860,33086,30130,30382,21305,30174,20731,23617,35692,31687,20559,29255,39575,39128,28418,29922,31080,25735,30629,25340,39057,36139,21697,32856,20050,22378,33529,33805,24179,20973,29942,35780,23631,22369,27900,39047,23110,30772,39748,36843,31893,21078,25169,38138,20166,33670,33889,33769,33970,22484,26420,22275,26222,28006,35889,26333,28689,26399,27450,26646,25114,22971,19971,20932,28422,26578,27791,20854,26827,22855,27495,30054,23822,33040,40784,26071,31048,31041,39569,36215,23682,20062,20225,21551,22865,30732,22120,27668,36804,24323,27773,27875,35755,25488,33598,33599,33601,33602,33604,33605,33608,33610,33611,33612,33613,33614,33619,33621,33622,33623,33624,33625,33629,33634,33648,33649,33650,33651,33652,33653,33654,33657,33658,33662,33663,33664,33665,33666,33667,33668,33671,33672,33674,33675,33676,33677,33679,33680,33681,33684,33685,33686,33687,33689,33690,33693,33695,33697,33698,33699,33700,33701,33702,33703,33708,33709,33710,33711,33717,33723,33726,33727,33730,33731,33732,33734,33736,33737,33739,33741,33742,33744,33745,33746,33747,33749,33751,33753,33754,33755,33758,33762,33763,33764,33766,33767,33768,33771,33772,33773,24688,27965,29301,25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,38065,38067,21069,28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,33108,32652,22681,34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,20392,24039,38808,25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,38054,20405,20146,31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,27682,20542,21375,28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,31179,19992,37041,29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,23624,39537,28192,33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,33791,33792,33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,33814,33815,33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,33835,33836,33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,33850,33851,33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,33866,33867,33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,33880,33885,33886,33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904,33906,33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079,26435,37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522,27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199,35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748,20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342,23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083,27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746,27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920,33921,33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941,33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958,33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974,33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996,33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014,34017,34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,34035,34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,34050,20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073,26862,20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194,29642,33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892,27733,25159,32558,22674,20260,21830,36175,26188,19978,23578,35059,26786,25422,31245,28903,33421,21242,38902,23569,21736,37045,32461,22882,36170,34503,33292,33293,36198,25668,23556,24913,28041,31038,35774,30775,30003,21627,20280,36523,28145,23072,32453,31070,27784,23457,23158,29978,32958,24910,28183,22768,29983,29989,29298,21319,32499,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061,34062,34063,34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078,34080,34082,34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095,34096,34097,34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116,34117,34118,34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132,34133,34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149,34150,34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165,34166,34167,34168,34172,34173,34175,34176,34177,30465,30427,21097,32988,22307,24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,20160,39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,22763,19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,20365,37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,23551,25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,33298,28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,40736,23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,34178,34179,34182,34184,34185,34186,34187,34188,34189,34190,34192,34193,34194,34195,34196,34197,34198,34199,34200,34201,34202,34205,34206,34207,34208,34209,34210,34211,34213,34214,34215,34217,34219,34220,34221,34225,34226,34227,34228,34229,34230,34232,34234,34235,34236,34237,34238,34239,34240,34242,34243,34244,34245,34246,34247,34248,34250,34251,34252,34253,34254,34257,34258,34260,34262,34263,34264,34265,34266,34267,34269,34270,34271,34272,34273,34274,34275,34277,34278,34279,34280,34282,34283,34284,34285,34286,34287,34288,34289,34290,34291,34292,34293,34294,34295,34296,24661,21047,32781,25684,34928,29993,24069,26643,25332,38684,21452,29245,35841,27700,30561,31246,21550,30636,39034,33308,35828,30805,26388,28865,26031,25749,22070,24605,31169,21496,19997,27515,32902,23546,21987,22235,20282,20284,39282,24051,26494,32824,24578,39042,36865,23435,35772,35829,25628,33368,25822,22013,33487,37221,20439,32032,36895,31903,20723,22609,28335,23487,35785,32899,37240,33948,31639,34429,38539,38543,32485,39635,30862,23681,31319,36930,38567,31071,23385,25439,31499,34001,26797,21766,32553,29712,32034,38145,25152,22604,20182,23427,22905,22612,34297,34298,34300,34301,34302,34304,34305,34306,34307,34308,34310,34311,34312,34313,34314,34315,34316,34317,34318,34319,34320,34322,34323,34324,34325,34327,34328,34329,34330,34331,34332,34333,34334,34335,34336,34337,34338,34339,34340,34341,34342,34344,34346,34347,34348,34349,34350,34351,34352,34353,34354,34355,34356,34357,34358,34359,34361,34362,34363,34365,34366,34367,34368,34369,34370,34371,34372,34373,34374,34375,34376,34377,34378,34379,34380,34386,34387,34389,34390,34391,34392,34393,34395,34396,34397,34399,34400,34401,34403,34404,34405,34406,34407,34408,34409,34410,29549,25374,36427,36367,32974,33492,25260,21488,27888,37214,22826,24577,27760,22349,25674,36138,30251,28393,22363,27264,30192,28525,35885,35848,22374,27631,34962,30899,25506,21497,28845,27748,22616,25642,22530,26848,33179,21776,31958,20504,36538,28108,36255,28907,25487,28059,28372,32486,33796,26691,36867,28120,38518,35752,22871,29305,34276,33150,30140,35466,26799,21076,36386,38161,25552,39064,36420,21884,20307,26367,22159,24789,28053,21059,23625,22825,28155,22635,30000,29980,24684,33300,33094,25361,26465,36834,30522,36339,36148,38081,24086,21381,21548,28867,34413,34415,34416,34418,34419,34420,34421,34422,34423,34424,34435,34436,34437,34438,34439,34440,34441,34446,34447,34448,34449,34450,34452,34454,34455,34456,34457,34458,34459,34462,34463,34464,34465,34466,34469,34470,34475,34477,34478,34482,34483,34487,34488,34489,34491,34492,34493,34494,34495,34497,34498,34499,34501,34504,34508,34509,34514,34515,34517,34518,34519,34522,34524,34525,34528,34529,34530,34531,34533,34534,34535,34536,34538,34539,34540,34543,34549,34550,34551,34554,34555,34556,34557,34559,34561,34564,34565,34566,34571,34572,34574,34575,34576,34577,34580,34582,27712,24311,20572,20141,24237,25402,33351,36890,26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171,20599,25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303,21520,20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216,25302,25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703,34521,27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024,28919,23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579,20129,26505,32593,24448,26106,26395,24536,22916,23041,34585,34587,34589,34591,34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,34608,34610,34611,34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,34627,34628,34629,34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,34646,34648,34650,34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,34665,34666,34667,34668,34669,34671,34673,34674,34675,34677,34679,34680,34681,34682,34687,34688,34689,34692,34694,34695,34697,34698,34700,34702,34703,34704,34705,34706,34708,34709,34710,34712,34713,34714,34715,34716,34717,34718,34720,34721,34722,34723,34724,24013,24494,21361,38886,36829,26693,22260,21807,24799,20026,28493,32500,33479,33806,22996,20255,20266,23614,32428,26410,34074,21619,30031,32963,21890,39759,20301,28205,35859,23561,24944,21355,30239,28201,34442,25991,38395,32441,21563,31283,32010,38382,21985,32705,29934,25373,34583,28065,31389,25105,26017,21351,25569,27779,24043,21596,38056,20044,27745,35820,23627,26080,33436,26791,21566,21556,27595,27494,20116,25410,21320,33310,20237,20398,22366,25098,38654,26212,29289,21247,21153,24735,35823,26132,29081,26512,35199,30802,30717,26224,22075,21560,38177,29306,34725,34726,34727,34729,34730,34734,34736,34737,34738,34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,34756,34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,34775,34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,34791,34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,34806,34807,34808,34810,34811,34812,34813,34815,34816,34817,34818,34820,34821,34822,34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,34836,34839,34840,34841,34842,34844,34845,34846,34847,34848,34851,31232,24687,24076,24713,33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,20064,23219,21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,36758,26247,23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,40092,32420,21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,29486,21439,33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,31665,35140,28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,20687,21521,35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,26195,34852,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34867,34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882,34883,34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899,34901,34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922,34925,34927,34929,34931,34932,34933,34934,34936,34937,34938,34939,34940,34944,34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965,34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982,34983,34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123,27463,34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,34809,25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,24515,20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,37266,24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,20462,32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,39035,24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,32493,36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995,34996,34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,35015,35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,35035,35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,35054,35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,35076,35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092,35093,35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,35111,35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873,30307,30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092,35810,23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486,40493,21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766,28937,21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068,38414,28814,27839,22852,25513,30524,34893,28436,33395,22576,29141,21388,30746,38593,21761,24422,28976,23476,35866,39564,27523,22830,40495,31207,26472,25196,20335,30113,32650,27915,38451,27687,20208,30162,20859,26679,28478,36992,33136,22934,29814,35128,35129,35130,35131,35132,35133,35134,35135,35136,35138,35139,35141,35142,35143,35144,35145,35146,35147,35148,35149,35150,35151,35152,35153,35154,35155,35156,35157,35158,35159,35160,35161,35162,35163,35164,35165,35168,35169,35170,35171,35172,35173,35175,35176,35177,35178,35179,35180,35181,35182,35183,35184,35185,35186,35187,35188,35189,35190,35191,35192,35193,35194,35196,35197,35198,35200,35202,35204,35205,35207,35208,35209,35210,35211,35212,35213,35214,35215,35216,35217,35218,35219,35220,35221,35222,35223,35224,35225,35226,35227,35228,35229,35230,35231,35232,35233,25671,23591,36965,31377,35875,23002,21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029,25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381,20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413,26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159,24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322,35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899,38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,35234,35235,35236,35237,35238,35239,35240,35241,35242,35243,35244,35245,35246,35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,35257,35258,35259,35260,35261,35262,35263,35264,35267,35277,35283,35284,35285,35287,35288,35289,35291,35293,35295,35296,35297,35298,35300,35303,35304,35305,35306,35308,35309,35310,35312,35313,35314,35316,35317,35318,35319,35320,35321,35322,35323,35324,35325,35326,35327,35329,35330,35331,35332,35333,35334,35336,35337,35338,35339,35340,35341,35342,35343,35344,35345,35346,35347,35348,35349,35350,35351,35352,35353,35354,35355,35356,35357,21360,33521,27185,23156,40560,24212,32552,33721,33828,33829,33639,34631,36814,36194,30408,24433,39062,30828,26144,21727,25317,20323,33219,30152,24248,38605,36362,34553,21647,27891,28044,27704,24703,21191,29992,24189,20248,24736,24551,23588,30001,37038,38080,29369,27833,28216,37193,26377,21451,21491,20305,37321,35825,21448,24188,36802,28132,20110,30402,27014,34398,24858,33286,20313,20446,36926,40060,24841,28189,28180,38533,20104,23089,38632,19982,23679,31161,23431,35821,32701,29577,22495,33419,37057,21505,36935,21947,23786,24481,24840,27442,29425,32946,35465,35358,35359,35360,35361,35362,35363,35364,35365,35366,35367,35368,35369,35370,35371,35372,35373,35374,35375,35376,35377,35378,35379,35380,35381,35382,35383,35384,35385,35386,35387,35388,35389,35391,35392,35393,35394,35395,35396,35397,35398,35399,35401,35402,35403,35404,35405,35406,35407,35408,35409,35410,35411,35412,35413,35414,35415,35416,35417,35418,35419,35420,35421,35422,35423,35424,35425,35426,35427,35428,35429,35430,35431,35432,35433,35434,35435,35436,35437,35438,35439,35440,35441,35442,35443,35444,35445,35446,35447,35448,35450,35451,35452,35453,35454,35455,35456,28020,23507,35029,39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253,21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234,36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801,36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472,36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991,34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321,21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711,35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471,35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485,35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498,35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511,35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524,35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537,35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550,35551,35552,35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856,35784,25688,25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,26025,36759,23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,24432,28467,24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,25307,26157,25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,34544,36761,32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275,36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529,24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558,35559,35560,35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586,35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600,35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613,35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625,35626,35627,35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,35640,35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,35653,24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930,33026,27713,20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351,27490,36286,21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769,21046,26234,31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544,38047,34935,32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788,31909,36724,32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417,29482,35832,35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609,21161,34496,36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663,35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676,35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690,35691,35693,35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,35705,35706,35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717,35718,35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730,35731,35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743,35756,35761,35771,35783,35792,35818,35849,35870,20303,27880,31069,39547,25235,29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,25758,22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,21331,26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,28363,28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,36394,23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,31062,35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,24038,20304,26590,20570,20316,22352,24231,59408,59409,59410,59411,59412,35896,35897,35898,35899,35900,35901,35902,35903,35904,35906,35907,35908,35909,35912,35914,35915,35917,35918,35919,35920,35921,35922,35923,35924,35926,35927,35928,35929,35931,35932,35933,35934,35935,35936,35939,35940,35941,35942,35943,35944,35945,35948,35949,35950,35951,35952,35953,35954,35956,35957,35958,35959,35963,35964,35965,35966,35967,35968,35969,35971,35972,35974,35975,35976,35979,35981,35982,35983,35984,35985,35986,35987,35989,35990,35991,35993,35994,35995,35996,35997,35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,36008,36009,36010,36011,36012,36013,20109,19980,20800,19984,24319,21317,19989,20120,19998,39730,23404,22121,20008,31162,20031,21269,20039,22829,29243,21358,27664,22239,32996,39319,27603,30590,40727,20022,20127,40720,20060,20073,20115,33416,23387,21868,22031,20164,21389,21405,21411,21413,21422,38757,36189,21274,21493,21286,21294,21310,36188,21350,21347,20994,21000,21006,21037,21043,21055,21056,21068,21086,21089,21084,33967,21117,21122,21121,21136,21139,20866,32596,20155,20163,20169,20162,20200,20193,20203,20190,20251,20211,20258,20324,20213,20261,20263,20233,20267,20318,20327,25912,20314,20317,36014,36015,36016,36017,36018,36019,36020,36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,36032,36033,36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,36045,36046,36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,36058,36059,36060,36061,36062,36063,36064,36065,36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,36077,36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088,36089,36090,36091,36092,36093,36094,36095,36096,36097,36098,36099,36100,36101,36102,36103,36104,36105,36106,36107,36108,36109,20319,20311,20274,20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,20372,20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,20467,20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,20552,20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,20718,20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,40649,39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822,20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925,20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120,36121,36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202,36204,36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223,36224,36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242,36243,36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257,36258,36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271,36272,36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296,36297,36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750,35751,35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796,35798,35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830,35833,35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861,35862,35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886,35887,35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461,38460,38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576,37015,37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313,36316,36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338,36340,36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360,36363,36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378,36379,36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,36400,36402,36403,36404,36406,36407,36408,36411,36412,36414,36415,36419,36421,36422,36428,36429,36430,36431,36432,36435,36436,36437,36438,36439,36440,36442,36443,36444,36445,36446,36447,36448,36449,36450,36451,36452,36453,36455,36456,36458,36459,36462,36465,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,37090,37084,37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,37177,37187,37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,21471,29166,30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,22433,22654,22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,22331,22338,22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,22436,22412,22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,22456,22516,22511,22520,22500,22493,36467,36469,36471,36472,36473,36474,36475,36477,36478,36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,36497,36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,36529,36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,22539,22541,22525,22509,22528,22558,22553,22596,22560,22629,22636,22657,22665,22682,22656,39336,40729,25087,33401,33405,33407,33423,33418,33448,33412,33422,33425,33431,33433,33451,33464,33470,33456,33480,33482,33507,33432,33463,33454,33483,33484,33473,33449,33460,33441,33450,33439,33476,33486,33444,33505,33545,33527,33508,33551,33543,33500,33524,33490,33496,33548,33531,33491,33553,33562,33542,33556,33557,33504,33493,33564,33617,33627,33628,33544,33682,33596,33588,33585,33691,33630,33583,33615,33607,33603,33631,33600,33559,33632,33581,33594,33587,33638,33637,36581,36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676,33640,33563,33641,33644,33642,33645,33646,33712,33656,33715,33716,33696,33706,33683,33692,33669,33660,33718,33705,33661,33720,33659,33688,33694,33704,33722,33724,33729,33793,33765,33752,22535,33816,33803,33757,33789,33750,33820,33848,33809,33798,33748,33759,33807,33795,33784,33785,33770,33733,33728,33830,33776,33761,33884,33873,33882,33881,33907,33927,33928,33914,33929,33912,33852,33862,33897,33910,33932,33934,33841,33901,33985,33997,34000,34022,33981,34003,33994,33983,33978,34016,33953,33977,33972,33943,34021,34019,34060,29965,34104,34032,34105,34079,34106,36677,36678,36679,36680,36681,36682,36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36714,36736,36748,36754,36765,36768,36769,36770,36772,36773,36774,36775,36778,36780,36781,36782,36783,36786,36787,36788,36789,36791,36792,36794,36795,36796,36799,36800,36803,36806,36809,36810,36811,36812,36813,36815,36818,36822,36823,36826,36832,36833,36835,36839,36844,36847,36849,36850,36852,36853,36854,36858,36859,36860,36862,36863,36871,36872,36876,36878,36883,36885,36888,34134,34107,34047,34044,34137,34120,34152,34148,34142,34170,30626,34115,34162,34171,34212,34216,34183,34191,34169,34222,34204,34181,34233,34231,34224,34259,34241,34268,34303,34343,34309,34345,34326,34364,24318,24328,22844,22849,32823,22869,22874,22872,21263,23586,23589,23596,23604,25164,25194,25247,25275,25290,25306,25303,25326,25378,25334,25401,25419,25411,25517,25590,25457,25466,25486,25524,25453,25516,25482,25449,25518,25532,25586,25592,25568,25599,25540,25566,25550,25682,25542,25534,25669,25665,25611,25627,25632,25612,25638,25633,25694,25732,25709,25750,36889,36892,36899,36900,36901,36903,36904,36905,36906,36907,36908,36912,36913,36914,36915,36916,36919,36921,36922,36925,36927,36928,36931,36933,36934,36936,36937,36938,36939,36940,36942,36948,36949,36950,36953,36954,36956,36957,36958,36959,36960,36961,36964,36966,36967,36969,36970,36971,36972,36975,36976,36977,36978,36979,36982,36983,36984,36985,36986,36987,36988,36990,36993,36996,36997,36998,36999,37001,37002,37004,37005,37006,37007,37008,37010,37012,37014,37016,37018,37020,37022,37023,37024,37028,37029,37031,37032,37033,37035,37037,37042,37047,37052,37053,37055,37056,25722,25783,25784,25753,25786,25792,25808,25815,25828,25826,25865,25893,25902,24331,24530,29977,24337,21343,21489,21501,21481,21480,21499,21522,21526,21510,21579,21586,21587,21588,21590,21571,21537,21591,21593,21539,21554,21634,21652,21623,21617,21604,21658,21659,21636,21622,21606,21661,21712,21677,21698,21684,21714,21671,21670,21715,21716,21618,21667,21717,21691,21695,21708,21721,21722,21724,21673,21674,21668,21725,21711,21726,21787,21735,21792,21757,21780,21747,21794,21795,21775,21777,21799,21802,21863,21903,21941,21833,21869,21825,21845,21823,21840,21820,37058,37059,37062,37064,37065,37067,37068,37069,37074,37076,37077,37078,37080,37081,37082,37086,37087,37088,37091,37092,37093,37097,37098,37100,37102,37104,37105,37106,37107,37109,37110,37111,37113,37114,37115,37116,37119,37120,37121,37123,37125,37126,37127,37128,37129,37130,37131,37132,37133,37134,37135,37136,37137,37138,37139,37140,37141,37142,37143,37144,37146,37147,37148,37149,37151,37152,37153,37156,37157,37158,37159,37160,37161,37162,37163,37164,37165,37166,37168,37170,37171,37172,37173,37174,37175,37176,37178,37179,37180,37181,37182,37183,37184,37185,37186,37188,21815,21846,21877,21878,21879,21811,21808,21852,21899,21970,21891,21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,21949,21950,21908,21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,21981,21956,21999,21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,22024,22028,22017,22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,22093,22114,22105,22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,22163,22191,22228,22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,22300,24079,24089,24084,24081,24113,24123,24124,37189,37191,37192,37201,37203,37204,37205,37206,37208,37209,37211,37212,37215,37216,37222,37223,37224,37227,37229,37235,37242,37243,37244,37248,37249,37250,37251,37252,37254,37256,37258,37262,37263,37267,37268,37269,37270,37271,37272,37273,37276,37277,37278,37279,37280,37281,37284,37285,37286,37287,37288,37289,37291,37292,37296,37297,37298,37299,37302,37303,37304,37305,37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317,37318,37320,37323,37328,37330,37331,37332,37333,37334,37335,37336,37337,37338,37339,37341,37342,37343,37344,37345,37346,37347,37348,37349,24119,24132,24148,24155,24158,24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706,23708,23733,23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780,23755,23781,23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870,23860,23869,23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961,23965,35955,23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476,24488,24493,24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377,29390,29389,29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434,37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362,37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375,37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388,37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401,37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414,37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427,37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440,37441,37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461,29474,29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566,33307,22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284,39287,39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192,24209,24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283,24296,24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574,24581,24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619,24586,24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450,37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,37504,37505,37506,37507,37508,37509,37510,37511,37512,37513,37514,37515,37516,37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,37530,37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543,24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,24753,24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,24875,24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,38385,38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,38413,38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,27740,27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,27856,27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,27825,27859,27887,27902,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554,37555,37556,37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567,37568,37569,37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581,37582,37583,37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594,37595,37596,37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607,37608,37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620,37621,37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633,37634,37635,37636,37637,37638,37639,37640,37641,27961,27943,27916,27971,27976,27911,27908,27929,27918,27947,27981,27950,27957,27930,27983,27986,27988,27955,28049,28015,28062,28064,27998,28051,28052,27996,28000,28028,28003,28186,28103,28101,28126,28174,28095,28128,28177,28134,28125,28121,28182,28075,28172,28078,28203,28270,28238,28267,28338,28255,28294,28243,28244,28210,28197,28228,28383,28337,28312,28384,28461,28386,28325,28327,28349,28347,28343,28375,28340,28367,28303,28354,28319,28514,28486,28487,28452,28437,28409,28463,28470,28491,28532,28458,28425,28457,28553,28557,28556,28536,28530,28540,28538,28625,37642,37643,37644,37645,37646,37647,37648,37649,37650,37651,37652,37653,37654,37655,37656,37657,37658,37659,37660,37661,37662,37663,37664,37665,37666,37667,37668,37669,37670,37671,37672,37673,37674,37675,37676,37677,37678,37679,37680,37681,37682,37683,37684,37685,37686,37687,37688,37689,37690,37691,37692,37693,37695,37696,37697,37698,37699,37700,37701,37702,37703,37704,37705,37706,37707,37708,37709,37710,37711,37712,37713,37714,37715,37716,37717,37718,37719,37720,37721,37722,37723,37724,37725,37726,37727,37728,37729,37730,37731,37732,37733,37734,37735,37736,37737,37739,28617,28583,28601,28598,28610,28641,28654,28638,28640,28655,28698,28707,28699,28729,28725,28751,28766,23424,23428,23445,23443,23461,23480,29999,39582,25652,23524,23534,35120,23536,36423,35591,36790,36819,36821,36837,36846,36836,36841,36838,36851,36840,36869,36868,36875,36902,36881,36877,36886,36897,36917,36918,36909,36911,36932,36945,36946,36944,36968,36952,36962,36955,26297,36980,36989,36994,37000,36995,37003,24400,24407,24406,24408,23611,21675,23632,23641,23409,23651,23654,32700,24362,24361,24365,33396,24380,39739,23662,22913,22915,22925,22953,22954,22947,37740,37741,37742,37743,37744,37745,37746,37747,37748,37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759,37760,37761,37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772,37773,37774,37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786,37787,37788,37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799,37800,37801,37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812,37813,37814,37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825,37826,37827,37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986,22955,22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,23000,23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,23100,23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,23224,23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,23360,23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,39551,39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,39580,39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,32425,37838,37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850,37851,37852,37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863,37864,37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,37877,37878,37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,37890,37891,37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902,37903,37904,37905,37906,37907,37908,37909,37910,37911,37912,37913,37914,37915,37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926,37927,37928,37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449,32450,32457,32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494,32495,32497,32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520,32523,32524,32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547,32548,32549,32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563,32565,24186,30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634,29649,29623,29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662,29626,29682,29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936,37937,37938,37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949,37951,37952,37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963,37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976,37977,37978,37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989,37990,37991,37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003,38004,38005,38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016,38017,38018,38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118,38139,38172,38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,29852,29838,29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,38890,38891,38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,26535,26485,26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,26544,26636,26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,26621,26674,26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,26689,26727,26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,26818,26990,26876,26911,26912,26873,38183,38195,38205,38211,38216,38219,38229,38234,38240,38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,38273,38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,38286,38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299,38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312,38313,38314,38315,38316,38317,38318,38319,38320,38321,38322,38323,38324,38325,38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,38337,38338,38339,38340,38341,38342,38343,38344,38345,38346,38347,26916,26864,26891,26881,26967,26851,26896,26993,26937,26976,26946,26973,27012,26987,27008,27032,27000,26932,27084,27015,27016,27086,27017,26982,26979,27001,27035,27047,27067,27051,27053,27092,27057,27073,27082,27103,27029,27104,27021,27135,27183,27117,27159,27160,27237,27122,27204,27198,27296,27216,27227,27189,27278,27257,27197,27176,27224,27260,27281,27280,27305,27287,27307,29495,29522,27521,27522,27527,27524,27538,27539,27533,27546,27547,27553,27562,36715,36717,36721,36722,36723,36725,36726,36728,36727,36729,36730,36732,36734,36737,36738,36740,36743,36747,38348,38349,38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361,38362,38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,38375,38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,38439,38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,38465,38467,38474,38478,38479,38481,38482,38483,38486,38487,38488,38489,38490,38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,38532,38535,38537,38538,36749,36750,36751,36760,36762,36558,25099,25111,25115,25119,25122,25121,25125,25124,25132,33255,29935,29940,29951,29967,29969,29971,25908,26094,26095,26096,26122,26137,26482,26115,26133,26112,28805,26359,26141,26164,26161,26166,26165,32774,26207,26196,26177,26191,26198,26209,26199,26231,26244,26252,26279,26269,26302,26331,26332,26342,26345,36146,36147,36150,36155,36157,36160,36165,36166,36168,36169,36167,36173,36181,36185,35271,35274,35275,35276,35278,35279,35280,35281,29294,29343,29277,29286,29295,29310,29311,29316,29323,29325,29327,29330,25352,25394,25520,38540,38542,38545,38546,38547,38549,38550,38554,38555,38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,38568,38569,38570,38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,38584,38586,38587,38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,38614,38615,38616,38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,38628,38629,38630,38631,38635,38636,38637,38638,38640,38641,38642,38644,38645,38648,38650,38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672,38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,25663,25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672,27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270,29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948,32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989,33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054,33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148,33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406,33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699,38700,38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717,38719,38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731,38732,38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749,38751,38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768,38769,38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785,38786,38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803,38805,38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449,27459,27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315,26000,40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828,28822,28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975,28977,29043,29020,29032,28997,29042,29002,29048,29050,29080,29107,29109,29096,29088,29152,29140,29159,29177,29213,29224,28780,28952,29030,29113,25150,25149,25155,25160,25161,31035,31040,31046,31049,31067,31068,31059,31066,31074,31063,31072,31087,31079,31098,31109,31114,31130,31143,31155,24529,24528,38814,38815,38817,38818,38820,38821,38822,38823,38824,38825,38826,38828,38830,38832,38833,38835,38837,38838,38839,38840,38841,38842,38843,38844,38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,38870,38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,38883,38884,38885,38888,38894,38895,38896,38897,38898,38900,38903,38904,38905,38906,38907,38908,38909,38910,38911,38912,38913,38914,38915,38916,38917,38918,38919,38920,38921,38922,38923,38924,38925,38926,24636,24669,24666,24679,24641,24665,24675,24747,24838,24845,24925,25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,30710,30712,30720,30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,30779,30751,30780,30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,30791,30796,30826,30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,30932,30937,30921,30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,40699,40700,30449,30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,30517,30520,30544,30545,30535,30531,30554,30568,38927,38928,38929,38930,38931,38932,38933,38934,38935,38936,38937,38938,38939,38940,38941,38942,38943,38944,38945,38946,38947,38948,38949,38950,38951,38952,38953,38954,38955,38956,38957,38958,38959,38960,38961,38962,38963,38964,38965,38966,38967,38968,38969,38970,38971,38972,38973,38974,38975,38976,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986,38987,38988,38989,38990,38991,38992,38993,38994,38995,38996,38997,38998,38999,39000,39001,39002,39003,39004,39005,39006,39007,39008,39009,39010,39011,39012,39013,39014,39015,39016,39017,39018,39019,39020,39021,39022,30562,30565,30591,30605,30589,30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030,30027,30024,30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625,32633,32641,32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029,38031,38032,38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061,38060,38063,38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079,38084,38088,38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102,38103,38105,38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122,39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,39075,39080,39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,39092,39093,39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,39105,39106,39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,39119,39120,39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,39141,39142,39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,39155,39156,39157,39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,39168,39169,39170,39171,39172,39173,39174,39175,38121,38123,38126,38127,38131,38132,38133,38135,38137,38140,38141,38143,38147,38146,38150,38151,38153,38154,38157,38158,38159,38162,38163,38164,38165,38166,38168,38171,38173,38174,38175,38178,38186,38187,38185,38188,38193,38194,38196,38198,38199,38200,38204,38206,38207,38210,38197,38212,38213,38214,38217,38220,38222,38223,38226,38227,38228,38230,38231,38232,38233,38235,38238,38239,38237,38241,38242,38244,38245,38246,38247,38248,38249,38250,38251,38252,38255,38257,38258,38259,38202,30695,30700,38601,31189,31213,31203,31211,31238,23879,31235,31234,31262,31252,39176,39177,39178,39179,39180,39182,39183,39185,39186,39187,39188,39189,39190,39191,39192,39193,39194,39195,39196,39197,39198,39199,39200,39201,39202,39203,39204,39205,39206,39207,39208,39209,39210,39211,39212,39213,39215,39216,39217,39218,39219,39220,39221,39222,39223,39224,39225,39226,39227,39228,39229,39230,39231,39232,39233,39234,39235,39236,39237,39238,39239,39240,39241,39242,39243,39244,39245,39246,39247,39248,39249,39250,39251,39254,39255,39256,39257,39258,39259,39260,39261,39262,39263,39264,39265,39266,39268,39270,39283,39288,39289,39291,39294,39298,39299,39305,31289,31287,31313,40655,39333,31344,30344,30350,30355,30361,30372,29918,29920,29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,40503,40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,40526,40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,40554,40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,30131,30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,30180,30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,30245,30232,30229,30233,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329,39330,39331,39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344,39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,39410,39411,39412,39413,39414,39415,39416,39417,30235,30268,30242,30240,30272,30253,30256,30271,30261,30275,30270,30259,30285,30302,30292,30300,30294,30315,30319,32714,31462,31352,31353,31360,31366,31368,31381,31398,31392,31404,31400,31405,31411,34916,34921,34930,34941,34943,34946,34978,35014,34999,35004,35017,35042,35022,35043,35045,35057,35098,35068,35048,35070,35056,35105,35097,35091,35099,35082,35124,35115,35126,35137,35174,35195,30091,32997,30386,30388,30684,32786,32788,32790,32796,32800,32802,32805,32806,32807,32809,32808,32817,32779,32821,32835,32838,32845,32850,32873,32881,35203,39032,39040,39043,39418,39419,39420,39421,39422,39423,39424,39425,39426,39427,39428,39429,39430,39431,39432,39433,39434,39435,39436,39437,39438,39439,39440,39441,39442,39443,39444,39445,39446,39447,39448,39449,39450,39451,39452,39453,39454,39455,39456,39457,39458,39459,39460,39461,39462,39463,39464,39465,39466,39467,39468,39469,39470,39471,39472,39473,39474,39475,39476,39477,39478,39479,39480,39481,39482,39483,39484,39485,39486,39487,39488,39489,39490,39491,39492,39493,39494,39495,39496,39497,39498,39499,39500,39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,39049,39052,39053,39055,39060,39066,39067,39070,39071,39073,39074,39077,39078,34381,34388,34412,34414,34431,34426,34428,34427,34472,34445,34443,34476,34461,34471,34467,34474,34451,34473,34486,34500,34485,34510,34480,34490,34481,34479,34505,34511,34484,34537,34545,34546,34541,34547,34512,34579,34526,34548,34527,34520,34513,34563,34567,34552,34568,34570,34573,34569,34595,34619,34590,34597,34606,34586,34622,34632,34612,34609,34601,34615,34623,34690,34594,34685,34686,34683,34656,34672,34636,34670,34699,34643,34659,34684,34660,34649,34661,34707,34735,34728,34770,39514,39515,39516,39517,39518,39519,39520,39521,39522,39523,39524,39525,39526,39527,39528,39529,39530,39531,39538,39555,39561,39565,39566,39572,39573,39577,39590,39593,39594,39595,39596,39597,39598,39599,39602,39603,39604,39605,39609,39611,39613,39614,39615,39619,39620,39622,39623,39624,39625,39626,39629,39630,39631,39632,39634,39636,39637,39638,39639,39641,39642,39643,39644,39645,39646,39648,39650,39651,39652,39653,39655,39656,39657,39658,39660,39662,39664,39665,39666,39667,39668,39669,39670,39671,39672,39674,39676,39677,39678,39679,39680,39681,39682,39684,39685,39686,34758,34696,34693,34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,34752,34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,34876,32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,31531,31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,31518,31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,31632,31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,31697,31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,31755,39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701,39702,39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716,39717,39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731,39732,39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754,39755,39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771,39772,39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784,39785,39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797,39798,39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278,33281,33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336,33339,33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949,34952,35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889,31901,31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941,31959,31976,33390,26280,32703,32718,32725,32741,32737,32742,32745,32750,32755,31992,32119,32166,32174,32327,32411,40632,40628,36211,36228,36244,36241,36273,36199,36205,35911,35913,37194,37200,37198,37199,37220,39804,39805,39806,39807,39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,39831,39832,39833,39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,39844,39845,39846,39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39859,39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,39896,39897,39898,39899,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,37260,37253,37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,37306,35925,40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,36310,36311,36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,36347,36324,36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,36409,36405,36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,36463,36468,36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,35988,26011,35286,35294,35290,35292,39900,39901,39902,39903,39904,39905,39906,39907,39908,39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,39934,39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,39947,39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,39960,39961,39962,39963,39964,39965,39966,39967,39968,39969,39970,39971,39972,39973,39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,39985,39986,39987,39988,39989,39990,39991,39992,39993,39994,39995,35301,35307,35311,35390,35622,38739,38633,38643,38639,38662,38657,38664,38671,38670,38698,38701,38704,38718,40832,40835,40837,40838,40839,40840,40841,40842,40844,40702,40715,40717,38585,38588,38589,38606,38610,30655,38624,37518,37550,37576,37694,37738,37834,37775,37950,37995,40063,40066,40069,40070,40071,40072,31267,40075,40078,40080,40081,40082,40084,40085,40090,40091,40094,40095,40096,40097,40098,40099,40101,40102,40103,40104,40105,40107,40109,40110,40112,40113,40114,40115,40116,40117,40118,40119,40122,40123,40124,40125,40132,40133,40134,40135,40138,40139,39996,39997,39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048,40049,40050,40051,40052,40053,40054,40055,40056,40057,40058,40059,40061,40062,40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093,40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146,40154,40155,40160,40161,40140,40141,40142,40143,40144,40147,40148,40149,40151,40152,40153,40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827,38819,38834,38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621,39618,39627,39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181,39214,39253,39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695,39699,39711,39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605,40607,40667,40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738,40748,40751,40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168,40169,40170,40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,40182,40183,40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,40195,40196,40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,40208,40209,40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,40221,40222,40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233,40234,40235,40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,40247,40248,40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908,57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921,57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,57986,57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999,58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267,40268,40269,40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280,40281,40282,40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293,40294,40295,40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308,40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319,40320,40321,40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332,40333,40334,40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345,40346,40347,40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005,58006,58007,58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018,58019,58020,58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031,58032,58033,58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044,58045,58046,58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057,58058,58059,58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070,58071,58072,58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083,58084,58085,58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355,40356,40357,40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368,40369,40370,40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381,40382,40383,40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394,40395,40396,40397,40398,40399,40400,40401,40402,40403,40404,40405,40406,40407,40408,40409,40410,40411,40412,40413,40414,40415,40416,40417,40418,40419,40420,40421,40422,40423,40424,40425,40426,40427,40428,40429,40430,40431,40432,40433,40434,40435,40436,40437,40438,40439,40440,40441,40442,40443,40444,40445,40446,40447,40448,40449,40450,58096,58097,58098,58099,58100,58101,58102,58103,58104,58105,58106,58107,58108,58109,58110,58111,58112,58113,58114,58115,58116,58117,58118,58119,58120,58121,58122,58123,58124,58125,58126,58127,58128,58129,58130,58131,58132,58133,58134,58135,58136,58137,58138,58139,58140,58141,58142,58143,58144,58145,58146,58147,58148,58149,58150,58151,58152,58153,58154,58155,58156,58157,58158,58159,58160,58161,58162,58163,58164,58165,58166,58167,58168,58169,58170,58171,58172,58173,58174,58175,58176,58177,58178,58179,58180,58181,58182,58183,58184,58185,58186,58187,58188,58189,40451,40452,40453,40454,40455,40456,40457,40458,40459,40460,40461,40462,40463,40464,40465,40466,40467,40468,40469,40470,40471,40472,40473,40474,40475,40476,40477,40478,40484,40487,40494,40496,40500,40507,40508,40512,40525,40528,40530,40531,40532,40534,40537,40541,40543,40544,40545,40546,40549,40558,40559,40562,40564,40565,40566,40567,40568,40569,40570,40571,40572,40573,40576,40577,40579,40580,40581,40582,40585,40586,40588,40589,40590,40591,40592,40593,40596,40597,40598,40599,40600,40601,40602,40603,40604,40606,40608,40609,40610,40611,40612,40613,40615,40616,40617,40618,58190,58191,58192,58193,58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205,58206,58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,58219,58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,58232,58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,58245,58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,58258,58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,58271,58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,40631,40633,40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,40650,40651,40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,40675,40676,40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,40693,40694,40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,40710,40711,40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,40728,40730,40731,40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,40744,40745,40746,40747,40749,40750,40752,40753,58284,58285,58286,58287,58288,58289,58290,58291,58292,58293,58294,58295,58296,58297,58298,58299,58300,58301,58302,58303,58304,58305,58306,58307,58308,58309,58310,58311,58312,58313,58314,58315,58316,58317,58318,58319,58320,58321,58322,58323,58324,58325,58326,58327,58328,58329,58330,58331,58332,58333,58334,58335,58336,58337,58338,58339,58340,58341,58342,58343,58344,58345,58346,58347,58348,58349,58350,58351,58352,58353,58354,58355,58356,58357,58358,58359,58360,58361,58362,58363,58364,58365,58366,58367,58368,58369,58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757,40758,40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777,40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792,40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805,40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830,40833,40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,40856,40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,63985,58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389,58390,58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402,58403,58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415,58416,58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428,58429,58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441,58442,58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454,58455,58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467,58468,58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032,64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427,13383,11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815,14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735,11950,17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996,59459,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822,18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731,19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476,58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489,58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502,58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515,58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528,58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541,58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554,58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565], + "gb18030-ranges":[[0,128],[36,165],[38,169],[45,178],[50,184],[81,216],[89,226],[95,235],[96,238],[100,244],[103,248],[104,251],[105,253],[109,258],[126,276],[133,284],[148,300],[172,325],[175,329],[179,334],[208,364],[306,463],[307,465],[308,467],[309,469],[310,471],[311,473],[312,475],[313,477],[341,506],[428,594],[443,610],[544,712],[545,716],[558,730],[741,930],[742,938],[749,962],[750,970],[805,1026],[819,1104],[820,1106],[7922,8209],[7924,8215],[7925,8218],[7927,8222],[7934,8231],[7943,8241],[7944,8244],[7945,8246],[7950,8252],[8062,8365],[8148,8452],[8149,8454],[8152,8458],[8164,8471],[8174,8482],[8236,8556],[8240,8570],[8262,8596],[8264,8602],[8374,8713],[8380,8720],[8381,8722],[8384,8726],[8388,8731],[8390,8737],[8392,8740],[8393,8742],[8394,8748],[8396,8751],[8401,8760],[8406,8766],[8416,8777],[8419,8781],[8424,8787],[8437,8802],[8439,8808],[8445,8816],[8482,8854],[8485,8858],[8496,8870],[8521,8896],[8603,8979],[8936,9322],[8946,9372],[9046,9548],[9050,9588],[9063,9616],[9066,9622],[9076,9634],[9092,9652],[9100,9662],[9108,9672],[9111,9676],[9113,9680],[9131,9702],[9162,9735],[9164,9738],[9218,9793],[9219,9795],[11329,11906],[11331,11909],[11334,11913],[11336,11917],[11346,11928],[11361,11944],[11363,11947],[11366,11951],[11370,11956],[11372,11960],[11375,11964],[11389,11979],[11682,12284],[11686,12292],[11687,12312],[11692,12319],[11694,12330],[11714,12351],[11716,12436],[11723,12447],[11725,12535],[11730,12543],[11736,12586],[11982,12842],[11989,12850],[12102,12964],[12336,13200],[12348,13215],[12350,13218],[12384,13253],[12393,13263],[12395,13267],[12397,13270],[12510,13384],[12553,13428],[12851,13727],[12962,13839],[12973,13851],[13738,14617],[13823,14703],[13919,14801],[13933,14816],[14080,14964],[14298,15183],[14585,15471],[14698,15585],[15583,16471],[15847,16736],[16318,17208],[16434,17325],[16438,17330],[16481,17374],[16729,17623],[17102,17997],[17122,18018],[17315,18212],[17320,18218],[17402,18301],[17418,18318],[17859,18760],[17909,18811],[17911,18814],[17915,18820],[17916,18823],[17936,18844],[17939,18848],[17961,18872],[18664,19576],[18703,19620],[18814,19738],[18962,19887],[19043,40870],[33469,59244],[33470,59336],[33471,59367],[33484,59413],[33485,59417],[33490,59423],[33497,59431],[33501,59437],[33505,59443],[33513,59452],[33520,59460],[33536,59478],[33550,59493],[37845,63789],[37921,63866],[37948,63894],[38029,63976],[38038,63986],[38064,64016],[38065,64018],[38066,64021],[38069,64025],[38075,64034],[38076,64037],[38078,64042],[39108,65074],[39109,65093],[39113,65107],[39114,65112],[39115,65127],[39116,65132],[39265,65375],[39394,65510],[189000,65536]], + "jis0208":[12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,12295,12540,8213,8208,65295,65340,65374,8741,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,65291,65293,177,215,247,65309,8800,65308,65310,8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,65504,65505,65285,65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,null,null,null,null,null,null,null,null,null,null,null,8712,8715,8838,8839,8834,8835,8746,8745,null,null,null,null,null,null,null,null,8743,8744,65506,8658,8660,8704,8707,null,null,null,null,null,null,null,null,null,null,null,8736,8869,8978,8706,8711,8801,8786,8810,8811,8730,8765,8733,8757,8747,8748,null,null,null,null,null,null,null,8491,8240,9839,9837,9834,8224,8225,182,null,null,null,null,9711,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,null,null,null,null,null,null,null,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,null,null,null,null,null,null,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,null,null,null,null,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,null,null,null,null,null,null,null,null,null,null,null,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,null,null,null,null,null,null,null,null,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,null,null,null,null,null,null,null,null,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,null,null,null,null,null,null,null,null,null,null,null,null,null,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,null,13129,13076,13090,13133,13080,13095,13059,13110,13137,13143,13069,13094,13091,13099,13130,13115,13212,13213,13214,13198,13199,13252,13217,null,null,null,null,null,null,null,null,13179,12317,12319,8470,13261,8481,12964,12965,12966,12967,12968,12849,12850,12857,13182,13181,13180,8786,8801,8747,8750,8721,8730,8869,8736,8735,8895,8757,8745,8746,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,20124,21782,23043,38463,21696,24859,25384,23030,36898,33909,33564,31312,24746,25569,28197,26093,33894,33446,39925,26771,22311,26017,25201,23451,22992,34427,39156,32098,32190,39822,25110,31903,34999,23433,24245,25353,26263,26696,38343,38797,26447,20197,20234,20301,20381,20553,22258,22839,22996,23041,23561,24799,24847,24944,26131,26885,28858,30031,30064,31227,32173,32239,32963,33806,34915,35586,36949,36986,21307,20117,20133,22495,32946,37057,30959,19968,22769,28322,36920,31282,33576,33419,39983,20801,21360,21693,21729,22240,23035,24341,39154,28139,32996,34093,38498,38512,38560,38907,21515,21491,23431,28879,32701,36802,38632,21359,40284,31418,19985,30867,33276,28198,22040,21764,27421,34074,39995,23013,21417,28006,29916,38287,22082,20113,36939,38642,33615,39180,21473,21942,23344,24433,26144,26355,26628,27704,27891,27945,29787,30408,31310,38964,33521,34907,35424,37613,28082,30123,30410,39365,24742,35585,36234,38322,27022,21421,20870,22290,22576,22852,23476,24310,24616,25513,25588,27839,28436,28814,28948,29017,29141,29503,32257,33398,33489,34199,36960,37467,40219,22633,26044,27738,29989,20985,22830,22885,24448,24540,25276,26106,27178,27431,27572,29579,32705,35158,40236,40206,40644,23713,27798,33659,20740,23627,25014,33222,26742,29281,20057,20474,21368,24681,28201,31311,38899,19979,21270,20206,20309,20285,20385,20339,21152,21487,22025,22799,23233,23478,23521,31185,26247,26524,26550,27468,27827,28779,29634,31117,31166,31292,31623,33457,33499,33540,33655,33775,33747,34662,35506,22057,36008,36838,36942,38686,34442,20420,23784,25105,29273,30011,33253,33469,34558,36032,38597,39187,39381,20171,20250,35299,22238,22602,22730,24315,24555,24618,24724,24674,25040,25106,25296,25913,39745,26214,26800,28023,28784,30028,30342,32117,33445,34809,38283,38542,35997,20977,21182,22806,21683,23475,23830,24936,27010,28079,30861,33995,34903,35442,37799,39608,28012,39336,34521,22435,26623,34510,37390,21123,22151,21508,24275,25313,25785,26684,26680,27579,29554,30906,31339,35226,35282,36203,36611,37101,38307,38548,38761,23398,23731,27005,38989,38990,25499,31520,27179,27263,26806,39949,28511,21106,21917,24688,25324,27963,28167,28369,33883,35088,36676,19988,39993,21494,26907,27194,38788,26666,20828,31427,33970,37340,37772,22107,40232,26658,33541,33841,31909,21000,33477,29926,20094,20355,20896,23506,21002,21208,21223,24059,21914,22570,23014,23436,23448,23515,24178,24185,24739,24863,24931,25022,25563,25954,26577,26707,26874,27454,27475,27735,28450,28567,28485,29872,29976,30435,30475,31487,31649,31777,32233,32566,32752,32925,33382,33694,35251,35532,36011,36996,37969,38291,38289,38306,38501,38867,39208,33304,20024,21547,23736,24012,29609,30284,30524,23721,32747,36107,38593,38929,38996,39000,20225,20238,21361,21916,22120,22522,22855,23305,23492,23696,24076,24190,24524,25582,26426,26071,26082,26399,26827,26820,27231,24112,27589,27671,27773,30079,31048,23395,31232,32000,24509,35215,35352,36020,36215,36556,36637,39138,39438,39740,20096,20605,20736,22931,23452,25135,25216,25836,27450,29344,30097,31047,32681,34811,35516,35696,25516,33738,38816,21513,21507,21931,26708,27224,35440,30759,26485,40653,21364,23458,33050,34384,36870,19992,20037,20167,20241,21450,21560,23470,24339,24613,25937,26429,27714,27762,27875,28792,29699,31350,31406,31496,32026,31998,32102,26087,29275,21435,23621,24040,25298,25312,25369,28192,34394,35377,36317,37624,28417,31142,39770,20136,20139,20140,20379,20384,20689,20807,31478,20849,20982,21332,21281,21375,21483,21932,22659,23777,24375,24394,24623,24656,24685,25375,25945,27211,27841,29378,29421,30703,33016,33029,33288,34126,37111,37857,38911,39255,39514,20208,20957,23597,26241,26989,23616,26354,26997,29577,26704,31873,20677,21220,22343,24062,37670,26020,27427,27453,29748,31105,31165,31563,32202,33465,33740,34943,35167,35641,36817,37329,21535,37504,20061,20534,21477,21306,29399,29590,30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598,23507,36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705,31402,29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676,36557,37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411,22865,24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179,30054,31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686,36605,38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625,27424,27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860,21048,21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177,29309,29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963,37749,38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572,29694,32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396,24049,24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776,34382,35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566,23087,24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062,39881,20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475,21521,21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184,24195,24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356,26477,26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295,31968,32005,32024,32094,32177,32789,32771,32943,32945,33108,33167,33322,33618,34892,34913,35611,36002,36092,37066,37237,37489,30783,37628,38308,38477,38917,39321,39640,40251,21083,21163,21495,21512,22741,25335,28640,35946,36703,40633,20811,21051,21578,22269,31296,37239,40288,40658,29508,28425,33136,29969,24573,24794,39592,29403,36796,27492,38915,20170,22256,22372,22718,23130,24680,25031,26127,26118,26681,26801,28151,30165,32058,33390,39746,20123,20304,21449,21766,23919,24038,24046,26619,27801,29811,30722,35408,37782,35039,22352,24231,25387,20661,20652,20877,26368,21705,22622,22971,23472,24425,25165,25505,26685,27507,28168,28797,37319,29312,30741,30758,31085,25998,32048,33756,35009,36617,38555,21092,22312,26448,32618,36001,20916,22338,38442,22586,27018,32948,21682,23822,22524,30869,40442,20316,21066,21643,25662,26152,26388,26613,31364,31574,32034,37679,26716,39853,31545,21273,20874,21047,23519,25334,25774,25830,26413,27578,34217,38609,30352,39894,25420,37638,39851,30399,26194,19977,20632,21442,23665,24808,25746,25955,26719,29158,29642,29987,31639,32386,34453,35715,36059,37240,39184,26028,26283,27531,20181,20180,20282,20351,21050,21496,21490,21987,22235,22763,22987,22985,23039,23376,23629,24066,24107,24535,24605,25351,25903,23388,26031,26045,26088,26525,27490,27515,27663,29509,31049,31169,31992,32025,32043,32930,33026,33267,35222,35422,35433,35430,35468,35566,36039,36060,38604,39164,27503,20107,20284,20365,20816,23383,23546,24904,25345,26178,27425,28363,27835,29246,29885,30164,30913,31034,32780,32819,33258,33940,36766,27728,40575,24335,35672,40235,31482,36600,23437,38635,19971,21489,22519,22833,23241,23460,24713,28287,28422,30142,36074,23455,34048,31712,20594,26612,33437,23649,34122,32286,33294,20889,23556,25448,36198,26012,29038,31038,32023,32773,35613,36554,36974,34503,37034,20511,21242,23610,26451,28796,29237,37196,37320,37675,33509,23490,24369,24825,20027,21462,23432,25163,26417,27530,29417,29664,31278,33131,36259,37202,39318,20754,21463,21610,23551,25480,27193,32172,38656,22234,21454,21608,23447,23601,24030,20462,24833,25342,27954,31168,31179,32066,32333,32722,33261,33311,33936,34886,35186,35728,36468,36655,36913,37195,37228,38598,37276,20160,20303,20805,21313,24467,25102,26580,27713,28171,29539,32294,37325,37507,21460,22809,23487,28113,31069,32302,31899,22654,29087,20986,34899,36848,20426,23803,26149,30636,31459,33308,39423,20934,24490,26092,26991,27529,28147,28310,28516,30462,32020,24033,36981,37255,38918,20966,21021,25152,26257,26329,28186,24246,32210,32626,26360,34223,34295,35576,21161,21465,22899,24207,24464,24661,37604,38500,20663,20767,21213,21280,21319,21484,21736,21830,21809,22039,22888,22974,23100,23477,23558,23567,23569,23578,24196,24202,24288,24432,25215,25220,25307,25484,25463,26119,26124,26157,26230,26494,26786,27167,27189,27836,28040,28169,28248,28988,28966,29031,30151,30465,30813,30977,31077,31216,31456,31505,31911,32057,32918,33750,33931,34121,34909,35059,35359,35388,35412,35443,35937,36062,37284,37478,37758,37912,38556,38808,19978,19976,19998,20055,20887,21104,22478,22580,22732,23330,24120,24773,25854,26465,26454,27972,29366,30067,31331,33976,35698,37304,37664,22065,22516,39166,25325,26893,27542,29165,32340,32887,33394,35302,39135,34645,36785,23611,20280,20449,20405,21767,23072,23517,23529,24515,24910,25391,26032,26187,26862,27035,28024,28145,30003,30137,30495,31070,31206,32051,33251,33455,34218,35242,35386,36523,36763,36914,37341,38663,20154,20161,20995,22645,22764,23563,29978,23613,33102,35338,36805,38499,38765,31525,35535,38920,37218,22259,21416,36887,21561,22402,24101,25512,27700,28810,30561,31883,32736,34928,36930,37204,37648,37656,38543,29790,39620,23815,23913,25968,26530,36264,38619,25454,26441,26905,33733,38935,38592,35070,28548,25722,23544,19990,28716,30045,26159,20932,21046,21218,22995,24449,24615,25104,25919,25972,26143,26228,26866,26646,27491,28165,29298,29983,30427,31934,32854,22768,35069,35199,35488,35475,35531,36893,37266,38738,38745,25993,31246,33030,38587,24109,24796,25114,26021,26132,26512,30707,31309,31821,32318,33034,36012,36196,36321,36447,30889,20999,25305,25509,25666,25240,35373,31363,31680,35500,38634,32118,33292,34633,20185,20808,21315,21344,23459,23554,23574,24029,25126,25159,25776,26643,26676,27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218,32330,32680,33146,33307,33337,34214,35438,36046,36341,36984,36983,37549,37521,38275,39854,21069,21892,28472,28982,20840,31109,32341,33203,31950,22092,22609,23720,25514,26366,26365,26970,29401,30095,30094,30990,31062,31199,31895,32032,32068,34311,35380,38459,36961,40736,20711,21109,21452,21474,20489,21930,22766,22863,29245,23435,23652,21277,24803,24819,25436,25475,25407,25531,25805,26089,26361,24035,27085,27133,28437,29157,20105,30185,30456,31379,31967,32207,32156,32865,33609,33624,33900,33980,34299,35013,36208,36865,36973,37783,38684,39442,20687,22679,24974,33235,34101,36104,36896,20419,20596,21063,21363,24687,25417,26463,28204,36275,36895,20439,23646,36042,26063,32154,21330,34966,20854,25539,23384,23403,23562,25613,26449,36956,20182,22810,22826,27760,35409,21822,22549,22949,24816,25171,26561,33333,26965,38464,39364,39464,20307,22534,23550,32784,23729,24111,24453,24608,24907,25140,26367,27888,28382,32974,33151,33492,34955,36024,36864,36910,38538,40667,39899,20195,21488,22823,31532,37261,38988,40441,28381,28711,21331,21828,23429,25176,25246,25299,27810,28655,29730,35351,37944,28609,35582,33592,20967,34552,21482,21481,20294,36948,36784,22890,33073,24061,31466,36799,26842,35895,29432,40008,27197,35504,20025,21336,22022,22374,25285,25506,26086,27470,28129,28251,28845,30701,31471,31658,32187,32829,32966,34507,35477,37723,22243,22727,24382,26029,26262,27264,27573,30007,35527,20516,30693,22320,24347,24677,26234,27744,30196,31258,32622,33268,34584,36933,39347,31689,30044,31481,31569,33988,36880,31209,31378,33590,23265,30528,20013,20210,23449,24544,25277,26172,26609,27880,34411,34935,35387,37198,37619,39376,27159,28710,29482,33511,33879,36015,19969,20806,20939,21899,23541,24086,24115,24193,24340,24373,24427,24500,25074,25361,26274,26397,28526,29266,30010,30522,32884,33081,33144,34678,35519,35548,36229,36339,37530,38263,38914,40165,21189,25431,30452,26389,27784,29645,36035,37806,38515,27941,22684,26894,27084,36861,37786,30171,36890,22618,26626,25524,27131,20291,28460,26584,36795,34086,32180,37716,26943,28528,22378,22775,23340,32044,29226,21514,37347,40372,20141,20302,20572,20597,21059,35998,21576,22564,23450,24093,24213,24237,24311,24351,24716,25269,25402,25552,26799,27712,30855,31118,31243,32224,33351,35330,35558,36420,36883,37048,37165,37336,40718,27877,25688,25826,25973,28404,30340,31515,36969,37841,28346,21746,24505,25764,36685,36845,37444,20856,22635,22825,23637,24215,28155,32399,29980,36028,36578,39003,28857,20253,27583,28593,30000,38651,20814,21520,22581,22615,22956,23648,24466,26007,26460,28193,30331,33759,36077,36884,37117,37709,30757,30778,21162,24230,22303,22900,24594,20498,20826,20908,20941,20992,21776,22612,22616,22871,23445,23798,23947,24764,25237,25645,26481,26691,26812,26847,30423,28120,28271,28059,28783,29128,24403,30168,31095,31561,31572,31570,31958,32113,21040,33891,34153,34276,35342,35588,35910,36367,36867,36879,37913,38518,38957,39472,38360,20685,21205,21516,22530,23566,24999,25758,27934,30643,31461,33012,33796,36947,37509,23776,40199,21311,24471,24499,28060,29305,30563,31167,31716,27602,29420,35501,26627,27233,20984,31361,26932,23626,40182,33515,23493,37193,28702,22136,23663,24775,25958,27788,35930,36929,38931,21585,26311,37389,22856,37027,20869,20045,20970,34201,35598,28760,25466,37707,26978,39348,32260,30071,21335,26976,36575,38627,27741,20108,23612,24336,36841,21250,36049,32905,34425,24319,26085,20083,20837,22914,23615,38894,20219,22922,24525,35469,28641,31152,31074,23527,33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043,22492,22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226,25773,35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259,25309,25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186,26757,26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833,20271,21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333,28448,29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368,24161,32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244,31567,38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070,25644,26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009,31684,37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290,21329,21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130,30382,30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147,31800,20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305,30091,39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019,23195,32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413,35961,24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428,25996,27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142,23500,20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104,33178,33433,35676,36000,36070,36212,38428,38468,20398,25771,27494,33310,33889,34154,37096,23553,26963,39080,33914,34135,20239,21103,24489,24133,26381,31119,33145,35079,35206,28149,24343,25173,27832,20175,29289,39826,20998,21563,22132,22707,24996,25198,28954,22894,31881,31966,32027,38640,25991,32862,19993,20341,20853,22592,24163,24179,24330,26564,20006,34109,38281,38491,31859,38913,20731,22721,30294,30887,21029,30629,34065,31622,20559,22793,29255,31687,32232,36794,36820,36941,20415,21193,23081,24321,38829,20445,33303,37610,22275,25429,27497,29995,35036,36628,31298,21215,22675,24917,25098,26286,27597,31807,33769,20515,20472,21253,21574,22577,22857,23453,23792,23791,23849,24214,25265,25447,25918,26041,26379,27861,27873,28921,30770,32299,32990,33459,33804,34028,34562,35090,35370,35914,37030,37586,39165,40179,40300,20047,20129,20621,21078,22346,22952,24125,24536,24537,25151,26292,26395,26576,26834,20882,32033,32938,33192,35584,35980,36031,37502,38450,21536,38956,21271,20693,21340,22696,25778,26420,29287,30566,31302,37350,21187,27809,27526,22528,24140,22868,26412,32763,20961,30406,25705,30952,39764,40635,22475,22969,26151,26522,27598,21737,27097,24149,33180,26517,39850,26622,40018,26717,20134,20451,21448,25273,26411,27819,36804,20397,32365,40639,19975,24930,28288,28459,34067,21619,26410,39749,24051,31637,23724,23494,34588,28234,34001,31252,33032,22937,31885,27665,30496,21209,22818,28961,29279,30683,38695,40289,26891,23167,23064,20901,21517,21629,26126,30431,36855,37528,40180,23018,29277,28357,20813,26825,32191,32236,38754,40634,25720,27169,33538,22916,23391,27611,29467,30450,32178,32791,33945,20786,26408,40665,30446,26466,21247,39173,23588,25147,31870,36016,21839,24758,32011,38272,21249,20063,20918,22812,29242,32822,37326,24357,30690,21380,24441,32004,34220,35379,36493,38742,26611,34222,37971,24841,24840,27833,30290,35565,36664,21807,20305,20778,21191,21451,23461,24189,24736,24962,25558,26377,26586,28263,28044,29494,29495,30001,31056,35029,35480,36938,37009,37109,38596,34701,22805,20104,20313,19982,35465,36671,38928,20653,24188,22934,23481,24248,25562,25594,25793,26332,26954,27096,27915,28342,29076,29992,31407,32650,32768,33865,33993,35201,35617,36362,36965,38525,39178,24958,25233,27442,27779,28020,32716,32764,28096,32645,34746,35064,26469,33713,38972,38647,27931,32097,33853,37226,20081,21365,23888,27396,28651,34253,34349,35239,21033,21519,23653,26446,26792,29702,29827,30178,35023,35041,37324,38626,38520,24459,29575,31435,33870,25504,30053,21129,27969,28316,29705,30041,30827,31890,38534,31452,40845,20406,24942,26053,34396,20102,20142,20698,20001,20940,23534,26009,26753,28092,29471,30274,30637,31260,31975,33391,35538,36988,37327,38517,38936,21147,32209,20523,21400,26519,28107,29136,29747,33256,36650,38563,40023,40607,29792,22593,28057,32047,39006,20196,20278,20363,20919,21169,23994,24604,29618,31036,33491,37428,38583,38646,38666,40599,40802,26278,27508,21015,21155,28872,35010,24265,24651,24976,28451,29001,31806,32244,32879,34030,36899,37676,21570,39791,27347,28809,36034,36335,38706,21172,23105,24266,24324,26391,27004,27028,28010,28431,29282,29436,31725,32769,32894,34635,37070,20845,40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031,24785,26528,40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056,20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147,20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314,20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369,20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452,20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478,20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600,20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717,20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794,20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846,20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898,20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960,34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038,21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119,21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,21180,21173,21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,21241,21254,21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,21304,21312,21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,21367,21378,21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,26364,29166,21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,21558,21545,21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,21632,21622,21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,21675,21698,21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,21754,21730,21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,21853,21913,21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,21929,21895,21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,22014,22013,22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,22063,22124,22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,22210,22204,22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,22271,22276,22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,22328,22350,22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,22451,22436,22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,22553,22557,22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,22687,22699,22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,22757,22748,22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,22811,26790,22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,22872,22882,22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,22982,23016,23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,23148,23113,23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,23255,23270,23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,23358,23363,23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,23416,25992,23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,23526,23522,23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,23584,23586,23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,23662,20066,23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,23749,23742,23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,23900,23839,23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,23916,23923,23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,23996,24009,24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,24081,24091,24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,24135,24181,24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,24291,24285,24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,24312,24318,24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,24392,24396,24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,24450,24447,24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571,24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625,24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646,24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730,24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560,24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835,24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876,24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933,24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977,25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037,25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101,25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182,25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219,25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282,25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406,25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525,25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652,25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898,25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794,25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,25842,25850,25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,25910,25912,30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,25987,35722,26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,26073,26080,26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,26191,26180,26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,26248,26254,26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,26326,26330,26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,26407,38712,26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,26468,26505,26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,26548,26604,26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,26599,27292,26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,26743,26751,26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,26784,26810,26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,26829,26836,26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,26920,26922,26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,26990,26937,26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,27088,27071,27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,27025,27040,27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,27111,27141,27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,27148,27250,27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,27296,27268,27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,27345,27359,27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,27448,27447,30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,27489,27512,27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,27563,27567,27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,27635,27631,40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,27778,27789,27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,27837,27863,27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,34893,27958,27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,27994,28025,27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,28088,28102,28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,28142,28205,28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,28191,28227,28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,28371,28349,28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,28748,28396,28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,28550,28538,28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,28561,28610,28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,28628,28632,28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,28698,28532,28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,28913,28844,28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013,29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143,29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183,29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254,29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362,29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450,29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546,29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678,29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761,29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908,29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955,29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026,30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087,30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133,30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204,30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242,30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313,30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350,30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418,30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,30500,30494,30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,30591,30590,30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,30653,30651,30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,30752,31018,30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,30929,30918,30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,30983,30994,30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,31098,31103,31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,31207,31212,31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,31294,31287,31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,31383,31381,31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,31434,31437,31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,31490,31503,31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,31492,31565,31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,31645,31640,31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,31692,31695,31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,31763,31731,31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,31820,31811,31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,31875,31888,31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,31933,31936,31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,31994,32006,32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,32115,32086,32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,32155,32186,32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,32159,32176,32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,32274,32305,32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,32306,32314,32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,32387,32213,32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,32398,32411,32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,32600,32607,32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,32660,32670,32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,32710,32714,32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,32786,32792,32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,32863,32866,32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,32923,32915,32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,33033,33007,33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,33020,33137,33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,33188,33187,33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,33225,33229,33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,33281,33282,33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,33369,33368,33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,33400,33406,33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,33523,33530,33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,33558,33586,33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,33706,33695,33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,33673,33704,33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,33760,33778,33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,33924,33911,33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,33890,33977,33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,34081,34047,34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,34120,34113,34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,34203,34282,34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,34269,34277,34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,34367,34381,20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,34486,34479,34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,34523,34543,34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,34612,34623,34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,34647,34664,34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,34749,34752,34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,34831,34829,34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,34870,34873,34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,34974,34933,34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992,35007,34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048,35058,35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131,35126,35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191,35198,35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258,35261,35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340,35355,35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426,35461,35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522,35546,35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596,35591,35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624,35649,35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700,35709,35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912,35916,35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981,35982,35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040,36033,36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109,36112,40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290,36286,36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348,36360,36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423,36425,36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476,36481,36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,36524,36528,36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,36606,36618,36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,36667,36665,36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,36708,36764,36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,36852,36869,36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,36917,36921,36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,36968,36975,36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,37039,37041,37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,37206,37208,37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,37290,37301,37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,37372,37365,37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,37476,37448,37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,37559,37609,37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,37724,37728,37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,37861,37848,37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,37942,37931,37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,37417,38000,38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,38292,38294,38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,28662,38339,38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,38446,38447,38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,38508,38541,38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,38585,38606,38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,38675,38670,38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,38726,38728,38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,38789,38780,38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,38836,38851,38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,38924,38968,38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,39028,39027,39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,39186,39188,39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,39241,39237,39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,39356,39391,39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,39439,39429,39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,39515,39511,39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,39631,39633,39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,39665,39671,39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,39722,39726,39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,39811,39825,39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,39889,39890,39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,39945,39955,39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,39984,40007,39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,40201,40200,40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,40257,40255,40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,40327,40363,40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,40390,40399,40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,40565,40569,40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,40632,40618,40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,40677,40680,40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,40725,40737,40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,40812,40810,40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,65506,65508,65287,65282,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,65506,65508,65287,65282,12849,8470,8481,8757,32394,35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], + "jis0212":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,728,711,184,729,733,175,731,730,65374,900,901,null,null,null,null,null,null,null,null,161,166,191,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,186,170,169,174,8482,164,8470,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,902,904,905,906,938,null,908,null,910,939,null,911,null,null,null,null,940,941,942,943,970,912,972,962,973,971,944,974,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,1119,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,198,272,null,294,null,306,null,321,319,null,330,216,338,null,358,222,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,230,273,240,295,305,307,312,322,320,329,331,248,339,223,359,254,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,193,192,196,194,258,461,256,260,197,195,262,264,268,199,266,270,201,200,203,202,282,278,274,280,null,284,286,290,288,292,205,204,207,206,463,304,298,302,296,308,310,313,317,315,323,327,325,209,211,210,214,212,465,336,332,213,340,344,342,346,348,352,350,356,354,218,217,220,219,364,467,368,362,370,366,360,471,475,473,469,372,221,376,374,377,381,379,null,null,null,null,null,null,null,225,224,228,226,259,462,257,261,229,227,263,265,269,231,267,271,233,232,235,234,283,279,275,281,501,285,287,null,289,293,237,236,239,238,464,null,299,303,297,309,311,314,318,316,324,328,326,241,243,242,246,244,466,337,333,245,341,345,343,347,349,353,351,357,355,250,249,252,251,365,468,369,363,371,367,361,472,476,474,470,373,253,255,375,378,382,380,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,19970,19972,19973,19980,19986,19999,20003,20004,20008,20011,20014,20015,20016,20021,20032,20033,20036,20039,20049,20058,20060,20067,20072,20073,20084,20085,20089,20095,20109,20118,20119,20125,20143,20153,20163,20176,20186,20187,20192,20193,20194,20200,20207,20209,20211,20213,20221,20222,20223,20224,20226,20227,20232,20235,20236,20242,20245,20246,20247,20249,20270,20273,20320,20275,20277,20279,20281,20283,20286,20288,20290,20296,20297,20299,20300,20306,20308,20310,20312,20319,20323,20330,20332,20334,20337,20343,20344,20345,20346,20349,20350,20353,20354,20356,20357,20361,20362,20364,20366,20368,20370,20371,20372,20375,20377,20378,20382,20383,20402,20407,20409,20411,20412,20413,20414,20416,20417,20421,20422,20424,20425,20427,20428,20429,20431,20434,20444,20448,20450,20464,20466,20476,20477,20479,20480,20481,20484,20487,20490,20492,20494,20496,20499,20503,20504,20507,20508,20509,20510,20514,20519,20526,20528,20530,20531,20533,20544,20545,20546,20549,20550,20554,20556,20558,20561,20562,20563,20567,20569,20575,20576,20578,20579,20582,20583,20586,20589,20592,20593,20539,20609,20611,20612,20614,20618,20622,20623,20624,20626,20627,20628,20630,20635,20636,20638,20639,20640,20641,20642,20650,20655,20656,20665,20666,20669,20672,20675,20676,20679,20684,20686,20688,20691,20692,20696,20700,20701,20703,20706,20708,20710,20712,20713,20719,20721,20726,20730,20734,20739,20742,20743,20744,20747,20748,20749,20750,20722,20752,20759,20761,20763,20764,20765,20766,20771,20775,20776,20780,20781,20783,20785,20787,20788,20789,20792,20793,20802,20810,20815,20819,20821,20823,20824,20831,20836,20838,20862,20867,20868,20875,20878,20888,20893,20897,20899,20909,20920,20922,20924,20926,20927,20930,20936,20943,20945,20946,20947,20949,20952,20958,20962,20965,20974,20978,20979,20980,20983,20993,20994,20997,21010,21011,21013,21014,21016,21026,21032,21041,21042,21045,21052,21061,21065,21077,21079,21080,21082,21084,21087,21088,21089,21094,21102,21111,21112,21113,21120,21122,21125,21130,21132,21139,21141,21142,21143,21144,21146,21148,21156,21157,21158,21159,21167,21168,21174,21175,21176,21178,21179,21181,21184,21188,21190,21192,21196,21199,21201,21204,21206,21211,21212,21217,21221,21224,21225,21226,21228,21232,21233,21236,21238,21239,21248,21251,21258,21259,21260,21265,21267,21272,21275,21276,21278,21279,21285,21287,21288,21289,21291,21292,21293,21296,21298,21301,21308,21309,21310,21314,21324,21323,21337,21339,21345,21347,21349,21356,21357,21362,21369,21374,21379,21383,21384,21390,21395,21396,21401,21405,21409,21412,21418,21419,21423,21426,21428,21429,21431,21432,21434,21437,21440,21445,21455,21458,21459,21461,21466,21469,21470,21472,21478,21479,21493,21506,21523,21530,21537,21543,21544,21546,21551,21553,21556,21557,21571,21572,21575,21581,21583,21598,21602,21604,21606,21607,21609,21611,21613,21614,21620,21631,21633,21635,21637,21640,21641,21645,21649,21653,21654,21660,21663,21665,21670,21671,21673,21674,21677,21678,21681,21687,21689,21690,21691,21695,21702,21706,21709,21710,21728,21738,21740,21743,21750,21756,21758,21759,21760,21761,21765,21768,21769,21772,21773,21774,21781,21802,21803,21810,21813,21814,21819,21820,21821,21825,21831,21833,21834,21837,21840,21841,21848,21850,21851,21854,21856,21857,21860,21862,21887,21889,21890,21894,21896,21902,21903,21905,21906,21907,21908,21911,21923,21924,21933,21938,21951,21953,21955,21958,21961,21963,21964,21966,21969,21970,21971,21975,21976,21979,21982,21986,21993,22006,22015,22021,22024,22026,22029,22030,22031,22032,22033,22034,22041,22060,22064,22067,22069,22071,22073,22075,22076,22077,22079,22080,22081,22083,22084,22086,22089,22091,22093,22095,22100,22110,22112,22113,22114,22115,22118,22121,22125,22127,22129,22130,22133,22148,22149,22152,22155,22156,22165,22169,22170,22173,22174,22175,22182,22183,22184,22185,22187,22188,22189,22193,22195,22199,22206,22213,22217,22218,22219,22223,22224,22220,22221,22233,22236,22237,22239,22241,22244,22245,22246,22247,22248,22257,22251,22253,22262,22263,22273,22274,22279,22282,22284,22289,22293,22298,22299,22301,22304,22306,22307,22308,22309,22313,22314,22316,22318,22319,22323,22324,22333,22334,22335,22341,22342,22348,22349,22354,22370,22373,22375,22376,22379,22381,22382,22383,22384,22385,22387,22388,22389,22391,22393,22394,22395,22396,22398,22401,22403,22412,22420,22423,22425,22426,22428,22429,22430,22431,22433,22421,22439,22440,22441,22444,22456,22461,22471,22472,22476,22479,22485,22493,22494,22500,22502,22503,22505,22509,22512,22517,22518,22520,22525,22526,22527,22531,22532,22536,22537,22497,22540,22541,22555,22558,22559,22560,22566,22567,22573,22578,22585,22591,22601,22604,22605,22607,22608,22613,22623,22625,22628,22631,22632,22648,22652,22655,22656,22657,22663,22664,22665,22666,22668,22669,22671,22672,22676,22678,22685,22688,22689,22690,22694,22697,22705,22706,22724,22716,22722,22728,22733,22734,22736,22738,22740,22742,22746,22749,22753,22754,22761,22771,22789,22790,22795,22796,22802,22803,22804,34369,22813,22817,22819,22820,22824,22831,22832,22835,22837,22838,22847,22851,22854,22866,22867,22873,22875,22877,22878,22879,22881,22883,22891,22893,22895,22898,22901,22902,22905,22907,22908,22923,22924,22926,22930,22933,22935,22943,22948,22951,22957,22958,22959,22960,22963,22967,22970,22972,22977,22979,22980,22984,22986,22989,22994,23005,23006,23007,23011,23012,23015,23022,23023,23025,23026,23028,23031,23040,23044,23052,23053,23054,23058,23059,23070,23075,23076,23079,23080,23082,23085,23088,23108,23109,23111,23112,23116,23120,23125,23134,23139,23141,23143,23149,23159,23162,23163,23166,23179,23184,23187,23190,23193,23196,23198,23199,23200,23202,23207,23212,23217,23218,23219,23221,23224,23226,23227,23231,23236,23238,23240,23247,23258,23260,23264,23269,23274,23278,23285,23286,23293,23296,23297,23304,23319,23348,23321,23323,23325,23329,23333,23341,23352,23361,23371,23372,23378,23382,23390,23400,23406,23407,23420,23421,23422,23423,23425,23428,23430,23434,23438,23440,23441,23443,23444,23446,23464,23465,23468,23469,23471,23473,23474,23479,23482,23484,23488,23489,23501,23503,23510,23511,23512,23513,23514,23520,23535,23537,23540,23549,23564,23575,23582,23583,23587,23590,23593,23595,23596,23598,23600,23602,23605,23606,23641,23642,23644,23650,23651,23655,23656,23657,23661,23664,23668,23669,23674,23675,23676,23677,23687,23688,23690,23695,23698,23709,23711,23712,23714,23715,23718,23722,23730,23732,23733,23738,23753,23755,23762,23773,23767,23790,23793,23794,23796,23809,23814,23821,23826,23851,23843,23844,23846,23847,23857,23860,23865,23869,23871,23874,23875,23878,23880,23893,23889,23897,23882,23903,23904,23905,23906,23908,23914,23917,23920,23929,23930,23934,23935,23937,23939,23944,23946,23954,23955,23956,23957,23961,23963,23967,23968,23975,23979,23984,23988,23992,23993,24003,24007,24011,24016,24014,24024,24025,24032,24036,24041,24056,24057,24064,24071,24077,24082,24084,24085,24088,24095,24096,24110,24104,24114,24117,24126,24139,24144,24137,24145,24150,24152,24155,24156,24158,24168,24170,24171,24172,24173,24174,24176,24192,24203,24206,24226,24228,24229,24232,24234,24236,24241,24243,24253,24254,24255,24262,24268,24267,24270,24273,24274,24276,24277,24284,24286,24293,24299,24322,24326,24327,24328,24334,24345,24348,24349,24353,24354,24355,24356,24360,24363,24364,24366,24368,24372,24374,24379,24381,24383,24384,24388,24389,24391,24397,24400,24404,24408,24411,24416,24419,24420,24423,24431,24434,24436,24437,24440,24442,24445,24446,24457,24461,24463,24470,24476,24477,24482,24487,24491,24484,24492,24495,24496,24497,24504,24516,24519,24520,24521,24523,24528,24529,24530,24531,24532,24542,24545,24546,24552,24553,24554,24556,24557,24558,24559,24562,24563,24566,24570,24572,24583,24586,24589,24595,24596,24599,24600,24602,24607,24612,24621,24627,24629,24640,24647,24648,24649,24652,24657,24660,24662,24663,24669,24673,24679,24689,24702,24703,24706,24710,24712,24714,24718,24721,24723,24725,24728,24733,24734,24738,24740,24741,24744,24752,24753,24759,24763,24766,24770,24772,24776,24777,24778,24779,24782,24783,24788,24789,24793,24795,24797,24798,24802,24805,24818,24821,24824,24828,24829,24834,24839,24842,24844,24848,24849,24850,24851,24852,24854,24855,24857,24860,24862,24866,24874,24875,24880,24881,24885,24886,24887,24889,24897,24901,24902,24905,24926,24928,24940,24946,24952,24955,24956,24959,24960,24961,24963,24964,24971,24973,24978,24979,24983,24984,24988,24989,24991,24992,24997,25000,25002,25005,25016,25017,25020,25024,25025,25026,25038,25039,25045,25052,25053,25054,25055,25057,25058,25063,25065,25061,25068,25069,25071,25089,25091,25092,25095,25107,25109,25116,25120,25122,25123,25127,25129,25131,25145,25149,25154,25155,25156,25158,25164,25168,25169,25170,25172,25174,25178,25180,25188,25197,25199,25203,25210,25213,25229,25230,25231,25232,25254,25256,25267,25270,25271,25274,25278,25279,25284,25294,25301,25302,25306,25322,25330,25332,25340,25341,25347,25348,25354,25355,25357,25360,25363,25366,25368,25385,25386,25389,25397,25398,25401,25404,25409,25410,25411,25412,25414,25418,25419,25422,25426,25427,25428,25432,25435,25445,25446,25452,25453,25457,25460,25461,25464,25468,25469,25471,25474,25476,25479,25482,25488,25492,25493,25497,25498,25502,25508,25510,25517,25518,25519,25533,25537,25541,25544,25550,25553,25555,25556,25557,25564,25568,25573,25578,25580,25586,25587,25589,25592,25593,25609,25610,25616,25618,25620,25624,25630,25632,25634,25636,25637,25641,25642,25647,25648,25653,25661,25663,25675,25679,25681,25682,25683,25684,25690,25691,25692,25693,25695,25696,25697,25699,25709,25715,25716,25723,25725,25733,25735,25743,25744,25745,25752,25753,25755,25757,25759,25761,25763,25766,25768,25772,25779,25789,25790,25791,25796,25801,25802,25803,25804,25806,25808,25809,25813,25815,25828,25829,25833,25834,25837,25840,25845,25847,25851,25855,25857,25860,25864,25865,25866,25871,25875,25876,25878,25881,25883,25886,25887,25890,25894,25897,25902,25905,25914,25916,25917,25923,25927,25929,25936,25938,25940,25951,25952,25959,25963,25978,25981,25985,25989,25994,26002,26005,26008,26013,26016,26019,26022,26030,26034,26035,26036,26047,26050,26056,26057,26062,26064,26068,26070,26072,26079,26096,26098,26100,26101,26105,26110,26111,26112,26116,26120,26121,26125,26129,26130,26133,26134,26141,26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26161,26163,26169,26167,26176,26181,26182,26186,26188,26193,26190,26199,26200,26201,26203,26204,26208,26209,26363,26218,26219,26220,26238,26227,26229,26239,26231,26232,26233,26235,26240,26236,26251,26252,26253,26256,26258,26265,26266,26267,26268,26271,26272,26276,26285,26289,26290,26293,26299,26303,26304,26306,26307,26312,26316,26318,26319,26324,26331,26335,26344,26347,26348,26350,26362,26373,26375,26382,26387,26393,26396,26400,26402,26419,26430,26437,26439,26440,26444,26452,26453,26461,26470,26476,26478,26484,26486,26491,26497,26500,26510,26511,26513,26515,26518,26520,26521,26523,26544,26545,26546,26549,26555,26556,26557,26617,26560,26562,26563,26565,26568,26569,26578,26583,26585,26588,26593,26598,26608,26610,26614,26615,26706,26644,26649,26653,26655,26664,26663,26668,26669,26671,26672,26673,26675,26683,26687,26692,26693,26698,26700,26709,26711,26712,26715,26731,26734,26735,26736,26737,26738,26741,26745,26746,26747,26748,26754,26756,26758,26760,26774,26776,26778,26780,26785,26787,26789,26793,26794,26798,26802,26811,26821,26824,26828,26831,26832,26833,26835,26838,26841,26844,26845,26853,26856,26858,26859,26860,26861,26864,26865,26869,26870,26875,26876,26877,26886,26889,26890,26896,26897,26899,26902,26903,26929,26931,26933,26936,26939,26946,26949,26953,26958,26967,26971,26979,26980,26981,26982,26984,26985,26988,26992,26993,26994,27002,27003,27007,27008,27021,27026,27030,27032,27041,27045,27046,27048,27051,27053,27055,27063,27064,27066,27068,27077,27080,27089,27094,27095,27106,27109,27118,27119,27121,27123,27125,27134,27136,27137,27139,27151,27153,27157,27162,27165,27168,27172,27176,27184,27186,27188,27191,27195,27198,27199,27205,27206,27209,27210,27214,27216,27217,27218,27221,27222,27227,27236,27239,27242,27249,27251,27262,27265,27267,27270,27271,27273,27275,27281,27291,27293,27294,27295,27301,27307,27311,27312,27313,27316,27325,27326,27327,27334,27337,27336,27340,27344,27348,27349,27350,27356,27357,27364,27367,27372,27376,27377,27378,27388,27389,27394,27395,27398,27399,27401,27407,27408,27409,27415,27419,27422,27428,27432,27435,27436,27439,27445,27446,27451,27455,27462,27466,27469,27474,27478,27480,27485,27488,27495,27499,27502,27504,27509,27517,27518,27522,27525,27543,27547,27551,27552,27554,27555,27560,27561,27564,27565,27566,27568,27576,27577,27581,27582,27587,27588,27593,27596,27606,27610,27617,27619,27622,27623,27630,27633,27639,27641,27647,27650,27652,27653,27657,27661,27662,27664,27666,27673,27679,27686,27687,27688,27692,27694,27699,27701,27702,27706,27707,27711,27722,27723,27725,27727,27730,27732,27737,27739,27740,27755,27757,27759,27764,27766,27768,27769,27771,27781,27782,27783,27785,27796,27797,27799,27800,27804,27807,27824,27826,27828,27842,27846,27853,27855,27856,27857,27858,27860,27862,27866,27868,27872,27879,27881,27883,27884,27886,27890,27892,27908,27911,27914,27918,27919,27921,27923,27930,27942,27943,27944,27751,27950,27951,27953,27961,27964,27967,27991,27998,27999,28001,28005,28007,28015,28016,28028,28034,28039,28049,28050,28052,28054,28055,28056,28074,28076,28084,28087,28089,28093,28095,28100,28104,28106,28110,28111,28118,28123,28125,28127,28128,28130,28133,28137,28143,28144,28148,28150,28156,28160,28164,28190,28194,28199,28210,28214,28217,28219,28220,28228,28229,28232,28233,28235,28239,28241,28242,28243,28244,28247,28252,28253,28254,28258,28259,28264,28275,28283,28285,28301,28307,28313,28320,28327,28333,28334,28337,28339,28347,28351,28352,28353,28355,28359,28360,28362,28365,28366,28367,28395,28397,28398,28409,28411,28413,28420,28424,28426,28428,28429,28438,28440,28442,28443,28454,28457,28458,28463,28464,28467,28470,28475,28476,28461,28495,28497,28498,28499,28503,28505,28506,28509,28510,28513,28514,28520,28524,28541,28542,28547,28551,28552,28555,28556,28557,28560,28562,28563,28564,28566,28570,28575,28576,28581,28582,28583,28584,28590,28591,28592,28597,28598,28604,28613,28615,28616,28618,28634,28638,28648,28649,28656,28661,28665,28668,28669,28672,28677,28678,28679,28685,28695,28704,28707,28719,28724,28727,28729,28732,28739,28740,28744,28745,28746,28747,28756,28757,28765,28766,28750,28772,28773,28780,28782,28789,28790,28798,28801,28805,28806,28820,28821,28822,28823,28824,28827,28836,28843,28848,28849,28852,28855,28874,28881,28883,28884,28885,28886,28888,28892,28900,28922,28931,28932,28933,28934,28935,28939,28940,28943,28958,28960,28971,28973,28975,28976,28977,28984,28993,28997,28998,28999,29002,29003,29008,29010,29015,29018,29020,29022,29024,29032,29049,29056,29061,29063,29068,29074,29082,29083,29088,29090,29103,29104,29106,29107,29114,29119,29120,29121,29124,29131,29132,29139,29142,29145,29146,29148,29176,29182,29184,29191,29192,29193,29203,29207,29210,29213,29215,29220,29227,29231,29236,29240,29241,29249,29250,29251,29253,29262,29263,29264,29267,29269,29270,29274,29276,29278,29280,29283,29288,29291,29294,29295,29297,29303,29304,29307,29308,29311,29316,29321,29325,29326,29331,29339,29352,29357,29358,29361,29364,29374,29377,29383,29385,29388,29397,29398,29400,29407,29413,29427,29428,29434,29435,29438,29442,29444,29445,29447,29451,29453,29458,29459,29464,29465,29470,29474,29476,29479,29480,29484,29489,29490,29493,29498,29499,29501,29507,29517,29520,29522,29526,29528,29533,29534,29535,29536,29542,29543,29545,29547,29548,29550,29551,29553,29559,29561,29564,29568,29569,29571,29573,29574,29582,29584,29587,29589,29591,29592,29596,29598,29599,29600,29602,29605,29606,29610,29611,29613,29621,29623,29625,29628,29629,29631,29637,29638,29641,29643,29644,29647,29650,29651,29654,29657,29661,29665,29667,29670,29671,29673,29684,29685,29687,29689,29690,29691,29693,29695,29696,29697,29700,29703,29706,29713,29722,29723,29732,29734,29736,29737,29738,29739,29740,29741,29742,29743,29744,29745,29753,29760,29763,29764,29766,29767,29771,29773,29777,29778,29783,29789,29794,29798,29799,29800,29803,29805,29806,29809,29810,29824,29825,29829,29830,29831,29833,29839,29840,29841,29842,29848,29849,29850,29852,29855,29856,29857,29859,29862,29864,29865,29866,29867,29870,29871,29873,29874,29877,29881,29883,29887,29896,29897,29900,29904,29907,29912,29914,29915,29918,29919,29924,29928,29930,29931,29935,29940,29946,29947,29948,29951,29958,29970,29974,29975,29984,29985,29988,29991,29993,29994,29999,30006,30009,30013,30014,30015,30016,30019,30023,30024,30030,30032,30034,30039,30046,30047,30049,30063,30065,30073,30074,30075,30076,30077,30078,30081,30085,30096,30098,30099,30101,30105,30108,30114,30116,30132,30138,30143,30144,30145,30148,30150,30156,30158,30159,30167,30172,30175,30176,30177,30180,30183,30188,30190,30191,30193,30201,30208,30210,30211,30212,30215,30216,30218,30220,30223,30226,30227,30229,30230,30233,30235,30236,30237,30238,30243,30245,30246,30249,30253,30258,30259,30261,30264,30265,30266,30268,30282,30272,30273,30275,30276,30277,30281,30283,30293,30297,30303,30308,30309,30317,30318,30319,30321,30324,30337,30341,30348,30349,30357,30363,30364,30365,30367,30368,30370,30371,30372,30373,30374,30375,30376,30378,30381,30397,30401,30405,30409,30411,30412,30414,30420,30425,30432,30438,30440,30444,30448,30449,30454,30457,30460,30464,30470,30474,30478,30482,30484,30485,30487,30489,30490,30492,30498,30504,30509,30510,30511,30516,30517,30518,30521,30525,30526,30530,30533,30534,30538,30541,30542,30543,30546,30550,30551,30556,30558,30559,30560,30562,30564,30567,30570,30572,30576,30578,30579,30580,30586,30589,30592,30596,30604,30605,30612,30613,30614,30618,30623,30626,30631,30634,30638,30639,30641,30645,30654,30659,30665,30673,30674,30677,30681,30686,30687,30688,30692,30694,30698,30700,30704,30705,30708,30712,30715,30725,30726,30729,30733,30734,30737,30749,30753,30754,30755,30765,30766,30768,30773,30775,30787,30788,30791,30792,30796,30798,30802,30812,30814,30816,30817,30819,30820,30824,30826,30830,30842,30846,30858,30863,30868,30872,30881,30877,30878,30879,30884,30888,30892,30893,30896,30897,30898,30899,30907,30909,30911,30919,30920,30921,30924,30926,30930,30931,30933,30934,30948,30939,30943,30944,30945,30950,30954,30962,30963,30976,30966,30967,30970,30971,30975,30982,30988,30992,31002,31004,31006,31007,31008,31013,31015,31017,31021,31025,31028,31029,31035,31037,31039,31044,31045,31046,31050,31051,31055,31057,31060,31064,31067,31068,31079,31081,31083,31090,31097,31099,31100,31102,31115,31116,31121,31123,31124,31125,31126,31128,31131,31132,31137,31144,31145,31147,31151,31153,31156,31160,31163,31170,31172,31175,31176,31178,31183,31188,31190,31194,31197,31198,31200,31202,31205,31210,31211,31213,31217,31224,31228,31234,31235,31239,31241,31242,31244,31249,31253,31259,31262,31265,31271,31275,31277,31279,31280,31284,31285,31288,31289,31290,31300,31301,31303,31304,31308,31317,31318,31321,31324,31325,31327,31328,31333,31335,31338,31341,31349,31352,31358,31360,31362,31365,31366,31370,31371,31376,31377,31380,31390,31392,31395,31404,31411,31413,31417,31419,31420,31430,31433,31436,31438,31441,31451,31464,31465,31467,31468,31473,31476,31483,31485,31486,31495,31508,31519,31523,31527,31529,31530,31531,31533,31534,31535,31536,31537,31540,31549,31551,31552,31553,31559,31566,31573,31584,31588,31590,31593,31594,31597,31599,31602,31603,31607,31620,31625,31630,31632,31633,31638,31643,31646,31648,31653,31660,31663,31664,31666,31669,31670,31674,31675,31676,31677,31682,31685,31688,31690,31700,31702,31703,31705,31706,31707,31720,31722,31730,31732,31733,31736,31737,31738,31740,31742,31745,31746,31747,31748,31750,31753,31755,31756,31758,31759,31769,31771,31776,31781,31782,31784,31788,31793,31795,31796,31798,31801,31802,31814,31818,31829,31825,31826,31827,31833,31834,31835,31836,31837,31838,31841,31843,31847,31849,31853,31854,31856,31858,31865,31868,31869,31878,31879,31887,31892,31902,31904,31910,31920,31926,31927,31930,31931,31932,31935,31940,31943,31944,31945,31949,31951,31955,31956,31957,31959,31961,31962,31965,31974,31977,31979,31989,32003,32007,32008,32009,32015,32017,32018,32019,32022,32029,32030,32035,32038,32042,32045,32049,32060,32061,32062,32064,32065,32071,32072,32077,32081,32083,32087,32089,32090,32092,32093,32101,32103,32106,32112,32120,32122,32123,32127,32129,32130,32131,32133,32134,32136,32139,32140,32141,32145,32150,32151,32157,32158,32166,32167,32170,32179,32182,32183,32185,32194,32195,32196,32197,32198,32204,32205,32206,32215,32217,32256,32226,32229,32230,32234,32235,32237,32241,32245,32246,32249,32250,32264,32272,32273,32277,32279,32284,32285,32288,32295,32296,32300,32301,32303,32307,32310,32319,32324,32325,32327,32334,32336,32338,32344,32351,32353,32354,32357,32363,32366,32367,32371,32376,32382,32385,32390,32391,32394,32397,32401,32405,32408,32410,32413,32414,32572,32571,32573,32574,32575,32579,32580,32583,32591,32594,32595,32603,32604,32605,32609,32611,32612,32613,32614,32621,32625,32637,32638,32639,32640,32651,32653,32655,32656,32657,32662,32663,32668,32673,32674,32678,32682,32685,32692,32700,32703,32704,32707,32712,32718,32719,32731,32735,32739,32741,32744,32748,32750,32751,32754,32762,32765,32766,32767,32775,32776,32778,32781,32782,32783,32785,32787,32788,32790,32797,32798,32799,32800,32804,32806,32812,32814,32816,32820,32821,32823,32825,32826,32828,32830,32832,32836,32864,32868,32870,32877,32881,32885,32897,32904,32910,32924,32926,32934,32935,32939,32952,32953,32968,32973,32975,32978,32980,32981,32983,32984,32992,33005,33006,33008,33010,33011,33014,33017,33018,33022,33027,33035,33046,33047,33048,33052,33054,33056,33060,33063,33068,33072,33077,33082,33084,33093,33095,33098,33100,33106,33111,33120,33121,33127,33128,33129,33133,33135,33143,33153,33168,33156,33157,33158,33163,33166,33174,33176,33179,33182,33186,33198,33202,33204,33211,33227,33219,33221,33226,33230,33231,33237,33239,33243,33245,33246,33249,33252,33259,33260,33264,33265,33266,33269,33270,33272,33273,33277,33279,33280,33283,33295,33299,33300,33305,33306,33309,33313,33314,33320,33330,33332,33338,33347,33348,33349,33350,33355,33358,33359,33361,33366,33372,33376,33379,33383,33389,33396,33403,33405,33407,33408,33409,33411,33412,33415,33417,33418,33422,33425,33428,33430,33432,33434,33435,33440,33441,33443,33444,33447,33448,33449,33450,33454,33456,33458,33460,33463,33466,33468,33470,33471,33478,33488,33493,33498,33504,33506,33508,33512,33514,33517,33519,33526,33527,33533,33534,33536,33537,33543,33544,33546,33547,33620,33563,33565,33566,33567,33569,33570,33580,33581,33582,33584,33587,33591,33594,33596,33597,33602,33603,33604,33607,33613,33614,33617,33621,33622,33623,33648,33656,33661,33663,33664,33666,33668,33670,33677,33682,33684,33685,33688,33689,33691,33692,33693,33702,33703,33705,33708,33726,33727,33728,33735,33737,33743,33744,33745,33748,33757,33619,33768,33770,33782,33784,33785,33788,33793,33798,33802,33807,33809,33813,33817,33709,33839,33849,33861,33863,33864,33866,33869,33871,33873,33874,33878,33880,33881,33882,33884,33888,33892,33893,33895,33898,33904,33907,33908,33910,33912,33916,33917,33921,33925,33938,33939,33941,33950,33958,33960,33961,33962,33967,33969,33972,33978,33981,33982,33984,33986,33991,33992,33996,33999,34003,34012,34023,34026,34031,34032,34033,34034,34039,34098,34042,34043,34045,34050,34051,34055,34060,34062,34064,34076,34078,34082,34083,34084,34085,34087,34090,34091,34095,34099,34100,34102,34111,34118,34127,34128,34129,34130,34131,34134,34137,34140,34141,34142,34143,34144,34145,34146,34148,34155,34159,34169,34170,34171,34173,34175,34177,34181,34182,34185,34187,34188,34191,34195,34200,34205,34207,34208,34210,34213,34215,34228,34230,34231,34232,34236,34237,34238,34239,34242,34247,34250,34251,34254,34221,34264,34266,34271,34272,34278,34280,34285,34291,34294,34300,34303,34304,34308,34309,34317,34318,34320,34321,34322,34328,34329,34331,34334,34337,34343,34345,34358,34360,34362,34364,34365,34368,34370,34374,34386,34387,34390,34391,34392,34393,34397,34400,34401,34402,34403,34404,34409,34412,34415,34421,34422,34423,34426,34445,34449,34454,34456,34458,34460,34465,34470,34471,34472,34477,34481,34483,34484,34485,34487,34488,34489,34495,34496,34497,34499,34501,34513,34514,34517,34519,34522,34524,34528,34531,34533,34535,34440,34554,34556,34557,34564,34565,34567,34571,34574,34575,34576,34579,34580,34585,34590,34591,34593,34595,34600,34606,34607,34609,34610,34617,34618,34620,34621,34622,34624,34627,34629,34637,34648,34653,34657,34660,34661,34671,34673,34674,34683,34691,34692,34693,34694,34695,34696,34697,34699,34700,34704,34707,34709,34711,34712,34713,34718,34720,34723,34727,34732,34733,34734,34737,34741,34750,34751,34753,34760,34761,34762,34766,34773,34774,34777,34778,34780,34783,34786,34787,34788,34794,34795,34797,34801,34803,34808,34810,34815,34817,34819,34822,34825,34826,34827,34832,34841,34834,34835,34836,34840,34842,34843,34844,34846,34847,34856,34861,34862,34864,34866,34869,34874,34876,34881,34883,34885,34888,34889,34890,34891,34894,34897,34901,34902,34904,34906,34908,34911,34912,34916,34921,34929,34937,34939,34944,34968,34970,34971,34972,34975,34976,34984,34986,35002,35005,35006,35008,35018,35019,35020,35021,35022,35025,35026,35027,35035,35038,35047,35055,35056,35057,35061,35063,35073,35078,35085,35086,35087,35093,35094,35096,35097,35098,35100,35104,35110,35111,35112,35120,35121,35122,35125,35129,35130,35134,35136,35138,35141,35142,35145,35151,35154,35159,35162,35163,35164,35169,35170,35171,35179,35182,35184,35187,35189,35194,35195,35196,35197,35209,35213,35216,35220,35221,35227,35228,35231,35232,35237,35248,35252,35253,35254,35255,35260,35284,35285,35286,35287,35288,35301,35305,35307,35309,35313,35315,35318,35321,35325,35327,35332,35333,35335,35343,35345,35346,35348,35349,35358,35360,35362,35364,35366,35371,35372,35375,35381,35383,35389,35390,35392,35395,35397,35399,35401,35405,35406,35411,35414,35415,35416,35420,35421,35425,35429,35431,35445,35446,35447,35449,35450,35451,35454,35455,35456,35459,35462,35467,35471,35472,35474,35478,35479,35481,35487,35495,35497,35502,35503,35507,35510,35511,35515,35518,35523,35526,35528,35529,35530,35537,35539,35540,35541,35543,35549,35551,35564,35568,35572,35573,35574,35580,35583,35589,35590,35595,35601,35612,35614,35615,35594,35629,35632,35639,35644,35650,35651,35652,35653,35654,35656,35666,35667,35668,35673,35661,35678,35683,35693,35702,35704,35705,35708,35710,35713,35716,35717,35723,35725,35727,35732,35733,35740,35742,35743,35896,35897,35901,35902,35909,35911,35913,35915,35919,35921,35923,35924,35927,35928,35931,35933,35929,35939,35940,35942,35944,35945,35949,35955,35957,35958,35963,35966,35974,35975,35979,35984,35986,35987,35993,35995,35996,36004,36025,36026,36037,36038,36041,36043,36047,36054,36053,36057,36061,36065,36072,36076,36079,36080,36082,36085,36087,36088,36094,36095,36097,36099,36105,36114,36119,36123,36197,36201,36204,36206,36223,36226,36228,36232,36237,36240,36241,36245,36254,36255,36256,36262,36267,36268,36271,36274,36277,36279,36281,36283,36288,36293,36294,36295,36296,36298,36302,36305,36308,36309,36311,36313,36324,36325,36327,36332,36336,36284,36337,36338,36340,36349,36353,36356,36357,36358,36363,36369,36372,36374,36384,36385,36386,36387,36390,36391,36401,36403,36406,36407,36408,36409,36413,36416,36417,36427,36429,36430,36431,36436,36443,36444,36445,36446,36449,36450,36457,36460,36461,36463,36464,36465,36473,36474,36475,36482,36483,36489,36496,36498,36501,36506,36507,36509,36510,36514,36519,36521,36525,36526,36531,36533,36538,36539,36544,36545,36547,36548,36551,36559,36561,36564,36572,36584,36590,36592,36593,36599,36601,36602,36589,36608,36610,36615,36616,36623,36624,36630,36631,36632,36638,36640,36641,36643,36645,36647,36648,36652,36653,36654,36660,36661,36662,36663,36666,36672,36673,36675,36679,36687,36689,36690,36691,36692,36693,36696,36701,36702,36709,36765,36768,36769,36772,36773,36774,36789,36790,36792,36798,36800,36801,36806,36810,36811,36813,36816,36818,36819,36821,36832,36835,36836,36840,36846,36849,36853,36854,36859,36862,36866,36868,36872,36876,36888,36891,36904,36905,36911,36906,36908,36909,36915,36916,36919,36927,36931,36932,36940,36955,36957,36962,36966,36967,36972,36976,36980,36985,36997,37000,37003,37004,37006,37008,37013,37015,37016,37017,37019,37024,37025,37026,37029,37040,37042,37043,37044,37046,37053,37068,37054,37059,37060,37061,37063,37064,37077,37079,37080,37081,37084,37085,37087,37093,37074,37110,37099,37103,37104,37108,37118,37119,37120,37124,37125,37126,37128,37133,37136,37140,37142,37143,37144,37146,37148,37150,37152,37157,37154,37155,37159,37161,37166,37167,37169,37172,37174,37175,37177,37178,37180,37181,37187,37191,37192,37199,37203,37207,37209,37210,37211,37217,37220,37223,37229,37236,37241,37242,37243,37249,37251,37253,37254,37258,37262,37265,37267,37268,37269,37272,37278,37281,37286,37288,37292,37293,37294,37296,37297,37298,37299,37302,37307,37308,37309,37311,37314,37315,37317,37331,37332,37335,37337,37338,37342,37348,37349,37353,37354,37356,37357,37358,37359,37360,37361,37367,37369,37371,37373,37376,37377,37380,37381,37382,37383,37385,37386,37388,37392,37394,37395,37398,37400,37404,37405,37411,37412,37413,37414,37416,37422,37423,37424,37427,37429,37430,37432,37433,37434,37436,37438,37440,37442,37443,37446,37447,37450,37453,37454,37455,37457,37464,37465,37468,37469,37472,37473,37477,37479,37480,37481,37486,37487,37488,37493,37494,37495,37496,37497,37499,37500,37501,37503,37512,37513,37514,37517,37518,37522,37527,37529,37535,37536,37540,37541,37543,37544,37547,37551,37554,37558,37560,37562,37563,37564,37565,37567,37568,37569,37570,37571,37573,37574,37575,37576,37579,37580,37581,37582,37584,37587,37589,37591,37592,37593,37596,37597,37599,37600,37601,37603,37605,37607,37608,37612,37614,37616,37625,37627,37631,37632,37634,37640,37645,37649,37652,37653,37660,37661,37662,37663,37665,37668,37669,37671,37673,37674,37683,37684,37686,37687,37703,37704,37705,37712,37713,37714,37717,37719,37720,37722,37726,37732,37733,37735,37737,37738,37741,37743,37744,37745,37747,37748,37750,37754,37757,37759,37760,37761,37762,37768,37770,37771,37773,37775,37778,37781,37784,37787,37790,37793,37795,37796,37798,37800,37803,37812,37813,37814,37818,37801,37825,37828,37829,37830,37831,37833,37834,37835,37836,37837,37843,37849,37852,37854,37855,37858,37862,37863,37881,37879,37880,37882,37883,37885,37889,37890,37892,37896,37897,37901,37902,37903,37909,37910,37911,37919,37934,37935,37937,37938,37939,37940,37947,37951,37949,37955,37957,37960,37962,37964,37973,37977,37980,37983,37985,37987,37992,37995,37997,37998,37999,38001,38002,38020,38019,38264,38265,38270,38276,38280,38284,38285,38286,38301,38302,38303,38305,38310,38313,38315,38316,38324,38326,38330,38333,38335,38342,38344,38345,38347,38352,38353,38354,38355,38361,38362,38365,38366,38367,38368,38372,38374,38429,38430,38434,38436,38437,38438,38444,38449,38451,38455,38456,38457,38458,38460,38461,38465,38482,38484,38486,38487,38488,38497,38510,38516,38523,38524,38526,38527,38529,38530,38531,38532,38537,38545,38550,38554,38557,38559,38564,38565,38566,38569,38574,38575,38579,38586,38602,38610,23986,38616,38618,38621,38622,38623,38633,38639,38641,38650,38658,38659,38661,38665,38682,38683,38685,38689,38690,38691,38696,38705,38707,38721,38723,38730,38734,38735,38741,38743,38744,38746,38747,38755,38759,38762,38766,38771,38774,38775,38776,38779,38781,38783,38784,38793,38805,38806,38807,38809,38810,38814,38815,38818,38828,38830,38833,38834,38837,38838,38840,38841,38842,38844,38846,38847,38849,38852,38853,38855,38857,38858,38860,38861,38862,38864,38865,38868,38871,38872,38873,38877,38878,38880,38875,38881,38884,38895,38897,38900,38903,38904,38906,38919,38922,38937,38925,38926,38932,38934,38940,38942,38944,38947,38950,38955,38958,38959,38960,38962,38963,38965,38949,38974,38980,38983,38986,38993,38994,38995,38998,38999,39001,39002,39010,39011,39013,39014,39018,39020,39083,39085,39086,39088,39092,39095,39096,39098,39099,39103,39106,39109,39112,39116,39137,39139,39141,39142,39143,39146,39155,39158,39170,39175,39176,39185,39189,39190,39191,39194,39195,39196,39199,39202,39206,39207,39211,39217,39218,39219,39220,39221,39225,39226,39227,39228,39232,39233,39238,39239,39240,39245,39246,39252,39256,39257,39259,39260,39262,39263,39264,39323,39325,39327,39334,39344,39345,39346,39349,39353,39354,39357,39359,39363,39369,39379,39380,39385,39386,39388,39390,39399,39402,39403,39404,39408,39412,39413,39417,39421,39422,39426,39427,39428,39435,39436,39440,39441,39446,39454,39456,39458,39459,39460,39463,39469,39470,39475,39477,39478,39480,39495,39489,39492,39498,39499,39500,39502,39505,39508,39510,39517,39594,39596,39598,39599,39602,39604,39605,39606,39609,39611,39614,39615,39617,39619,39622,39624,39630,39632,39634,39637,39638,39639,39643,39644,39648,39652,39653,39655,39657,39660,39666,39667,39669,39673,39674,39677,39679,39680,39681,39682,39683,39684,39685,39688,39689,39691,39692,39693,39694,39696,39698,39702,39705,39707,39708,39712,39718,39723,39725,39731,39732,39733,39735,39737,39738,39741,39752,39755,39756,39765,39766,39767,39771,39774,39777,39779,39781,39782,39784,39786,39787,39788,39789,39790,39795,39797,39799,39800,39801,39807,39808,39812,39813,39814,39815,39817,39818,39819,39821,39823,39824,39828,39834,39837,39838,39846,39847,39849,39852,39856,39857,39858,39863,39864,39867,39868,39870,39871,39873,39879,39880,39886,39888,39895,39896,39901,39903,39909,39911,39914,39915,39919,39923,39927,39928,39929,39930,39933,39935,39936,39938,39947,39951,39953,39958,39960,39961,39962,39964,39966,39970,39971,39974,39975,39976,39977,39978,39985,39989,39990,39991,39997,40001,40003,40004,40005,40009,40010,40014,40015,40016,40019,40020,40022,40024,40027,40029,40030,40031,40035,40041,40042,40028,40043,40040,40046,40048,40050,40053,40055,40059,40166,40178,40183,40185,40203,40194,40209,40215,40216,40220,40221,40222,40239,40240,40242,40243,40244,40250,40252,40261,40253,40258,40259,40263,40266,40275,40276,40287,40291,40290,40293,40297,40298,40299,40304,40310,40311,40315,40316,40318,40323,40324,40326,40330,40333,40334,40338,40339,40341,40342,40343,40344,40353,40362,40364,40366,40369,40373,40377,40380,40383,40387,40391,40393,40394,40404,40405,40406,40407,40410,40414,40415,40416,40421,40423,40425,40427,40430,40432,40435,40436,40446,40458,40450,40455,40462,40464,40465,40466,40469,40470,40473,40476,40477,40570,40571,40572,40576,40578,40579,40580,40581,40583,40590,40591,40598,40600,40603,40606,40612,40616,40620,40622,40623,40624,40627,40628,40629,40646,40648,40651,40661,40671,40676,40679,40684,40685,40686,40688,40689,40690,40693,40696,40703,40706,40707,40713,40719,40720,40721,40722,40724,40726,40727,40729,40730,40731,40735,40738,40742,40746,40747,40751,40753,40754,40756,40759,40761,40762,40764,40765,40767,40769,40771,40772,40773,40774,40775,40787,40789,40790,40791,40792,40794,40797,40798,40808,40809,40813,40814,40815,40816,40817,40819,40821,40826,40829,40847,40848,40849,40850,40852,40854,40855,40862,40865,40866,40867,40869,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null], + "ibm866":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160], + "iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729], + "iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729], + "iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729], + "iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119], + "iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null], + "iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null], + "iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null], + "iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312], + "iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217], + "iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255], + "iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255], + "iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255], + "koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066], + "koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066], + "macintosh":[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711], + "windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null], + "windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729], + "windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103], + "windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255], + "windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null], + "windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255], + "windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null], + "windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746], + "windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729], + "windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255], + "x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364] +}; + +// For strict environments where `this` inside the global scope +// is `undefined`, take a pure object instead +}(this || {})); + +/***/ }), + +/***/ "./node_modules/text-encoding/lib/encoding.js": +/*!****************************************************!*\ + !*** ./node_modules/text-encoding/lib/encoding.js ***! + \****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// This is free and unencumbered software released into the public domain. +// See LICENSE.md for more information. + +/** + * @fileoverview Global |this| required for resolving indexes in node. + * @suppress {globalThis} + */ +(function(global) { + 'use strict'; + + // If we're in node require encoding-indexes and attach it to the global. + if ( true && module.exports && + !global["encoding-indexes"]) { + global["encoding-indexes"] = + (__webpack_require__(/*! ./encoding-indexes.js */ "./node_modules/text-encoding/lib/encoding-indexes.js")["encoding-indexes"]); + } + + // + // Utilities + // + + /** + * @param {number} a The number to test. + * @param {number} min The minimum value in the range, inclusive. + * @param {number} max The maximum value in the range, inclusive. + * @return {boolean} True if a >= min and a <= max. + */ + function inRange(a, min, max) { + return min <= a && a <= max; + } + + /** + * @param {!Array.<*>} array The array to check. + * @param {*} item The item to look for in the array. + * @return {boolean} True if the item appears in the array. + */ + function includes(array, item) { + return array.indexOf(item) !== -1; + } + + var floor = Math.floor; + + /** + * @param {*} o + * @return {Object} + */ + function ToDictionary(o) { + if (o === undefined) return {}; + if (o === Object(o)) return o; + throw TypeError('Could not convert argument to dictionary'); + } + + /** + * @param {string} string Input string of UTF-16 code units. + * @return {!Array.} Code points. + */ + function stringToCodePoints(string) { + // https://heycam.github.io/webidl/#dfn-obtain-unicode + + // 1. Let S be the DOMString value. + var s = String(string); + + // 2. Let n be the length of S. + var n = s.length; + + // 3. Initialize i to 0. + var i = 0; + + // 4. Initialize U to be an empty sequence of Unicode characters. + var u = []; + + // 5. While i < n: + while (i < n) { + + // 1. Let c be the code unit in S at index i. + var c = s.charCodeAt(i); + + // 2. Depending on the value of c: + + // c < 0xD800 or c > 0xDFFF + if (c < 0xD800 || c > 0xDFFF) { + // Append to U the Unicode character with code point c. + u.push(c); + } + + // 0xDC00 ≤ c ≤ 0xDFFF + else if (0xDC00 <= c && c <= 0xDFFF) { + // Append to U a U+FFFD REPLACEMENT CHARACTER. + u.push(0xFFFD); + } + + // 0xD800 ≤ c ≤ 0xDBFF + else if (0xD800 <= c && c <= 0xDBFF) { + // 1. If i = n−1, then append to U a U+FFFD REPLACEMENT + // CHARACTER. + if (i === n - 1) { + u.push(0xFFFD); + } + // 2. Otherwise, i < n−1: + else { + // 1. Let d be the code unit in S at index i+1. + var d = s.charCodeAt(i + 1); + + // 2. If 0xDC00 ≤ d ≤ 0xDFFF, then: + if (0xDC00 <= d && d <= 0xDFFF) { + // 1. Let a be c & 0x3FF. + var a = c & 0x3FF; + + // 2. Let b be d & 0x3FF. + var b = d & 0x3FF; + + // 3. Append to U the Unicode character with code point + // 2^16+2^10*a+b. + u.push(0x10000 + (a << 10) + b); + + // 4. Set i to i+1. + i += 1; + } + + // 3. Otherwise, d < 0xDC00 or d > 0xDFFF. Append to U a + // U+FFFD REPLACEMENT CHARACTER. + else { + u.push(0xFFFD); + } + } + } + + // 3. Set i to i+1. + i += 1; + } + + // 6. Return U. + return u; + } + + /** + * @param {!Array.} code_points Array of code points. + * @return {string} string String of UTF-16 code units. + */ + function codePointsToString(code_points) { + var s = ''; + for (var i = 0; i < code_points.length; ++i) { + var cp = code_points[i]; + if (cp <= 0xFFFF) { + s += String.fromCharCode(cp); + } else { + cp -= 0x10000; + s += String.fromCharCode((cp >> 10) + 0xD800, + (cp & 0x3FF) + 0xDC00); + } + } + return s; + } + + + // + // Implementation of Encoding specification + // https://encoding.spec.whatwg.org/ + // + + // + // 4. Terminology + // + + /** + * An ASCII byte is a byte in the range 0x00 to 0x7F, inclusive. + * @param {number} a The number to test. + * @return {boolean} True if a is in the range 0x00 to 0x7F, inclusive. + */ + function isASCIIByte(a) { + return 0x00 <= a && a <= 0x7F; + } + + /** + * An ASCII code point is a code point in the range U+0000 to + * U+007F, inclusive. + */ + var isASCIICodePoint = isASCIIByte; + + + /** + * End-of-stream is a special token that signifies no more tokens + * are in the stream. + * @const + */ var end_of_stream = -1; + + /** + * A stream represents an ordered sequence of tokens. + * + * @constructor + * @param {!(Array.|Uint8Array)} tokens Array of tokens that provide + * the stream. + */ + function Stream(tokens) { + /** @type {!Array.} */ + this.tokens = [].slice.call(tokens); + // Reversed as push/pop is more efficient than shift/unshift. + this.tokens.reverse(); + } + + Stream.prototype = { + /** + * @return {boolean} True if end-of-stream has been hit. + */ + endOfStream: function() { + return !this.tokens.length; + }, + + /** + * When a token is read from a stream, the first token in the + * stream must be returned and subsequently removed, and + * end-of-stream must be returned otherwise. + * + * @return {number} Get the next token from the stream, or + * end_of_stream. + */ + read: function() { + if (!this.tokens.length) + return end_of_stream; + return this.tokens.pop(); + }, + + /** + * When one or more tokens are prepended to a stream, those tokens + * must be inserted, in given order, before the first token in the + * stream. + * + * @param {(number|!Array.)} token The token(s) to prepend to the + * stream. + */ + prepend: function(token) { + if (Array.isArray(token)) { + var tokens = /**@type {!Array.}*/(token); + while (tokens.length) + this.tokens.push(tokens.pop()); + } else { + this.tokens.push(token); + } + }, + + /** + * When one or more tokens are pushed to a stream, those tokens + * must be inserted, in given order, after the last token in the + * stream. + * + * @param {(number|!Array.)} token The tokens(s) to push to the + * stream. + */ + push: function(token) { + if (Array.isArray(token)) { + var tokens = /**@type {!Array.}*/(token); + while (tokens.length) + this.tokens.unshift(tokens.shift()); + } else { + this.tokens.unshift(token); + } + } + }; + + // + // 5. Encodings + // + + // 5.1 Encoders and decoders + + /** @const */ + var finished = -1; + + /** + * @param {boolean} fatal If true, decoding errors raise an exception. + * @param {number=} opt_code_point Override the standard fallback code point. + * @return {number} The code point to insert on a decoding error. + */ + function decoderError(fatal, opt_code_point) { + if (fatal) + throw TypeError('Decoder error'); + return opt_code_point || 0xFFFD; + } + + /** + * @param {number} code_point The code point that could not be encoded. + * @return {number} Always throws, no value is actually returned. + */ + function encoderError(code_point) { + throw TypeError('The code point ' + code_point + ' could not be encoded.'); + } + + /** @interface */ + function Decoder() {} + Decoder.prototype = { + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point, or |finished|. + */ + handler: function(stream, bite) {} + }; + + /** @interface */ + function Encoder() {} + Encoder.prototype = { + /** + * @param {Stream} stream The stream of code points being encoded. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit, or |finished|. + */ + handler: function(stream, code_point) {} + }; + + // 5.2 Names and labels + + // TODO: Define @typedef for Encoding: {name:string,labels:Array.} + // https://github.com/google/closure-compiler/issues/247 + + /** + * @param {string} label The encoding label. + * @return {?{name:string,labels:Array.}} + */ + function getEncoding(label) { + // 1. Remove any leading and trailing ASCII whitespace from label. + label = String(label).trim().toLowerCase(); + + // 2. If label is an ASCII case-insensitive match for any of the + // labels listed in the table below, return the corresponding + // encoding, and failure otherwise. + if (Object.prototype.hasOwnProperty.call(label_to_encoding, label)) { + return label_to_encoding[label]; + } + return null; + } + + /** + * Encodings table: https://encoding.spec.whatwg.org/encodings.json + * @const + * @type {!Array.<{ + * heading: string, + * encodings: Array.<{name:string,labels:Array.}> + * }>} + */ + var encodings = [ + { + "encodings": [ + { + "labels": [ + "unicode-1-1-utf-8", + "utf-8", + "utf8" + ], + "name": "UTF-8" + } + ], + "heading": "The Encoding" + }, + { + "encodings": [ + { + "labels": [ + "866", + "cp866", + "csibm866", + "ibm866" + ], + "name": "IBM866" + }, + { + "labels": [ + "csisolatin2", + "iso-8859-2", + "iso-ir-101", + "iso8859-2", + "iso88592", + "iso_8859-2", + "iso_8859-2:1987", + "l2", + "latin2" + ], + "name": "ISO-8859-2" + }, + { + "labels": [ + "csisolatin3", + "iso-8859-3", + "iso-ir-109", + "iso8859-3", + "iso88593", + "iso_8859-3", + "iso_8859-3:1988", + "l3", + "latin3" + ], + "name": "ISO-8859-3" + }, + { + "labels": [ + "csisolatin4", + "iso-8859-4", + "iso-ir-110", + "iso8859-4", + "iso88594", + "iso_8859-4", + "iso_8859-4:1988", + "l4", + "latin4" + ], + "name": "ISO-8859-4" + }, + { + "labels": [ + "csisolatincyrillic", + "cyrillic", + "iso-8859-5", + "iso-ir-144", + "iso8859-5", + "iso88595", + "iso_8859-5", + "iso_8859-5:1988" + ], + "name": "ISO-8859-5" + }, + { + "labels": [ + "arabic", + "asmo-708", + "csiso88596e", + "csiso88596i", + "csisolatinarabic", + "ecma-114", + "iso-8859-6", + "iso-8859-6-e", + "iso-8859-6-i", + "iso-ir-127", + "iso8859-6", + "iso88596", + "iso_8859-6", + "iso_8859-6:1987" + ], + "name": "ISO-8859-6" + }, + { + "labels": [ + "csisolatingreek", + "ecma-118", + "elot_928", + "greek", + "greek8", + "iso-8859-7", + "iso-ir-126", + "iso8859-7", + "iso88597", + "iso_8859-7", + "iso_8859-7:1987", + "sun_eu_greek" + ], + "name": "ISO-8859-7" + }, + { + "labels": [ + "csiso88598e", + "csisolatinhebrew", + "hebrew", + "iso-8859-8", + "iso-8859-8-e", + "iso-ir-138", + "iso8859-8", + "iso88598", + "iso_8859-8", + "iso_8859-8:1988", + "visual" + ], + "name": "ISO-8859-8" + }, + { + "labels": [ + "csiso88598i", + "iso-8859-8-i", + "logical" + ], + "name": "ISO-8859-8-I" + }, + { + "labels": [ + "csisolatin6", + "iso-8859-10", + "iso-ir-157", + "iso8859-10", + "iso885910", + "l6", + "latin6" + ], + "name": "ISO-8859-10" + }, + { + "labels": [ + "iso-8859-13", + "iso8859-13", + "iso885913" + ], + "name": "ISO-8859-13" + }, + { + "labels": [ + "iso-8859-14", + "iso8859-14", + "iso885914" + ], + "name": "ISO-8859-14" + }, + { + "labels": [ + "csisolatin9", + "iso-8859-15", + "iso8859-15", + "iso885915", + "iso_8859-15", + "l9" + ], + "name": "ISO-8859-15" + }, + { + "labels": [ + "iso-8859-16" + ], + "name": "ISO-8859-16" + }, + { + "labels": [ + "cskoi8r", + "koi", + "koi8", + "koi8-r", + "koi8_r" + ], + "name": "KOI8-R" + }, + { + "labels": [ + "koi8-ru", + "koi8-u" + ], + "name": "KOI8-U" + }, + { + "labels": [ + "csmacintosh", + "mac", + "macintosh", + "x-mac-roman" + ], + "name": "macintosh" + }, + { + "labels": [ + "dos-874", + "iso-8859-11", + "iso8859-11", + "iso885911", + "tis-620", + "windows-874" + ], + "name": "windows-874" + }, + { + "labels": [ + "cp1250", + "windows-1250", + "x-cp1250" + ], + "name": "windows-1250" + }, + { + "labels": [ + "cp1251", + "windows-1251", + "x-cp1251" + ], + "name": "windows-1251" + }, + { + "labels": [ + "ansi_x3.4-1968", + "ascii", + "cp1252", + "cp819", + "csisolatin1", + "ibm819", + "iso-8859-1", + "iso-ir-100", + "iso8859-1", + "iso88591", + "iso_8859-1", + "iso_8859-1:1987", + "l1", + "latin1", + "us-ascii", + "windows-1252", + "x-cp1252" + ], + "name": "windows-1252" + }, + { + "labels": [ + "cp1253", + "windows-1253", + "x-cp1253" + ], + "name": "windows-1253" + }, + { + "labels": [ + "cp1254", + "csisolatin5", + "iso-8859-9", + "iso-ir-148", + "iso8859-9", + "iso88599", + "iso_8859-9", + "iso_8859-9:1989", + "l5", + "latin5", + "windows-1254", + "x-cp1254" + ], + "name": "windows-1254" + }, + { + "labels": [ + "cp1255", + "windows-1255", + "x-cp1255" + ], + "name": "windows-1255" + }, + { + "labels": [ + "cp1256", + "windows-1256", + "x-cp1256" + ], + "name": "windows-1256" + }, + { + "labels": [ + "cp1257", + "windows-1257", + "x-cp1257" + ], + "name": "windows-1257" + }, + { + "labels": [ + "cp1258", + "windows-1258", + "x-cp1258" + ], + "name": "windows-1258" + }, + { + "labels": [ + "x-mac-cyrillic", + "x-mac-ukrainian" + ], + "name": "x-mac-cyrillic" + } + ], + "heading": "Legacy single-byte encodings" + }, + { + "encodings": [ + { + "labels": [ + "chinese", + "csgb2312", + "csiso58gb231280", + "gb2312", + "gb_2312", + "gb_2312-80", + "gbk", + "iso-ir-58", + "x-gbk" + ], + "name": "GBK" + }, + { + "labels": [ + "gb18030" + ], + "name": "gb18030" + } + ], + "heading": "Legacy multi-byte Chinese (simplified) encodings" + }, + { + "encodings": [ + { + "labels": [ + "big5", + "big5-hkscs", + "cn-big5", + "csbig5", + "x-x-big5" + ], + "name": "Big5" + } + ], + "heading": "Legacy multi-byte Chinese (traditional) encodings" + }, + { + "encodings": [ + { + "labels": [ + "cseucpkdfmtjapanese", + "euc-jp", + "x-euc-jp" + ], + "name": "EUC-JP" + }, + { + "labels": [ + "csiso2022jp", + "iso-2022-jp" + ], + "name": "ISO-2022-JP" + }, + { + "labels": [ + "csshiftjis", + "ms932", + "ms_kanji", + "shift-jis", + "shift_jis", + "sjis", + "windows-31j", + "x-sjis" + ], + "name": "Shift_JIS" + } + ], + "heading": "Legacy multi-byte Japanese encodings" + }, + { + "encodings": [ + { + "labels": [ + "cseuckr", + "csksc56011987", + "euc-kr", + "iso-ir-149", + "korean", + "ks_c_5601-1987", + "ks_c_5601-1989", + "ksc5601", + "ksc_5601", + "windows-949" + ], + "name": "EUC-KR" + } + ], + "heading": "Legacy multi-byte Korean encodings" + }, + { + "encodings": [ + { + "labels": [ + "csiso2022kr", + "hz-gb-2312", + "iso-2022-cn", + "iso-2022-cn-ext", + "iso-2022-kr" + ], + "name": "replacement" + }, + { + "labels": [ + "utf-16be" + ], + "name": "UTF-16BE" + }, + { + "labels": [ + "utf-16", + "utf-16le" + ], + "name": "UTF-16LE" + }, + { + "labels": [ + "x-user-defined" + ], + "name": "x-user-defined" + } + ], + "heading": "Legacy miscellaneous encodings" + } + ]; + + // Label to encoding registry. + /** @type {Object.}>} */ + var label_to_encoding = {}; + encodings.forEach(function(category) { + category.encodings.forEach(function(encoding) { + encoding.labels.forEach(function(label) { + label_to_encoding[label] = encoding; + }); + }); + }); + + // Registry of of encoder/decoder factories, by encoding name. + /** @type {Object.} */ + var encoders = {}; + /** @type {Object.} */ + var decoders = {}; + + // + // 6. Indexes + // + + /** + * @param {number} pointer The |pointer| to search for. + * @param {(!Array.|undefined)} index The |index| to search within. + * @return {?number} The code point corresponding to |pointer| in |index|, + * or null if |code point| is not in |index|. + */ + function indexCodePointFor(pointer, index) { + if (!index) return null; + return index[pointer] || null; + } + + /** + * @param {number} code_point The |code point| to search for. + * @param {!Array.} index The |index| to search within. + * @return {?number} The first pointer corresponding to |code point| in + * |index|, or null if |code point| is not in |index|. + */ + function indexPointerFor(code_point, index) { + var pointer = index.indexOf(code_point); + return pointer === -1 ? null : pointer; + } + + /** + * @param {string} name Name of the index. + * @return {(!Array.|!Array.>)} + * */ + function index(name) { + if (!('encoding-indexes' in global)) { + throw Error("Indexes missing." + + " Did you forget to include encoding-indexes.js first?"); + } + return global['encoding-indexes'][name]; + } + + /** + * @param {number} pointer The |pointer| to search for in the gb18030 index. + * @return {?number} The code point corresponding to |pointer| in |index|, + * or null if |code point| is not in the gb18030 index. + */ + function indexGB18030RangesCodePointFor(pointer) { + // 1. If pointer is greater than 39419 and less than 189000, or + // pointer is greater than 1237575, return null. + if ((pointer > 39419 && pointer < 189000) || (pointer > 1237575)) + return null; + + // 2. If pointer is 7457, return code point U+E7C7. + if (pointer === 7457) return 0xE7C7; + + // 3. Let offset be the last pointer in index gb18030 ranges that + // is equal to or less than pointer and let code point offset be + // its corresponding code point. + var offset = 0; + var code_point_offset = 0; + var idx = index('gb18030-ranges'); + var i; + for (i = 0; i < idx.length; ++i) { + /** @type {!Array.} */ + var entry = idx[i]; + if (entry[0] <= pointer) { + offset = entry[0]; + code_point_offset = entry[1]; + } else { + break; + } + } + + // 4. Return a code point whose value is code point offset + + // pointer − offset. + return code_point_offset + pointer - offset; + } + + /** + * @param {number} code_point The |code point| to locate in the gb18030 index. + * @return {number} The first pointer corresponding to |code point| in the + * gb18030 index. + */ + function indexGB18030RangesPointerFor(code_point) { + // 1. If code point is U+E7C7, return pointer 7457. + if (code_point === 0xE7C7) return 7457; + + // 2. Let offset be the last code point in index gb18030 ranges + // that is equal to or less than code point and let pointer offset + // be its corresponding pointer. + var offset = 0; + var pointer_offset = 0; + var idx = index('gb18030-ranges'); + var i; + for (i = 0; i < idx.length; ++i) { + /** @type {!Array.} */ + var entry = idx[i]; + if (entry[1] <= code_point) { + offset = entry[1]; + pointer_offset = entry[0]; + } else { + break; + } + } + + // 3. Return a pointer whose value is pointer offset + code point + // − offset. + return pointer_offset + code_point - offset; + } + + /** + * @param {number} code_point The |code_point| to search for in the Shift_JIS + * index. + * @return {?number} The code point corresponding to |pointer| in |index|, + * or null if |code point| is not in the Shift_JIS index. + */ + function indexShiftJISPointerFor(code_point) { + // 1. Let index be index jis0208 excluding all entries whose + // pointer is in the range 8272 to 8835, inclusive. + shift_jis_index = shift_jis_index || + index('jis0208').map(function(code_point, pointer) { + return inRange(pointer, 8272, 8835) ? null : code_point; + }); + var index_ = shift_jis_index; + + // 2. Return the index pointer for code point in index. + return index_.indexOf(code_point); + } + var shift_jis_index; + + /** + * @param {number} code_point The |code_point| to search for in the big5 + * index. + * @return {?number} The code point corresponding to |pointer| in |index|, + * or null if |code point| is not in the big5 index. + */ + function indexBig5PointerFor(code_point) { + // 1. Let index be index Big5 excluding all entries whose pointer + big5_index_no_hkscs = big5_index_no_hkscs || + index('big5').map(function(code_point, pointer) { + return (pointer < (0xA1 - 0x81) * 157) ? null : code_point; + }); + var index_ = big5_index_no_hkscs; + + // 2. If code point is U+2550, U+255E, U+2561, U+256A, U+5341, or + // U+5345, return the last pointer corresponding to code point in + // index. + if (code_point === 0x2550 || code_point === 0x255E || + code_point === 0x2561 || code_point === 0x256A || + code_point === 0x5341 || code_point === 0x5345) { + return index_.lastIndexOf(code_point); + } + + // 3. Return the index pointer for code point in index. + return indexPointerFor(code_point, index_); + } + var big5_index_no_hkscs; + + // + // 8. API + // + + /** @const */ var DEFAULT_ENCODING = 'utf-8'; + + // 8.1 Interface TextDecoder + + /** + * @constructor + * @param {string=} label The label of the encoding; + * defaults to 'utf-8'. + * @param {Object=} options + */ + function TextDecoder(label, options) { + // Web IDL conventions + if (!(this instanceof TextDecoder)) + throw TypeError('Called as a function. Did you forget \'new\'?'); + label = label !== undefined ? String(label) : DEFAULT_ENCODING; + options = ToDictionary(options); + + // A TextDecoder object has an associated encoding, decoder, + // stream, ignore BOM flag (initially unset), BOM seen flag + // (initially unset), error mode (initially replacement), and do + // not flush flag (initially unset). + + /** @private */ + this._encoding = null; + /** @private @type {?Decoder} */ + this._decoder = null; + /** @private @type {boolean} */ + this._ignoreBOM = false; + /** @private @type {boolean} */ + this._BOMseen = false; + /** @private @type {string} */ + this._error_mode = 'replacement'; + /** @private @type {boolean} */ + this._do_not_flush = false; + + + // 1. Let encoding be the result of getting an encoding from + // label. + var encoding = getEncoding(label); + + // 2. If encoding is failure or replacement, throw a RangeError. + if (encoding === null || encoding.name === 'replacement') + throw RangeError('Unknown encoding: ' + label); + if (!decoders[encoding.name]) { + throw Error('Decoder not present.' + + ' Did you forget to include encoding-indexes.js first?'); + } + + // 3. Let dec be a new TextDecoder object. + var dec = this; + + // 4. Set dec's encoding to encoding. + dec._encoding = encoding; + + // 5. If options's fatal member is true, set dec's error mode to + // fatal. + if (Boolean(options['fatal'])) + dec._error_mode = 'fatal'; + + // 6. If options's ignoreBOM member is true, set dec's ignore BOM + // flag. + if (Boolean(options['ignoreBOM'])) + dec._ignoreBOM = true; + + // For pre-ES5 runtimes: + if (!Object.defineProperty) { + this.encoding = dec._encoding.name.toLowerCase(); + this.fatal = dec._error_mode === 'fatal'; + this.ignoreBOM = dec._ignoreBOM; + } + + // 7. Return dec. + return dec; + } + + if (Object.defineProperty) { + // The encoding attribute's getter must return encoding's name. + Object.defineProperty(TextDecoder.prototype, 'encoding', { + /** @this {TextDecoder} */ + get: function() { return this._encoding.name.toLowerCase(); } + }); + + // The fatal attribute's getter must return true if error mode + // is fatal, and false otherwise. + Object.defineProperty(TextDecoder.prototype, 'fatal', { + /** @this {TextDecoder} */ + get: function() { return this._error_mode === 'fatal'; } + }); + + // The ignoreBOM attribute's getter must return true if ignore + // BOM flag is set, and false otherwise. + Object.defineProperty(TextDecoder.prototype, 'ignoreBOM', { + /** @this {TextDecoder} */ + get: function() { return this._ignoreBOM; } + }); + } + + /** + * @param {BufferSource=} input The buffer of bytes to decode. + * @param {Object=} options + * @return {string} The decoded string. + */ + TextDecoder.prototype.decode = function decode(input, options) { + var bytes; + if (typeof input === 'object' && input instanceof ArrayBuffer) { + bytes = new Uint8Array(input); + } else if (typeof input === 'object' && 'buffer' in input && + input.buffer instanceof ArrayBuffer) { + bytes = new Uint8Array(input.buffer, + input.byteOffset, + input.byteLength); + } else { + bytes = new Uint8Array(0); + } + + options = ToDictionary(options); + + // 1. If the do not flush flag is unset, set decoder to a new + // encoding's decoder, set stream to a new stream, and unset the + // BOM seen flag. + if (!this._do_not_flush) { + this._decoder = decoders[this._encoding.name]({ + fatal: this._error_mode === 'fatal'}); + this._BOMseen = false; + } + + // 2. If options's stream is true, set the do not flush flag, and + // unset the do not flush flag otherwise. + this._do_not_flush = Boolean(options['stream']); + + // 3. If input is given, push a copy of input to stream. + // TODO: Align with spec algorithm - maintain stream on instance. + var input_stream = new Stream(bytes); + + // 4. Let output be a new stream. + var output = []; + + /** @type {?(number|!Array.)} */ + var result; + + // 5. While true: + while (true) { + // 1. Let token be the result of reading from stream. + var token = input_stream.read(); + + // 2. If token is end-of-stream and the do not flush flag is + // set, return output, serialized. + // TODO: Align with spec algorithm. + if (token === end_of_stream) + break; + + // 3. Otherwise, run these subsubsteps: + + // 1. Let result be the result of processing token for decoder, + // stream, output, and error mode. + result = this._decoder.handler(input_stream, token); + + // 2. If result is finished, return output, serialized. + if (result === finished) + break; + + if (result !== null) { + if (Array.isArray(result)) + output.push.apply(output, /**@type {!Array.}*/(result)); + else + output.push(result); + } + + // 3. Otherwise, if result is error, throw a TypeError. + // (Thrown in handler) + + // 4. Otherwise, do nothing. + } + // TODO: Align with spec algorithm. + if (!this._do_not_flush) { + do { + result = this._decoder.handler(input_stream, input_stream.read()); + if (result === finished) + break; + if (result === null) + continue; + if (Array.isArray(result)) + output.push.apply(output, /**@type {!Array.}*/(result)); + else + output.push(result); + } while (!input_stream.endOfStream()); + this._decoder = null; + } + + // A TextDecoder object also has an associated serialize stream + // algorithm... + /** + * @param {!Array.} stream + * @return {string} + * @this {TextDecoder} + */ + function serializeStream(stream) { + // 1. Let token be the result of reading from stream. + // (Done in-place on array, rather than as a stream) + + // 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore + // BOM flag and BOM seen flag are unset, run these subsubsteps: + if (includes(['UTF-8', 'UTF-16LE', 'UTF-16BE'], this._encoding.name) && + !this._ignoreBOM && !this._BOMseen) { + if (stream.length > 0 && stream[0] === 0xFEFF) { + // 1. If token is U+FEFF, set BOM seen flag. + this._BOMseen = true; + stream.shift(); + } else if (stream.length > 0) { + // 2. Otherwise, if token is not end-of-stream, set BOM seen + // flag and append token to stream. + this._BOMseen = true; + } else { + // 3. Otherwise, if token is not end-of-stream, append token + // to output. + // (no-op) + } + } + // 4. Otherwise, return output. + return codePointsToString(stream); + } + + return serializeStream.call(this, output); + }; + + // 8.2 Interface TextEncoder + + /** + * @constructor + * @param {string=} label The label of the encoding. NONSTANDARD. + * @param {Object=} options NONSTANDARD. + */ + function TextEncoder(label, options) { + // Web IDL conventions + if (!(this instanceof TextEncoder)) + throw TypeError('Called as a function. Did you forget \'new\'?'); + options = ToDictionary(options); + + // A TextEncoder object has an associated encoding and encoder. + + /** @private */ + this._encoding = null; + /** @private @type {?Encoder} */ + this._encoder = null; + + // Non-standard + /** @private @type {boolean} */ + this._do_not_flush = false; + /** @private @type {string} */ + this._fatal = Boolean(options['fatal']) ? 'fatal' : 'replacement'; + + // 1. Let enc be a new TextEncoder object. + var enc = this; + + // 2. Set enc's encoding to UTF-8's encoder. + if (Boolean(options['NONSTANDARD_allowLegacyEncoding'])) { + // NONSTANDARD behavior. + label = label !== undefined ? String(label) : DEFAULT_ENCODING; + var encoding = getEncoding(label); + if (encoding === null || encoding.name === 'replacement') + throw RangeError('Unknown encoding: ' + label); + if (!encoders[encoding.name]) { + throw Error('Encoder not present.' + + ' Did you forget to include encoding-indexes.js first?'); + } + enc._encoding = encoding; + } else { + // Standard behavior. + enc._encoding = getEncoding('utf-8'); + + if (label !== undefined && 'console' in global) { + console.warn('TextEncoder constructor called with encoding label, ' + + 'which is ignored.'); + } + } + + // For pre-ES5 runtimes: + if (!Object.defineProperty) + this.encoding = enc._encoding.name.toLowerCase(); + + // 3. Return enc. + return enc; + } + + if (Object.defineProperty) { + // The encoding attribute's getter must return encoding's name. + Object.defineProperty(TextEncoder.prototype, 'encoding', { + /** @this {TextEncoder} */ + get: function() { return this._encoding.name.toLowerCase(); } + }); + } + + /** + * @param {string=} opt_string The string to encode. + * @param {Object=} options + * @return {!Uint8Array} Encoded bytes, as a Uint8Array. + */ + TextEncoder.prototype.encode = function encode(opt_string, options) { + opt_string = opt_string === undefined ? '' : String(opt_string); + options = ToDictionary(options); + + // NOTE: This option is nonstandard. None of the encodings + // permitted for encoding (i.e. UTF-8, UTF-16) are stateful when + // the input is a USVString so streaming is not necessary. + if (!this._do_not_flush) + this._encoder = encoders[this._encoding.name]({ + fatal: this._fatal === 'fatal'}); + this._do_not_flush = Boolean(options['stream']); + + // 1. Convert input to a stream. + var input = new Stream(stringToCodePoints(opt_string)); + + // 2. Let output be a new stream + var output = []; + + /** @type {?(number|!Array.)} */ + var result; + // 3. While true, run these substeps: + while (true) { + // 1. Let token be the result of reading from input. + var token = input.read(); + if (token === end_of_stream) + break; + // 2. Let result be the result of processing token for encoder, + // input, output. + result = this._encoder.handler(input, token); + if (result === finished) + break; + if (Array.isArray(result)) + output.push.apply(output, /**@type {!Array.}*/(result)); + else + output.push(result); + } + // TODO: Align with spec algorithm. + if (!this._do_not_flush) { + while (true) { + result = this._encoder.handler(input, input.read()); + if (result === finished) + break; + if (Array.isArray(result)) + output.push.apply(output, /**@type {!Array.}*/(result)); + else + output.push(result); + } + this._encoder = null; + } + // 3. If result is finished, convert output into a byte sequence, + // and then return a Uint8Array object wrapping an ArrayBuffer + // containing output. + return new Uint8Array(output); + }; + + + // + // 9. The encoding + // + + // 9.1 utf-8 + + // 9.1.1 utf-8 decoder + /** + * @constructor + * @implements {Decoder} + * @param {{fatal: boolean}} options + */ + function UTF8Decoder(options) { + var fatal = options.fatal; + + // utf-8's decoder's has an associated utf-8 code point, utf-8 + // bytes seen, and utf-8 bytes needed (all initially 0), a utf-8 + // lower boundary (initially 0x80), and a utf-8 upper boundary + // (initially 0xBF). + var /** @type {number} */ utf8_code_point = 0, + /** @type {number} */ utf8_bytes_seen = 0, + /** @type {number} */ utf8_bytes_needed = 0, + /** @type {number} */ utf8_lower_boundary = 0x80, + /** @type {number} */ utf8_upper_boundary = 0xBF; + + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream and utf-8 bytes needed is not 0, + // set utf-8 bytes needed to 0 and return error. + if (bite === end_of_stream && utf8_bytes_needed !== 0) { + utf8_bytes_needed = 0; + return decoderError(fatal); + } + + // 2. If byte is end-of-stream, return finished. + if (bite === end_of_stream) + return finished; + + // 3. If utf-8 bytes needed is 0, based on byte: + if (utf8_bytes_needed === 0) { + + // 0x00 to 0x7F + if (inRange(bite, 0x00, 0x7F)) { + // Return a code point whose value is byte. + return bite; + } + + // 0xC2 to 0xDF + else if (inRange(bite, 0xC2, 0xDF)) { + // 1. Set utf-8 bytes needed to 1. + utf8_bytes_needed = 1; + + // 2. Set UTF-8 code point to byte & 0x1F. + utf8_code_point = bite & 0x1F; + } + + // 0xE0 to 0xEF + else if (inRange(bite, 0xE0, 0xEF)) { + // 1. If byte is 0xE0, set utf-8 lower boundary to 0xA0. + if (bite === 0xE0) + utf8_lower_boundary = 0xA0; + // 2. If byte is 0xED, set utf-8 upper boundary to 0x9F. + if (bite === 0xED) + utf8_upper_boundary = 0x9F; + // 3. Set utf-8 bytes needed to 2. + utf8_bytes_needed = 2; + // 4. Set UTF-8 code point to byte & 0xF. + utf8_code_point = bite & 0xF; + } + + // 0xF0 to 0xF4 + else if (inRange(bite, 0xF0, 0xF4)) { + // 1. If byte is 0xF0, set utf-8 lower boundary to 0x90. + if (bite === 0xF0) + utf8_lower_boundary = 0x90; + // 2. If byte is 0xF4, set utf-8 upper boundary to 0x8F. + if (bite === 0xF4) + utf8_upper_boundary = 0x8F; + // 3. Set utf-8 bytes needed to 3. + utf8_bytes_needed = 3; + // 4. Set UTF-8 code point to byte & 0x7. + utf8_code_point = bite & 0x7; + } + + // Otherwise + else { + // Return error. + return decoderError(fatal); + } + + // Return continue. + return null; + } + + // 4. If byte is not in the range utf-8 lower boundary to utf-8 + // upper boundary, inclusive, run these substeps: + if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) { + + // 1. Set utf-8 code point, utf-8 bytes needed, and utf-8 + // bytes seen to 0, set utf-8 lower boundary to 0x80, and set + // utf-8 upper boundary to 0xBF. + utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; + utf8_lower_boundary = 0x80; + utf8_upper_boundary = 0xBF; + + // 2. Prepend byte to stream. + stream.prepend(bite); + + // 3. Return error. + return decoderError(fatal); + } + + // 5. Set utf-8 lower boundary to 0x80 and utf-8 upper boundary + // to 0xBF. + utf8_lower_boundary = 0x80; + utf8_upper_boundary = 0xBF; + + // 6. Set UTF-8 code point to (UTF-8 code point << 6) | (byte & + // 0x3F) + utf8_code_point = (utf8_code_point << 6) | (bite & 0x3F); + + // 7. Increase utf-8 bytes seen by one. + utf8_bytes_seen += 1; + + // 8. If utf-8 bytes seen is not equal to utf-8 bytes needed, + // continue. + if (utf8_bytes_seen !== utf8_bytes_needed) + return null; + + // 9. Let code point be utf-8 code point. + var code_point = utf8_code_point; + + // 10. Set utf-8 code point, utf-8 bytes needed, and utf-8 bytes + // seen to 0. + utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; + + // 11. Return a code point whose value is code point. + return code_point; + }; + } + + // 9.1.2 utf-8 encoder + /** + * @constructor + * @implements {Encoder} + * @param {{fatal: boolean}} options + */ + function UTF8Encoder(options) { + var fatal = options.fatal; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is an ASCII code point, return a byte whose + // value is code point. + if (isASCIICodePoint(code_point)) + return code_point; + + // 3. Set count and offset based on the range code point is in: + var count, offset; + // U+0080 to U+07FF, inclusive: + if (inRange(code_point, 0x0080, 0x07FF)) { + // 1 and 0xC0 + count = 1; + offset = 0xC0; + } + // U+0800 to U+FFFF, inclusive: + else if (inRange(code_point, 0x0800, 0xFFFF)) { + // 2 and 0xE0 + count = 2; + offset = 0xE0; + } + // U+10000 to U+10FFFF, inclusive: + else if (inRange(code_point, 0x10000, 0x10FFFF)) { + // 3 and 0xF0 + count = 3; + offset = 0xF0; + } + + // 4. Let bytes be a byte sequence whose first byte is (code + // point >> (6 × count)) + offset. + var bytes = [(code_point >> (6 * count)) + offset]; + + // 5. Run these substeps while count is greater than 0: + while (count > 0) { + + // 1. Set temp to code point >> (6 × (count − 1)). + var temp = code_point >> (6 * (count - 1)); + + // 2. Append to bytes 0x80 | (temp & 0x3F). + bytes.push(0x80 | (temp & 0x3F)); + + // 3. Decrease count by one. + count -= 1; + } + + // 6. Return bytes bytes, in order. + return bytes; + }; + } + + /** @param {{fatal: boolean}} options */ + encoders['UTF-8'] = function(options) { + return new UTF8Encoder(options); + }; + /** @param {{fatal: boolean}} options */ + decoders['UTF-8'] = function(options) { + return new UTF8Decoder(options); + }; + + // + // 10. Legacy single-byte encodings + // + + // 10.1 single-byte decoder + /** + * @constructor + * @implements {Decoder} + * @param {!Array.} index The encoding index. + * @param {{fatal: boolean}} options + */ + function SingleByteDecoder(index, options) { + var fatal = options.fatal; + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream, return finished. + if (bite === end_of_stream) + return finished; + + // 2. If byte is an ASCII byte, return a code point whose value + // is byte. + if (isASCIIByte(bite)) + return bite; + + // 3. Let code point be the index code point for byte − 0x80 in + // index single-byte. + var code_point = index[bite - 0x80]; + + // 4. If code point is null, return error. + if (code_point === null) + return decoderError(fatal); + + // 5. Return a code point whose value is code point. + return code_point; + }; + } + + // 10.2 single-byte encoder + /** + * @constructor + * @implements {Encoder} + * @param {!Array.} index The encoding index. + * @param {{fatal: boolean}} options + */ + function SingleByteEncoder(index, options) { + var fatal = options.fatal; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is an ASCII code point, return a byte whose + // value is code point. + if (isASCIICodePoint(code_point)) + return code_point; + + // 3. Let pointer be the index pointer for code point in index + // single-byte. + var pointer = indexPointerFor(code_point, index); + + // 4. If pointer is null, return error with code point. + if (pointer === null) + encoderError(code_point); + + // 5. Return a byte whose value is pointer + 0x80. + return pointer + 0x80; + }; + } + + (function() { + if (!('encoding-indexes' in global)) + return; + encodings.forEach(function(category) { + if (category.heading !== 'Legacy single-byte encodings') + return; + category.encodings.forEach(function(encoding) { + var name = encoding.name; + var idx = index(name.toLowerCase()); + /** @param {{fatal: boolean}} options */ + decoders[name] = function(options) { + return new SingleByteDecoder(idx, options); + }; + /** @param {{fatal: boolean}} options */ + encoders[name] = function(options) { + return new SingleByteEncoder(idx, options); + }; + }); + }); + }()); + + // + // 11. Legacy multi-byte Chinese (simplified) encodings + // + + // 11.1 gbk + + // 11.1.1 gbk decoder + // gbk's decoder is gb18030's decoder. + /** @param {{fatal: boolean}} options */ + decoders['GBK'] = function(options) { + return new GB18030Decoder(options); + }; + + // 11.1.2 gbk encoder + // gbk's encoder is gb18030's encoder with its gbk flag set. + /** @param {{fatal: boolean}} options */ + encoders['GBK'] = function(options) { + return new GB18030Encoder(options, true); + }; + + // 11.2 gb18030 + + // 11.2.1 gb18030 decoder + /** + * @constructor + * @implements {Decoder} + * @param {{fatal: boolean}} options + */ + function GB18030Decoder(options) { + var fatal = options.fatal; + // gb18030's decoder has an associated gb18030 first, gb18030 + // second, and gb18030 third (all initially 0x00). + var /** @type {number} */ gb18030_first = 0x00, + /** @type {number} */ gb18030_second = 0x00, + /** @type {number} */ gb18030_third = 0x00; + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream and gb18030 first, gb18030 + // second, and gb18030 third are 0x00, return finished. + if (bite === end_of_stream && gb18030_first === 0x00 && + gb18030_second === 0x00 && gb18030_third === 0x00) { + return finished; + } + // 2. If byte is end-of-stream, and gb18030 first, gb18030 + // second, or gb18030 third is not 0x00, set gb18030 first, + // gb18030 second, and gb18030 third to 0x00, and return error. + if (bite === end_of_stream && + (gb18030_first !== 0x00 || gb18030_second !== 0x00 || + gb18030_third !== 0x00)) { + gb18030_first = 0x00; + gb18030_second = 0x00; + gb18030_third = 0x00; + decoderError(fatal); + } + var code_point; + // 3. If gb18030 third is not 0x00, run these substeps: + if (gb18030_third !== 0x00) { + // 1. Let code point be null. + code_point = null; + // 2. If byte is in the range 0x30 to 0x39, inclusive, set + // code point to the index gb18030 ranges code point for + // (((gb18030 first − 0x81) × 10 + gb18030 second − 0x30) × + // 126 + gb18030 third − 0x81) × 10 + byte − 0x30. + if (inRange(bite, 0x30, 0x39)) { + code_point = indexGB18030RangesCodePointFor( + (((gb18030_first - 0x81) * 10 + gb18030_second - 0x30) * 126 + + gb18030_third - 0x81) * 10 + bite - 0x30); + } + + // 3. Let buffer be a byte sequence consisting of gb18030 + // second, gb18030 third, and byte, in order. + var buffer = [gb18030_second, gb18030_third, bite]; + + // 4. Set gb18030 first, gb18030 second, and gb18030 third to + // 0x00. + gb18030_first = 0x00; + gb18030_second = 0x00; + gb18030_third = 0x00; + + // 5. If code point is null, prepend buffer to stream and + // return error. + if (code_point === null) { + stream.prepend(buffer); + return decoderError(fatal); + } + + // 6. Return a code point whose value is code point. + return code_point; + } + + // 4. If gb18030 second is not 0x00, run these substeps: + if (gb18030_second !== 0x00) { + + // 1. If byte is in the range 0x81 to 0xFE, inclusive, set + // gb18030 third to byte and return continue. + if (inRange(bite, 0x81, 0xFE)) { + gb18030_third = bite; + return null; + } + + // 2. Prepend gb18030 second followed by byte to stream, set + // gb18030 first and gb18030 second to 0x00, and return error. + stream.prepend([gb18030_second, bite]); + gb18030_first = 0x00; + gb18030_second = 0x00; + return decoderError(fatal); + } + + // 5. If gb18030 first is not 0x00, run these substeps: + if (gb18030_first !== 0x00) { + + // 1. If byte is in the range 0x30 to 0x39, inclusive, set + // gb18030 second to byte and return continue. + if (inRange(bite, 0x30, 0x39)) { + gb18030_second = bite; + return null; + } + + // 2. Let lead be gb18030 first, let pointer be null, and set + // gb18030 first to 0x00. + var lead = gb18030_first; + var pointer = null; + gb18030_first = 0x00; + + // 3. Let offset be 0x40 if byte is less than 0x7F and 0x41 + // otherwise. + var offset = bite < 0x7F ? 0x40 : 0x41; + + // 4. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80 + // to 0xFE, inclusive, set pointer to (lead − 0x81) × 190 + + // (byte − offset). + if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFE)) + pointer = (lead - 0x81) * 190 + (bite - offset); + + // 5. Let code point be null if pointer is null and the index + // code point for pointer in index gb18030 otherwise. + code_point = pointer === null ? null : + indexCodePointFor(pointer, index('gb18030')); + + // 6. If code point is null and byte is an ASCII byte, prepend + // byte to stream. + if (code_point === null && isASCIIByte(bite)) + stream.prepend(bite); + + // 7. If code point is null, return error. + if (code_point === null) + return decoderError(fatal); + + // 8. Return a code point whose value is code point. + return code_point; + } + + // 6. If byte is an ASCII byte, return a code point whose value + // is byte. + if (isASCIIByte(bite)) + return bite; + + // 7. If byte is 0x80, return code point U+20AC. + if (bite === 0x80) + return 0x20AC; + + // 8. If byte is in the range 0x81 to 0xFE, inclusive, set + // gb18030 first to byte and return continue. + if (inRange(bite, 0x81, 0xFE)) { + gb18030_first = bite; + return null; + } + + // 9. Return error. + return decoderError(fatal); + }; + } + + // 11.2.2 gb18030 encoder + /** + * @constructor + * @implements {Encoder} + * @param {{fatal: boolean}} options + * @param {boolean=} gbk_flag + */ + function GB18030Encoder(options, gbk_flag) { + var fatal = options.fatal; + // gb18030's decoder has an associated gbk flag (initially unset). + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is an ASCII code point, return a byte whose + // value is code point. + if (isASCIICodePoint(code_point)) + return code_point; + + // 3. If code point is U+E5E5, return error with code point. + if (code_point === 0xE5E5) + return encoderError(code_point); + + // 4. If the gbk flag is set and code point is U+20AC, return + // byte 0x80. + if (gbk_flag && code_point === 0x20AC) + return 0x80; + + // 5. Let pointer be the index pointer for code point in index + // gb18030. + var pointer = indexPointerFor(code_point, index('gb18030')); + + // 6. If pointer is not null, run these substeps: + if (pointer !== null) { + + // 1. Let lead be floor(pointer / 190) + 0x81. + var lead = floor(pointer / 190) + 0x81; + + // 2. Let trail be pointer % 190. + var trail = pointer % 190; + + // 3. Let offset be 0x40 if trail is less than 0x3F and 0x41 otherwise. + var offset = trail < 0x3F ? 0x40 : 0x41; + + // 4. Return two bytes whose values are lead and trail + offset. + return [lead, trail + offset]; + } + + // 7. If gbk flag is set, return error with code point. + if (gbk_flag) + return encoderError(code_point); + + // 8. Set pointer to the index gb18030 ranges pointer for code + // point. + pointer = indexGB18030RangesPointerFor(code_point); + + // 9. Let byte1 be floor(pointer / 10 / 126 / 10). + var byte1 = floor(pointer / 10 / 126 / 10); + + // 10. Set pointer to pointer − byte1 × 10 × 126 × 10. + pointer = pointer - byte1 * 10 * 126 * 10; + + // 11. Let byte2 be floor(pointer / 10 / 126). + var byte2 = floor(pointer / 10 / 126); + + // 12. Set pointer to pointer − byte2 × 10 × 126. + pointer = pointer - byte2 * 10 * 126; + + // 13. Let byte3 be floor(pointer / 10). + var byte3 = floor(pointer / 10); + + // 14. Let byte4 be pointer − byte3 × 10. + var byte4 = pointer - byte3 * 10; + + // 15. Return four bytes whose values are byte1 + 0x81, byte2 + + // 0x30, byte3 + 0x81, byte4 + 0x30. + return [byte1 + 0x81, + byte2 + 0x30, + byte3 + 0x81, + byte4 + 0x30]; + }; + } + + /** @param {{fatal: boolean}} options */ + encoders['gb18030'] = function(options) { + return new GB18030Encoder(options); + }; + /** @param {{fatal: boolean}} options */ + decoders['gb18030'] = function(options) { + return new GB18030Decoder(options); + }; + + + // + // 12. Legacy multi-byte Chinese (traditional) encodings + // + + // 12.1 Big5 + + // 12.1.1 Big5 decoder + /** + * @constructor + * @implements {Decoder} + * @param {{fatal: boolean}} options + */ + function Big5Decoder(options) { + var fatal = options.fatal; + // Big5's decoder has an associated Big5 lead (initially 0x00). + var /** @type {number} */ Big5_lead = 0x00; + + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream and Big5 lead is not 0x00, set + // Big5 lead to 0x00 and return error. + if (bite === end_of_stream && Big5_lead !== 0x00) { + Big5_lead = 0x00; + return decoderError(fatal); + } + + // 2. If byte is end-of-stream and Big5 lead is 0x00, return + // finished. + if (bite === end_of_stream && Big5_lead === 0x00) + return finished; + + // 3. If Big5 lead is not 0x00, let lead be Big5 lead, let + // pointer be null, set Big5 lead to 0x00, and then run these + // substeps: + if (Big5_lead !== 0x00) { + var lead = Big5_lead; + var pointer = null; + Big5_lead = 0x00; + + // 1. Let offset be 0x40 if byte is less than 0x7F and 0x62 + // otherwise. + var offset = bite < 0x7F ? 0x40 : 0x62; + + // 2. If byte is in the range 0x40 to 0x7E, inclusive, or 0xA1 + // to 0xFE, inclusive, set pointer to (lead − 0x81) × 157 + + // (byte − offset). + if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0xA1, 0xFE)) + pointer = (lead - 0x81) * 157 + (bite - offset); + + // 3. If there is a row in the table below whose first column + // is pointer, return the two code points listed in its second + // column + // Pointer | Code points + // --------+-------------- + // 1133 | U+00CA U+0304 + // 1135 | U+00CA U+030C + // 1164 | U+00EA U+0304 + // 1166 | U+00EA U+030C + switch (pointer) { + case 1133: return [0x00CA, 0x0304]; + case 1135: return [0x00CA, 0x030C]; + case 1164: return [0x00EA, 0x0304]; + case 1166: return [0x00EA, 0x030C]; + } + + // 4. Let code point be null if pointer is null and the index + // code point for pointer in index Big5 otherwise. + var code_point = (pointer === null) ? null : + indexCodePointFor(pointer, index('big5')); + + // 5. If code point is null and byte is an ASCII byte, prepend + // byte to stream. + if (code_point === null && isASCIIByte(bite)) + stream.prepend(bite); + + // 6. If code point is null, return error. + if (code_point === null) + return decoderError(fatal); + + // 7. Return a code point whose value is code point. + return code_point; + } + + // 4. If byte is an ASCII byte, return a code point whose value + // is byte. + if (isASCIIByte(bite)) + return bite; + + // 5. If byte is in the range 0x81 to 0xFE, inclusive, set Big5 + // lead to byte and return continue. + if (inRange(bite, 0x81, 0xFE)) { + Big5_lead = bite; + return null; + } + + // 6. Return error. + return decoderError(fatal); + }; + } + + // 12.1.2 Big5 encoder + /** + * @constructor + * @implements {Encoder} + * @param {{fatal: boolean}} options + */ + function Big5Encoder(options) { + var fatal = options.fatal; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is an ASCII code point, return a byte whose + // value is code point. + if (isASCIICodePoint(code_point)) + return code_point; + + // 3. Let pointer be the index Big5 pointer for code point. + var pointer = indexBig5PointerFor(code_point); + + // 4. If pointer is null, return error with code point. + if (pointer === null) + return encoderError(code_point); + + // 5. Let lead be floor(pointer / 157) + 0x81. + var lead = floor(pointer / 157) + 0x81; + + // 6. If lead is less than 0xA1, return error with code point. + if (lead < 0xA1) + return encoderError(code_point); + + // 7. Let trail be pointer % 157. + var trail = pointer % 157; + + // 8. Let offset be 0x40 if trail is less than 0x3F and 0x62 + // otherwise. + var offset = trail < 0x3F ? 0x40 : 0x62; + + // Return two bytes whose values are lead and trail + offset. + return [lead, trail + offset]; + }; + } + + /** @param {{fatal: boolean}} options */ + encoders['Big5'] = function(options) { + return new Big5Encoder(options); + }; + /** @param {{fatal: boolean}} options */ + decoders['Big5'] = function(options) { + return new Big5Decoder(options); + }; + + + // + // 13. Legacy multi-byte Japanese encodings + // + + // 13.1 euc-jp + + // 13.1.1 euc-jp decoder + /** + * @constructor + * @implements {Decoder} + * @param {{fatal: boolean}} options + */ + function EUCJPDecoder(options) { + var fatal = options.fatal; + + // euc-jp's decoder has an associated euc-jp jis0212 flag + // (initially unset) and euc-jp lead (initially 0x00). + var /** @type {boolean} */ eucjp_jis0212_flag = false, + /** @type {number} */ eucjp_lead = 0x00; + + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream and euc-jp lead is not 0x00, set + // euc-jp lead to 0x00, and return error. + if (bite === end_of_stream && eucjp_lead !== 0x00) { + eucjp_lead = 0x00; + return decoderError(fatal); + } + + // 2. If byte is end-of-stream and euc-jp lead is 0x00, return + // finished. + if (bite === end_of_stream && eucjp_lead === 0x00) + return finished; + + // 3. If euc-jp lead is 0x8E and byte is in the range 0xA1 to + // 0xDF, inclusive, set euc-jp lead to 0x00 and return a code + // point whose value is 0xFF61 − 0xA1 + byte. + if (eucjp_lead === 0x8E && inRange(bite, 0xA1, 0xDF)) { + eucjp_lead = 0x00; + return 0xFF61 - 0xA1 + bite; + } + + // 4. If euc-jp lead is 0x8F and byte is in the range 0xA1 to + // 0xFE, inclusive, set the euc-jp jis0212 flag, set euc-jp lead + // to byte, and return continue. + if (eucjp_lead === 0x8F && inRange(bite, 0xA1, 0xFE)) { + eucjp_jis0212_flag = true; + eucjp_lead = bite; + return null; + } + + // 5. If euc-jp lead is not 0x00, let lead be euc-jp lead, set + // euc-jp lead to 0x00, and run these substeps: + if (eucjp_lead !== 0x00) { + var lead = eucjp_lead; + eucjp_lead = 0x00; + + // 1. Let code point be null. + var code_point = null; + + // 2. If lead and byte are both in the range 0xA1 to 0xFE, + // inclusive, set code point to the index code point for (lead + // − 0xA1) × 94 + byte − 0xA1 in index jis0208 if the euc-jp + // jis0212 flag is unset and in index jis0212 otherwise. + if (inRange(lead, 0xA1, 0xFE) && inRange(bite, 0xA1, 0xFE)) { + code_point = indexCodePointFor( + (lead - 0xA1) * 94 + (bite - 0xA1), + index(!eucjp_jis0212_flag ? 'jis0208' : 'jis0212')); + } + + // 3. Unset the euc-jp jis0212 flag. + eucjp_jis0212_flag = false; + + // 4. If byte is not in the range 0xA1 to 0xFE, inclusive, + // prepend byte to stream. + if (!inRange(bite, 0xA1, 0xFE)) + stream.prepend(bite); + + // 5. If code point is null, return error. + if (code_point === null) + return decoderError(fatal); + + // 6. Return a code point whose value is code point. + return code_point; + } + + // 6. If byte is an ASCII byte, return a code point whose value + // is byte. + if (isASCIIByte(bite)) + return bite; + + // 7. If byte is 0x8E, 0x8F, or in the range 0xA1 to 0xFE, + // inclusive, set euc-jp lead to byte and return continue. + if (bite === 0x8E || bite === 0x8F || inRange(bite, 0xA1, 0xFE)) { + eucjp_lead = bite; + return null; + } + + // 8. Return error. + return decoderError(fatal); + }; + } + + // 13.1.2 euc-jp encoder + /** + * @constructor + * @implements {Encoder} + * @param {{fatal: boolean}} options + */ + function EUCJPEncoder(options) { + var fatal = options.fatal; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is an ASCII code point, return a byte whose + // value is code point. + if (isASCIICodePoint(code_point)) + return code_point; + + // 3. If code point is U+00A5, return byte 0x5C. + if (code_point === 0x00A5) + return 0x5C; + + // 4. If code point is U+203E, return byte 0x7E. + if (code_point === 0x203E) + return 0x7E; + + // 5. If code point is in the range U+FF61 to U+FF9F, inclusive, + // return two bytes whose values are 0x8E and code point − + // 0xFF61 + 0xA1. + if (inRange(code_point, 0xFF61, 0xFF9F)) + return [0x8E, code_point - 0xFF61 + 0xA1]; + + // 6. If code point is U+2212, set it to U+FF0D. + if (code_point === 0x2212) + code_point = 0xFF0D; + + // 7. Let pointer be the index pointer for code point in index + // jis0208. + var pointer = indexPointerFor(code_point, index('jis0208')); + + // 8. If pointer is null, return error with code point. + if (pointer === null) + return encoderError(code_point); + + // 9. Let lead be floor(pointer / 94) + 0xA1. + var lead = floor(pointer / 94) + 0xA1; + + // 10. Let trail be pointer % 94 + 0xA1. + var trail = pointer % 94 + 0xA1; + + // 11. Return two bytes whose values are lead and trail. + return [lead, trail]; + }; + } + + /** @param {{fatal: boolean}} options */ + encoders['EUC-JP'] = function(options) { + return new EUCJPEncoder(options); + }; + /** @param {{fatal: boolean}} options */ + decoders['EUC-JP'] = function(options) { + return new EUCJPDecoder(options); + }; + + // 13.2 iso-2022-jp + + // 13.2.1 iso-2022-jp decoder + /** + * @constructor + * @implements {Decoder} + * @param {{fatal: boolean}} options + */ + function ISO2022JPDecoder(options) { + var fatal = options.fatal; + /** @enum */ + var states = { + ASCII: 0, + Roman: 1, + Katakana: 2, + LeadByte: 3, + TrailByte: 4, + EscapeStart: 5, + Escape: 6 + }; + // iso-2022-jp's decoder has an associated iso-2022-jp decoder + // state (initially ASCII), iso-2022-jp decoder output state + // (initially ASCII), iso-2022-jp lead (initially 0x00), and + // iso-2022-jp output flag (initially unset). + var /** @type {number} */ iso2022jp_decoder_state = states.ASCII, + /** @type {number} */ iso2022jp_decoder_output_state = states.ASCII, + /** @type {number} */ iso2022jp_lead = 0x00, + /** @type {boolean} */ iso2022jp_output_flag = false; + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // switching on iso-2022-jp decoder state: + switch (iso2022jp_decoder_state) { + default: + case states.ASCII: + // ASCII + // Based on byte: + + // 0x1B + if (bite === 0x1B) { + // Set iso-2022-jp decoder state to escape start and return + // continue. + iso2022jp_decoder_state = states.EscapeStart; + return null; + } + + // 0x00 to 0x7F, excluding 0x0E, 0x0F, and 0x1B + if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E + && bite !== 0x0F && bite !== 0x1B) { + // Unset the iso-2022-jp output flag and return a code point + // whose value is byte. + iso2022jp_output_flag = false; + return bite; + } + + // end-of-stream + if (bite === end_of_stream) { + // Return finished. + return finished; + } + + // Otherwise + // Unset the iso-2022-jp output flag and return error. + iso2022jp_output_flag = false; + return decoderError(fatal); + + case states.Roman: + // Roman + // Based on byte: + + // 0x1B + if (bite === 0x1B) { + // Set iso-2022-jp decoder state to escape start and return + // continue. + iso2022jp_decoder_state = states.EscapeStart; + return null; + } + + // 0x5C + if (bite === 0x5C) { + // Unset the iso-2022-jp output flag and return code point + // U+00A5. + iso2022jp_output_flag = false; + return 0x00A5; + } + + // 0x7E + if (bite === 0x7E) { + // Unset the iso-2022-jp output flag and return code point + // U+203E. + iso2022jp_output_flag = false; + return 0x203E; + } + + // 0x00 to 0x7F, excluding 0x0E, 0x0F, 0x1B, 0x5C, and 0x7E + if (inRange(bite, 0x00, 0x7F) && bite !== 0x0E && bite !== 0x0F + && bite !== 0x1B && bite !== 0x5C && bite !== 0x7E) { + // Unset the iso-2022-jp output flag and return a code point + // whose value is byte. + iso2022jp_output_flag = false; + return bite; + } + + // end-of-stream + if (bite === end_of_stream) { + // Return finished. + return finished; + } + + // Otherwise + // Unset the iso-2022-jp output flag and return error. + iso2022jp_output_flag = false; + return decoderError(fatal); + + case states.Katakana: + // Katakana + // Based on byte: + + // 0x1B + if (bite === 0x1B) { + // Set iso-2022-jp decoder state to escape start and return + // continue. + iso2022jp_decoder_state = states.EscapeStart; + return null; + } + + // 0x21 to 0x5F + if (inRange(bite, 0x21, 0x5F)) { + // Unset the iso-2022-jp output flag and return a code point + // whose value is 0xFF61 − 0x21 + byte. + iso2022jp_output_flag = false; + return 0xFF61 - 0x21 + bite; + } + + // end-of-stream + if (bite === end_of_stream) { + // Return finished. + return finished; + } + + // Otherwise + // Unset the iso-2022-jp output flag and return error. + iso2022jp_output_flag = false; + return decoderError(fatal); + + case states.LeadByte: + // Lead byte + // Based on byte: + + // 0x1B + if (bite === 0x1B) { + // Set iso-2022-jp decoder state to escape start and return + // continue. + iso2022jp_decoder_state = states.EscapeStart; + return null; + } + + // 0x21 to 0x7E + if (inRange(bite, 0x21, 0x7E)) { + // Unset the iso-2022-jp output flag, set iso-2022-jp lead + // to byte, iso-2022-jp decoder state to trail byte, and + // return continue. + iso2022jp_output_flag = false; + iso2022jp_lead = bite; + iso2022jp_decoder_state = states.TrailByte; + return null; + } + + // end-of-stream + if (bite === end_of_stream) { + // Return finished. + return finished; + } + + // Otherwise + // Unset the iso-2022-jp output flag and return error. + iso2022jp_output_flag = false; + return decoderError(fatal); + + case states.TrailByte: + // Trail byte + // Based on byte: + + // 0x1B + if (bite === 0x1B) { + // Set iso-2022-jp decoder state to escape start and return + // continue. + iso2022jp_decoder_state = states.EscapeStart; + return decoderError(fatal); + } + + // 0x21 to 0x7E + if (inRange(bite, 0x21, 0x7E)) { + // 1. Set the iso-2022-jp decoder state to lead byte. + iso2022jp_decoder_state = states.LeadByte; + + // 2. Let pointer be (iso-2022-jp lead − 0x21) × 94 + byte − 0x21. + var pointer = (iso2022jp_lead - 0x21) * 94 + bite - 0x21; + + // 3. Let code point be the index code point for pointer in + // index jis0208. + var code_point = indexCodePointFor(pointer, index('jis0208')); + + // 4. If code point is null, return error. + if (code_point === null) + return decoderError(fatal); + + // 5. Return a code point whose value is code point. + return code_point; + } + + // end-of-stream + if (bite === end_of_stream) { + // Set the iso-2022-jp decoder state to lead byte, prepend + // byte to stream, and return error. + iso2022jp_decoder_state = states.LeadByte; + stream.prepend(bite); + return decoderError(fatal); + } + + // Otherwise + // Set iso-2022-jp decoder state to lead byte and return + // error. + iso2022jp_decoder_state = states.LeadByte; + return decoderError(fatal); + + case states.EscapeStart: + // Escape start + + // 1. If byte is either 0x24 or 0x28, set iso-2022-jp lead to + // byte, iso-2022-jp decoder state to escape, and return + // continue. + if (bite === 0x24 || bite === 0x28) { + iso2022jp_lead = bite; + iso2022jp_decoder_state = states.Escape; + return null; + } + + // 2. Prepend byte to stream. + stream.prepend(bite); + + // 3. Unset the iso-2022-jp output flag, set iso-2022-jp + // decoder state to iso-2022-jp decoder output state, and + // return error. + iso2022jp_output_flag = false; + iso2022jp_decoder_state = iso2022jp_decoder_output_state; + return decoderError(fatal); + + case states.Escape: + // Escape + + // 1. Let lead be iso-2022-jp lead and set iso-2022-jp lead to + // 0x00. + var lead = iso2022jp_lead; + iso2022jp_lead = 0x00; + + // 2. Let state be null. + var state = null; + + // 3. If lead is 0x28 and byte is 0x42, set state to ASCII. + if (lead === 0x28 && bite === 0x42) + state = states.ASCII; + + // 4. If lead is 0x28 and byte is 0x4A, set state to Roman. + if (lead === 0x28 && bite === 0x4A) + state = states.Roman; + + // 5. If lead is 0x28 and byte is 0x49, set state to Katakana. + if (lead === 0x28 && bite === 0x49) + state = states.Katakana; + + // 6. If lead is 0x24 and byte is either 0x40 or 0x42, set + // state to lead byte. + if (lead === 0x24 && (bite === 0x40 || bite === 0x42)) + state = states.LeadByte; + + // 7. If state is non-null, run these substeps: + if (state !== null) { + // 1. Set iso-2022-jp decoder state and iso-2022-jp decoder + // output state to states. + iso2022jp_decoder_state = iso2022jp_decoder_state = state; + + // 2. Let output flag be the iso-2022-jp output flag. + var output_flag = iso2022jp_output_flag; + + // 3. Set the iso-2022-jp output flag. + iso2022jp_output_flag = true; + + // 4. Return continue, if output flag is unset, and error + // otherwise. + return !output_flag ? null : decoderError(fatal); + } + + // 8. Prepend lead and byte to stream. + stream.prepend([lead, bite]); + + // 9. Unset the iso-2022-jp output flag, set iso-2022-jp + // decoder state to iso-2022-jp decoder output state and + // return error. + iso2022jp_output_flag = false; + iso2022jp_decoder_state = iso2022jp_decoder_output_state; + return decoderError(fatal); + } + }; + } + + // 13.2.2 iso-2022-jp encoder + /** + * @constructor + * @implements {Encoder} + * @param {{fatal: boolean}} options + */ + function ISO2022JPEncoder(options) { + var fatal = options.fatal; + // iso-2022-jp's encoder has an associated iso-2022-jp encoder + // state which is one of ASCII, Roman, and jis0208 (initially + // ASCII). + /** @enum */ + var states = { + ASCII: 0, + Roman: 1, + jis0208: 2 + }; + var /** @type {number} */ iso2022jp_state = states.ASCII; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream and iso-2022-jp encoder + // state is not ASCII, prepend code point to stream, set + // iso-2022-jp encoder state to ASCII, and return three bytes + // 0x1B 0x28 0x42. + if (code_point === end_of_stream && + iso2022jp_state !== states.ASCII) { + stream.prepend(code_point); + iso2022jp_state = states.ASCII; + return [0x1B, 0x28, 0x42]; + } + + // 2. If code point is end-of-stream and iso-2022-jp encoder + // state is ASCII, return finished. + if (code_point === end_of_stream && iso2022jp_state === states.ASCII) + return finished; + + // 3. If ISO-2022-JP encoder state is ASCII or Roman, and code + // point is U+000E, U+000F, or U+001B, return error with U+FFFD. + if ((iso2022jp_state === states.ASCII || + iso2022jp_state === states.Roman) && + (code_point === 0x000E || code_point === 0x000F || + code_point === 0x001B)) { + return encoderError(0xFFFD); + } + + // 4. If iso-2022-jp encoder state is ASCII and code point is an + // ASCII code point, return a byte whose value is code point. + if (iso2022jp_state === states.ASCII && + isASCIICodePoint(code_point)) + return code_point; + + // 5. If iso-2022-jp encoder state is Roman and code point is an + // ASCII code point, excluding U+005C and U+007E, or is U+00A5 + // or U+203E, run these substeps: + if (iso2022jp_state === states.Roman && + ((isASCIICodePoint(code_point) && + code_point !== 0x005C && code_point !== 0x007E) || + (code_point == 0x00A5 || code_point == 0x203E))) { + + // 1. If code point is an ASCII code point, return a byte + // whose value is code point. + if (isASCIICodePoint(code_point)) + return code_point; + + // 2. If code point is U+00A5, return byte 0x5C. + if (code_point === 0x00A5) + return 0x5C; + + // 3. If code point is U+203E, return byte 0x7E. + if (code_point === 0x203E) + return 0x7E; + } + + // 6. If code point is an ASCII code point, and iso-2022-jp + // encoder state is not ASCII, prepend code point to stream, set + // iso-2022-jp encoder state to ASCII, and return three bytes + // 0x1B 0x28 0x42. + if (isASCIICodePoint(code_point) && + iso2022jp_state !== states.ASCII) { + stream.prepend(code_point); + iso2022jp_state = states.ASCII; + return [0x1B, 0x28, 0x42]; + } + + // 7. If code point is either U+00A5 or U+203E, and iso-2022-jp + // encoder state is not Roman, prepend code point to stream, set + // iso-2022-jp encoder state to Roman, and return three bytes + // 0x1B 0x28 0x4A. + if ((code_point === 0x00A5 || code_point === 0x203E) && + iso2022jp_state !== states.Roman) { + stream.prepend(code_point); + iso2022jp_state = states.Roman; + return [0x1B, 0x28, 0x4A]; + } + + // 8. If code point is U+2212, set it to U+FF0D. + if (code_point === 0x2212) + code_point = 0xFF0D; + + // 9. Let pointer be the index pointer for code point in index + // jis0208. + var pointer = indexPointerFor(code_point, index('jis0208')); + + // 10. If pointer is null, return error with code point. + if (pointer === null) + return encoderError(code_point); + + // 11. If iso-2022-jp encoder state is not jis0208, prepend code + // point to stream, set iso-2022-jp encoder state to jis0208, + // and return three bytes 0x1B 0x24 0x42. + if (iso2022jp_state !== states.jis0208) { + stream.prepend(code_point); + iso2022jp_state = states.jis0208; + return [0x1B, 0x24, 0x42]; + } + + // 12. Let lead be floor(pointer / 94) + 0x21. + var lead = floor(pointer / 94) + 0x21; + + // 13. Let trail be pointer % 94 + 0x21. + var trail = pointer % 94 + 0x21; + + // 14. Return two bytes whose values are lead and trail. + return [lead, trail]; + }; + } + + /** @param {{fatal: boolean}} options */ + encoders['ISO-2022-JP'] = function(options) { + return new ISO2022JPEncoder(options); + }; + /** @param {{fatal: boolean}} options */ + decoders['ISO-2022-JP'] = function(options) { + return new ISO2022JPDecoder(options); + }; + + // 13.3 Shift_JIS + + // 13.3.1 Shift_JIS decoder + /** + * @constructor + * @implements {Decoder} + * @param {{fatal: boolean}} options + */ + function ShiftJISDecoder(options) { + var fatal = options.fatal; + // Shift_JIS's decoder has an associated Shift_JIS lead (initially + // 0x00). + var /** @type {number} */ Shift_JIS_lead = 0x00; + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream and Shift_JIS lead is not 0x00, + // set Shift_JIS lead to 0x00 and return error. + if (bite === end_of_stream && Shift_JIS_lead !== 0x00) { + Shift_JIS_lead = 0x00; + return decoderError(fatal); + } + + // 2. If byte is end-of-stream and Shift_JIS lead is 0x00, + // return finished. + if (bite === end_of_stream && Shift_JIS_lead === 0x00) + return finished; + + // 3. If Shift_JIS lead is not 0x00, let lead be Shift_JIS lead, + // let pointer be null, set Shift_JIS lead to 0x00, and then run + // these substeps: + if (Shift_JIS_lead !== 0x00) { + var lead = Shift_JIS_lead; + var pointer = null; + Shift_JIS_lead = 0x00; + + // 1. Let offset be 0x40, if byte is less than 0x7F, and 0x41 + // otherwise. + var offset = (bite < 0x7F) ? 0x40 : 0x41; + + // 2. Let lead offset be 0x81, if lead is less than 0xA0, and + // 0xC1 otherwise. + var lead_offset = (lead < 0xA0) ? 0x81 : 0xC1; + + // 3. If byte is in the range 0x40 to 0x7E, inclusive, or 0x80 + // to 0xFC, inclusive, set pointer to (lead − lead offset) × + // 188 + byte − offset. + if (inRange(bite, 0x40, 0x7E) || inRange(bite, 0x80, 0xFC)) + pointer = (lead - lead_offset) * 188 + bite - offset; + + // 4. If pointer is in the range 8836 to 10715, inclusive, + // return a code point whose value is 0xE000 − 8836 + pointer. + if (inRange(pointer, 8836, 10715)) + return 0xE000 - 8836 + pointer; + + // 5. Let code point be null, if pointer is null, and the + // index code point for pointer in index jis0208 otherwise. + var code_point = (pointer === null) ? null : + indexCodePointFor(pointer, index('jis0208')); + + // 6. If code point is null and byte is an ASCII byte, prepend + // byte to stream. + if (code_point === null && isASCIIByte(bite)) + stream.prepend(bite); + + // 7. If code point is null, return error. + if (code_point === null) + return decoderError(fatal); + + // 8. Return a code point whose value is code point. + return code_point; + } + + // 4. If byte is an ASCII byte or 0x80, return a code point + // whose value is byte. + if (isASCIIByte(bite) || bite === 0x80) + return bite; + + // 5. If byte is in the range 0xA1 to 0xDF, inclusive, return a + // code point whose value is 0xFF61 − 0xA1 + byte. + if (inRange(bite, 0xA1, 0xDF)) + return 0xFF61 - 0xA1 + bite; + + // 6. If byte is in the range 0x81 to 0x9F, inclusive, or 0xE0 + // to 0xFC, inclusive, set Shift_JIS lead to byte and return + // continue. + if (inRange(bite, 0x81, 0x9F) || inRange(bite, 0xE0, 0xFC)) { + Shift_JIS_lead = bite; + return null; + } + + // 7. Return error. + return decoderError(fatal); + }; + } + + // 13.3.2 Shift_JIS encoder + /** + * @constructor + * @implements {Encoder} + * @param {{fatal: boolean}} options + */ + function ShiftJISEncoder(options) { + var fatal = options.fatal; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is an ASCII code point or U+0080, return a + // byte whose value is code point. + if (isASCIICodePoint(code_point) || code_point === 0x0080) + return code_point; + + // 3. If code point is U+00A5, return byte 0x5C. + if (code_point === 0x00A5) + return 0x5C; + + // 4. If code point is U+203E, return byte 0x7E. + if (code_point === 0x203E) + return 0x7E; + + // 5. If code point is in the range U+FF61 to U+FF9F, inclusive, + // return a byte whose value is code point − 0xFF61 + 0xA1. + if (inRange(code_point, 0xFF61, 0xFF9F)) + return code_point - 0xFF61 + 0xA1; + + // 6. If code point is U+2212, set it to U+FF0D. + if (code_point === 0x2212) + code_point = 0xFF0D; + + // 7. Let pointer be the index Shift_JIS pointer for code point. + var pointer = indexShiftJISPointerFor(code_point); + + // 8. If pointer is null, return error with code point. + if (pointer === null) + return encoderError(code_point); + + // 9. Let lead be floor(pointer / 188). + var lead = floor(pointer / 188); + + // 10. Let lead offset be 0x81, if lead is less than 0x1F, and + // 0xC1 otherwise. + var lead_offset = (lead < 0x1F) ? 0x81 : 0xC1; + + // 11. Let trail be pointer % 188. + var trail = pointer % 188; + + // 12. Let offset be 0x40, if trail is less than 0x3F, and 0x41 + // otherwise. + var offset = (trail < 0x3F) ? 0x40 : 0x41; + + // 13. Return two bytes whose values are lead + lead offset and + // trail + offset. + return [lead + lead_offset, trail + offset]; + }; + } + + /** @param {{fatal: boolean}} options */ + encoders['Shift_JIS'] = function(options) { + return new ShiftJISEncoder(options); + }; + /** @param {{fatal: boolean}} options */ + decoders['Shift_JIS'] = function(options) { + return new ShiftJISDecoder(options); + }; + + // + // 14. Legacy multi-byte Korean encodings + // + + // 14.1 euc-kr + + // 14.1.1 euc-kr decoder + /** + * @constructor + * @implements {Decoder} + * @param {{fatal: boolean}} options + */ + function EUCKRDecoder(options) { + var fatal = options.fatal; + + // euc-kr's decoder has an associated euc-kr lead (initially 0x00). + var /** @type {number} */ euckr_lead = 0x00; + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream and euc-kr lead is not 0x00, set + // euc-kr lead to 0x00 and return error. + if (bite === end_of_stream && euckr_lead !== 0) { + euckr_lead = 0x00; + return decoderError(fatal); + } + + // 2. If byte is end-of-stream and euc-kr lead is 0x00, return + // finished. + if (bite === end_of_stream && euckr_lead === 0) + return finished; + + // 3. If euc-kr lead is not 0x00, let lead be euc-kr lead, let + // pointer be null, set euc-kr lead to 0x00, and then run these + // substeps: + if (euckr_lead !== 0x00) { + var lead = euckr_lead; + var pointer = null; + euckr_lead = 0x00; + + // 1. If byte is in the range 0x41 to 0xFE, inclusive, set + // pointer to (lead − 0x81) × 190 + (byte − 0x41). + if (inRange(bite, 0x41, 0xFE)) + pointer = (lead - 0x81) * 190 + (bite - 0x41); + + // 2. Let code point be null, if pointer is null, and the + // index code point for pointer in index euc-kr otherwise. + var code_point = (pointer === null) + ? null : indexCodePointFor(pointer, index('euc-kr')); + + // 3. If code point is null and byte is an ASCII byte, prepend + // byte to stream. + if (pointer === null && isASCIIByte(bite)) + stream.prepend(bite); + + // 4. If code point is null, return error. + if (code_point === null) + return decoderError(fatal); + + // 5. Return a code point whose value is code point. + return code_point; + } + + // 4. If byte is an ASCII byte, return a code point whose value + // is byte. + if (isASCIIByte(bite)) + return bite; + + // 5. If byte is in the range 0x81 to 0xFE, inclusive, set + // euc-kr lead to byte and return continue. + if (inRange(bite, 0x81, 0xFE)) { + euckr_lead = bite; + return null; + } + + // 6. Return error. + return decoderError(fatal); + }; + } + + // 14.1.2 euc-kr encoder + /** + * @constructor + * @implements {Encoder} + * @param {{fatal: boolean}} options + */ + function EUCKREncoder(options) { + var fatal = options.fatal; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is an ASCII code point, return a byte whose + // value is code point. + if (isASCIICodePoint(code_point)) + return code_point; + + // 3. Let pointer be the index pointer for code point in index + // euc-kr. + var pointer = indexPointerFor(code_point, index('euc-kr')); + + // 4. If pointer is null, return error with code point. + if (pointer === null) + return encoderError(code_point); + + // 5. Let lead be floor(pointer / 190) + 0x81. + var lead = floor(pointer / 190) + 0x81; + + // 6. Let trail be pointer % 190 + 0x41. + var trail = (pointer % 190) + 0x41; + + // 7. Return two bytes whose values are lead and trail. + return [lead, trail]; + }; + } + + /** @param {{fatal: boolean}} options */ + encoders['EUC-KR'] = function(options) { + return new EUCKREncoder(options); + }; + /** @param {{fatal: boolean}} options */ + decoders['EUC-KR'] = function(options) { + return new EUCKRDecoder(options); + }; + + + // + // 15. Legacy miscellaneous encodings + // + + // 15.1 replacement + + // Not needed - API throws RangeError + + // 15.2 Common infrastructure for utf-16be and utf-16le + + /** + * @param {number} code_unit + * @param {boolean} utf16be + * @return {!Array.} bytes + */ + function convertCodeUnitToBytes(code_unit, utf16be) { + // 1. Let byte1 be code unit >> 8. + var byte1 = code_unit >> 8; + + // 2. Let byte2 be code unit & 0x00FF. + var byte2 = code_unit & 0x00FF; + + // 3. Then return the bytes in order: + // utf-16be flag is set: byte1, then byte2. + if (utf16be) + return [byte1, byte2]; + // utf-16be flag is unset: byte2, then byte1. + return [byte2, byte1]; + } + + // 15.2.1 shared utf-16 decoder + /** + * @constructor + * @implements {Decoder} + * @param {boolean} utf16_be True if big-endian, false if little-endian. + * @param {{fatal: boolean}} options + */ + function UTF16Decoder(utf16_be, options) { + var fatal = options.fatal; + var /** @type {?number} */ utf16_lead_byte = null, + /** @type {?number} */ utf16_lead_surrogate = null; + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream and either utf-16 lead byte or + // utf-16 lead surrogate is not null, set utf-16 lead byte and + // utf-16 lead surrogate to null, and return error. + if (bite === end_of_stream && (utf16_lead_byte !== null || + utf16_lead_surrogate !== null)) { + return decoderError(fatal); + } + + // 2. If byte is end-of-stream and utf-16 lead byte and utf-16 + // lead surrogate are null, return finished. + if (bite === end_of_stream && utf16_lead_byte === null && + utf16_lead_surrogate === null) { + return finished; + } + + // 3. If utf-16 lead byte is null, set utf-16 lead byte to byte + // and return continue. + if (utf16_lead_byte === null) { + utf16_lead_byte = bite; + return null; + } + + // 4. Let code unit be the result of: + var code_unit; + if (utf16_be) { + // utf-16be decoder flag is set + // (utf-16 lead byte << 8) + byte. + code_unit = (utf16_lead_byte << 8) + bite; + } else { + // utf-16be decoder flag is unset + // (byte << 8) + utf-16 lead byte. + code_unit = (bite << 8) + utf16_lead_byte; + } + // Then set utf-16 lead byte to null. + utf16_lead_byte = null; + + // 5. If utf-16 lead surrogate is not null, let lead surrogate + // be utf-16 lead surrogate, set utf-16 lead surrogate to null, + // and then run these substeps: + if (utf16_lead_surrogate !== null) { + var lead_surrogate = utf16_lead_surrogate; + utf16_lead_surrogate = null; + + // 1. If code unit is in the range U+DC00 to U+DFFF, + // inclusive, return a code point whose value is 0x10000 + + // ((lead surrogate − 0xD800) << 10) + (code unit − 0xDC00). + if (inRange(code_unit, 0xDC00, 0xDFFF)) { + return 0x10000 + (lead_surrogate - 0xD800) * 0x400 + + (code_unit - 0xDC00); + } + + // 2. Prepend the sequence resulting of converting code unit + // to bytes using utf-16be decoder flag to stream and return + // error. + stream.prepend(convertCodeUnitToBytes(code_unit, utf16_be)); + return decoderError(fatal); + } + + // 6. If code unit is in the range U+D800 to U+DBFF, inclusive, + // set utf-16 lead surrogate to code unit and return continue. + if (inRange(code_unit, 0xD800, 0xDBFF)) { + utf16_lead_surrogate = code_unit; + return null; + } + + // 7. If code unit is in the range U+DC00 to U+DFFF, inclusive, + // return error. + if (inRange(code_unit, 0xDC00, 0xDFFF)) + return decoderError(fatal); + + // 8. Return code point code unit. + return code_unit; + }; + } + + // 15.2.2 shared utf-16 encoder + /** + * @constructor + * @implements {Encoder} + * @param {boolean} utf16_be True if big-endian, false if little-endian. + * @param {{fatal: boolean}} options + */ + function UTF16Encoder(utf16_be, options) { + var fatal = options.fatal; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1. If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is in the range U+0000 to U+FFFF, inclusive, + // return the sequence resulting of converting code point to + // bytes using utf-16be encoder flag. + if (inRange(code_point, 0x0000, 0xFFFF)) + return convertCodeUnitToBytes(code_point, utf16_be); + + // 3. Let lead be ((code point − 0x10000) >> 10) + 0xD800, + // converted to bytes using utf-16be encoder flag. + var lead = convertCodeUnitToBytes( + ((code_point - 0x10000) >> 10) + 0xD800, utf16_be); + + // 4. Let trail be ((code point − 0x10000) & 0x3FF) + 0xDC00, + // converted to bytes using utf-16be encoder flag. + var trail = convertCodeUnitToBytes( + ((code_point - 0x10000) & 0x3FF) + 0xDC00, utf16_be); + + // 5. Return a byte sequence of lead followed by trail. + return lead.concat(trail); + }; + } + + // 15.3 utf-16be + // 15.3.1 utf-16be decoder + /** @param {{fatal: boolean}} options */ + encoders['UTF-16BE'] = function(options) { + return new UTF16Encoder(true, options); + }; + // 15.3.2 utf-16be encoder + /** @param {{fatal: boolean}} options */ + decoders['UTF-16BE'] = function(options) { + return new UTF16Decoder(true, options); + }; + + // 15.4 utf-16le + // 15.4.1 utf-16le decoder + /** @param {{fatal: boolean}} options */ + encoders['UTF-16LE'] = function(options) { + return new UTF16Encoder(false, options); + }; + // 15.4.2 utf-16le encoder + /** @param {{fatal: boolean}} options */ + decoders['UTF-16LE'] = function(options) { + return new UTF16Decoder(false, options); + }; + + // 15.5 x-user-defined + + // 15.5.1 x-user-defined decoder + /** + * @constructor + * @implements {Decoder} + * @param {{fatal: boolean}} options + */ + function XUserDefinedDecoder(options) { + var fatal = options.fatal; + /** + * @param {Stream} stream The stream of bytes being decoded. + * @param {number} bite The next byte read from the stream. + * @return {?(number|!Array.)} The next code point(s) + * decoded, or null if not enough data exists in the input + * stream to decode a complete code point. + */ + this.handler = function(stream, bite) { + // 1. If byte is end-of-stream, return finished. + if (bite === end_of_stream) + return finished; + + // 2. If byte is an ASCII byte, return a code point whose value + // is byte. + if (isASCIIByte(bite)) + return bite; + + // 3. Return a code point whose value is 0xF780 + byte − 0x80. + return 0xF780 + bite - 0x80; + }; + } + + // 15.5.2 x-user-defined encoder + /** + * @constructor + * @implements {Encoder} + * @param {{fatal: boolean}} options + */ + function XUserDefinedEncoder(options) { + var fatal = options.fatal; + /** + * @param {Stream} stream Input stream. + * @param {number} code_point Next code point read from the stream. + * @return {(number|!Array.)} Byte(s) to emit. + */ + this.handler = function(stream, code_point) { + // 1.If code point is end-of-stream, return finished. + if (code_point === end_of_stream) + return finished; + + // 2. If code point is an ASCII code point, return a byte whose + // value is code point. + if (isASCIICodePoint(code_point)) + return code_point; + + // 3. If code point is in the range U+F780 to U+F7FF, inclusive, + // return a byte whose value is code point − 0xF780 + 0x80. + if (inRange(code_point, 0xF780, 0xF7FF)) + return code_point - 0xF780 + 0x80; + + // 4. Return error with code point. + return encoderError(code_point); + }; + } + + /** @param {{fatal: boolean}} options */ + encoders['x-user-defined'] = function(options) { + return new XUserDefinedEncoder(options); + }; + /** @param {{fatal: boolean}} options */ + decoders['x-user-defined'] = function(options) { + return new XUserDefinedDecoder(options); + }; + + if (!global['TextEncoder']) + global['TextEncoder'] = TextEncoder; + if (!global['TextDecoder']) + global['TextDecoder'] = TextDecoder; + + if ( true && module.exports) { + module.exports = { + TextEncoder: global['TextEncoder'], + TextDecoder: global['TextDecoder'], + EncodingIndexes: global["encoding-indexes"] + }; + } + +// For strict environments where `this` inside the global scope +// is `undefined`, take a pure object instead +}(this || {})); + +/***/ }), + +/***/ "./src/lib/localizedlabels/FontUtil.ts": +/*!*********************************************!*\ + !*** ./src/lib/localizedlabels/FontUtil.ts ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ InlineFormats: () => (/* binding */ InlineFormats), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + 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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var InlineFormats; +(function (InlineFormats) { + InlineFormats[InlineFormats["bold"] = 0] = "bold"; + InlineFormats[InlineFormats["italic"] = 1] = "italic"; + InlineFormats[InlineFormats["boldItalic"] = 2] = "boldItalic"; + InlineFormats[InlineFormats["regular"] = 3] = "regular"; +})(InlineFormats || (InlineFormats = {})); +class FontHelper { + static initialize() { + return __awaiter(this, void 0, void 0, function* () { + this.availableFonts = yield figma.listAvailableFontsAsync(); + }); + } + static getSupportedInlineFormats(fontName) { + const supportedFormats = []; + const font = FontHelper.getStylingSupport(fontName); + if (font.bold) { + supportedFormats.push(InlineFormats.bold); + } + if (font.italic) { + supportedFormats.push(InlineFormats.italic); + } + if (font.boldItalic) { + supportedFormats.push(InlineFormats.boldItalic); + } + if (font.regular) { + supportedFormats.push(InlineFormats.regular); + } + return font; + } + static getStylingSupport(fontName) { + if (this.availableFonts === undefined) { + throw new Error('Fonthelper not yet initialized'); + } + const fontFamilyVariants = this.availableFonts.filter((font) => font.fontName.family === fontName.family).map((font) => font.fontName); + const font = { + variants: {}, + regular: undefined, + bold: undefined, + italic: undefined, + boldItalic: undefined, + }; + // restruction into font.variants->style->font + for (const fontFamilyVariant of fontFamilyVariants) { + font.variants[fontFamilyVariant.style] = fontFamilyVariant; + } + if (Object.keys(font.variants).length === 1) { + font.regular = font.variants[Object.keys(font.variants)[0]]; + // this font doesn't support b/i/bi formatting + return font; + } + const regulaStyle = Object.keys(font.variants).find((variant) => variant.toLowerCase() === 'regular'); + if (regulaStyle) { + font.regular = font.variants[regulaStyle]; + } + const boldStyle = Object.keys(font.variants).find((variant) => variant.toLowerCase() === 'bold'); + if (boldStyle) { + font.bold = font.variants[boldStyle]; + } + const italicStyle = Object.keys(font.variants).find((variant) => variant.toLowerCase() === 'italic'); + if (italicStyle) { + font.italic = font.variants[italicStyle]; + } + let boldItalicStyle = Object.keys(font.variants).find((variant) => variant.toLowerCase() === 'bold italic'); + if (boldItalicStyle) { + font.boldItalic = font.variants[boldItalicStyle]; + } + boldItalicStyle = Object.keys(font.variants).find((variant) => variant.toLowerCase() === 'bolditalic'); + if (boldItalicStyle) { + font.boldItalic = font.variants[boldItalicStyle]; + } + // try to get regular by excluding other variants as options + if (!font.regular) { + const regularCandidates = Object.keys(font.variants).filter((variantStyle) => { + const variantNameLower = variantStyle.toLowerCase(); + const variant = font.variants[variantStyle]; + // used by bold already + if (font.bold === variant) { + return false; + } + // used by italic already + if (font.italic === variant) { + return false; + } + // used by BoldItalic already + if (font.boldItalic === variant) { + return false; + } + // exclude variants + if (variantNameLower.indexOf('italic') === -1 + && variantNameLower.indexOf('bold') === -1) { + return true; + } + // regular didn't exist - allow fall back to medium + if (variantNameLower === 'medium') { + return true; + } + return false; + }); + if (regularCandidates.length === 1) { + // ok we have one option for regular by exultion of bold italic etc + font.regular = font.variants[regularCandidates[0]]; + } + else if (regularCandidates.length > 1) { + // multipler candidates found - prioritize medium + const mediumVariant = regularCandidates.find((variantStyle) => { + const variantNameLower = variantStyle.toLowerCase(); + if (variantNameLower === 'medium') { + return true; + } + }); + if (mediumVariant) { + // console.log('using medium variant') + font.regular = font.variants[mediumVariant]; + } + } + else { + // no regular variant found by exclusion for + } + } + return font; + } +} +FontHelper.stylingSupportCache = {}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FontHelper); + + +/***/ }), + +/***/ "./src/lib/localizedlabels/LocalizedLabelManager.ts": +/*!**********************************************************!*\ + !*** ./src/lib/localizedlabels/LocalizedLabelManager.ts ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ MARKER_CHARACTER: () => (/* binding */ MARKER_CHARACTER), +/* harmony export */ "default": () => (/* binding */ LocalizedLabelManager) +/* harmony export */ }); +/* harmony import */ var _VirtualTree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VirtualTree */ "./src/lib/localizedlabels/VirtualTree.ts"); +/* harmony import */ var _lint_TextNodeLinter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lint/TextNodeLinter */ "./src/lib/localizedlabels/lint/TextNodeLinter.ts"); +/* harmony import */ var _FontUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FontUtil */ "./src/lib/localizedlabels/FontUtil.ts"); +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + 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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; + + + +const MARKER_CHARACTER = '​'; +// export const MARKER_CHARACTER = 'X​'; +class LocalizedLabelManager { + refreshLabelMessageLinkCache(textNodeId, messageId) { + const currentKey = this.labelToMessage[textNodeId]; + if (messageId === undefined || messageId === '') { + if (currentKey) { + this.messageStore.messageIdToLabels[currentKey].delete(textNodeId); + return currentKey; + } + return undefined; + } + if (!this.messageStore.messageIdToLabels[messageId]) { + this.messageStore.messageIdToLabels[messageId] = new Set(); + } + if (this.messageStore.messageIdToLabels[messageId].has(textNodeId)) { + return undefined; + } + this.messageStore.messageIdToLabels[messageId].add(textNodeId); + this.labelToMessage[textNodeId] = messageId; + if (currentKey) { + if (currentKey !== messageId) { + this.messageStore.messageIdToLabels[currentKey].delete(textNodeId); + } + return currentKey; + } + return undefined; + } + constructor(messageStore) { + this.containerSizeThreashold = 3000; + this.proxyClassName = 'LocalizedLabelManager'; + this.samplesPrefix = 'sample_values'; + this.linkStyleDataKey = 'linkstyle'; + this.separator = '__'; + this.variantPatternHTMLHashDataKey = 'fth'; + this.sampleValuesDataKey = 'sv'; + this.anonymMessageDataKey = 'am'; + this.fillinsToPlaceholderKey = 'fitp'; + // TODO #14 migration - old fillin format? public fillinsKey = 'fi'; + this.parameterValuesKey = 'pv'; + this.languageDataKey = 'l'; + this.messageLinkStateDataKey = 'mt'; + this.messageUnmanagedKey = 'mum'; + this.messageVersionDataKey = 'mv'; + this.messagePluralDataKey = 'mp'; + this.messageGenderDataKey = 'mg'; + this.messageIdDataKey = 'mi'; + this.messageNamePrefixKey = 'mn_'; + // hash that allows detection of autorename + this.autoRenameHashKey = 'arh'; + this.labelIdDataKey = 'olid'; // we store the orginal label id (the id of the node when the plugin changed properties the first time) to detect a copy + this.virtualTree = new _VirtualTree__WEBPACK_IMPORTED_MODULE_0__["default"](); + this.labelToMessage = {}; + this.labelUpdateQueue = {}; + this.helperDomain = 'https://relativeUrl'; + this.textSegmentFields = [ + 'fontSize', + 'fontName', + 'fontWeight', + 'textDecoration', + 'textCase', + 'lineHeight', + 'letterSpacing', + 'fills', + 'textStyleId', + 'fillStyleId', + 'listOptions', + 'indentation', + 'hyperlink', + ]; + this.supportedInlineFields = [ + 'textDecoration', 'hyperlink', 'fontName', // 'listOptions', 'indentation', + ]; + if (!messageStore) { + return; + } + this.messageStore = messageStore; + figma.on('documentchange', this.forwardDocumentChanges.bind(this)); + const selectedNodeStateByUser = {}; + const that = this; + setInterval(() => { + var _a, _b; + const changeEvent = { + documentChanges: [], + }; + // for (const user of [figma.currentUser]) { // NOTE: activeUsers is only available in figJam :/ + // if (user?.id && user?.selection.length === 1) { + if (figma.currentPage.selection.length === 1) { + const activeNode = figma.currentPage.selection[0]; // figma.getNodeById(user.selection[0]); + const user = { id: 'singleUser' }; + const currentState = { + nodeId: '', + textSegments: [], + }; + if (activeNode !== undefined && (activeNode === null || activeNode === void 0 ? void 0 : activeNode.type) === 'TEXT') { + currentState.nodeId = activeNode === null || activeNode === void 0 ? void 0 : activeNode.id; + const unpropagatedTextSegments = activeNode.getStyledTextSegments(['indentation', 'listOptions']); + for (const textSegment of unpropagatedTextSegments) { + currentState.textSegments.push({ + indentation: textSegment.indentation, + listOptions: textSegment.listOptions, + }); + } + if (!selectedNodeStateByUser[user.id] || selectedNodeStateByUser[user.id].nodeId !== currentState.nodeId) { + selectedNodeStateByUser[user.id] = currentState; + console.log('no change'); + } + else if (selectedNodeStateByUser[user.id].textSegments.length !== currentState.textSegments.length) { + // TODO change detected + selectedNodeStateByUser[user.id] = currentState; + changeEvent.documentChanges.push({ + id: activeNode.id, + origin: ((_a = figma.currentUser) === null || _a === void 0 ? void 0 : _a.id) === user.id ? 'LOCAL' : 'REMOTE', + type: 'PROPERTY_CHANGE', + properties: ['listOptions'], + node: activeNode, + }); + } + else { + // eslint-disable-next-line no-restricted-syntax, no-labels + checkStateLoop: + // eslint-disable-next-line no-plusplus + for (let i = 0; i < currentState.textSegments.length; i++) { + if (selectedNodeStateByUser[user.id].textSegments[i].indentation !== currentState.textSegments[i].indentation + || selectedNodeStateByUser[user.id].textSegments[i].listOptions.type !== currentState.textSegments[i].listOptions.type) { + // TODO indentation change detected + selectedNodeStateByUser[user.id] = currentState; + changeEvent.documentChanges.push({ + id: activeNode.id, + origin: ((_b = figma.currentUser) === null || _b === void 0 ? void 0 : _b.id) === user.id ? 'LOCAL' : 'REMOTE', + type: 'PROPERTY_CHANGE', + properties: ['listOptions'], + node: activeNode, + }); + // eslint-disable-next-line no-labels, no-extra-label + break checkStateLoop; + } + } + } + } + else { + // node has changed no need to keep the old ones state in memory + delete selectedNodeStateByUser[user.id]; + } + } + // } + if (changeEvent.documentChanges.length > 0) { + console.log('emulating event'); + that.forwardDocumentChanges(changeEvent); + } + }, 100); + } + forwardDocumentChanges(event) { + const deletedIds = new Set(); + const changedLabels = []; + const createdLabels = []; + const keysChanged = new Set(); + for (const change of event.documentChanges) { + // eslint-disable-next-line default-case + switch (change.type) { + case 'CREATE': { + if (change.node.removed) { + // we skip changes of removed nodes + break; + } + const createdNode = figma.getNodeById(change.id); + if (createdNode.type === 'TEXT') { + const localizedLabel = this.toLocalizedLabelOrUndefined(createdNode); + if (localizedLabel) { + this.virtualTree.addNode(createdNode, createdNode.id); + if (localizedLabel.messageId) { + const previousKey = this.refreshLabelMessageLinkCache(localizedLabel.nodeId, localizedLabel.messageId); + if (previousKey !== localizedLabel.messageId) { + if (previousKey) { + keysChanged.add(previousKey); + } + keysChanged.add(localizedLabel.messageId); + } + } + else { + const previousKey = this.refreshLabelMessageLinkCache(localizedLabel.nodeId, undefined); + if (previousKey) { + keysChanged.add(previousKey); + } + } + createdLabels.push(localizedLabel); + } + } + else if (createdNode.children) { + // console.log(`Node created - with children ${change.id}`); + const skipInvisibleInstanceChildrenBefore = figma.skipInvisibleInstanceChildren; + figma.skipInvisibleInstanceChildren = true; + const createdTextNodes = createdNode.findAllWithCriteria({ types: ['TEXT'] }); + for (const createdTextNode of createdTextNodes) { + const localizedLabel = this.toLocalizedLabelOrUndefined(createdTextNode); + if (localizedLabel) { + this.virtualTree.addNode(createdNode, createdNode.id); + if (localizedLabel.messageId) { + const previousKey = this.refreshLabelMessageLinkCache(localizedLabel.nodeId, localizedLabel.messageId); + if (previousKey !== localizedLabel.messageId) { + if (previousKey) { + keysChanged.add(previousKey); + } + keysChanged.add(localizedLabel.messageId); + } + } + else { + const previousKey = this.refreshLabelMessageLinkCache(localizedLabel.nodeId, undefined); + if (previousKey) { + keysChanged.add(previousKey); + } + } + createdLabels.push(localizedLabel); + // lokalizedLabel.parentIds.forEach((parentId) => frameData.refreshTriggerIds.add(parentId)); + } + } + figma.skipInvisibleInstanceChildren = skipInvisibleInstanceChildrenBefore; + } + break; + } + case 'DELETE': { + // in case of a deletion we propagate the deleted node id - we don't have more information + // about this node from figma :-/ The ui layer will know what this change affects + const deletedLeafs = this.virtualTree.removeBranch(change.id).filter((node) => node.cacheRelevant); + deletedLeafs.forEach((node) => { + this.refreshLabelMessageLinkCache(node.id, undefined); + deletedIds.add(node.id); + }); + // console.log(`Node deleted ${change.id} leafs: ${JSON.stringify(deletedIds)}`); + break; + } + case 'PROPERTY_CHANGE': { + if (change.node.removed) { + // we skip changes of removed nodes + break; + } + const changedNode = figma.getNodeById(change.id); + if ((changedNode === null || changedNode === void 0 ? void 0 : changedNode.type) === 'DOCUMENT') { + break; + } + if ((changedNode === null || changedNode === void 0 ? void 0 : changedNode.type) === 'PAGE') { + break; + } + if ((changedNode === null || changedNode === void 0 ? void 0 : changedNode.type) === 'TEXT') { + // console.log(`Node changed - text ${changedNode.id}`); + if (!this.virtualTree.hasNode(changedNode.id)) { + // console.log(`Node changed - text ${changedNode.id} added to vt`); + this.virtualTree.addNode(changedNode, changedNode.id); + } + else if (change.properties.includes('parent')) { + // console.log(`Node changed - text ${changedNode.id} moved...`); + this.virtualTree.moveNode(changedNode.id, changedNode.parent); + } + const localizedLabel = this.toLocalizedLabelOrUndefined(changedNode); + if (localizedLabel) { + if (localizedLabel.messageId) { + const previousKey = this.refreshLabelMessageLinkCache(localizedLabel.nodeId, localizedLabel.messageId); + if (previousKey !== localizedLabel.messageId) { + if (previousKey) { + keysChanged.add(previousKey); + } + keysChanged.add(localizedLabel.messageId); + } + } + else { + const previousKey = this.refreshLabelMessageLinkCache(localizedLabel.nodeId, undefined); + if (previousKey) { + keysChanged.add(previousKey); + } + } + changedLabels.push(localizedLabel); + } + } + else if (changedNode.children) { + let changedVirtualNodes = []; + if (change.properties.includes('parent')) { + changedVirtualNodes = this.virtualTree.moveNode(changedNode.id, changedNode.parent); + // console.log(`Node changed - parent ${change.id} moved in vt affacted: ${JSON.stringify(changedVirtualNodes.length)}`); + } + else if (change.properties.includes('name') || change.properties.includes('pluginData')) { + // if the name changed we have to update all childs since naming changes the key abrivation + changedVirtualNodes = this.virtualTree.getAllNodesInBranchByRootId(changedNode.id); + // console.log(`Node changed - ${change.id} name in vt affacted: ${JSON.stringify(changedVirtualNodes.length)}`); + } + // eslint-disable-next-line @typescript-eslint/no-loop-func + changedVirtualNodes.forEach((changedVNode) => { + if (changedVNode.cacheRelevant) { + const movedFigmaNode = figma.getNodeById(changedVNode.id); + if (movedFigmaNode && movedFigmaNode.type === 'TEXT') { + const localizedLabel = this.toLocalizedLabelOrUndefined(movedFigmaNode); + if (localizedLabel) { + if (localizedLabel.messageId) { + const previousKey = this.refreshLabelMessageLinkCache(localizedLabel.nodeId, localizedLabel.messageId); + if (previousKey !== localizedLabel.messageId) { + if (previousKey) { + keysChanged.add(previousKey); + } + keysChanged.add(localizedLabel.messageId); + } + } + else { + const previousKey = this.refreshLabelMessageLinkCache(localizedLabel.nodeId, undefined); + if (previousKey) { + keysChanged.add(previousKey); + } + } + changedLabels.push(localizedLabel); + // lokalizedLabel.parentIds.forEach((parentId) => frameData.refreshTriggerIds.add(parentId)); + } + } + } + }); + } + break; + } + case 'STYLE_CREATE': + case 'STYLE_DELETE': + case 'STYLE_PROPERTY_CHANGE': + break; + } + } + const message = { + target: 'LocalizedLabelManager', + type: 'cacheUpdate', + deletedNodeIds: [...deletedIds], + changedLabels: changedLabels.filter((node) => !createdLabels.some((createdNode) => createdNode.nodeId === node.nodeId)), + createdLabels, + changedKeys: [...keysChanged], + }; + // console.log('keys changed'); + // console.log(keysChanged); + figma.ui.postMessage(message); + } + prepare() { + return __awaiter(this, void 0, void 0, function* () { + yield _FontUtil__WEBPACK_IMPORTED_MODULE_2__["default"].initialize(); + }); + } + startFillupCache() { + return __awaiter(this, void 0, void 0, function* () { + // we start the async process here - this will load frame by frame and intercept each load with a tick + this.fillUpCache().catch((e) => console.log(e)); + }); + } + fillUpCache() { + return __awaiter(this, void 0, void 0, function* () { + let start = Date.now(); + const containers = []; + let textNodesToPrcoess = []; + console.log(`fillUpCache - enter ${Date.now() - start}`); + yield new Promise((resolve) => setTimeout(resolve, 2)); + const pages = figma.root.children; + for (const page of pages) { + // console.log('fillUpCache - page...' + page.name); + for (const pageChild of page.children) { + // console.log('fillUpCache - pageChilde...' + pageChild.name); + if (pageChild.type === 'TEXT') { + textNodesToPrcoess.push(pageChild); + } + else if (pageChild.type === 'COMPONENT' + || pageChild.type === 'COMPONENT_SET' + || pageChild.type === 'INSTANCE') { + // we add it as container to collect + containers.push(pageChild); + } + else if (pageChild.type === 'SECTION' + || pageChild.type === 'GROUP' + || pageChild.type === 'FRAME') { + if (pageChild.width < this.containerSizeThreashold) { + containers.push(pageChild); + } + else { + for (const sectionChild of pageChild.children) { + // console.log('fillUpCache - sectionChild...' + sectionChild.name); + if (sectionChild.type === 'TEXT') { + textNodesToPrcoess.push(sectionChild); + } + else if (sectionChild.type === 'COMPONENT' + || sectionChild.type === 'COMPONENT_SET' + || sectionChild.type === 'FRAME' + || sectionChild.type === 'GROUP' + || sectionChild.type === 'SECTION' + || sectionChild.type === 'INSTANCE') { + // we add it as container to collect + containers.push(sectionChild); + } + } + } + } + } + } + console.log(`fillUpCache - containers ${containers.length} collected ${Date.now() - start}`); + yield new Promise((resolve) => setTimeout(resolve, 2)); + let lastInterception = Date.now(); + const outerStart = Date.now(); + const skipInvisibleInstanceChildrenBefore = figma.skipInvisibleInstanceChildren; + figma.skipInvisibleInstanceChildren = true; + // collect missing textNodesToProcess + for (const container of containers) { + start = Date.now(); + // find all textNodes in the container + // const foundtextNodes = container.findAllWithCriteria({ types: ['TEXT'] }); + const foundtextNodes = container.findAll().filter((node) => node.type === 'TEXT'); + if (foundtextNodes.filter((node) => node.id.indexOf(';') !== -1).length > 0) { + // debugger; + } + textNodesToPrcoess = textNodesToPrcoess.concat(foundtextNodes); + const blockedExecutionTime = Date.now() - lastInterception; + if (blockedExecutionTime > 30) { + // console.log(`fillUpCache - ${container.name} textNodes ${foundtextNodes.length} collected ${Date.now() - start}`); + // console.log(`fillUpCache - break because of blockage of ${blockedExecutionTime}`); + lastInterception = Date.now(); + // eslint-disable-next-line no-promise-executor-return + // await new Promise((resolve) => setTimeout(resolve, 2)); + } + } + figma.skipInvisibleInstanceChildren = skipInvisibleInstanceChildrenBefore; + console.log(`fillUpCache - collection of textNodes took ${Date.now() - outerStart}`); + const localizedLabels = []; + yield new Promise((resolve) => setTimeout(resolve, 1)); + const innerStart = Date.now(); + const keysLoaded = new Set(); + for (const textNode of textNodesToPrcoess) { + if (this.firstTextnodeInViewport === undefined && textNode.absoluteBoundingBox) { + if (textNode.absoluteBoundingBox.x > figma.viewport.bounds.x + && textNode.absoluteBoundingBox.x < figma.viewport.bounds.x + figma.viewport.bounds.width + && textNode.absoluteBoundingBox.y > figma.viewport.bounds.y + && textNode.absoluteBoundingBox.y < figma.viewport.bounds.y + figma.viewport.bounds.height) { + this.firstTextnodeInViewport = textNode.id; + if (figma.currentPage.selection.length === 0) { + figma.currentPage.selection = [textNode]; + } + } + } + const textNodeId = textNode.id; + this.virtualTree.addNode(textNode, textNodeId); + const messageId = textNode.getPluginData(this.messageIdDataKey); + if (messageId) { + const previousMessage = this.refreshLabelMessageLinkCache(textNodeId, messageId); + if (previousMessage) { + keysLoaded.add(previousMessage); + this.virtualTree.addNode(textNode, textNodeId); + } + keysLoaded.add(messageId); + } + } + console.log(`fillUpCache - creating localizedLabels took ${Date.now() - innerStart}ms for ${localizedLabels.length} labels`); + const message = { + target: 'LocalizedLabelManager', + type: 'linksLoaded', + keys: [...keysLoaded], + }; + // console.log(JSON.stringify(event)); + // console.log(message); + figma.ui.postMessage(message); + }); + } + getSelection() { + return __awaiter(this, void 0, void 0, function* () { + const selectionEnhanced = {}; + for (const selectedNode of figma.currentPage.selection) { + const rootFrame = this.getRootFrame(selectedNode); + if (selectedNode.type === 'TEXT') { + const textNode = this.toLocalizedLabelOrUndefined(selectedNode); + // the node within the selection is a label + selectionEnhanced[selectedNode.id] = { + rootFrameId: rootFrame === null || rootFrame === void 0 ? void 0 : rootFrame.id, + directSelection: true, + isLabel: selectedNode.type === 'TEXT', + selectedNodeId: selectedNode.id, + messageId: textNode === null || textNode === void 0 ? void 0 : textNode.messageId, + }; + } + else { + selectionEnhanced[selectedNode.id] = { + directSelection: true, + isLabel: false, + rootFrameId: rootFrame === null || rootFrame === void 0 ? void 0 : rootFrame.id, + selectedNodeId: selectedNode.id, + messageId: undefined, + }; + const virtualSelectedNode = this.virtualTree.getVirtualNode(selectedNode.id); + if (virtualSelectedNode) { + // eslint-disable-next-line @typescript-eslint/no-loop-func + this.virtualTree.getAllNodesInBranchByRootId(virtualSelectedNode.id).forEach((virtualNode) => { + if (virtualNode.type === 'TEXT' && selectionEnhanced[virtualNode.id] === undefined) { + const textNode = this.toLocalizedLabelOrUndefined(figma.getNodeById(virtualNode.id)); + selectionEnhanced[virtualNode.id] = { + directSelection: false, + isLabel: true, + rootFrameId: rootFrame === null || rootFrame === void 0 ? void 0 : rootFrame.id, + selectedNodeId: virtualNode.id, + messageId: textNode === null || textNode === void 0 ? void 0 : textNode.messageId, + }; + } + }); + } + } + } + return selectionEnhanced; + }); + } + /** + * Walks up the tree and returns the frame closest to the root node + * + * @param node the node to extract the root frame from + * @returns the root frame (The last parent of type frame) + */ + // eslint-disable-next-line class-methods-use-this + getRootFrame(node) { + if (!node.parent) { + throw new Error('given node has no parent'); + } + let parent = node; + let rootFrame; + while (parent) { + const parentType = parent.type; + if ((parentType === 'COMPONENT' + || parentType === 'COMPONENT_SET' + || parentType === 'FRAME' + || parentType === 'GROUP' + || parentType === 'INSTANCE') && parent.width < this.containerSizeThreashold) { + rootFrame = parent; + } + parent = parent.parent; + } + return rootFrame; + } + getById(textNodeId) { + return __awaiter(this, void 0, void 0, function* () { + const textNode = figma.getNodeById(textNodeId); + const lokalizedLabel = this.toLocalizedLabelOrUndefined(textNode); + if (lokalizedLabel) { + if (!this.virtualTree.hasNode(textNode.id)) { + this.virtualTree.addNode(textNode, textNode.id); + } + } + return lokalizedLabel; + }); + } + getWithMessage(messageId) { + return __awaiter(this, void 0, void 0, function* () { + const labels = []; + const linkedNodes = figma.root.findAllWithCriteria({ + pluginData: { + keys: [`${this.messageNamePrefixKey}_${messageId}`], + }, + }); + for (const textNode of linkedNodes) { + const lokalizedLabel = this.toLocalizedLabelOrUndefined(textNode); + if (lokalizedLabel) { + if (!this.virtualTree.hasNode(textNode.id)) { + this.virtualTree.addNode(textNode, textNode.id); + } + labels.push(lokalizedLabel); + } + } + return labels; + }); + } + getFrameById(frameId) { + return __awaiter(this, void 0, void 0, function* () { + const frame = figma.getNodeById(frameId); + return this.getFrame(frame); + }); + } + getFrame(frame) { + return __awaiter(this, void 0, void 0, function* () { + const skipInvisibleInstanceChildrenBefore = figma.skipInvisibleInstanceChildren; + figma.skipInvisibleInstanceChildren = true; + const frameData = { + id: frame.id, + name: frame.name, + localizedLabelsInFrame: [], + }; + const textNodes = frame.findAllWithCriteria({ types: ['TEXT'] }); + for (const textNode of textNodes) { + const lokalizedLabel = this.toLocalizedLabelOrUndefined(textNode); + if (lokalizedLabel) { + if (!this.virtualTree.hasNode(textNode.id)) { + this.virtualTree.addNode(textNode, textNode.id); + } + frameData.localizedLabelsInFrame.push(lokalizedLabel); + // lokalizedLabel.parentIds.forEach((parentId) => frameData.refreshTriggerIds.add(parentId)); + } + } + figma.skipInvisibleInstanceChildren = skipInvisibleInstanceChildrenBefore; + return frameData; + }); + } + setLinkStyle(linkStyle) { + return __awaiter(this, void 0, void 0, function* () { + figma.root.setPluginData(this.linkStyleDataKey, linkStyle); + }); + } + getLinkStyle() { + return __awaiter(this, void 0, void 0, function* () { + const linkStyleRaw = figma.root.getPluginData(this.linkStyleDataKey); + try { + JSON.parse(linkStyleRaw); + return linkStyleRaw; + } + catch (e) { + return ''; + } + }); + } + updateFrameProperties(frameNodeId, properties) { + return __awaiter(this, void 0, void 0, function* () { + const frame = figma.getNodeById(frameNodeId); + if (!frame) { + return; + } + if (properties.language !== undefined) { + frame.setPluginData(this.languageDataKey, properties.language); + } + if (properties.sampleValues !== undefined) { + if (properties.sampleValues) { + frame.setPluginData(this.sampleValuesDataKey, `${true}`); + } + else { + frame.setPluginData(this.sampleValuesDataKey, ''); + } + } + // console.log((new Date()).getTime() + 'execution finished - puting result into message'); + }); + } + updateMessageReference(textNode, messageId) { + for (const dataKey of textNode.getPluginDataKeys()) { + if (dataKey.startsWith(`${this.messageNamePrefixKey}_`)) { + if (messageId === null || dataKey !== `${this.messageNamePrefixKey}_${messageId}`) { + textNode.setPluginData(dataKey, ''); + } + } + } + if (textNode.getPluginData(this.messageIdDataKey) !== messageId) { + textNode.setPluginData(this.messageIdDataKey, ''); + } + } + updateLabelProperties(nodeId, changedProperties) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; + return __awaiter(this, void 0, void 0, function* () { + // setup queue for atomic label update processing + // - if no execution is ongoing hop right in and create a queue + // - if an execution is ongoing await the previous call + if (this.labelUpdateQueue[nodeId]) { + // eslint-disable-next-line no-promise-executor-return + // console.log('queing update'); + yield (new Promise((resolver) => { + // we don't resolve this promise - this is done by the excution of the current function + this.labelUpdateQueue[nodeId].push(resolver); + })); + // console.log('dequied'); + } + else { + // console.log('queing not needed - prepare queue for next call'); + // start a new queue + this.labelUpdateQueue[nodeId] = []; + } + const textNode = figma.getNodeById(nodeId); + try { + if (changedProperties.labelName !== undefined) { + // console.log('setting name'); + textNode.name = changedProperties.labelName; + textNode.autoRename = false; + textNode.setPluginData(this.autoRenameHashKey, ''); + } + if (((_a = changedProperties.messageState) === null || _a === void 0 ? void 0 : _a.type) === 'unset') { + this.updateMessageReference(textNode, null); + textNode.setPluginData(this.parameterValuesKey, ''); + textNode.setPluginData(this.anonymMessageDataKey, ''); + textNode.setPluginData(this.parameterValuesKey, ''); + } + else if (((_b = changedProperties.messageState) === null || _b === void 0 ? void 0 : _b.type) === 'unmanaged') { + this.updateMessageReference(textNode, null); + textNode.setPluginData(this.parameterValuesKey, ''); + textNode.setPluginData(this.messageUnmanagedKey, JSON.stringify(true)); + textNode.setPluginData(this.messageIdDataKey, ''); + textNode.setPluginData(this.anonymMessageDataKey, ''); + } + else if (((_c = changedProperties.messageState) === null || _c === void 0 ? void 0 : _c.type) === 'unlinked') { + this.updateMessageReference(textNode, null); + textNode.setPluginData(this.parameterValuesKey, JSON.stringify(changedProperties.messageState.parameterValues)); + textNode.setPluginData(this.anonymMessageDataKey, JSON.stringify(changedProperties.messageState.unlinkedMessage)); + textNode.setPluginData(this.messageUnmanagedKey, JSON.stringify(false)); + textNode.setPluginData(this.messageIdDataKey, ''); + } + else if (((_d = changedProperties.messageState) === null || _d === void 0 ? void 0 : _d.type) === 'linked') { + this.updateMessageReference(textNode, changedProperties.messageState.messageId); + textNode.setPluginData(this.parameterValuesKey, JSON.stringify(changedProperties.messageState.parameterValues)); + textNode.setPluginData(this.messageUnmanagedKey, JSON.stringify(false)); + textNode.setPluginData(this.messageIdDataKey, changedProperties.messageState.messageId); + textNode.setPluginData(this.anonymMessageDataKey, ''); + textNode.setPluginData(`${this.messageNamePrefixKey}_${changedProperties.messageState.messageId}`, changedProperties.messageState.messageId); + } + if (changedProperties.messageVersion !== undefined) { + textNode.setPluginData(this.messageVersionDataKey, `${changedProperties.messageVersion}`); + } + // TODO #18 selectors set variables instead + // if (changedProperties.gender !== undefined) { + // textNode.setPluginData(this.messageGenderDataKey, changedProperties.gender ? changedProperties.gender : ''); + // } + // if (changedProperties.plural !== undefined) { + // textNode.setPluginData(this.messagePluralDataKey, changedProperties.plural ? changedProperties.plural : ''); + // } + if (changedProperties.language !== undefined) { + if (changedProperties.language !== ((_e = this.messageStore) === null || _e === void 0 ? void 0 : _e.getConfigSync().refLanguage)) { + if (textNode.autoRename) { + textNode.setPluginData(this.autoRenameHashKey, textNode.characters); + textNode.autoRename = false; + } + } + else if (textNode.getPluginData(this.autoRenameHashKey) === textNode.name) { + textNode.autoRename = true; + } + textNode.setPluginData(this.languageDataKey, changedProperties.language ? changedProperties.language : ''); + } + if (changedProperties.fillinsToPlaceholder !== undefined) { + textNode.setPluginData(this.fillinsToPlaceholderKey, JSON.stringify(changedProperties.fillinsToPlaceholder)); + } + // TODO think about the order - at the moment a lables characters might not get updated after fillins got set + // NOTE: we also send the characters even if only styling has changed + if (changedProperties.characters !== undefined) { + try { + yield this.loadFontsForTextNodes([textNode]); + } + catch (e) { + // rethrow with better error message + e.message = `Can't update label - not all Fonts could get loaded: ${e.message}`; + throw e; + } + // const textWithDecorators = this.toTextRangeObject(changedProperties.translation); + // console.log(`setting characters from ${textNode.characters} to ${changedProperties.characters}`); + // NOTE: when we are here and we have mixed font family we **should** have warned the user already - we go for the first one + // TODO warn user about problematic labels + const textNodeFontFamily = (_f = textNode.fontName.family) !== null && _f !== void 0 ? _f : textNode.getRangeFontName(0, 1).family; + const fonts = yield figma.listAvailableFontsAsync(); + const fontFamilyVariants = fonts.filter((font) => font.fontName.family === textNodeFontFamily).map((font) => font.fontName); + // check what inline style variants we find (bold, italic, bold&italic, regular) + const fontStyleVariants = new Set(); + for (const rangeStyle of changedProperties.ops) { + if (((_g = rangeStyle.attributes) === null || _g === void 0 ? void 0 : _g.italic) && ((_h = rangeStyle.attributes) === null || _h === void 0 ? void 0 : _h.bold)) { + fontStyleVariants.add('bold italic'); + } + else if ((_j = rangeStyle.attributes) === null || _j === void 0 ? void 0 : _j.italic) { + fontStyleVariants.add('italic'); + } + else if ((_k = rangeStyle.attributes) === null || _k === void 0 ? void 0 : _k.bold) { + fontStyleVariants.add('bold'); + } + else { + fontStyleVariants.add('regular'); + } + } + // TODO check style segments when creating localized labels and warn for incompatibility + // TODO also check for available fonts when creating the labels to disable bold/italic options for those labels that don't support it + // TODO only load thos font variants that are needed and fail if one tries to apply them + // find font names for style variants + let regularFontName; + let boldFontName; + let italicFontName; + let boldItalicFontName; + if (fontStyleVariants.size > 0) { + fontFamilyVariants.forEach((fontFamilyVariant) => { + const styleLowerCase = fontFamilyVariant.style.toLowerCase(); + if (styleLowerCase === 'regular') { + regularFontName = fontFamilyVariant; + } + if (!regularFontName && styleLowerCase === 'medium') { + regularFontName = fontFamilyVariant; + } + if (styleLowerCase === 'bold') { + boldFontName = fontFamilyVariant; + } + if (styleLowerCase === 'italic') { + italicFontName = fontFamilyVariant; + } + if (styleLowerCase.includes('bold italic')) { + boldItalicFontName = fontFamilyVariant; + } + if (!boldItalicFontName && styleLowerCase.includes('italic') && styleLowerCase.includes('bold')) { + boldItalicFontName = fontFamilyVariant; + } + }); + if (fontStyleVariants.has('regular')) { + if (!regularFontName) { + throw new Error(`No regular font variant for ${textNodeFontFamily} found `); + } + try { + yield figma.loadFontAsync(regularFontName); + } + catch (e) { + e.message = `Could not load regular font for ${textNodeFontFamily}: ${e.message}`; + throw e; + } + } + if (fontStyleVariants.has('bold')) { + if (!boldFontName) { + throw new Error(`No bold font variant for ${textNodeFontFamily} found `); + } + try { + yield figma.loadFontAsync(boldFontName); + } + catch (e) { + e.message = `Could not load bold font for ${textNodeFontFamily}: ${e.message}`; + throw e; + } + } + if (fontStyleVariants.has('italic')) { + if (!italicFontName) { + throw new Error(`No italic font variant for ${textNodeFontFamily} found `); + } + try { + yield figma.loadFontAsync(italicFontName); + } + catch (e) { + e.message = `Could not load italic font for ${textNodeFontFamily}: ${e.message}`; + throw e; + } + } + if (fontStyleVariants.has('bold italic')) { + if (!boldItalicFontName) { + throw new Error(`No italic font variant for ${textNodeFontFamily} found `); + } + try { + yield figma.loadFontAsync(boldItalicFontName); + } + catch (e) { + e.message = `Could not load italic+bold font for ${textNodeFontFamily}: ${e.message}`; + throw e; + } + } + } + textNode.characters = changedProperties.characters; + for (const rangeStyle of changedProperties.ops) { + // debugger; + const list = (_l = rangeStyle.attributes) === null || _l === void 0 ? void 0 : _l.list; + if (list === 'ordered') { + textNode.setRangeListOptions(rangeStyle.from, rangeStyle.to, { type: 'ORDERED' }); + } + else if (list === 'bullet') { + textNode.setRangeListOptions(rangeStyle.from, rangeStyle.to, { type: 'UNORDERED' }); + } + else { + textNode.setRangeListOptions(rangeStyle.from, rangeStyle.to, { type: 'NONE' }); + } + let linkUrl = (_m = rangeStyle.attributes) === null || _m === void 0 ? void 0 : _m.link; + if (linkUrl && linkUrl.startsWith('/')) { + linkUrl = this.helperDomain + linkUrl; + } + textNode.setRangeHyperlink(rangeStyle.from, rangeStyle.to, linkUrl ? { type: 'URL', value: linkUrl } : null); + let decoration = 'NONE'; + if (((_o = rangeStyle.attributes) === null || _o === void 0 ? void 0 : _o.textDecoration) === 'UNDERLINE') { + decoration = 'UNDERLINE'; + } + else if (((_p = rangeStyle.attributes) === null || _p === void 0 ? void 0 : _p.textDecoration) === 'STRIKETHROUGH') { + decoration = 'STRIKETHROUGH'; + } + textNode.setRangeTextDecoration(rangeStyle.from, rangeStyle.to, decoration); + // console.log(`Processing: ${textNode.characters.length} ${rangeStyle.to} ${textNode.characters} ${changedProperties.characters}`); + // check if we should apply styles at all... is bold/italic/regular swiched once? otherwise keep the orginal label + if (!((_q = rangeStyle.attributes) === null || _q === void 0 ? void 0 : _q.bold) && !((_r = rangeStyle.attributes) === null || _r === void 0 ? void 0 : _r.italic)) { + if (rangeStyle.from === 0 + && rangeStyle.to === textNode.characters.length) { + if (textNode.fontName === boldItalicFontName + || textNode.fontName === boldFontName + || textNode.fontName === italicFontName) { + textNode.setRangeFontName(rangeStyle.from, rangeStyle.to, regularFontName); + } + } + else { + textNode.setRangeFontName(rangeStyle.from, rangeStyle.to, regularFontName); + } + } + else if (!((_s = rangeStyle.attributes) === null || _s === void 0 ? void 0 : _s.bold) && ((_t = rangeStyle.attributes) === null || _t === void 0 ? void 0 : _t.italic)) { + textNode.setRangeFontName(rangeStyle.from, rangeStyle.to, italicFontName); + } + else if (((_u = rangeStyle.attributes) === null || _u === void 0 ? void 0 : _u.bold) && !((_v = rangeStyle.attributes) === null || _v === void 0 ? void 0 : _v.italic)) { + textNode.setRangeFontName(rangeStyle.from, rangeStyle.to, boldFontName); + } + else if (((_w = rangeStyle.attributes) === null || _w === void 0 ? void 0 : _w.bold) && ((_x = rangeStyle.attributes) === null || _x === void 0 ? void 0 : _x.italic)) { + textNode.setRangeFontName(rangeStyle.from, rangeStyle.to, boldItalicFontName); + } + } + textNode.setPluginData(this.variantPatternHTMLHashDataKey, changedProperties.variantPatternHTMLHash ? changedProperties.variantPatternHTMLHash : ''); + } + } + finally { + // allow this function to return sucessfully before we start the next update in the queue + setTimeout(() => { + const nextUpdateResolver = this.labelUpdateQueue[nodeId].shift(); + if (nextUpdateResolver) { + nextUpdateResolver(); + } + else { + delete this.labelUpdateQueue[nodeId]; + } + }, 1); + } + return this.toLocalizedLabelOrUndefined(textNode); + }); + } + commitUndo() { + return __awaiter(this, void 0, void 0, function* () { + return figma.commitUndo(); + }); + } + fixLabelLints(textNodeId, lintsToFix) { + return __awaiter(this, void 0, void 0, function* () { + const textNode = figma.getNodeById(textNodeId); + yield this.loadFontsForTextNodes([textNode]); + const linter = new _lint_TextNodeLinter__WEBPACK_IMPORTED_MODULE_1__["default"](); + linter.fix(textNode, lintsToFix); + }); + } + loadFontsForTextNodes(textNodes) { + return __awaiter(this, void 0, void 0, function* () { + const fontsToLoad = []; + for (const textNode of textNodes) { + this.getFonts(textNode, fontsToLoad); + } + yield this.loadFonts(fontsToLoad); + }); + } + loadFonts(fontArray = []) { + return __awaiter(this, void 0, void 0, function* () { + yield Promise.all(fontArray.map(figma.loadFontAsync)); + }); + } + getFonts(textNode, fontArray = []) { + if (textNode.characters.length === 0) { + if (!fontArray.find((font) => font.family === textNode.fontName.family && font.style === textNode.fontName.style)) { + fontArray.push(textNode.fontName); + } + } + else { + const fontsToLoad = textNode.getRangeAllFontNames(0, textNode.characters.length); + for (const fontToLoad of fontsToLoad) { + if (!fontArray.find((font) => font.family === fontToLoad.family && font.style === fontToLoad.style)) { + fontArray.push(fontToLoad); + } + } + } + } + extractKeyName(name) { + // regex extracts the first word starting with at least three characters + const nameParts = name.match(/[a-zA-Z]{3}[a-zA-Z0-9\-_]*/); + if (nameParts) { + return nameParts[0].toLowerCase(); + } + return ''; + } + toLocalizedLabelOrUndefined(node) { + var _a, _b; + let derivable = true; + if (node.autoRename) { + derivable = false; + } + // we skip nodes that are not visible + if (!node.visible) { + return; + } + let derivedName = this.extractKeyName(node.name); + derivable = false; + if (derivable && derivedName === '') { + derivable = false; + } + let page = null; + let rootFrame = null; + const parentIds = []; + let { x } = node; + let { y } = node; + let parent = node.parent; + while (parent) { + // we skip nodes where one of the parent nodes is invisible + if (parent.visible === false) { + return; + } + const parentType = parent.type; + if ((parentType === 'COMPONENT' + || parentType === 'COMPONENT_SET' + || parentType === 'FRAME' + || parentType === 'GROUP' + || parentType === 'INSTANCE') && parent.width < this.containerSizeThreashold) { + rootFrame = parent; + } + else if (parentType === 'PAGE') { + page = parent; + } + if (parentType !== 'GROUP' + && parentType !== 'PAGE' + && parent.parent && parent.parent.type !== 'PAGE') { + x += parent.x; + y += parent.y; + } + // 1/4 of the time... + parentIds.push(parent.id); + parent = parent.parent; + } + if (!page || !rootFrame) { + return; + } + derivedName = this.extractKeyName(rootFrame.name) + this.separator + derivedName; + // 1562ms -> 1071ms ~ 1/4 + const labelText = node.characters; + const fillins = node.getPluginData(this.fillinsToPlaceholderKey) === '' ? {} : JSON.parse(node.getPluginData(this.fillinsToPlaceholderKey)); + const parameterValues = node.getPluginData(this.parameterValuesKey) === '' ? {} : JSON.parse(node.getPluginData(this.parameterValuesKey)); + const tokenizedTextResult = this.extractDeltaOpsAndLabelStyles(node, fillins); + if (labelText.length === 1 && !/[0-9a-zA-Z\n\s]/.test(labelText)) { + return; + } + // get plugin 1192ms -> 938ms + // if no plural id is specified than we fall back to "other" - the default plural + const language = node.getPluginData(this.languageDataKey) === '' ? (_a = this.messageStore) === null || _a === void 0 ? void 0 : _a.getConfigSync().refLanguage : node.getPluginData(this.languageDataKey); + const unmanaged = node.getPluginData(this.messageUnmanagedKey) === 'true'; + const messageId = node.getPluginData(this.messageIdDataKey) === '' ? undefined : node.getPluginData(this.messageIdDataKey); + const rootFrameLanguage = rootFrame.getPluginData(this.languageDataKey) === '' ? (_b = this.messageStore) === null || _b === void 0 ? void 0 : _b.getConfigSync().refLanguage : rootFrame.getPluginData(this.languageDataKey); + const variantPatternHTMLHash = node.getPluginData(this.variantPatternHTMLHashDataKey) !== '' ? node.getPluginData(this.variantPatternHTMLHashDataKey) : undefined; + const unlinkedMessage = node.getPluginData(this.anonymMessageDataKey) !== '' ? JSON.parse(node.getPluginData(this.anonymMessageDataKey)) : undefined; + // eslint-disable-next-line consistent-return + return { + pageId: page.id, + pageName: page.name, + rootFrameId: rootFrame.id, + rootFrameName: rootFrame.name, + rootFrameLanguage, + language, + variantPatternHTMLHash, + nodeId: node.id, + name: node.name, + height: node.height, + width: node.width, + x, + y, + messageId, + unmanaged, + parameterValues, + fillinsToPlaceholder: fillins, + derivedKey: derivable ? derivedName : undefined, + characters: labelText, + ops: tokenizedTextResult.deltaOps, + matchingLabelLints: tokenizedTextResult.matchingLabelLints, + labelStyle: tokenizedTextResult.labelStyle, + unlinkedMessage, + }; + } + // tries to find the fillins in the characters set to map them to placeholders + getPlaceholderDeltaOps(characters, fillins) { + const placeholderDeltaOps = []; + const fillinValues = Object.keys(fillins); + // eslint-disable-next-line for-direction, no-plusplus + for (let i = fillinValues.length - 1; i >= 0; i--) { + const fillinValue = fillinValues[i]; + const placeholder = fillins[fillinValue]; + let matchIndex = 0; + while (matchIndex !== -1) { + matchIndex = characters.indexOf(fillinValue, matchIndex); + if (matchIndex !== -1) { + const start = matchIndex; + const end = matchIndex + (`${fillinValue}`).length; + // ensure no conflict with previous match + if (placeholderDeltaOps.find((op) => op.start < end && start < op.end) === undefined) { + placeholderDeltaOps.push({ + start, + end, + attributes: { + placeholder: { + name: placeholder.name, + unnamed: !placeholder.named, + argumentPosition: placeholder.specifiedArgumentPosition, + formatFn: placeholder.formatFunctionName, + options: placeholder.options, + invisibleMarkers: fillinValue.split(MARKER_CHARACTER).length, + }, + }, + }); + } + matchIndex += 1; + } + } + } + return placeholderDeltaOps.sort((op1, op2) => op1.start - op2.start); + } + getTextStyleDeltaOps(node) { + // if (matchingRules.length > 0) { + // console.log(`MATCHING RULES: ${matchingRules.join(', ')}`); + // console.log('auto fixing...'); + // this.loadFontsForTextNodes([node]).then(() => { + // linter.fix(node, matchingRules); + // }) + // } else { + // console.log('MATCHIGN RULES: NONE'); + // } + const textStyleDeltaOps = []; + const textSegments = node.getStyledTextSegments(['indentation', 'listOptions', 'fontName', 'textDecoration', 'hyperlink']); + textSegments.forEach((textSegment) => { + var _a, _b, _c; + // if the node has one stile (non mixed) its not inline styling - ignore it + const italic = node.fontName !== figma.mixed ? undefined : textSegment.fontName.style.toLowerCase().includes('italic'); + const weightName = textSegment.fontName.style.replace('italic', '').replace(' ', ''); + const bold = node.fontName !== figma.mixed ? undefined : weightName.toLowerCase().includes('bold'); + const textDecoration = node.textDecoration !== figma.mixed || textSegment.textDecoration === 'NONE' ? undefined : textSegment.textDecoration; + let linkUrl = ((_a = textSegment.hyperlink) === null || _a === void 0 ? void 0 : _a.type) === 'URL' ? (_b = textSegment.hyperlink) === null || _b === void 0 ? void 0 : _b.value : undefined; + if (linkUrl && ((_c = textSegment.hyperlink) === null || _c === void 0 ? void 0 : _c.value.startsWith(this.helperDomain))) { + linkUrl = textSegment.hyperlink.value.substring(this.helperDomain.length); + } + const attributes = { + textDecoration, + bold: bold ? true : undefined, + italic: italic ? true : undefined, + link: linkUrl, + indentation: textSegment.indentation, + }; + // let listType = undefined as undefined | 'bullet' | 'ordered'; + if (textSegment.listOptions.type === 'ORDERED') { + attributes.list = 'ordered'; + } + if (textSegment.listOptions.type === 'UNORDERED') { + attributes.list = 'bullet'; + } + textStyleDeltaOps.push({ + start: textSegment.start, + end: textSegment.end, + attributes, + }); + }); + return textStyleDeltaOps; + } + getDeltaOps(node, fillins) { + const deltaOps = []; + const textStyleDeltaOps = this.getTextStyleDeltaOps(node); + const placehodlderDeltaOps = this.getPlaceholderDeltaOps(node.characters, fillins); + // merge textsegments and placeholder segments + for (const textStyleDeltaOp of textStyleDeltaOps) { + // console.log('processing:'); + // console.log(textStyleDeltaOp); + // eslint-disable-next-line no-plusplus + for (let i = 0; i < placehodlderDeltaOps.length; i++) { + const placehodlderDeltaOp = placehodlderDeltaOps[i]; + if (!placehodlderDeltaOps[i].processed) { + if (textStyleDeltaOp.start === placehodlderDeltaOp.start + && textStyleDeltaOp.end === placehodlderDeltaOp.end) { + // style delta and placeholder match + // - add placeholder to textStyleOp and push the whole textStyleOp + textStyleDeltaOp.attributes.placeholder = placehodlderDeltaOp.attributes.placeholder; + deltaOps.push(textStyleDeltaOp); + placehodlderDeltaOp.processed = true; + textStyleDeltaOp.processed = true; + } + else if (textStyleDeltaOp.start === placehodlderDeltaOp.start + && textStyleDeltaOp.end > (placehodlderDeltaOp.end - placehodlderDeltaOp.attributes.placeholder.invisibleMarkers) + && textStyleDeltaOp.end < placehodlderDeltaOp.end) { + // style delta only formats the placeholder - but its end sits within the invisible markers + // - no split needed but set end to the end of the text marker + textStyleDeltaOp.attributes.placeholder = placehodlderDeltaOp.attributes.placeholder; + textStyleDeltaOp.end = placehodlderDeltaOp.end; + textStyleDeltaOp.processed = true; + placehodlderDeltaOp.processed = true; + deltaOps.push(textStyleDeltaOp); + } + else if (textStyleDeltaOp.start >= placehodlderDeltaOp.start + && textStyleDeltaOp.end <= placehodlderDeltaOp.end) { + // Segment starts and ends within the placeholder but don't cover it completly (previous cases) + // - we ignore this style + textStyleDeltaOp.processed = true; + } + else if (textStyleDeltaOp.start < placehodlderDeltaOp.start + && textStyleDeltaOp.end >= (placehodlderDeltaOp.end - placehodlderDeltaOp.attributes.placeholder.invisibleMarkers)) { + // start is before the placeholder and it covers it completly split it and move start + // - push delta before the placeholder + deltaOps.push({ + start: textStyleDeltaOp.start, + end: placehodlderDeltaOp.start, + attributes: Object.assign({}, textStyleDeltaOp.attributes), + }); + // push delta covering the placeholder + deltaOps.push({ + start: placehodlderDeltaOp.start, + end: placehodlderDeltaOp.end, + attributes: Object.assign(Object.assign({}, textStyleDeltaOp.attributes), placehodlderDeltaOp.attributes), + }); + // placeholder is processed + placehodlderDeltaOp.processed = true; + // textStyleDeltaOp only if it ends with the placeholder + if (textStyleDeltaOp.end <= placehodlderDeltaOp.end) { + textStyleDeltaOp.processed = true; + } + else { + textStyleDeltaOp.start = placehodlderDeltaOp.end; + } + if (!(textStyleDeltaOp.start < textStyleDeltaOp.end)) { + throw new Error('textStyleDeltaOp.start < textStyleDeltaOp.end'); + } + } + else if (textStyleDeltaOp.start < placehodlderDeltaOp.start + && textStyleDeltaOp.end >= placehodlderDeltaOp.start + && textStyleDeltaOp.end < (placehodlderDeltaOp.end - placehodlderDeltaOp.attributes.placeholder.invisibleMarkers)) { + // start falls before a placeholder but it ends within it -> move end to the beginng + // - we cant process it yet since its bounds may be changed by later placeholder + textStyleDeltaOp.end = placehodlderDeltaOp.start; + deltaOps.push({ + start: textStyleDeltaOp.start, + end: textStyleDeltaOp.end, + attributes: Object.assign({}, textStyleDeltaOp.attributes), + }); + // placeholder is processed + textStyleDeltaOp.processed = true; + } + else if (textStyleDeltaOp.start >= placehodlderDeltaOp.start + && textStyleDeltaOp.start < (placehodlderDeltaOp.end - placehodlderDeltaOp.attributes.placeholder.invisibleMarkers)) { + // start falls into a placeholder - move it to the end of the placeholder + // - we cant process it yet since its bounds may be changed by later placeholder + textStyleDeltaOp.start = placehodlderDeltaOp.end; + } + else if (textStyleDeltaOp.end > placehodlderDeltaOp.start + && textStyleDeltaOp.end < (placehodlderDeltaOp.end - placehodlderDeltaOp.attributes.placeholder.invisibleMarkers)) { + // end falls into hello within helloXXX of the placeholder move it to the start + textStyleDeltaOp.end = placehodlderDeltaOp.start; + textStyleDeltaOp.processed = true; + if (textStyleDeltaOp.end < textStyleDeltaOp.start) { + // still a legal rang - add it finaly + deltaOps.push(textStyleDeltaOp); + } + } + } + } + if (!textStyleDeltaOp.processed) { + if (!(textStyleDeltaOp.start < textStyleDeltaOp.end)) { + throw new Error('textStyleDeltaOp.start < textStyleDeltaOp.end'); + } + deltaOps.push(textStyleDeltaOp); + } + } + const uncoveredPlaceholderOps = placehodlderDeltaOps.filter((placehodlderDeltaOp) => !placehodlderDeltaOp.processed); + for (const uncoveredPlaceholderOp of uncoveredPlaceholderOps) { + uncoveredPlaceholderOp.ignoreForLabelStyle = true; + deltaOps.push(uncoveredPlaceholderOp); + } + return deltaOps.sort((op1, op2) => op1.start - op2.start); + } + extractDeltaOpsAndLabelStyles(node, fillins) { + const fontFamilies = new Set(); + const labelStyle = { + fontFamily: null, + bold: null, + italic: null, + textDecoration: null, + }; + const deltaOps = this.getDeltaOps(node, fillins); + const linter = new _lint_TextNodeLinter__WEBPACK_IMPORTED_MODULE_1__["default"](); + const matchingLabelLints = linter.lint(node); + // get label styles + for (const deltaOp of deltaOps) { + if (deltaOp.ignoreForLabelStyle) { + // ignoring placeholders not wrapped by styles + // eslint-disable-next-line no-continue + continue; + } + if (deltaOp.attributes.fontFamily) { + fontFamilies.add(deltaOp.attributes.fontFamily); + // console.log('adding font fimily: ' + deltaOp.attributes.fontFamily); + } + labelStyle.bold = labelStyle.bold !== null && labelStyle.bold !== deltaOp.attributes.bold ? 'MIXED' : deltaOp.attributes.bold; + labelStyle.italic = labelStyle.italic !== null && labelStyle.italic !== deltaOp.attributes.italic ? 'MIXED' : deltaOp.attributes.italic; + labelStyle.textDecoration = labelStyle.textDecoration !== null && labelStyle.textDecoration !== deltaOp.attributes.textDecoration ? 'MIXED' : deltaOp.attributes.textDecoration; + labelStyle.fontFamily = labelStyle.fontFamily !== null && labelStyle.fontFamily !== deltaOp.attributes.fontFamily ? 'MIXED' : deltaOp.attributes.fontFamily; + } + // reset unmixed label stlyes + for (const deltaOp of deltaOps) { + deltaOp.attributes.bold = labelStyle.bold !== 'MIXED' ? undefined : deltaOp.attributes.bold; + deltaOp.attributes.italic = labelStyle.italic !== 'MIXED' ? undefined : deltaOp.attributes.italic; + deltaOp.attributes.textDecoration = labelStyle.textDecoration !== 'MIXED' ? undefined : deltaOp.attributes.textDecoration; + deltaOp.attributes.fontFamily = labelStyle.fontFamily !== 'MIXED' ? undefined : deltaOp.attributes.fontFamily; + } + return { + matchingLabelLints, + // if we have no style changes within the label we don't handle styling + deltaOps, + labelStyle, + }; + } + getPluginData(key) { + return ''; + } +} + + +/***/ }), + +/***/ "./src/lib/localizedlabels/VirtualTree.ts": +/*!************************************************!*\ + !*** ./src/lib/localizedlabels/VirtualTree.ts ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ VirtualTreeNode: () => (/* binding */ VirtualTreeNode), +/* harmony export */ "default": () => (/* binding */ VirtualTree) +/* harmony export */ }); +/* eslint-disable max-classes-per-file */ +class VirtualTreeNode { + constructor(baseNode, nodeId) { + this.id = nodeId; + this.type = baseNode.type; + this.cacheRelevant = baseNode.type === 'TEXT'; + this.parent = null; + this.children = []; + } +} +class VirtualTree { + constructor() { + this.lookupTable = new Map(); + } + hasNode(id) { + return this.lookupTable.get(id) !== undefined; + } + getVirtualNode(id) { + return this.lookupTable.get(id); + } + addNode(node, nodeId) { + let virtualNode = this.getVirtualNode(nodeId); + if (virtualNode) { + return virtualNode; + } + virtualNode = new VirtualTreeNode(node, nodeId); + this.lookupTable.set(virtualNode.id, virtualNode); + const { parent } = node; + const parentId = parent === null || parent === void 0 ? void 0 : parent.id; + let virtualParent = parentId ? this.lookupTable.get(parentId) : undefined; + if (parentId && parent) { + if (virtualParent === undefined) { + virtualParent = this.addNode(parent, parentId); + } + virtualNode.parent = virtualParent; + virtualParent.children.push(virtualNode); + } + return virtualNode; + } + removeBranch(rootIdentifier) { + const rootNode = this.lookupTable.get(rootIdentifier); + if (!rootNode) { + return []; + } + return this.traverseAndDelete(rootNode); + } + traverseAndDelete(node) { + var _a; + let deletedNodes = [node]; + for (const child of node.children) { + deletedNodes = deletedNodes.concat(this.traverseAndDelete(child)); + this.lookupTable.delete(child.id); + } + // if parent has no children - remove parent as well! + // eslint-disable-next-line no-param-reassign + node.parent.children = node.parent.children.filter((child) => child !== node); + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.children.length) === 0) { + this.lookupTable.delete(node.parent.id); + } + this.lookupTable.delete(node.id); + return deletedNodes; + } + moveNode(identifier, newParent) { + const virtualNode = this.lookupTable.get(identifier); + if (virtualNode === undefined) { + // console.log('VirtualTree: NOTING TO MOVE'); + return []; + } + const parentId = newParent.id; + let virtualParent = parentId ? this.lookupTable.get(parentId) : undefined; + if (virtualParent === undefined) { + virtualParent = this.addNode(newParent, parentId); + } + virtualNode.parent.children = virtualNode.parent.children.filter((child) => child !== virtualNode); + if (virtualNode.parent.children.length === 0) { + // console.log('VirtualTree: NO NEED OF PARENT - removing cache'); + this.lookupTable.delete(virtualNode.parent.id); + } + virtualNode.parent = virtualParent; + virtualParent.children.push(virtualNode); + return this.getAllNodesInBranch(virtualNode); + } + getAllNodesInBranchByRootId(id) { + const virtualNode = this.lookupTable.get(id); + if (virtualNode === undefined) { + // console.log('VirtualTree: no node to get branch from'); + return []; + } + return this.getAllNodesInBranch(virtualNode); + } + getAllNodesInBranch(node) { + let nodesInBranch = [node]; + for (const child of node.children) { + nodesInBranch = nodesInBranch.concat(this.getAllNodesInBranch(child)); + } + // console.log(`VirtualTree: found nodesInBranch ${nodesInBranch.length}`); + return nodesInBranch; + } +} + + +/***/ }), + +/***/ "./src/lib/localizedlabels/lint/TextNodeLinter.ts": +/*!********************************************************!*\ + !*** ./src/lib/localizedlabels/lint/TextNodeLinter.ts ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ TextNodeLinter) +/* harmony export */ }); +/* harmony import */ var _rules_MixedStyleNotSupported__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rules/MixedStyleNotSupported */ "./src/lib/localizedlabels/lint/rules/MixedStyleNotSupported.ts"); +/* harmony import */ var _rules_FontStyleNotSupported__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rules/FontStyleNotSupported */ "./src/lib/localizedlabels/lint/rules/FontStyleNotSupported.ts"); +/* harmony import */ var _rules_IndentationNotSupported__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rules/IndentationNotSupported */ "./src/lib/localizedlabels/lint/rules/IndentationNotSupported.ts"); +/* harmony import */ var _rules_TextDecorationUnknown__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rules/TextDecorationUnknown */ "./src/lib/localizedlabels/lint/rules/TextDecorationUnknown.ts"); + +// eslint-disable-next-line import/no-named-as-default + + + + +class TextNodeLinter { + constructor() { + this.defaultRules = [ + _rules_MixedStyleNotSupported__WEBPACK_IMPORTED_MODULE_0__["default"].createRuleForField('openTypeFeatures'), + _rules_MixedStyleNotSupported__WEBPACK_IMPORTED_MODULE_0__["default"].createRuleForField('textCase'), + _rules_MixedStyleNotSupported__WEBPACK_IMPORTED_MODULE_0__["default"].createRuleForField('fontSize'), + _rules_MixedStyleNotSupported__WEBPACK_IMPORTED_MODULE_0__["default"].createRuleForField('letterSpacing'), + _rules_MixedStyleNotSupported__WEBPACK_IMPORTED_MODULE_0__["default"].createRuleForField('lineHeight'), + _rules_MixedStyleNotSupported__WEBPACK_IMPORTED_MODULE_0__["default"].createRuleForField('leadingTrim'), + _rules_MixedStyleNotSupported__WEBPACK_IMPORTED_MODULE_0__["default"].createRuleForField('fills'), + new _rules_FontStyleNotSupported__WEBPACK_IMPORTED_MODULE_1__["default"](), + new _rules_IndentationNotSupported__WEBPACK_IMPORTED_MODULE_2__["default"](), + new _rules_TextDecorationUnknown__WEBPACK_IMPORTED_MODULE_3__["default"](), + new _rules_FontStyleNotSupported__WEBPACK_IMPORTED_MODULE_1__["default"](), + ]; + this.registeredRules = {}; + for (const defaultRule of this.defaultRules) { + this.registerRule(defaultRule); + } + } + registerRule(textNodeLintRule) { + this.registeredRules[textNodeLintRule.ruleName] = textNodeLintRule; + } + lint(textNode) { + const matchingRules = []; + for (const rule of Object.values(this.registeredRules)) { + const currentRuleMatches = rule.matches(textNode); + if (currentRuleMatches) { + matchingRules.push(rule.ruleName); + } + } + return matchingRules; + } + fix(textNode, ruleNames) { + for (const ruleNameToFix of ruleNames) { + this.registeredRules[ruleNameToFix].fix(textNode); + } + } +} +// TODO: +// fontFamily source for bold/italic/regular +// -> check if family does not differ +// - fix find fontfamily that is used the most and replace all others +// -> check if clear mapping to bold/italic is possible +// - fix remove non clear mapping segments (replace with regular for now - later use project configs mapping) +// fontWeight - ignore for - taken care of by bold? but check if it only differs on bold/italic? + + +/***/ }), + +/***/ "./src/lib/localizedlabels/lint/rules/BaseTextNodeLintRule.ts": +/*!********************************************************************!*\ + !*** ./src/lib/localizedlabels/lint/rules/BaseTextNodeLintRule.ts ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +class BaseTextNodeLintRule { + constructor(ruleName) { + this.ruleName = ruleName; + } + static fixWithMostProminent(textNode, field) { + const currentStyleSegments = textNode.getStyledTextSegments([field]); + const stylesPresent = {}; + for (const stlyeSegment of currentStyleSegments) { + const serializedStyle = JSON.stringify(stlyeSegment[field]); + if (!stylesPresent[serializedStyle]) { + stylesPresent[serializedStyle] = 0; + } + stylesPresent[serializedStyle] += stlyeSegment.end - stlyeSegment.start; + } + let mostPresentStyleSerialized; + let mostPresentStylePresens = 0; + for (const [styleSerialized, presens] of Object.entries(stylesPresent)) { + if (mostPresentStylePresens < presens) { + mostPresentStylePresens = presens; + mostPresentStyleSerialized = styleSerialized; + } + } + try { + // eslint-disable-next-line no-param-reassign + textNode[field] = JSON.parse(mostPresentStyleSerialized); + } + catch (e) { + throw new Error(`${field} inline styles can't get fixed automatically at the Moment. please remvoe those styles manually from the TextNode to use within Parrot.`); + } + } +} +BaseTextNodeLintRule.fieldsToSetSegmentMethodName = {}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseTextNodeLintRule); + + +/***/ }), + +/***/ "./src/lib/localizedlabels/lint/rules/FontStyleNotSupported.ts": +/*!*********************************************************************!*\ + !*** ./src/lib/localizedlabels/lint/rules/FontStyleNotSupported.ts ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ FontStyleNotSuppoorted) +/* harmony export */ }); +/* harmony import */ var _FontUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../FontUtil */ "./src/lib/localizedlabels/FontUtil.ts"); +/* harmony import */ var _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BaseTextNodeLintRule */ "./src/lib/localizedlabels/lint/rules/BaseTextNodeLintRule.ts"); + + +// eslint-disable-next-line max-classes-per-file +class FontStyleNotSuppoorted extends _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_1__["default"] { + constructor() { + super('FontStyleNotSupported'); + this.fontNameStyleField = 'fontName'; + } + // eslint-disable-next-line class-methods-use-this + matches(textNode) { + var _a, _b, _c, _d; + if (textNode.characters.length === 0) { + return false; + } + // no inline styling on the text node + if (textNode.fontName !== figma.mixed) { + return false; + } + const fontNameStyleSegments = textNode.getStyledTextSegments([this.fontNameStyleField], 0, textNode.characters.length); + for (const fontNameStyleSegment of fontNameStyleSegments) { + // eslint-disable-next-line no-await-in-loop + const font = _FontUtil__WEBPACK_IMPORTED_MODULE_0__["default"].getStylingSupport(fontNameStyleSegment.fontName); + if (fontNameStyleSegment.fontName.style !== ((_a = font.bold) === null || _a === void 0 ? void 0 : _a.style) + && fontNameStyleSegment.fontName.style !== ((_b = font.italic) === null || _b === void 0 ? void 0 : _b.style) + && fontNameStyleSegment.fontName.style !== ((_c = font.boldItalic) === null || _c === void 0 ? void 0 : _c.style) + && fontNameStyleSegment.fontName.style !== ((_d = font.regular) === null || _d === void 0 ? void 0 : _d.style)) { + return true; + } + } + return false; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this + fix(textNode) { + var _a, _b, _c, _d; + const currentStyleSegments = textNode.getStyledTextSegments([this.fontNameStyleField]); + const stylesPresent = {}; + let fontFamily = ''; + for (const fontNameStyleSegment of currentStyleSegments) { + const font = _FontUtil__WEBPACK_IMPORTED_MODULE_0__["default"].getStylingSupport(fontNameStyleSegment.fontName); + fontFamily = fontNameStyleSegment.fontName.family; + if (fontNameStyleSegment.fontName.style === ((_a = font.bold) === null || _a === void 0 ? void 0 : _a.style) + || fontNameStyleSegment.fontName.style === ((_b = font.italic) === null || _b === void 0 ? void 0 : _b.style) + || fontNameStyleSegment.fontName.style === ((_c = font.boldItalic) === null || _c === void 0 ? void 0 : _c.style) + || fontNameStyleSegment.fontName.style === ((_d = font.regular) === null || _d === void 0 ? void 0 : _d.style)) { + const serializedStyle = JSON.stringify(fontNameStyleSegment[this.fontNameStyleField]); + if (!stylesPresent[serializedStyle]) { + stylesPresent[serializedStyle] = 0; + } + stylesPresent[serializedStyle] += fontNameStyleSegment.end - fontNameStyleSegment.start; + } + } + let mostPresentStyleSerialized; + let mostPresentStylePresens = 0; + for (const [styleSerialized, presens] of Object.entries(stylesPresent)) { + if (mostPresentStylePresens < presens) { + mostPresentStylePresens = presens; + mostPresentStyleSerialized = styleSerialized; + } + } + try { + // eslint-disable-next-line no-param-reassign + textNode[this.fontNameStyleField] = JSON.parse(mostPresentStyleSerialized); + } + catch (e) { + throw new Error(`${this.fontNameStyleField} inline styles can't get fixed automatically for font family ${fontFamily}. please remvoe those styles manually from the TextNode to use within Parrot.`); + } + } +} + + +/***/ }), + +/***/ "./src/lib/localizedlabels/lint/rules/IndentationNotSupported.ts": +/*!***********************************************************************!*\ + !*** ./src/lib/localizedlabels/lint/rules/IndentationNotSupported.ts ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ IndentationNotSupported) +/* harmony export */ }); +/* harmony import */ var _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseTextNodeLintRule */ "./src/lib/localizedlabels/lint/rules/BaseTextNodeLintRule.ts"); + +// eslint-disable-next-line max-classes-per-file +class IndentationNotSupported extends _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_0__["default"] { + constructor() { + super('IndentationNotSupported'); + } + // eslint-disable-next-line class-methods-use-this + matches(textNode) { + if (textNode.characters.length === 0) { + return false; + } + const indentations = textNode.getRangeIndentation(0, textNode.characters.length); + if (indentations !== figma.mixed) { + return false; + } + const styleSegments = textNode.getStyledTextSegments(['indentation', 'listOptions']); + for (const styleSegment of styleSegments) { + if (styleSegment.indentation !== 0 && styleSegment.listOptions.type === 'NONE') { + return true; + } + if (styleSegment.indentation > 1) { + return true; + } + } + return false; + } + // eslint-disable-next-line class-methods-use-this + fix(textNode) { + const styleSegments = textNode.getStyledTextSegments(['indentation', 'listOptions']); + for (const styleSegment of styleSegments) { + // -> check if !=0 is only present within lists + if (styleSegment.indentation !== 0 && styleSegment.listOptions.type === 'NONE') { + textNode.setRangeIndentation(styleSegment.start, styleSegment.end, 0); + } + // -> check if only 0 and 1 are present + if (styleSegment.indentation > 1) { + textNode.setRangeIndentation(styleSegment.start, styleSegment.end, 1); + } + } + } +} + + +/***/ }), + +/***/ "./src/lib/localizedlabels/lint/rules/MixedStyleNotSupported.ts": +/*!**********************************************************************!*\ + !*** ./src/lib/localizedlabels/lint/rules/MixedStyleNotSupported.ts ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ MixedStyleNotSupported) +/* harmony export */ }); +/* harmony import */ var _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseTextNodeLintRule */ "./src/lib/localizedlabels/lint/rules/BaseTextNodeLintRule.ts"); + +// eslint-disable-next-line max-classes-per-file +class MixedStyleNotSupported extends _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_0__["default"] { + constructor(ruleName, styleField) { + super(ruleName); + this.styleField = styleField; + } + static createRuleForField(styleField) { + const ruleName = `MixedStyleNotSupportedFor${styleField.charAt(0).toUpperCase()}${styleField.slice(1)}`; + return new MixedStyleNotSupported(ruleName, styleField); + } + matches(textNode) { + return textNode[this.styleField] === figma.mixed; + } + fix(textNode) { + _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_0__["default"].fixWithMostProminent(textNode, this.styleField); + } +} + + +/***/ }), + +/***/ "./src/lib/localizedlabels/lint/rules/TextDecorationUnknown.ts": +/*!*********************************************************************!*\ + !*** ./src/lib/localizedlabels/lint/rules/TextDecorationUnknown.ts ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ TextDecorationUnknown) +/* harmony export */ }); +/* harmony import */ var _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseTextNodeLintRule */ "./src/lib/localizedlabels/lint/rules/BaseTextNodeLintRule.ts"); + +// eslint-disable-next-line max-classes-per-file +class TextDecorationUnknown extends _BaseTextNodeLintRule__WEBPACK_IMPORTED_MODULE_0__["default"] { + constructor() { + super('TextDecorationUnknown'); + } + // eslint-disable-next-line class-methods-use-this + matches(textNode) { + if (textNode.characters.length === 0) { + return false; + } + if (textNode.textDecoration !== figma.mixed) { + return false; + } + const styleSegments = textNode.getStyledTextSegments(['textDecoration']); + for (const styleSegment of styleSegments) { + if (styleSegment.textDecoration !== 'NONE' + && styleSegment.textDecoration !== 'STRIKETHROUGH' + && styleSegment.textDecoration !== 'UNDERLINE') { + return true; + } + } + return false; + } + // eslint-disable-next-line class-methods-use-this + fix(textNode) { + const styleSegments = textNode.getStyledTextSegments(['textDecoration']); + for (const styleSegment of styleSegments) { + // change unsupported listoptions type to none + if (styleSegment.textDecoration !== 'NONE' + && styleSegment.textDecoration !== 'STRIKETHROUGH' + && styleSegment.textDecoration !== 'UNDERLINE') { + textNode.setRangeTextDecoration(styleSegment.start, styleSegment.end, 'NONE'); + } + } + } +} + + +/***/ }), + +/***/ "./src/lib/message/store/InlangMessageStoreFigmaRoot.ts": +/*!**************************************************************!*\ + !*** ./src/lib/message/store/InlangMessageStoreFigmaRoot.ts ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ InlangMessageStore: () => (/* binding */ InlangMessageStore) +/* harmony export */ }); +/* harmony import */ var text_encoding__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! text-encoding */ "./node_modules/text-encoding/index.js"); +/* harmony import */ var text_encoding__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(text_encoding__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var blakejs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! blakejs */ "./node_modules/blakejs/index.js"); +/* harmony import */ var blakejs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(blakejs__WEBPACK_IMPORTED_MODULE_1__); +/* eslint-disable class-methods-use-this */ +/* eslint-disable no-await-in-loop */ +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + 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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; + + +const defaultStringFillinValue = 'Loren Impsum'; +const defaultDecimalFillinValue = 7; +const defaultFloatFillinValue = Math.PI; +const encoder = new (text_encoding__WEBPACK_IMPORTED_MODULE_0___default().TextEncoder)(); +class InlangMessageStore { + constructor(asProxy) { + this.proxyClassName = 'InlangMessageStore'; + /** + * Prefix for messageId's + * - the head version of a message is stored withing a pluginDataKey of the current document root node + * - all messages are strored prefixed with the messagePrefix followed by a slot (for collisions) hashed orignal message name + */ + this.messagePrefix = 'prt_im__'; + // contains a map from messageId to message hash + this.messageState = {}; + this.messageIdToLabels = {}; + if (!asProxy) { + figma.on('documentchange', this.forwardDocumentChanges.bind(this)); + } + } + // eslint-disable-next-line class-methods-use-this + forwardDocumentChanges(event) { + for (const change of event.documentChanges) { + if (change.origin === 'LOCAL' + || change.type !== 'PROPERTY_CHANGE' + || change.node.parent === null + || change.properties.indexOf('pluginData') === -1) { + // eslint-disable-next-line no-continue + continue; + } + // TODO #14 CACHING TEST Multi user - check if a message update triggered by another user is propagated to parrot + // TODO #14 CACHING implement for multi user - keep tracK of changes in config as well + // eslint-disable-next-line default-case + const currentFileStorageKeys = figma.root.getPluginDataKeys().filter((value) => value.indexOf(this.messagePrefix) === 0); + let currentCachedMessageIds = Object.keys(this.messageState); + const changedKeys = { + deleted: [], + updated: [], + added: [], + }; + for (const currentFileStorageKey of currentFileStorageKeys) { + const id = currentFileStorageKey.slice(this.messagePrefix.length); + if (this.messageState[id] === undefined) { + changedKeys.added.push(id); + } + else { + if (blakejs__WEBPACK_IMPORTED_MODULE_1___default().blake2sHex(figma.root.getPluginData(currentFileStorageKey)) !== this.messageState[id]) { + changedKeys.updated.push(id); + } + currentCachedMessageIds = currentCachedMessageIds.filter((messageId) => messageId !== id); + } + } + changedKeys.deleted = currentCachedMessageIds; + for (const deletedKey of currentCachedMessageIds) { + delete this.messageState[deletedKey]; + } + if (changedKeys.deleted.length > 0 + || changedKeys.added.length > 0 + || changedKeys.updated.length > 0) { + figma.ui.postMessage({ + target: 'TranslationKeyStore', + type: 'cacheUpdate', + changedKeys, + }); + } + } + } + getConfigSync() { + const messageRaw = figma.root.getPluginData(InlangMessageStore.configDataKey); + if (messageRaw === '' || !messageRaw) { + return { + refLanguage: undefined, + enabledLanguages: [], + }; + } + return JSON.parse(messageRaw); + } + getConfig() { + return __awaiter(this, void 0, void 0, function* () { + return this.getConfigSync(); + }); + } + setConfig(languageConfig) { + return __awaiter(this, void 0, void 0, function* () { + figma.root.setPluginData(InlangMessageStore.configDataKey, JSON.stringify(languageConfig)); + }); + } + saveMessage(message) { + return __awaiter(this, void 0, void 0, function* () { + figma.root.setPluginData(this.messagePrefix + message.id, JSON.stringify(message)); + }); + } + deleteMessage(id) { + return __awaiter(this, void 0, void 0, function* () { + figma.root.setPluginData(this.messagePrefix + id, ''); + }); + } + getMessageAsync(messageId) { + return __awaiter(this, void 0, void 0, function* () { + return this.getMessage(messageId); + }); + } + getMessage(messageId) { + const messageStorageKey = this.messagePrefix + messageId; + const messageRaw = figma.root.getPluginData(messageStorageKey); + if (messageRaw === '') { + return undefined; + } + const messageRawHash = blakejs__WEBPACK_IMPORTED_MODULE_1___default().blake2sHex(encoder.encode(messageRaw)); + const message = JSON.parse(messageRaw); + if (message !== undefined) { + this.messageState[message.id] = messageRawHash; + } + return message; + } + load() { + return __awaiter(this, void 0, void 0, function* () { + const messages = []; + for (const messageStorageKey of figma.root.getPluginDataKeys()) { + if (messageStorageKey.startsWith(this.messagePrefix)) { + const messageName = messageStorageKey.substring(this.messagePrefix.length); + const message = this.getMessage(messageName); + if (message !== undefined) { + messages.push(message); + } + } + } + return messages; + }); + } + commitUndo() { + return __awaiter(this, void 0, void 0, function* () { + return figma.commitUndo(); + }); + } +} +// TODO #14 migration - migrate old config +InlangMessageStore.configDataKey = 'prt_ic'; +/** + * we store a version map here: + * [ + * { name: 'v-1.0.0', description: '', id: string? }, + * ] + */ +InlangMessageStore.tagsDataKey = 'prt_t'; + + +/***/ }), + +/***/ "./src/lib/message/variants/Gender.ts": +/*!********************************************!*\ + !*** ./src/lib/message/variants/Gender.ts ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Gender: () => (/* binding */ Gender), +/* harmony export */ genderList: () => (/* binding */ genderList) +/* harmony export */ }); +/* eslint-disable import/prefer-default-export */ +var Gender; +(function (Gender) { + Gender["FEMALE"] = "f"; + Gender["NEUTRAL"] = "n"; + Gender["MALE"] = "m"; +})(Gender || (Gender = {})); +const genderList = [ + Gender.MALE, Gender.FEMALE, Gender.NEUTRAL, +]; + + +/***/ }), + +/***/ "./src/lib/migrations/MigrationManager.ts": +/*!************************************************!*\ + !*** ./src/lib/migrations/MigrationManager.ts ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ MigrationManager) +/* harmony export */ }); +/* harmony import */ var _message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../message/variants/Gender */ "./src/lib/message/variants/Gender.ts"); +// import { MessageStoreFigmaRoot } from '../message/store/MessageStoreFigmaRoot'; + +class MigrationManager { + constructor() { + this.lastMigrationKey = 'parrot_migration_executed'; + this.migrations = [ + { + version: '0.9.55', + migrate: (version) => { + const configDataKeyOld = 'aar_c'; + const keyPrefixOld = 'aar_k__'; + const keyHistoryPrefixOld = 'aar_h__'; + const configDataKey = 'prt_c'; + const messagePrefix = 'prt_m__'; + const messageHistoryPrefix = 'prt_mh__'; + // go through all messages - add the message name + const oldDataKeys = figma.root.getPluginDataKeys(); + for (const oldDataKey of oldDataKeys) { + if (oldDataKey.startsWith(keyPrefixOld)) { + const messageName = oldDataKey.substring(keyPrefixOld.length, oldDataKey.length); + const oldMessage = JSON.parse(figma.root.getPluginData(oldDataKey)); + if (!oldMessage.translations) { + figma.root.setPluginData(oldDataKey, ''); + } + else { + oldMessage.variants = {}; + for (const [language, plurals] of Object.entries(oldMessage.translations)) { + for (const [plural, variant] of Object.entries(plurals)) { + if (oldMessage.variants[language] === undefined) { + oldMessage.variants[language] = { + [_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL]: {}, + }; + } + if (oldMessage.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] === undefined) { + oldMessage.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] = {}; + } + oldMessage.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] = variant; + } + } + } + delete oldMessage.keyName; + oldMessage.name = messageName; + oldMessage.gender = false; + const messageId = 'TODO'; // TODO #14 migration MessageStoreFigmaRoot.createMessageId(messageName, 0); + figma.root.setPluginData(messagePrefix + messageId, JSON.stringify(oldMessage)); + console.log(`migrating ${keyHistoryPrefixOld}${messageName}`); + const oldMessageHistory = JSON.parse(figma.root.getPluginData(keyHistoryPrefixOld + messageName)); + // add message name to first history entry + oldMessageHistory[0].name = messageName; + // process history to fix translation entries + for (const oldHistoryEntry of oldMessageHistory) { + if (!oldHistoryEntry.translations) { + console.log(`empty oldHistory found for ${messageName} + ${JSON.stringify(oldHistoryEntry)}`); + } + else { + oldHistoryEntry.variants = {}; + for (const [language, plurals] of Object.entries(oldHistoryEntry.translations)) { + for (const [plural, variant] of Object.entries(plurals)) { + if (oldHistoryEntry.variants[language] === undefined) { + oldHistoryEntry.variants[language] = { + [_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL]: {}, + }; + } + if (oldHistoryEntry.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] === undefined) { + oldHistoryEntry.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] = {}; + } + oldHistoryEntry.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] = variant; + } + } + delete oldHistoryEntry.transalations; + } + } + delete oldMessage.keyName; + oldMessage.name = messageName; + oldMessage.gender = false; + // use new storage key + figma.root.setPluginData(messageHistoryPrefix + messageId, JSON.stringify(oldMessageHistory)); + // remove old keys + figma.root.setPluginData(keyHistoryPrefixOld + messageName, ''); + figma.root.setPluginData(oldDataKey, ''); + } + } + const configOld = figma.root.getPluginData(configDataKeyOld); + if (figma.root.getPluginData(configDataKey) === '') { + console.log(`Migration of config;${configOld}`); + figma.root.setPluginData(configDataKey, configOld); + } + // go through all textnodes with references to messages and update to slot 0 + const textNodesToMigrate = figma.root.findAllWithCriteria({ + pluginData: { + keys: ['kt', 'ut'], + }, + }); + for (const textNodeToMigrate of textNodesToMigrate) { + // message link state - migrate kt to mt + textNodeToMigrate.setPluginData('mt', textNodeToMigrate.getPluginData('kt')); + textNodeToMigrate.setPluginData('kt', ''); + // message version - migrate kv to mv + textNodeToMigrate.setPluginData('mv', textNodeToMigrate.getPluginData('kv')); + textNodeToMigrate.setPluginData('kv', ''); + // message plural - migrate kp to mp + textNodeToMigrate.setPluginData('mp', textNodeToMigrate.getPluginData('kp')); + textNodeToMigrate.setPluginData('kp', ''); + // message gender - add mg + textNodeToMigrate.setPluginData('mg', _message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL); + // migrate unlinged message (ut -> am) + const unlinkedMessageRaw = textNodeToMigrate.getPluginData('ut'); + if (unlinkedMessageRaw !== '') { + // process history to fix translation entries + const unlinkedMessage = JSON.parse(unlinkedMessageRaw); + unlinkedMessage.variants = {}; + for (const [language, plurals] of Object.entries(unlinkedMessage.translations)) { + for (const [plural, variant] of Object.entries(plurals)) { + if (unlinkedMessage.variants[language] === undefined) { + unlinkedMessage.variants[language] = { + [_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL]: {}, + }; + } + if (unlinkedMessage.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] === undefined) { + unlinkedMessage.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] = {}; + } + unlinkedMessage.variants[language][_message_variants_Gender__WEBPACK_IMPORTED_MODULE_0__.Gender.NEUTRAL][plural] = variant; + } + } + delete unlinkedMessage.translations; + unlinkedMessage.gender = false; + textNodeToMigrate.setPluginData('am', JSON.stringify(unlinkedMessage)); + textNodeToMigrate.setPluginData('ut', ''); + } + // migrate key (messageName) to message id + const messageName = textNodeToMigrate.getPluginData('key'); + if (messageName !== '') { + // TODO #14 migration - we skip the old format for new versions + textNodeToMigrate.setPluginData('mi', 'i' /* MessageStoreFigmaRoot.createMessageId(messageName, 0) */); + textNodeToMigrate.setPluginData('key', ''); + } + } + // TODO #14 migration implement migration + figma.root.setPluginData(this.lastMigrationKey, version); + }, + }, + ]; + } + migrate() { + const lastMigration = figma.root.getPluginData(this.lastMigrationKey); + for (const migration of this.migrations) { + if (this.isMigrationNeeded(lastMigration, migration.version)) { + migration.migrate(migration.version); + } + } + } + // eslint-disable-next-line class-methods-use-this, consistent-return + isMigrationNeeded(lastMigrationVersion, migrationVersion) { + if (lastMigrationVersion === '') { + return true; + } + const [majorMigrated, minorMigrated, figmaMigrated] = lastMigrationVersion.split('.'); + const [majorMigration, minorMigration, figmaMigration] = migrationVersion.split('.'); + if (parseInt(majorMigrated, 10) < parseInt(majorMigration, 10)) { + return true; + } + if (parseInt(majorMigrated, 10) > parseInt(majorMigration, 10)) { + return false; + } + if (parseInt(majorMigrated, 10) === parseInt(majorMigration, 10)) { + if (parseInt(minorMigrated, 10) < parseInt(minorMigration, 10)) { + return true; + } + if (parseInt(minorMigrated, 10) > parseInt(minorMigration, 10)) { + return false; + } + if (parseInt(minorMigrated, 10) === parseInt(minorMigration, 10)) { + if (parseInt(figmaMigrated, 10) < parseInt(figmaMigration, 10)) { + return true; + } + return false; + } + } + } +} + + +/***/ }), + +/***/ "./src/lib/rpc/AsyncFunctionProxy.ts": +/*!*******************************************!*\ + !*** ./src/lib/rpc/AsyncFunctionProxy.ts ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AsyncFunctionProxy: () => (/* binding */ AsyncFunctionProxy), +/* harmony export */ AsyncMessageBus: () => (/* binding */ AsyncMessageBus) +/* harmony export */ }); +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + 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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +/* eslint-disable max-classes-per-file */ +class AsyncMessageBus { +} +AsyncMessageBus.invocationResult = 'invocationResult'; +AsyncMessageBus.invocationRequest = 'invocationRequest'; +class AsyncFunctionProxy { + constructor(name, postMessage, messageBus) { + this.invocationId = 0; + this.invocationRequests = {}; + this.invocationRequestHandler = {}; + this.postMessage = (message) => { postMessage(message); }; + this.name = name; + try { + if (messageBus.addEventListener) { + messageBus.addEventListener('message', (event) => { + this.handleMessage(event.data.pluginMessage); + }); + } + else { + messageBus.on('message', (message) => { this.handleMessage(message); }); + } + } + catch (e) { + const error = new Error(`was not able to add event listener to receive events${name}`); + throw error; + } + } + handleMessage(message) { + if (message.target === 'AsyncFunctionProxy') { + if (message.type === AsyncMessageBus.invocationResult) { + this.handleInvocationResult(message); + } + else if (message.type === AsyncMessageBus.invocationRequest) { + this.handleInvocationRequest(message); + } + } + } + /** + * monkey patches all async method of the given instnce and proxies calls via figmas postMessage to + * sandbox or / the ui + * + * @param instance + */ + proxyAsyncMethods(instance) { + const instanceClassName = instance.proxyClassName; + const instancePrototype = Object.getPrototypeOf(instance); + for (const memberName of Object.getOwnPropertyNames(instancePrototype)) { + if (memberName !== 'constructor' + && instancePrototype[memberName].constructor + && instancePrototype[memberName].constructor.name === 'Function') { + const proxy = this; + // eslint-disable-next-line func-names -- we store this function anonymous in an array and there is no way to dynamically name it for better - thats fine + instancePrototype[memberName] = function () { + return __awaiter(this, arguments, void 0, function* () { + // console.log(proxy.name + ' request invocation of: ' + instanceClassName + '.' + memberName); + // eslint-disable-next-line prefer-rest-params -- proxy here we want just forward the arguments + return proxy.invoke(`${instanceClassName}.${memberName}`, Array.prototype.slice.call(arguments)); + }); + }; + } + } + } + registerInstance(instance) { + const instanceClassName = instance.proxyClassName; + // console.log(this.name+ ' proxy class:' + instanceClassName + Object.getOwnPropertyNames(instance)); + const instancePrototype = Object.getPrototypeOf(instance); + for (const memberName of Object.getOwnPropertyNames(instancePrototype)) { + if (memberName !== 'constructor' + && instancePrototype[memberName].constructor + && instancePrototype[memberName].constructor.name === 'Function') { + // console.log(this.name+ ' proxy class!' + instanceClassName + '.' + memberName); + this.registerInvocationHandler(`${instanceClassName}.${memberName}`, instance, instance[memberName]); + } + } + } + registerInvocationHandler(messageName, instance, messageHandler) { + // console.log(`registerInvocationHandler${messageName}`); + if (this.invocationRequestHandler[messageName]) { + // console.log(this.invocationRequestHandler[messageName]); + throw new Error(`${this.name} Message ${messageName} handler did exist already`); + } + this.invocationRequestHandler[messageName] = { + instance, + method: messageHandler, + }; + } + invoke(messageName, parameter) { + return __awaiter(this, void 0, void 0, function* () { + const invocationId = `${messageName}.${this.invocationId += 1}`; + return new Promise((resolve, reject) => { + this.invocationRequests[invocationId] = { + messageName, + resolve: resolve.bind(this), + reject: reject.bind(this), + }; + const message = { + target: 'AsyncFunctionProxy', + type: AsyncMessageBus.invocationRequest, + name: messageName, + id: invocationId, + parameter, + }; + this.postMessage(message); + }); + }); + } + handleInvocationRequest(pluginMessage) { + if (!this.invocationRequestHandler[pluginMessage.name]) { + throw new Error(`${this.name} Invocation handler for [${pluginMessage.name}] does not exist (did you register the executing instance in [${this.name}]?`); + } + const methodHandler = this.invocationRequestHandler[pluginMessage.name]; + methodHandler.method.apply(methodHandler.instance, pluginMessage.parameter).then((data) => { + const transferObj = { + target: 'AsyncFunctionProxy', + type: AsyncMessageBus.invocationResult, + invocationId: pluginMessage.id, + result: data, + }; + this.postMessage(transferObj); + }).catch((error) => { + // eslint-disable-next-line no-console + this.postMessage({ + target: 'AsyncFunctionProxy', + type: AsyncMessageBus.invocationResult, + invocationId: pluginMessage.id, + error: this.toSerializableError(error), + }); + }); + } + handleInvocationResult(pluginMessage) { + if (!this.invocationRequests[pluginMessage.invocationId]) { + throw Error(`${this.name} Invocation with id ${pluginMessage.invocationId} was not found `); + } + if (pluginMessage.error !== undefined) { + const error = this.fromSerializableError(pluginMessage.error); + this.invocationRequests[pluginMessage.invocationId].reject(error); + } + else { + const fn = this.invocationRequests[pluginMessage.invocationId].resolve; + // console.log(this.name, " handleInvocationResult result "+ fn + ' ' + JSON.stringify(pluginMessage)) + fn(pluginMessage.result); + } + return true; + } + // eslint-disable-next-line class-methods-use-this + toSerializableError(error) { + return { + message: error.message, + name: error.name, + stack: error.stack, + }; + } + // eslint-disable-next-line class-methods-use-this + fromSerializableError(serializedError) { + const { message, name, stack } = serializedError; + const error = new Error(message); + error.name = name; + error.stack = stack; + return error; + } +} + + +/***/ }), + +/***/ "./src/lib/windowManager/WindowManagerSandbox.ts": +/*!*******************************************************!*\ + !*** ./src/lib/windowManager/WindowManagerSandbox.ts ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ RESIZEDETECTION_OVERLAP_PX: () => (/* binding */ RESIZEDETECTION_OVERLAP_PX), +/* harmony export */ WindowManagerSandbox: () => (/* binding */ WindowManagerSandbox), +/* harmony export */ WindowMode: () => (/* binding */ WindowMode) +/* harmony export */ }); +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + 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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var WindowMode; +(function (WindowMode) { + WindowMode["IntroWindow"] = "introWindow"; + WindowMode["Minimized"] = "minimized"; + WindowMode["Window"] = "window"; + WindowMode["BottomSheet"] = "bottomSheet"; + WindowMode["Fullscreen"] = "fullscreen"; + WindowMode["DevPanel"] = "devPanel"; +})(WindowMode || (WindowMode = {})); +const RESIZEDETECTION_OVERLAP_PX = 5; +class WindowManagerSandbox { + static init(config, windowMode) { + if (this.instance) { + throw new Error('init called twice'); + } + // @ts-ignore --- figma does not provide this in ther typings yet + if (figma.editorType === 'dev') { + // eslint-disable-next-line no-param-reassign + windowMode = WindowMode.DevPanel; + } + this.instance = new WindowManagerSandbox(config, windowMode); + } + /** + * + * @param initalWidnwoWidth the width to use when showing the window the very first time + * @param initialWindowModeHeight + * @param initialBottomSheetHeight + * @param initalWindowMode + * @param enforceInitialConfig + */ + constructor(config, windowMode) { + this.proxyClassName = 'LocalizedLabelManager'; + this.titleBarHeight = 40; + // ### bottom sheet + this.bottomSheetHeight = 300; + // NOTE:: margins set to 0 for now since ruler will make the margins look odd + this.bottomSheetMarginRight = 0; + this.bottomSheetMarginLeft = 0; + // #### fullscreen + this.fullscreenMarginRight = 35; + this.fullscreenMarginLeft = 35; + this.fullscreenMarginTop = 35; + this.fullscreenMarginBottom = 35; + this.handlePluginX = -1; + this.handlePluginY = -1; + this.handledViewportZoom = -1; + this.handledViewportWidth = -1; + this.handledViewportHeight = -1; + this.viewPortResizing = false; + this.windowResizing = false; + this.wasDragged = false; + this.settleTime = 500; + this.reshowing = false; + this.bottomSheetHeight = config.bottomSheet.height; + this.windowModeSize = config.windowSize; + this.introModeSize = config.introWindowSize; + this.currentWindowMode = config.windowMode; + this.viewPortState = { + width: figma.viewport.bounds.width, + height: figma.viewport.bounds.height, + zoom: figma.viewport.zoom, + }; + console.log('awaiting promises'); + Promise.all([ + figma.clientStorage.getAsync('windowSize'), + figma.clientStorage.getAsync('windowBottomSheetHeight'), + figma.clientStorage.getAsync('windowMode'), + ]).then((values) => { + console.log('awaiting promises donef'); + const [storedWindowSize, storedWindowBottomSheetHeight, storedWindowMode] = values; + if (storedWindowSize + && storedWindowSize.width !== undefined + && !Number.isNaN(storedWindowSize.width) + && storedWindowSize.height !== undefined + && !Number.isNaN(storedWindowSize.height)) { + this.windowModeSize = storedWindowSize; + } + if (storedWindowBottomSheetHeight) { + this.bottomSheetHeight = storedWindowBottomSheetHeight; + } + if (windowMode) { + this.currentWindowMode = windowMode; + } + else { + this.currentWindowMode = storedWindowMode !== null && storedWindowMode !== void 0 ? storedWindowMode : config.windowMode; + } + const windowRect = this.calculateWindowRect(this.currentWindowMode); + const patchedHtml = __html__.split('__%%InitialWindowMode%%__').join(this.currentWindowMode); + figma.showUI(patchedHtml, { + themeColors: true, width: windowRect.width, height: windowRect.height, visible: false, + }); + // @ts-ignore -- figmas ui type does not expose the reposition atm + figma.ui.reposition(windowRect.x, windowRect.y); + console.log('calling show'); + figma.ui.show(); + this.viewportResizeCheckInterval = setInterval(() => { + // check if the viewports width has changed + this.checkForViewPortResize(true); + }, 1); + figma.ui.on('message', (message) => { + if (message.target === 'WindowManager') { + if (message.size) { + this.handleSizeMessage(message); + } + else if (message.requestedWindowMode !== undefined) { + this.setWindowMode(message.requestedWindowMode); + } + else if (message.windowOverlapChanged) { + this.onWindowOverlapChanged(); + } + } + }); + }); + } + checkForViewPortResize(fromCheckInterval = false) { + const previousZoom = this.viewPortState.zoom; + const previousWidth = this.viewPortState.width; + const previousHeight = this.viewPortState.height; + this.viewPortState = { + width: figma.viewport.bounds.width, + height: figma.viewport.bounds.height, + zoom: figma.viewport.zoom, + }; + // its not possible to zoom and resize the viewport at the same time + // only if there is no change in zoom a window positioning is needed + if (previousZoom === figma.viewport.zoom + && (previousWidth !== figma.viewport.bounds.width + || previousHeight !== figma.viewport.bounds.height)) { + console.log(`[WM] resize deteceted from ${fromCheckInterval ? 'interval' : 'drag'}`); + this.onViewPortResize(); + return true; + } + return false; + } + onWindowOverlapChanged() { + if (this.reshowing) { + console.log('[WM] skipping becaus reshowing'); + return; + } + if (!this.viewPortResizing && !this.checkForViewPortResize()) { + // drag detected! forces reshow + this.wasDragged = true; + if (this.currentWindowMode === WindowMode.BottomSheet) { + console.log('[WM] overlap changed - changing to window'); + // in case of the bottom sheet we always keep the windows size equal to the viewport size + const width = Math.ceil(figma.viewport.bounds.width * figma.viewport.zoom); + const height = this.bottomSheetHeight; + this.windowModeSize.width = width; + this.windowModeSize.height = height; + figma.clientStorage.setAsync('windowSize', this.windowModeSize); + this.setWindowMode(WindowMode.Window, this.windowModeSize); + // no resize needed since we keep the windows size of the bottom sheet. + } /* else if (this.currentWindowMode === WindowMode.Minimized) { + console.log('[WM] overlap changed - changing to window'); + + const newRect = this.calculateWindowRect(WindowMode.Window); + this.windowModeSize.height = newRect.height; + this.windowModeSize.width = newRect.width; + this.setWindowMode(WindowMode.Window, this.windowModeSize); + } */ + } + else { + console.log('[WM] overlap changed - viewport resize'); + } + } + onViewPortResize() { + console.log(`[WM] viewport resize ${this.currentWindowMode}`); + this.viewPortResizing = true; + // While viewport resizing is happening we don't accept window mode requests to not interferre with movement detection + if (this.viewPortResizeSettleTimeout) { + clearTimeout(this.viewPortResizeSettleTimeout); + } + this.viewPortResizeSettleTimeout = setTimeout(() => { + this.viewPortResizing = false; + }, this.settleTime); + if (this.currentWindowMode === WindowMode.BottomSheet + // || this.currentWindowMode === WindowMode.Minimized + || this.currentWindowMode === WindowMode.Fullscreen) { + const windowRect = this.calculateWindowRect(this.currentWindowMode); + console.log(`[WM] viewport resize updating rect: ${JSON.stringify(windowRect)}`); + this.updateWindowRect(windowRect); + } + } + setWindowMode(targetWindowMode, windowRect) { + return __awaiter(this, void 0, void 0, function* () { + const newWindowRect = windowRect !== null && windowRect !== void 0 ? windowRect : this.calculateWindowRect(targetWindowMode); + if (this.currentWindowMode !== WindowMode.BottomSheet + // && this.currentWindowMode !== WindowMode.Minimized + && this.currentWindowMode !== WindowMode.Fullscreen) { + // for screens without bottom overlap we asume it was draggeed + this.wasDragged = true; + } + this.updateWindowRect(newWindowRect); + this.currentWindowMode = targetWindowMode; + figma.clientStorage.setAsync('windowMode', targetWindowMode); + console.log(`[WM] WINDOW MODE SET TO ${this.currentWindowMode}`); + figma.ui.postMessage({ + target: 'WindowManager', + windowMode: this.currentWindowMode, + }); + if (!(this.currentWindowMode !== WindowMode.BottomSheet + // && this.currentWindowMode !== WindowMode.Minimized + && this.currentWindowMode !== WindowMode.Fullscreen)) { + // for screens without bottom overlap we asume it was draggeed + this.wasDragged = false; + } + }); + } + handleSizeMessage(message) { + switch (this.currentWindowMode) { + case WindowMode.BottomSheet: + // apply the new height to the window and recalculate the new window rect + this.bottomSheetHeight = Math.floor(message.size.height); + // eslint-disable-next-line no-case-declarations + const windowRect = this.calculateWindowRect(WindowMode.BottomSheet); + figma.clientStorage.setAsync('windowBottomSheetHeight', this.bottomSheetHeight); + this.updateWindowRect(windowRect); + break; + case WindowMode.Window: + if (message.size.width === undefined) { + throw new Error('width not provided handleSizeMessage for window mode'); + } + if (message.size.height === undefined) { + throw new Error('height not provided handleSizeMessage for window mode'); + } + this.windowModeSize = { + width: Math.floor(message.size.width), + height: Math.floor(message.size.height), + }; + figma.clientStorage.setAsync('windowSize', this.windowModeSize); + this.updateWindowRect(this.windowModeSize); + break; + case WindowMode.IntroWindow: + if (message.size.width) { + this.introModeSize.width = message.size.width; + } + if (message.size.height) { + this.introModeSize.height = message.size.height; + } + console.log('updating intor window size to ' + JSON.stringify(this.introModeSize)); + this.updateWindowRect(this.introModeSize); + break; + default: + throw new Error('resizing only supported in window and bottom sheet mode'); + } + } + calculateWindowRect(windowMode) { + var _a; + const leftPanelWidth = 240; + const rightPanelWidth = 240; + switch (windowMode) { + case WindowMode.DevPanel: + return { + width: Math.floor(rightPanelWidth), + height: 100, + x: 0, + y: 0, + }; + case WindowMode.Fullscreen: + return { + width: Math.floor(figma.viewport.bounds.width * figma.viewport.zoom + leftPanelWidth + rightPanelWidth - (this.fullscreenMarginLeft + this.fullscreenMarginRight)), + height: Math.floor(figma.viewport.bounds.height * figma.viewport.zoom - (this.titleBarHeight + this.fullscreenMarginTop + this.fullscreenMarginBottom)), + x: Math.floor(figma.viewport.bounds.x - ((leftPanelWidth) / figma.viewport.zoom) + (this.fullscreenMarginLeft / figma.viewport.zoom)), + y: Math.floor(figma.viewport.bounds.y + (this.fullscreenMarginTop / figma.viewport.zoom)), + }; + case WindowMode.BottomSheet: + return { + width: Math.floor(figma.viewport.bounds.width * figma.viewport.zoom - (this.bottomSheetMarginLeft + this.bottomSheetMarginRight)), + height: Math.floor(this.bottomSheetHeight), + x: Math.floor(figma.viewport.bounds.x + (this.bottomSheetMarginLeft / figma.viewport.zoom)), + y: Math.floor(figma.viewport.bounds.y + figma.viewport.bounds.height - ((this.bottomSheetHeight + this.titleBarHeight - RESIZEDETECTION_OVERLAP_PX) / figma.viewport.zoom)), + }; + case WindowMode.Window: + // TODO center window on switch to window mode - there is no way to save the window position at the moment + return { + width: Math.floor(this.windowModeSize.width), + height: Math.floor(this.windowModeSize.height), + x: Math.floor(figma.viewport.bounds.x + ((figma.viewport.bounds.width / 2) - ((this.windowModeSize.width / 2) / figma.viewport.zoom))), + y: Math.floor(figma.viewport.bounds.y + ((figma.viewport.bounds.height / 2) - (((this.windowModeSize.height + this.titleBarHeight) / 2) / figma.viewport.zoom))), + }; + case WindowMode.Minimized: + // eslint-disable-next-line no-case-declarations + const minimizedViewHeight = 42; + return { + width: 200, + height: Math.floor(minimizedViewHeight), + x: Math.floor(figma.viewport.bounds.x + (this.bottomSheetMarginLeft / figma.viewport.zoom)), + y: Math.floor(figma.viewport.bounds.y + figma.viewport.bounds.height - ((minimizedViewHeight + this.titleBarHeight - RESIZEDETECTION_OVERLAP_PX) / figma.viewport.zoom)), + }; + case WindowMode.IntroWindow: + // eslint-disable-next-line no-case-declarations + const centerHeight = (_a = this.introModeSize.centerHeight) !== null && _a !== void 0 ? _a : this.introModeSize.height; + return { + width: Math.floor(this.introModeSize.width), + height: Math.floor(this.introModeSize.height), + x: Math.floor(figma.viewport.bounds.x + ((figma.viewport.bounds.width / 2) - ((this.introModeSize.width / 2) / figma.viewport.zoom))), + y: Math.floor(figma.viewport.bounds.y + ((figma.viewport.bounds.height / 2) - (((centerHeight + this.titleBarHeight) / 2) / figma.viewport.zoom))), + }; + default: + throw new Error(`Unsupported Window mode ${windowMode}`); + } + } + /** + * This function updates the windo rect (x, y, width, height) + * While resize is not a problem, reposition is broken when the window is manually moved + * once by the user. The problem can be workearound by hiding and showing the window. + * Since we can't know when the window was moved (we don't have an event nor acces to the postion of the window). + * We trigger it on every mode switch. + * @param windowRect the x, y to move the window (optional), width, height to apply to the window + * @param forceReshow pass false to skip the reshow workarround (for example in the bootom sheet) + */ + updateWindowRect(windowRect) { + console.log('[WM] windowRect'); + if (windowRect.x && windowRect.y && this.wasDragged) { + console.log('[WM] reshow needed'); + figma.ui.hide(); + this.reshowing = true; + setTimeout(() => { + figma.ui.show(); + setTimeout(() => { + console.log('[WM] reshow done'); + this.reshowing = false; + }, 100); + }, 1); + } + // here we are save to resize and reposition + figma.ui.resize(windowRect.width, windowRect.height); + if (windowRect.x && windowRect.y) { + // @ts-ignore + figma.ui.reposition(windowRect.x, windowRect.y); + } + } +} + + +/***/ }), + +/***/ "./src/shared/FigmaHelper.ts": +/*!***********************************!*\ + !*** ./src/shared/FigmaHelper.ts ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ FigmaHelper) +/* harmony export */ }); +/* eslint-disable -- TODO remove this when most of the class is used again */ +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + 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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +const defaultLinkStyleKey = 'defaultLinkStyle'; +class FigmaHelper { + constructor(figma) { + this.proxyClassName = 'FigmaHelper'; + this.figma = figma; + } + toggleKeyFrame(frameNodeId) { + return __awaiter(this, void 0, void 0, function* () { + const frame = figma.getNodeById(frameNodeId); + if (!frame) { + return; + } + /* + let showSamleValues = frame.getPluginData(FigmaLocaliziationKeyHelper.sampleValuesDataKey) == '' ? false : true; + + console.log('[' +frame.getPluginData(FigmaLocaliziationKeyHelper.sampleValuesDataKey) +']'); + if (showSamleValues) { + console.log("showSamleValues true - setting it to none" ); + frame.setPluginData(FigmaLocaliziationKeyHelper.sampleValuesDataKey, ''); + } else { + console.log("showSamleValues false - setting it to true" ); + frame.setPluginData(FigmaLocaliziationKeyHelper.sampleValuesDataKey, 'true'); + } + */ + // this.drawKeyFrame(frame); + yield this.updateFrame(frame); + }); + } + // async drawKeyFrame(frameNodeId: string, labelManager: LocalizedLabelManager) { + // const frame = figma.getNodeById(frameNodeId); + // const MARGIN = 50; + // let translatedFrame = await labelManager.getFrameById(frameNodeId); + // let keyFrame: FrameNode | null = null + // /*if (frame.getPluginData('keyFrameId')) { + // let oldFrame = figma.getNodeById(frame.getPluginData('keyFrameId')) as FrameNode | null + // if (oldFrame) { + // oldFrame.remove() + // } + // }*/ + // keyFrame = figma.createFrame(); + // keyFrame.name = "Localized Keys" + // // frame.setPluginData('keyFrameId', keyFrame.id); + // let frameFrame = frame as FrameNode + // keyFrame.x = frameFrame.x - MARGIN + // keyFrame.y = frameFrame.y - MARGIN + // keyFrame.fills = [{ + // type: 'SOLID', + // visible: false, + // color: { r: 200 / 255, g: 200 / 255, b: 200 / 255 }, + // }]; + // let fontToLoad = null; + // let maxRight = 0; + // let maxBottom = (frame as FrameNode).height; + // let i = 0; + // for (let nodeWithKey of translatedFrame.localizedLabelsInFrame) { + // if (nodeWithKey.messageLinkState !== MessageLinkState.Linked) { + // continue; + // } + // let textNode = figma.createText() + // textNode.y = MARGIN + (40 * i); + // textNode.x = frameFrame.width + MARGIN + MARGIN; + // if (!fontToLoad) { + // fontToLoad = textNode.fontName as FontName + // // Load the font in the text node before setting the characters + // await figma.loadFontAsync(fontToLoad); + // } + // // Set bigger font size and red color + // textNode.fontSize = 18 + // textNode.fills = [{ type: 'SOLID', color: { r: 1, g: 1, b: 1 } }] + // textNode.characters = nodeWithKey.messageId!; + // maxRight = Math.max(textNode.x + textNode.width, maxRight); + // maxBottom = Math.max(textNode.y + textNode.height, maxBottom); + // keyFrame.appendChild(textNode); + // // Move to (50, 50) + // const x1 = nodeWithKey.x + (nodeWithKey.width / 2) + MARGIN; + // const y1 = nodeWithKey.y + MARGIN; + // const x2 = textNode.x - 5; + // const y2 = textNode.y + (textNode.height / 2); + // let leftTop = { + // x: x1 < x2 ? x1 : x2, + // y: y1 < y2 ? y1 : y2, + // } + // let rightBottom = { + // x: x1 > x2 ? x1 : x2, + // y: y1 > y2 ? y1 : y2, + // } + // const width = rightBottom.x - leftTop.x; + // const height = rightBottom.y - leftTop.y; + // const length = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)) + // let line = figma.createLine(); + // line.x = x1; + // line.y = y1; + // line.name = nodeWithKey.messageId! + // // Make line 200px long + // line.resize(length, 0); + // // 4px thick red line with arrows at each end + // line.strokeWeight = 1 + // line.strokes = [{ type: 'SOLID', color: { r: 0, g: 0, b: 0 } }] + // line.dashPattern = [2, 2] + // const width2 = x2 - x1; + // const height2 = y2 - y1; + // line.rotation = -Math.atan2(height2, width2) * 180 / Math.PI; + // keyFrame.appendChild(line); + // i++; + // } + // keyFrame.resize(maxRight + MARGIN, maxBottom + MARGIN); + // const fills: Paint[] = [{ + // type: 'SOLID', + // color: { r: 200 / 255, g: 200 / 255, b: 200 / 255 }, + // opacity: 0.28 + // }]; + // // draw a semi transparent box around the original frame + // const rectLeft = figma.createRectangle(); + // rectLeft.x = 0 + // rectLeft.y = 0 + // rectLeft.resize(MARGIN, maxBottom + MARGIN) + // rectLeft.fills = fills; + // keyFrame.insertChild(0, rectLeft); + // const rectRight = figma.createRectangle(); + // rectRight.x = frameFrame.width + MARGIN; + // rectRight.y = 0 + // rectRight.resize(maxRight - MARGIN - frameFrame.width, maxBottom + MARGIN) + // rectRight.fills = fills; + // keyFrame.insertChild(0, rectRight); + // const rectTop = figma.createRectangle(); + // rectTop.x = MARGIN + // rectTop.y = 0 + // rectTop.resize(frameFrame.width, MARGIN - 30) + // rectTop.fills = fills; + // keyFrame.insertChild(0, rectTop); + // const rectBottom = figma.createRectangle(); + // rectBottom.x = MARGIN + // rectBottom.y = frameFrame.height + MARGIN; + // rectBottom.resize(frameFrame.width, maxBottom - frameFrame.height + MARGIN) + // rectBottom.fills = fills; + // keyFrame.insertChild(0, rectBottom); + // } + updateFrame(frame) { + return __awaiter(this, void 0, void 0, function* () { + /* + console.log('updateFrame extractAllKeysFromChildMixin') + let nodesWithKeys = FigmaLocaliziationHelper.extractAllKeysFromChildMixin(frame as ChildrenMixin, []) + let language = frame.getPluginData(FigmaLocaliziationHelper.languageDataKey) == '' ? 'none' : frame.getPluginData(FigmaLocaliziationHelper.languageDataKey); + + let useSampleValues = frame.getPluginData(FigmaLocaliziationHelper.sampleValuesDataKey) == '' ? false : true; + + await (new FigmaUtil()).loadFontsForNodesWithId(nodesWithKeys.map(nodeWithKey => nodeWithKey.nodeId)); + + for (let nodeWithKey of nodesWithKeys) { + + if (language === 'none') { + break; + } + + this.messageStore!.enrichLocalizationState(nodeWithKey, language as Language); + let textNodeId = nodeWithKey.nodeId; + + if (language == 'keys') { + await this.updateTextNode(textNodeId, nodeWithKey.key, undefined, true); + } else { + + let textNode = figma.getNodeById(textNodeId)! as TextNode; + let pluralId = textNode.getPluginData('pluralId') === '' ? Plural.Other : textNode.getPluginData('pluralId'); + + let selectedPlural = nodeWithKey.translataions?.[pluralId] + if (selectedPlural && selectedPlural.translation && selectedPlural.translationFilled ) { + let text = selectedPlural.translation + if (useSampleValues) { + text = selectedPlural.translationFilled + } + await this.updateTextNode(textNodeId, text, pluralId, true); + } + + } + } + console.log((new Date()).getTime()+' updateFrame done') + */ + }); + } +} + + +/***/ }), + +/***/ "./src/shared/FigmaUtil.ts": +/*!*********************************!*\ + !*** ./src/shared/FigmaUtil.ts ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ FigmaUtil) +/* harmony export */ }); +/* harmony import */ var _lib_windowManager_WindowManagerSandbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/windowManager/WindowManagerSandbox */ "./src/lib/windowManager/WindowManagerSandbox.ts"); +/* eslint-disable class-methods-use-this -- this class gets proxied using the async proxy - this doesn't work with static methods for now :-/ */ +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + 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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; + +/** + * Figma api wrapper that simplifies varios task. + * All public async functions only accept and return primitives and can be proxied between sandbox and iframe + */ +class FigmaUtil { + constructor() { + this.proxyClassName = 'FigmaUtil'; + } + getFileKey() { + let fileKey = figma.root.getPluginData('uniqFileKey'); + if (!fileKey) { + fileKey = `${Math.floor(Math.random() * 100)}`; + figma.root.setPluginData('uniqFileKey', fileKey); + } + return fileKey; + } + setRootPluginData(key, value) { + return __awaiter(this, void 0, void 0, function* () { + this.setRootPluginDataSync(key, value); + }); + } + setRootPluginDataSync(key, value) { + figma.root.setPluginData(key, value); + } + getRootPluginData(key) { + return __awaiter(this, void 0, void 0, function* () { + return this.getRootPluginDataSync(key); + }); + } + getRootPluginDataSync(key) { + return figma.root.getPluginData(key); + } + notify(message) { + return __awaiter(this, void 0, void 0, function* () { + figma.notify(message); + }); + } + notifyError(message) { + return __awaiter(this, void 0, void 0, function* () { + figma.notify(message, { + timeout: 3000, + error: true, + }); + }); + } + getUserId() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + return (_a = figma.currentUser) === null || _a === void 0 ? void 0 : _a.id; + }); + } + getImageFromFrame(nodeId, settings) { + return __awaiter(this, void 0, void 0, function* () { + const node = figma.getNodeById(nodeId); + const imageAsUint8Array = yield node.exportAsync(settings); + return imageAsUint8Array; + }); + } + // async drawKeyFrame(frameNodeId: string, name: string, localizedLabelsInFrame: LocalizedLabel[]) { + // const frame = figma.getNodeById(frameNodeId); + // const MARGIN = 50; + // let keyFrame: FrameNode | null = null; + // /* if (frame.getPluginData('keyFrameId')) { + // let oldFrame = figma.getNodeById(frame.getPluginData('keyFrameId')) as FrameNode | null + // if (oldFrame) { + // oldFrame.remove() + // } + // } */ + // keyFrame = figma.createFrame(); + // keyFrame.name = 'Localized Keys'; + // // frame.setPluginData('keyFrameId', keyFrame.id); + // const frameFrame = frame as FrameNode; + // keyFrame.x = frameFrame.x - MARGIN; + // keyFrame.y = frameFrame.y - MARGIN; + // keyFrame.fills = [{ + // type: 'SOLID', + // visible: false, + // color: { r: 200 / 255, g: 200 / 255, b: 200 / 255 }, + // }]; + // let fontToLoad = null; + // const containerRatio = 2; // (frame as FrameNode).height / (frame as FrameNode).width; + // const sortedNodes = localizedLabelsInFrame.sort((a, b) => Math.hypot(a.x, a.y * containerRatio) - Math.hypot(b.x, b.y * containerRatio)); + // let maxRight = 0; + // let maxBottom = (frame as FrameNode).height; + // let i = 0; + // for (const nodeWithKey of sortedNodes) { + // if (nodeWithKey.messageLinkState !== MessageLinkState.Linked) { + // // eslint-disable-next-line no-continue + // continue; + // } + // const textNode = figma.createText(); + // textNode.y = MARGIN + (40 * i); + // textNode.x = frameFrame.width + MARGIN + MARGIN; + // if (!fontToLoad) { + // fontToLoad = textNode.fontName as FontName; + // // Load the font in the text node before setting the characters + // // eslint-disable-next-line no-await-in-loop + // await figma.loadFontAsync(fontToLoad); + // } + // // Set bigger font size and red color + // textNode.fontSize = 18; + // textNode.fills = [{ type: 'SOLID', color: { r: 1, g: 1, b: 1 } }]; + // textNode.characters = nodeWithKey.messageId!; + // maxRight = Math.max(textNode.x + textNode.width, maxRight); + // maxBottom = Math.max(textNode.y + textNode.height, maxBottom); + // keyFrame.appendChild(textNode); + // // Move to (50, 50) + // const x1 = nodeWithKey.x + (nodeWithKey.width / 2) + MARGIN; + // const y1 = nodeWithKey.y + MARGIN; + // const x2 = textNode.x - 5; + // const y2 = textNode.y + (textNode.height / 2); + // const leftTop = { + // x: x1 < x2 ? x1 : x2, + // y: y1 < y2 ? y1 : y2, + // }; + // const rightBottom = { + // x: x1 > x2 ? x1 : x2, + // y: y1 > y2 ? y1 : y2, + // }; + // const width = rightBottom.x - leftTop.x; + // const height = rightBottom.y - leftTop.y; + // const length = Math.sqrt(width ** 2 + height ** 2); + // const line = figma.createLine(); + // line.x = x1; + // line.y = y1; + // line.name = nodeWithKey.messageId!; + // // Make line 200px long + // line.resize(length, 0); + // // 4px thick red line with arrows at each end + // line.strokeWeight = 1; + // line.strokes = [{ type: 'SOLID', color: { r: 0, g: 0, b: 0 } }]; + // line.dashPattern = [2, 2]; + // const width2 = x2 - x1; + // const height2 = y2 - y1; + // line.rotation = -Math.atan2(height2, width2) * 180 / Math.PI; + // keyFrame.appendChild(line); + // i++; + // } + // keyFrame.resize(maxRight + MARGIN, maxBottom + MARGIN); + // const fills: Paint[] = [{ + // type: 'SOLID', + // color: { r: 200 / 255, g: 200 / 255, b: 200 / 255 }, + // opacity: 0.28, + // }]; + // // draw a semi transparent box around the original frame + // const rectLeft = figma.createRectangle(); + // rectLeft.x = 0; + // rectLeft.y = 0; + // rectLeft.resize(MARGIN, maxBottom + MARGIN); + // rectLeft.fills = fills; + // keyFrame.insertChild(0, rectLeft); + // const rectRight = figma.createRectangle(); + // rectRight.x = frameFrame.width + MARGIN; + // rectRight.y = 0; + // rectRight.resize(maxRight - MARGIN - frameFrame.width, maxBottom + MARGIN); + // rectRight.fills = fills; + // keyFrame.insertChild(0, rectRight); + // const rectTop = figma.createRectangle(); + // rectTop.x = MARGIN; + // rectTop.y = 0; + // rectTop.resize(frameFrame.width, MARGIN - 30); + // rectTop.fills = fills; + // keyFrame.insertChild(0, rectTop); + // const rectBottom = figma.createRectangle(); + // rectBottom.x = MARGIN; + // rectBottom.y = frameFrame.height + MARGIN; + // rectBottom.resize(frameFrame.width, maxBottom - frameFrame.height + MARGIN); + // rectBottom.fills = fills; + // keyFrame.insertChild(0, rectBottom); + // } + getLocalFileConfig(key) { + return __awaiter(this, void 0, void 0, function* () { + const fileKey = this.getFileKey(); + const value = yield figma.clientStorage.getAsync(`${fileKey}__${key}`); + // console.log(`${fileKey}__${key} - ${value} GET LOCALFILE`); + return value !== '' ? value : undefined; + }); + } + setLocalFileConfig(key, value) { + return __awaiter(this, void 0, void 0, function* () { + const fileKey = this.getFileKey(); + // console.log(`${fileKey}__${key} - ${value} SET LOCALFILE`); + return figma.clientStorage.setAsync(`${fileKey}__${key}`, value); + }); + } + ensureZoomLevelShowsNode(nodeId) { + return __awaiter(this, void 0, void 0, function* () { + const nodeToScrollAndZoomIntoView = figma.getNodeById(nodeId); + const viewportRect = figma.viewport.bounds; + const virtualViewportRect = Object.assign({}, viewportRect); + const nodeRect = nodeToScrollAndZoomIntoView.absoluteBoundingBox; + const zoomMarginLeft = 60; // we add another 30 for the ruler + const zoomMarginRight = 30; + const zoomMarginTop = 60; // we add another 30 for the ruler + const zoomMarginBottom = 30; + const normalizedViewportWidth = virtualViewportRect.width * figma.viewport.zoom; + const requiredZoomForWidth = normalizedViewportWidth / (nodeRect.width + zoomMarginLeft + zoomMarginRight); + const normalizedViewportHeight = virtualViewportRect.height * figma.viewport.zoom; + const requiredZoomForHeight = normalizedViewportHeight / (nodeRect.height + zoomMarginTop + zoomMarginBottom); + const zoomFactor = Math.min(requiredZoomForWidth, Math.min(requiredZoomForHeight, figma.viewport.zoom)); + if (zoomFactor !== figma.viewport.zoom) { + figma.viewport.zoom = zoomFactor; + } + }); + } + scrollIntoViewIfNeeded(nodeId, select) { + return __awaiter(this, void 0, void 0, function* () { + yield this.ensureZoomLevelShowsNode(nodeId); + // console.log('scrollIntoViewIfNeeded'); + const nodeToScrollAndZoomIntoView = figma.getNodeById(nodeId); + const nodeRect = nodeToScrollAndZoomIntoView.absoluteBoundingBox; + const nodeCenterX = nodeRect.x + nodeRect.width / 2; + const nodeCenterY = nodeRect.y + nodeRect.height / 2; + const viewportRect = figma.viewport.bounds; + const virtualViewportRect = Object.assign({}, viewportRect); + const heightCorrection = _lib_windowManager_WindowManagerSandbox__WEBPACK_IMPORTED_MODULE_0__.WindowManagerSandbox.instance.currentWindowMode === _lib_windowManager_WindowManagerSandbox__WEBPACK_IMPORTED_MODULE_0__.WindowMode.BottomSheet ? (_lib_windowManager_WindowManagerSandbox__WEBPACK_IMPORTED_MODULE_0__.WindowManagerSandbox.instance.bottomSheetHeight + _lib_windowManager_WindowManagerSandbox__WEBPACK_IMPORTED_MODULE_0__.WindowManagerSandbox.instance.titleBarHeight) / figma.viewport.zoom : 0; + virtualViewportRect.height -= heightCorrection; + // console.log(nodeRect); + // console.log(viewportRect); + if (select) { + yield this.selectNodes([nodeId]); + } + const center = Object.assign({}, figma.viewport.center); + const zoomMarginLeft = 60 / figma.viewport.zoom; // we add another 30 for the ruler + const zoomMarginRight = 30 / figma.viewport.zoom; + const zoomMarginTop = 60 / figma.viewport.zoom; // we add another 30 for the ruler + const zoomMarginBottom = 30 / figma.viewport.zoom; + if (nodeRect) { + if (nodeRect.x < virtualViewportRect.x) { + // node left to the viewport + center.x = nodeCenterX + virtualViewportRect.width / 2 - nodeRect.width / 2 - zoomMarginLeft; + } + else if (nodeRect.x + nodeRect.width > virtualViewportRect.x + virtualViewportRect.width) { + // node right to the viewoport + center.x = nodeCenterX - virtualViewportRect.width / 2 + nodeRect.width / 2 + zoomMarginRight; + } + if (nodeRect.y < virtualViewportRect.y) { + // node above of the viewport + center.y = nodeCenterY + viewportRect.height / 2 - nodeRect.height / 2 - zoomMarginTop; + } + else if (nodeRect.y + nodeRect.height > virtualViewportRect.y + virtualViewportRect.height) { + // node below the viewport + center.y = nodeCenterY - viewportRect.height / 2 + nodeRect.height / 2 + zoomMarginBottom + heightCorrection; // + nodeRect.height + zoomMargin + heightCorrection; + } + } + figma.viewport.center = center; + if (select) { + yield this.selectNodes([nodeId]); + } + }); + } + getSelectedNodeIds() { + return __awaiter(this, void 0, void 0, function* () { + return figma.currentPage.selection.map((node) => node.id); + }); + } + selectNodes(nodeIds) { + return __awaiter(this, void 0, void 0, function* () { + const nodesToSelect = []; + for (const nodeId of nodeIds) { + const node = figma.getNodeById(nodeId); + if (!node) { + console.log(`WARNING: node with id ${nodeId} not found in select nodes`); + continue; + } + nodesToSelect.push(node); + } + if (nodesToSelect.length > 0) { + figma.currentPage.selection = nodesToSelect; + } + }); + } + scrollAndZoomNodesIntoView(nodeIds) { + return __awaiter(this, void 0, void 0, function* () { + const nodesToSelect = []; + for (const nodeId of nodeIds) { + const node = figma.getNodeById(nodeId); + if (!node) { + console.log(`WARNING: node with id ${nodeId} not found in select nodes`); + continue; + } + nodesToSelect.push(node); + } + if (nodesToSelect.length > 0) { + figma.viewport.scrollAndZoomIntoView(nodesToSelect); + } + }); + } + loadFontsForNodesWithId(textNodeIds) { + return __awaiter(this, void 0, void 0, function* () { + yield this.loadFontForTextNodes(textNodeIds.map((textNodeId) => figma.getNodeById(textNodeId))); + }); + } + loadFontForTextNodes(textNodes) { + return __awaiter(this, void 0, void 0, function* () { + const fontsToLoad = []; + for (const textNode of textNodes) { + this.getFonts(textNode, fontsToLoad); + } + yield this.loadFonts(fontsToLoad); + }); + } + loadFonts(fontArray = []) { + return __awaiter(this, void 0, void 0, function* () { + yield Promise.all(fontArray.map(figma.loadFontAsync)); + }); + } + getFonts(textNode, fontArray = []) { + if (textNode.characters.length === 0) { + if (!fontArray.find((font) => font.family === textNode.fontName.family && font.style === textNode.fontName.style)) { + fontArray.push(textNode.fontName); + } + } + else { + const fontsToLoad = textNode.getRangeAllFontNames(0, textNode.characters.length); + for (const fontToLoad of fontsToLoad) { + if (!fontArray.find((font) => font.family === fontToLoad.family && font.style === fontToLoad.style)) { + fontArray.push(fontToLoad); + } + } + } + } +} + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!*****************************!*\ + !*** ./src/sandbox/code.ts ***! + \*****************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _lib_rpc_AsyncFunctionProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/rpc/AsyncFunctionProxy */ "./src/lib/rpc/AsyncFunctionProxy.ts"); +/* harmony import */ var _lib_migrations_MigrationManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/migrations/MigrationManager */ "./src/lib/migrations/MigrationManager.ts"); +/* harmony import */ var _shared_FigmaUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/FigmaUtil */ "./src/shared/FigmaUtil.ts"); +/* harmony import */ var _shared_FigmaHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/FigmaHelper */ "./src/shared/FigmaHelper.ts"); +/* harmony import */ var _lib_windowManager_WindowManagerSandbox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/windowManager/WindowManagerSandbox */ "./src/lib/windowManager/WindowManagerSandbox.ts"); +/* harmony import */ var _lib_localizedlabels_LocalizedLabelManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/localizedlabels/LocalizedLabelManager */ "./src/lib/localizedlabels/LocalizedLabelManager.ts"); +/* harmony import */ var _lib_message_store_InlangMessageStoreFigmaRoot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../lib/message/store/InlangMessageStoreFigmaRoot */ "./src/lib/message/store/InlangMessageStoreFigmaRoot.ts"); +/* eslint-disable no-await-in-loop */ +// This plugin will open a window to prompt the user to enter a number, and +// it will then create that many rectangles on the screen. +// This file holds the main code for the plugins. It has access to the *document*. +// You can access browser APIs in the + \ No newline at end of file diff --git a/versions/dev/ui.js b/versions/dev/ui.js new file mode 100644 index 0000000..d74ab1f --- /dev/null +++ b/versions/dev/ui.js @@ -0,0 +1,131008 @@ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ createCache) +/* harmony export */ }); +/* harmony import */ var _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/sheet */ "./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Tokenizer.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Utility.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Enum.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Serializer.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Middleware.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Parser.js"); +/* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js"); +/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"); + + + + + +var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) { + var previous = 0; + var character = 0; + + while (true) { + previous = character; + character = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)(); // &\f + + if (previous === 38 && character === 12) { + points[index] = 1; + } + + if ((0,stylis__WEBPACK_IMPORTED_MODULE_3__.token)(character)) { + break; + } + + (0,stylis__WEBPACK_IMPORTED_MODULE_3__.next)(); + } + + return (0,stylis__WEBPACK_IMPORTED_MODULE_3__.slice)(begin, stylis__WEBPACK_IMPORTED_MODULE_3__.position); +}; + +var toRules = function toRules(parsed, points) { + // pretend we've started with a comma + var index = -1; + var character = 44; + + do { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_3__.token)(character)) { + case 0: + // &\f + if (character === 38 && (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)() === 12) { + // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings + // stylis inserts \f after & to know when & where it should replace this sequence with the context selector + // and when it should just concatenate the outer and inner selectors + // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here + points[index] = 1; + } + + parsed[index] += identifierWithPointTracking(stylis__WEBPACK_IMPORTED_MODULE_3__.position - 1, points, index); + break; + + case 2: + parsed[index] += (0,stylis__WEBPACK_IMPORTED_MODULE_3__.delimit)(character); + break; + + case 4: + // comma + if (character === 44) { + // colon + parsed[++index] = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)() === 58 ? '&\f' : ''; + points[index] = parsed[index].length; + break; + } + + // fallthrough + + default: + parsed[index] += (0,stylis__WEBPACK_IMPORTED_MODULE_4__.from)(character); + } + } while (character = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.next)()); + + return parsed; +}; + +var getRules = function getRules(value, points) { + return (0,stylis__WEBPACK_IMPORTED_MODULE_3__.dealloc)(toRules((0,stylis__WEBPACK_IMPORTED_MODULE_3__.alloc)(value), points)); +}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11 + + +var fixedElements = /* #__PURE__ */new WeakMap(); +var compat = function compat(element) { + if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo + // negative .length indicates that this rule has been already prefixed + element.length < 1) { + return; + } + + var value = element.value, + parent = element.parent; + var isImplicitRule = element.column === parent.column && element.line === parent.line; + + while (parent.type !== 'rule') { + parent = parent.parent; + if (!parent) return; + } // short-circuit for the simplest case + + + if (element.props.length === 1 && value.charCodeAt(0) !== 58 + /* colon */ + && !fixedElements.get(parent)) { + return; + } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level) + // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent" + + + if (isImplicitRule) { + return; + } + + fixedElements.set(element, true); + var points = []; + var rules = getRules(value, points); + var parentRules = parent.props; + + for (var i = 0, k = 0; i < rules.length; i++) { + for (var j = 0; j < parentRules.length; j++, k++) { + element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i]; + } + } +}; +var removeLabel = function removeLabel(element) { + if (element.type === 'decl') { + var value = element.value; + + if ( // charcode for l + value.charCodeAt(0) === 108 && // charcode for b + value.charCodeAt(2) === 98) { + // this ignores label + element["return"] = ''; + element.value = ''; + } + } +}; +var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason'; + +var isIgnoringComment = function isIgnoringComment(element) { + return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1; +}; + +var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { + return function (element, index, children) { + if (element.type !== 'rule' || cache.compat) return; + var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); + + if (unsafePseudoClasses) { + var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent` + // + // considering this input: + // .a { + // .b /* comm */ {} + // color: hotpink; + // } + // we get output corresponding to this: + // .a { + // & { + // /* comm */ + // color: hotpink; + // } + // .b {} + // } + + var commentContainer = isNested ? element.parent.children : // global rule at the root level + children; + + for (var i = commentContainer.length - 1; i >= 0; i--) { + var node = commentContainer[i]; + + if (node.line < element.line) { + break; + } // it is quite weird but comments are *usually* put at `column: element.column - 1` + // so we seek *from the end* for the node that is earlier than the rule's `element` and check that + // this will also match inputs like this: + // .a { + // /* comm */ + // .b {} + // } + // + // but that is fine + // + // it would be the easiest to change the placement of the comment to be the first child of the rule: + // .a { + // .b { /* comm */ } + // } + // with such inputs we wouldn't have to search for the comment at all + // TODO: consider changing this comment placement in the next major version + + + if (node.column < element.column) { + if (isIgnoringComment(node)) { + return; + } + + break; + } + } + + unsafePseudoClasses.forEach(function (unsafePseudoClass) { + console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); + }); + } + }; +}; + +var isImportRule = function isImportRule(element) { + return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; +}; + +var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) { + for (var i = index - 1; i >= 0; i--) { + if (!isImportRule(children[i])) { + return true; + } + } + + return false; +}; // use this to remove incorrect elements from further processing +// so they don't get handed to the `sheet` (or anything else) +// as that could potentially lead to additional logs which in turn could be overhelming to the user + + +var nullifyElement = function nullifyElement(element) { + element.type = ''; + element.value = ''; + element["return"] = ''; + element.children = ''; + element.props = ''; +}; + +var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) { + if (!isImportRule(element)) { + return; + } + + if (element.parent) { + console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); + nullifyElement(element); + } else if (isPrependedWithRegularRules(index, children)) { + console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); + nullifyElement(element); + } +}; + +/* eslint-disable no-fallthrough */ + +function prefix(value, length) { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.hash)(value, length)) { + // color-adjust + case 5103: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'print-' + value + value; + // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) + + case 5737: + case 4201: + case 3177: + case 3433: + case 1641: + case 4457: + case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break + + case 5572: + case 6356: + case 5844: + case 3191: + case 6645: + case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, + + case 6391: + case 5879: + case 5623: + case 6135: + case 4599: + case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) + + case 4215: + case 6389: + case 5109: + case 5365: + case 5621: + case 3829: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + value; + // appearance, user-select, transform, hyphens, text-size-adjust + + case 5349: + case 4246: + case 4810: + case 6968: + case 2756: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + // flex, flex-direction + + case 6828: + case 4268: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + // order + + case 6165: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-' + value + value; + // align-items + + case 5187: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(\w+).+(:[^]+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-$1$2' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-$1$2') + value; + // align-self + + case 5443: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-item-' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /flex-|-self/, '') + value; + // align-content + + case 4675: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-line-pack' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /align-content|flex-|-self/, '') + value; + // flex-shrink + + case 5548: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'shrink', 'negative') + value; + // flex-basis + + case 5292: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'basis', 'preferred-size') + value; + // flex-grow + + case 6060: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, '-grow', '') + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'grow', 'positive') + value; + // transition + + case 4554: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /([^-])(transform)/g, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2') + value; + // cursor + + case 6187: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(zoom-|grab)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1'), /(image-set)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1'), value, '') + value; + // background, background-image + + case 5495: + case 3959: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(image-set\([^]*)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1' + '$`$1'); + // justify-content + + case 4968: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)(flex-)?(.*)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-pack:$3' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + value; + // (margin|padding)-inline-(start|end) + + case 4095: + case 3583: + case 4068: + case 2532: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+)-inline(.+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1$2') + value; + // (min|max)?(width|height|inline-size|block-size) + + case 8116: + case 7059: + case 5753: + case 5535: + case 5445: + case 5701: + case 4933: + case 4677: + case 5533: + case 5789: + case 5021: + case 4765: + // stretch, max-content, min-content, fill-available + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.strlen)(value) - 1 - length > 6) switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 1)) { + // (m)ax-content, (m)in-content + case 109: + // - + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 4) !== 45) break; + // (f)ill-available, (f)it-content + + case 102: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)(.+)-([^]+)/, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2-$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 3) == 108 ? '$3' : '$2-$3')) + value; + // (s)tretch + + case 115: + return ~(0,stylis__WEBPACK_IMPORTED_MODULE_4__.indexof)(value, 'stretch') ? prefix((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'stretch', 'fill-available'), length) + value : value; + } + break; + // position: sticky + + case 4949: + // (s)ticky? + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 1) !== 115) break; + // display: (flex|inline-flex) + + case 6444: + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, (0,stylis__WEBPACK_IMPORTED_MODULE_4__.strlen)(value) - 3 - (~(0,stylis__WEBPACK_IMPORTED_MODULE_4__.indexof)(value, '!important') && 10))) { + // stic(k)y + case 107: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, ':', ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT) + value; + // (inline-)?fl(e)x + + case 101: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + '$2box$3') + value; + } + + break; + // writing-mode + + case 5936: + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 11)) { + // vertical-l(r) + case 114: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'tb') + value; + // vertical-r(l) + + case 108: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value; + // horizontal(-)tb + + case 45: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'lr') + value; + } + + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + } + + return value; +} + +var prefixer = function prefixer(element, index, children, callback) { + if (element.length > -1) if (!element["return"]) switch (element.type) { + case stylis__WEBPACK_IMPORTED_MODULE_5__.DECLARATION: + element["return"] = prefix(element.value, element.length); + break; + + case stylis__WEBPACK_IMPORTED_MODULE_5__.KEYFRAMES: + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + value: (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(element.value, '@', '@' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT) + })], callback); + + case stylis__WEBPACK_IMPORTED_MODULE_5__.RULESET: + if (element.length) return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.combine)(element.props, function (value) { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.match)(value, /(::plac\w+|:read-\w+)/)) { + // :read-(only|write) + case ':read-only': + case ':read-write': + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(read-\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + '$1')] + })], callback); + // :placeholder + + case '::placeholder': + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'input-$1')] + }), (0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + '$1')] + }), (0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'input-$1')] + })], callback); + } + + return ''; + }); + } +}; + +var defaultStylisPlugins = [prefixer]; + +var createCache = function createCache(options) { + var key = options.key; + + if ( true && !key) { + throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements."); + } + + if (key === 'css') { + var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration + // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) + // note this very very intentionally targets all style elements regardless of the key to ensure + // that creating a cache works inside of render of a React component + + Array.prototype.forEach.call(ssrStyles, function (node) { + // we want to only move elements which have a space in the data-emotion attribute value + // because that indicates that it is an Emotion 11 server-side rendered style elements + // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector + // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) + // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles + // will not result in the Emotion 10 styles being destroyed + var dataEmotionAttribute = node.getAttribute('data-emotion'); + + if (dataEmotionAttribute.indexOf(' ') === -1) { + return; + } + document.head.appendChild(node); + node.setAttribute('data-s', ''); + }); + } + + var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; + + if (true) { + // $FlowFixMe + if (/[^a-z-]/.test(key)) { + throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed"); + } + } + + var inserted = {}; + var container; + var nodesToHydrate = []; + + { + container = options.container || document.head; + Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which + // means that the style elements we're looking at are only Emotion 11 server-rendered style elements + document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) { + var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe + + for (var i = 1; i < attrib.length; i++) { + inserted[attrib[i]] = true; + } + + nodesToHydrate.push(node); + }); + } + + var _insert; + + var omnipresentPlugins = [compat, removeLabel]; + + if (true) { + omnipresentPlugins.push(createUnsafeSelectorsAlarm({ + get compat() { + return cache.compat; + } + + }), incorrectImportAlarm); + } + + { + var currentSheet; + var finalizingPlugins = [stylis__WEBPACK_IMPORTED_MODULE_6__.stringify, true ? function (element) { + if (!element.root) { + if (element["return"]) { + currentSheet.insert(element["return"]); + } else if (element.value && element.type !== stylis__WEBPACK_IMPORTED_MODULE_5__.COMMENT) { + // insert empty rule in non-production environments + // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet + currentSheet.insert(element.value + "{}"); + } + } + } : 0]; + var serializer = (0,stylis__WEBPACK_IMPORTED_MODULE_7__.middleware)(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); + + var stylis = function stylis(styles) { + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)((0,stylis__WEBPACK_IMPORTED_MODULE_8__.compile)(styles), serializer); + }; + + _insert = function insert(selector, serialized, sheet, shouldCache) { + currentSheet = sheet; + + if ( true && serialized.map !== undefined) { + currentSheet = { + insert: function insert(rule) { + sheet.insert(rule + serialized.map); + } + }; + } + + stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); + + if (shouldCache) { + cache.inserted[serialized.name] = true; + } + }; + } + + var cache = { + key: key, + sheet: new _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__.StyleSheet({ + key: key, + container: container, + nonce: options.nonce, + speedy: options.speedy, + prepend: options.prepend, + insertionPoint: options.insertionPoint + }), + nonce: options.nonce, + inserted: inserted, + registered: {}, + insert: _insert + }; + cache.sheet.hydrate(nodesToHydrate); + return cache; +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/hash/dist/emotion-hash.esm.js": +/*!*************************************************************!*\ + !*** ./node_modules/@emotion/hash/dist/emotion-hash.esm.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ murmur2) +/* harmony export */ }); +/* eslint-disable */ +// Inspired by https://github.com/garycourt/murmurhash-js +// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 +function murmur2(str) { + // 'm' and 'r' are mixing constants generated offline. + // They're not really 'magic', they just happen to work well. + // const m = 0x5bd1e995; + // const r = 24; + // Initialize the hash + var h = 0; // Mix 4 bytes at a time into the hash + + var k, + i = 0, + len = str.length; + + for (; len >= 4; ++i, len -= 4) { + k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; + k = + /* Math.imul(k, m): */ + (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); + k ^= + /* k >>> r: */ + k >>> 24; + h = + /* Math.imul(k, m): */ + (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ + /* Math.imul(h, m): */ + (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); + } // Handle the last few bytes of the input array + + + switch (len) { + case 3: + h ^= (str.charCodeAt(i + 2) & 0xff) << 16; + + case 2: + h ^= (str.charCodeAt(i + 1) & 0xff) << 8; + + case 1: + h ^= str.charCodeAt(i) & 0xff; + h = + /* Math.imul(h, m): */ + (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); + } // Do a few final mixes of the hash to ensure the last few + // bytes are well-incorporated. + + + h ^= h >>> 13; + h = + /* Math.imul(h, m): */ + (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); + return ((h ^ h >>> 15) >>> 0).toString(36); +} + + + + +/***/ }), + +/***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ memoize) +/* harmony export */ }); +function memoize(fn) { + var cache = Object.create(null); + return function (arg) { + if (cache[arg] === undefined) cache[arg] = fn(arg); + return cache[arg]; + }; +} + + + + +/***/ }), + +/***/ "./node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js ***! + \*****************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ hoistNonReactStatics) +/* harmony export */ }); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_0__); + + +// this file isolates this package that is not tree-shakeable +// and if this module doesn't actually contain any logic of its own +// then Rollup just use 'hoist-non-react-statics' directly in other chunks + +var hoistNonReactStatics = (function (targetComponent, sourceComponent) { + return hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_0___default()(targetComponent, sourceComponent); +}); + + + + +/***/ }), + +/***/ "./node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: () => (/* binding */ CacheProvider), +/* harmony export */ E: () => (/* binding */ Emotion$1), +/* harmony export */ T: () => (/* binding */ ThemeContext), +/* harmony export */ _: () => (/* binding */ __unsafe_useEmotionCache), +/* harmony export */ a: () => (/* binding */ ThemeProvider), +/* harmony export */ b: () => (/* binding */ withTheme), +/* harmony export */ c: () => (/* binding */ createEmotionProps), +/* harmony export */ h: () => (/* binding */ hasOwnProperty), +/* harmony export */ i: () => (/* binding */ isBrowser), +/* harmony export */ u: () => (/* binding */ useTheme), +/* harmony export */ w: () => (/* binding */ withEmotionCache) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/cache */ "./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js"); +/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); +/* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js"); +/* harmony import */ var _isolated_hnrs_dist_emotion_react_isolated_hnrs_browser_esm_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js */ "./node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js"); +/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @emotion/utils */ "./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js"); +/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js"); +/* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @emotion/use-insertion-effect-with-fallbacks */ "./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js"); + + + + + + + + + + +var isBrowser = "object" !== 'undefined'; +var hasOwnProperty = {}.hasOwnProperty; + +var EmotionCacheContext = /* #__PURE__ */react__WEBPACK_IMPORTED_MODULE_0__.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case +// because this module is primarily intended for the browser and node +// but it's also required in react native and similar environments sometimes +// and we could have a special build just for that +// but this is much easier and the native packages +// might use a different theme context in the future anyway +typeof HTMLElement !== 'undefined' ? /* #__PURE__ */(0,_emotion_cache__WEBPACK_IMPORTED_MODULE_1__["default"])({ + key: 'css' +}) : null); + +if (true) { + EmotionCacheContext.displayName = 'EmotionCacheContext'; +} + +var CacheProvider = EmotionCacheContext.Provider; +var __unsafe_useEmotionCache = function useEmotionCache() { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(EmotionCacheContext); +}; + +var withEmotionCache = function withEmotionCache(func) { + // $FlowFixMe + return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + // the cache will never be null in the browser + var cache = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(EmotionCacheContext); + return func(props, cache, ref); + }); +}; + +if (!isBrowser) { + withEmotionCache = function withEmotionCache(func) { + return function (props) { + var cache = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(EmotionCacheContext); + + if (cache === null) { + // yes, we're potentially creating this on every render + // it doesn't actually matter though since it's only on the server + // so there will only every be a single render + // that could change in the future because of suspense and etc. but for now, + // this works and i don't want to optimise for a future thing that we aren't sure about + cache = (0,_emotion_cache__WEBPACK_IMPORTED_MODULE_1__["default"])({ + key: 'css' + }); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(EmotionCacheContext.Provider, { + value: cache + }, func(props, cache)); + } else { + return func(props, cache); + } + }; + }; +} + +var ThemeContext = /* #__PURE__ */react__WEBPACK_IMPORTED_MODULE_0__.createContext({}); + +if (true) { + ThemeContext.displayName = 'EmotionThemeContext'; +} + +var useTheme = function useTheme() { + return react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext); +}; + +var getTheme = function getTheme(outerTheme, theme) { + if (typeof theme === 'function') { + var mergedTheme = theme(outerTheme); + + if ( true && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) { + throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!'); + } + + return mergedTheme; + } + + if ( true && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) { + throw new Error('[ThemeProvider] Please make your theme prop a plain object'); + } + + return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__["default"])({}, outerTheme, theme); +}; + +var createCacheWithTheme = /* #__PURE__ */(0,_emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_3__["default"])(function (outerTheme) { + return (0,_emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_3__["default"])(function (theme) { + return getTheme(outerTheme, theme); + }); +}); +var ThemeProvider = function ThemeProvider(props) { + var theme = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext); + + if (props.theme !== theme) { + theme = createCacheWithTheme(theme)(props.theme); + } + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(ThemeContext.Provider, { + value: theme + }, props.children); +}; +function withTheme(Component) { + var componentName = Component.displayName || Component.name || 'Component'; + + var render = function render(props, ref) { + var theme = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__["default"])({ + theme: theme, + ref: ref + }, props)); + }; // $FlowFixMe + + + var WithTheme = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(render); + WithTheme.displayName = "WithTheme(" + componentName + ")"; + return (0,_isolated_hnrs_dist_emotion_react_isolated_hnrs_browser_esm_js__WEBPACK_IMPORTED_MODULE_7__["default"])(WithTheme, Component); +} + +var getLastPart = function getLastPart(functionName) { + // The match may be something like 'Object.createEmotionProps' or + // 'Loader.prototype.render' + var parts = functionName.split('.'); + return parts[parts.length - 1]; +}; + +var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) { + // V8 + var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line); + if (match) return getLastPart(match[1]); // Safari / Firefox + + match = /^([A-Za-z0-9$.]+)@/.exec(line); + if (match) return getLastPart(match[1]); + return undefined; +}; + +var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS +// identifiers, thus we only need to replace what is a valid character for JS, +// but not for CSS. + +var sanitizeIdentifier = function sanitizeIdentifier(identifier) { + return identifier.replace(/\$/g, '-'); +}; + +var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) { + if (!stackTrace) return undefined; + var lines = stackTrace.split('\n'); + + for (var i = 0; i < lines.length; i++) { + var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error" + + if (!functionName) continue; // If we reach one of these, we have gone too far and should quit + + if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an + // uppercase letter + + if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName); + } + + return undefined; +}; + +var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; +var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; +var createEmotionProps = function createEmotionProps(type, props) { + if ( true && typeof props.css === 'string' && // check if there is a css declaration + props.css.indexOf(':') !== -1) { + throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`"); + } + + var newProps = {}; + + for (var key in props) { + if (hasOwnProperty.call(props, key)) { + newProps[key] = props[key]; + } + } + + newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when + // the label hasn't already been computed + + if ( true && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) { + var label = getLabelFromStackTrace(new Error().stack); + if (label) newProps[labelPropName] = label; + } + + return newProps; +}; + +var Insertion = function Insertion(_ref) { + var cache = _ref.cache, + serialized = _ref.serialized, + isStringTag = _ref.isStringTag; + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__.registerStyles)(cache, serialized, isStringTag); + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_6__.useInsertionEffectAlwaysWithSyncFallback)(function () { + return (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__.insertStyles)(cache, serialized, isStringTag); + }); + + return null; +}; + +var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) { + var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works + // not passing the registered cache to serializeStyles because it would + // make certain babel optimisations not possible + + if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { + cssProp = cache.registered[cssProp]; + } + + var WrappedComponent = props[typePropName]; + var registeredStyles = [cssProp]; + var className = ''; + + if (typeof props.className === 'string') { + className = (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__.getRegisteredStyles)(cache.registered, registeredStyles, props.className); + } else if (props.className != null) { + className = props.className + " "; + } + + var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_5__.serializeStyles)(registeredStyles, undefined, react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext)); + + if ( true && serialized.name.indexOf('-') === -1) { + var labelFromStack = props[labelPropName]; + + if (labelFromStack) { + serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_5__.serializeStyles)([serialized, 'label:' + labelFromStack + ';']); + } + } + + className += cache.key + "-" + serialized.name; + var newProps = {}; + + for (var key in props) { + if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( false || key !== labelPropName)) { + newProps[key] = props[key]; + } + } + + newProps.ref = ref; + newProps.className = className; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Insertion, { + cache: cache, + serialized: serialized, + isStringTag: typeof WrappedComponent === 'string' + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(WrappedComponent, newProps)); +}); + +if (true) { + Emotion.displayName = 'EmotionCssPropInternal'; +} + +var Emotion$1 = Emotion; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/react/dist/emotion-react.browser.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CacheProvider: () => (/* reexport safe */ _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.C), +/* harmony export */ ClassNames: () => (/* binding */ ClassNames), +/* harmony export */ Global: () => (/* binding */ Global), +/* harmony export */ ThemeContext: () => (/* reexport safe */ _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.T), +/* harmony export */ ThemeProvider: () => (/* reexport safe */ _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.a), +/* harmony export */ __unsafe_useEmotionCache: () => (/* reexport safe */ _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__._), +/* harmony export */ createElement: () => (/* binding */ jsx), +/* harmony export */ css: () => (/* binding */ css), +/* harmony export */ jsx: () => (/* binding */ jsx), +/* harmony export */ keyframes: () => (/* binding */ keyframes), +/* harmony export */ useTheme: () => (/* reexport safe */ _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.u), +/* harmony export */ withEmotionCache: () => (/* reexport safe */ _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.w), +/* harmony export */ withTheme: () => (/* reexport safe */ _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.b) +/* harmony export */ }); +/* harmony import */ var _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emotion-element-c39617d8.browser.esm.js */ "./node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/utils */ "./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js"); +/* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/use-insertion-effect-with-fallbacks */ "./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js"); +/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js"); +/* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/cache */ "./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js"); +/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); +/* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_8__); + + + + + + + + + + + + +var pkg = { + name: "@emotion/react", + version: "11.11.1", + main: "dist/emotion-react.cjs.js", + module: "dist/emotion-react.esm.js", + browser: { + "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js" + }, + exports: { + ".": { + module: { + worker: "./dist/emotion-react.worker.esm.js", + browser: "./dist/emotion-react.browser.esm.js", + "default": "./dist/emotion-react.esm.js" + }, + "import": "./dist/emotion-react.cjs.mjs", + "default": "./dist/emotion-react.cjs.js" + }, + "./jsx-runtime": { + module: { + worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js", + browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js" + }, + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js" + }, + "./_isolated-hnrs": { + module: { + worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js", + browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js" + }, + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js" + }, + "./jsx-dev-runtime": { + module: { + worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js", + browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js" + }, + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js" + }, + "./package.json": "./package.json", + "./types/css-prop": "./types/css-prop.d.ts", + "./macro": { + types: { + "import": "./macro.d.mts", + "default": "./macro.d.ts" + }, + "default": "./macro.js" + } + }, + types: "types/index.d.ts", + files: [ + "src", + "dist", + "jsx-runtime", + "jsx-dev-runtime", + "_isolated-hnrs", + "types/*.d.ts", + "macro.*" + ], + sideEffects: false, + author: "Emotion Contributors", + license: "MIT", + scripts: { + "test:typescript": "dtslint types" + }, + dependencies: { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.11.0", + "@emotion/cache": "^11.11.0", + "@emotion/serialize": "^1.1.2", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", + "hoist-non-react-statics": "^3.3.1" + }, + peerDependencies: { + react: ">=16.8.0" + }, + peerDependenciesMeta: { + "@types/react": { + optional: true + } + }, + devDependencies: { + "@definitelytyped/dtslint": "0.0.112", + "@emotion/css": "11.11.0", + "@emotion/css-prettifier": "1.1.3", + "@emotion/server": "11.11.0", + "@emotion/styled": "11.11.0", + "html-tag-names": "^1.1.2", + react: "16.14.0", + "svg-tag-names": "^1.1.1", + typescript: "^4.5.5" + }, + repository: "https://github.com/emotion-js/emotion/tree/main/packages/react", + publishConfig: { + access: "public" + }, + "umd:main": "dist/emotion-react.umd.min.js", + preconstruct: { + entrypoints: [ + "./index.js", + "./jsx-runtime.js", + "./jsx-dev-runtime.js", + "./_isolated-hnrs.js" + ], + umdName: "emotionReact", + exports: { + envConditions: [ + "browser", + "worker" + ], + extra: { + "./types/css-prop": "./types/css-prop.d.ts", + "./macro": { + types: { + "import": "./macro.d.mts", + "default": "./macro.d.ts" + }, + "default": "./macro.js" + } + } + } + } +}; + +var jsx = function jsx(type, props) { + var args = arguments; + + if (props == null || !_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.h.call(props, 'css')) { + // $FlowFixMe + return react__WEBPACK_IMPORTED_MODULE_1__.createElement.apply(undefined, args); + } + + var argsLength = args.length; + var createElementArgArray = new Array(argsLength); + createElementArgArray[0] = _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.E; + createElementArgArray[1] = (0,_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.c)(type, props); + + for (var i = 2; i < argsLength; i++) { + createElementArgArray[i] = args[i]; + } // $FlowFixMe + + + return react__WEBPACK_IMPORTED_MODULE_1__.createElement.apply(null, createElementArgArray); +}; + +var warnedAboutCssPropForGlobal = false; // maintain place over rerenders. +// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild +// initial client-side render from SSR, use place of hydrating tag + +var Global = /* #__PURE__ */(0,_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.w)(function (props, cache) { + if ( true && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is + // probably using the custom createElement which + // means it will be turned into a className prop + // $FlowFixMe I don't really want to add it to the type since it shouldn't be used + props.className || props.css)) { + console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?"); + warnedAboutCssPropForGlobal = true; + } + + var styles = props.styles; + var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__.serializeStyles)([styles], undefined, react__WEBPACK_IMPORTED_MODULE_1__.useContext(_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.T)); + + if (!_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.i) { + var _ref; + + var serializedNames = serialized.name; + var serializedStyles = serialized.styles; + var next = serialized.next; + + while (next !== undefined) { + serializedNames += ' ' + next.name; + serializedStyles += next.styles; + next = next.next; + } + + var shouldCache = cache.compat === true; + var rules = cache.insert("", { + name: serializedNames, + styles: serializedStyles + }, cache.sheet, shouldCache); + + if (shouldCache) { + return null; + } + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = { + __html: rules + }, _ref.nonce = cache.sheet.nonce, _ref)); + } // yes, i know these hooks are used conditionally + // but it is based on a constant that will never change at runtime + // it's effectively like having two implementations and switching them out + // so it's not actually breaking anything + + + var sheetRef = react__WEBPACK_IMPORTED_MODULE_1__.useRef(); + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__.useInsertionEffectWithLayoutFallback)(function () { + var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675 + + var sheet = new cache.sheet.constructor({ + key: key, + nonce: cache.sheet.nonce, + container: cache.sheet.container, + speedy: cache.sheet.isSpeedy + }); + var rehydrating = false; // $FlowFixMe + + var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]"); + + if (cache.sheet.tags.length) { + sheet.before = cache.sheet.tags[0]; + } + + if (node !== null) { + rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s + + node.setAttribute('data-emotion', key); + sheet.hydrate([node]); + } + + sheetRef.current = [sheet, rehydrating]; + return function () { + sheet.flush(); + }; + }, [cache]); + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__.useInsertionEffectWithLayoutFallback)(function () { + var sheetRefCurrent = sheetRef.current; + var sheet = sheetRefCurrent[0], + rehydrating = sheetRefCurrent[1]; + + if (rehydrating) { + sheetRefCurrent[1] = false; + return; + } + + if (serialized.next !== undefined) { + // insert keyframes + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_2__.insertStyles)(cache, serialized.next, true); + } + + if (sheet.tags.length) { + // if this doesn't exist then it will be null so the style element will be appended + var element = sheet.tags[sheet.tags.length - 1].nextElementSibling; + sheet.before = element; + sheet.flush(); + } + + cache.insert("", serialized, sheet, false); + }, [cache, serialized.name]); + return null; +}); + +if (true) { + Global.displayName = 'EmotionGlobal'; +} + +function css() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__.serializeStyles)(args); +} + +var keyframes = function keyframes() { + var insertable = css.apply(void 0, arguments); + var name = "animation-" + insertable.name; // $FlowFixMe + + return { + name: name, + styles: "@keyframes " + name + "{" + insertable.styles + "}", + anim: 1, + toString: function toString() { + return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; + } + }; +}; + +var classnames = function classnames(args) { + var len = args.length; + var i = 0; + var cls = ''; + + for (; i < len; i++) { + var arg = args[i]; + if (arg == null) continue; + var toAdd = void 0; + + switch (typeof arg) { + case 'boolean': + break; + + case 'object': + { + if (Array.isArray(arg)) { + toAdd = classnames(arg); + } else { + if ( true && arg.styles !== undefined && arg.name !== undefined) { + console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.'); + } + + toAdd = ''; + + for (var k in arg) { + if (arg[k] && k) { + toAdd && (toAdd += ' '); + toAdd += k; + } + } + } + + break; + } + + default: + { + toAdd = arg; + } + } + + if (toAdd) { + cls && (cls += ' '); + cls += toAdd; + } + } + + return cls; +}; + +function merge(registered, css, className) { + var registeredStyles = []; + var rawClassName = (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_2__.getRegisteredStyles)(registered, registeredStyles, className); + + if (registeredStyles.length < 2) { + return className; + } + + return rawClassName + css(registeredStyles); +} + +var Insertion = function Insertion(_ref) { + var cache = _ref.cache, + serializedArr = _ref.serializedArr; + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__.useInsertionEffectAlwaysWithSyncFallback)(function () { + + for (var i = 0; i < serializedArr.length; i++) { + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_2__.insertStyles)(cache, serializedArr[i], false); + } + }); + + return null; +}; + +var ClassNames = /* #__PURE__ */(0,_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.w)(function (props, cache) { + var hasRendered = false; + var serializedArr = []; + + var css = function css() { + if (hasRendered && "development" !== 'production') { + throw new Error('css can only be used during render'); + } + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__.serializeStyles)(args, cache.registered); + serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx` + + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_2__.registerStyles)(cache, serialized, false); + return cache.key + "-" + serialized.name; + }; + + var cx = function cx() { + if (hasRendered && "development" !== 'production') { + throw new Error('cx can only be used during render'); + } + + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return merge(cache.registered, css, classnames(args)); + }; + + var content = { + css: css, + cx: cx, + theme: react__WEBPACK_IMPORTED_MODULE_1__.useContext(_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__.T) + }; + var ele = props.children(content); + hasRendered = true; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(Insertion, { + cache: cache, + serializedArr: serializedArr + }), ele); +}); + +if (true) { + ClassNames.displayName = 'EmotionClassNames'; +} + +if (true) { + var isBrowser = "object" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked + + var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined'; + + if (isBrowser && !isTestEnv) { + // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later + var globalContext = // $FlowIgnore + typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef + : isBrowser ? window : ({}); + var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__"; + + if (globalContext[globalKey]) { + console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.'); + } + + globalContext[globalKey] = true; + } +} + + + + +/***/ }), + +/***/ "./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ serializeStyles: () => (/* binding */ serializeStyles) +/* harmony export */ }); +/* harmony import */ var _emotion_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/hash */ "./node_modules/@emotion/hash/dist/emotion-hash.esm.js"); +/* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js"); +/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"); + + + + +var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; +var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."; +var hyphenateRegex = /[A-Z]|^ms/g; +var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; + +var isCustomProperty = function isCustomProperty(property) { + return property.charCodeAt(1) === 45; +}; + +var isProcessableValue = function isProcessableValue(value) { + return value != null && typeof value !== 'boolean'; +}; + +var processStyleName = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_2__["default"])(function (styleName) { + return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); +}); + +var processStyleValue = function processStyleValue(key, value) { + switch (key) { + case 'animation': + case 'animationName': + { + if (typeof value === 'string') { + return value.replace(animationRegex, function (match, p1, p2) { + cursor = { + name: p1, + styles: p2, + next: cursor + }; + return p1; + }); + } + } + } + + if (_emotion_unitless__WEBPACK_IMPORTED_MODULE_1__["default"][key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { + return value + 'px'; + } + + return value; +}; + +if (true) { + var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/; + var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset']; + var oldProcessStyleValue = processStyleValue; + var msPattern = /^-ms-/; + var hyphenPattern = /-(.)/g; + var hyphenatedCache = {}; + + processStyleValue = function processStyleValue(key, value) { + if (key === 'content') { + if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) { + throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`"); + } + } + + var processed = oldProcessStyleValue(key, value); + + if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) { + hyphenatedCache[key] = true; + console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) { + return _char.toUpperCase(); + }) + "?"); + } + + return processed; + }; +} + +var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.'; + +function handleInterpolation(mergedProps, registered, interpolation) { + if (interpolation == null) { + return ''; + } + + if (interpolation.__emotion_styles !== undefined) { + if ( true && interpolation.toString() === 'NO_COMPONENT_SELECTOR') { + throw new Error(noComponentSelectorMessage); + } + + return interpolation; + } + + switch (typeof interpolation) { + case 'boolean': + { + return ''; + } + + case 'object': + { + if (interpolation.anim === 1) { + cursor = { + name: interpolation.name, + styles: interpolation.styles, + next: cursor + }; + return interpolation.name; + } + + if (interpolation.styles !== undefined) { + var next = interpolation.next; + + if (next !== undefined) { + // not the most efficient thing ever but this is a pretty rare case + // and there will be very few iterations of this generally + while (next !== undefined) { + cursor = { + name: next.name, + styles: next.styles, + next: cursor + }; + next = next.next; + } + } + + var styles = interpolation.styles + ";"; + + if ( true && interpolation.map !== undefined) { + styles += interpolation.map; + } + + return styles; + } + + return createStringFromObject(mergedProps, registered, interpolation); + } + + case 'function': + { + if (mergedProps !== undefined) { + var previousCursor = cursor; + var result = interpolation(mergedProps); + cursor = previousCursor; + return handleInterpolation(mergedProps, registered, result); + } else if (true) { + console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`"); + } + + break; + } + + case 'string': + if (true) { + var matched = []; + var replaced = interpolation.replace(animationRegex, function (match, p1, p2) { + var fakeVarName = "animation" + matched.length; + matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`"); + return "${" + fakeVarName + "}"; + }); + + if (matched.length) { + console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`")); + } + } + + break; + } // finalize string values (regular strings and functions interpolated into css calls) + + + if (registered == null) { + return interpolation; + } + + var cached = registered[interpolation]; + return cached !== undefined ? cached : interpolation; +} + +function createStringFromObject(mergedProps, registered, obj) { + var string = ''; + + if (Array.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + string += handleInterpolation(mergedProps, registered, obj[i]) + ";"; + } + } else { + for (var _key in obj) { + var value = obj[_key]; + + if (typeof value !== 'object') { + if (registered != null && registered[value] !== undefined) { + string += _key + "{" + registered[value] + "}"; + } else if (isProcessableValue(value)) { + string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";"; + } + } else { + if (_key === 'NO_COMPONENT_SELECTOR' && "development" !== 'production') { + throw new Error(noComponentSelectorMessage); + } + + if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { + for (var _i = 0; _i < value.length; _i++) { + if (isProcessableValue(value[_i])) { + string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";"; + } + } + } else { + var interpolated = handleInterpolation(mergedProps, registered, value); + + switch (_key) { + case 'animation': + case 'animationName': + { + string += processStyleName(_key) + ":" + interpolated + ";"; + break; + } + + default: + { + if ( true && _key === 'undefined') { + console.error(UNDEFINED_AS_OBJECT_KEY_ERROR); + } + + string += _key + "{" + interpolated + "}"; + } + } + } + } + } + } + + return string; +} + +var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g; +var sourceMapPattern; + +if (true) { + sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; +} // this is the cursor for keyframes +// keyframes are stored on the SerializedStyles object as a linked list + + +var cursor; +var serializeStyles = function serializeStyles(args, registered, mergedProps) { + if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { + return args[0]; + } + + var stringMode = true; + var styles = ''; + cursor = undefined; + var strings = args[0]; + + if (strings == null || strings.raw === undefined) { + stringMode = false; + styles += handleInterpolation(mergedProps, registered, strings); + } else { + if ( true && strings[0] === undefined) { + console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); + } + + styles += strings[0]; + } // we start at 1 since we've already handled the first arg + + + for (var i = 1; i < args.length; i++) { + styles += handleInterpolation(mergedProps, registered, args[i]); + + if (stringMode) { + if ( true && strings[i] === undefined) { + console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); + } + + styles += strings[i]; + } + } + + var sourceMap; + + if (true) { + styles = styles.replace(sourceMapPattern, function (match) { + sourceMap = match; + return ''; + }); + } // using a global regex with .exec is stateful so lastIndex has to be reset each time + + + labelPattern.lastIndex = 0; + var identifierName = ''; + var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 + + while ((match = labelPattern.exec(styles)) !== null) { + identifierName += '-' + // $FlowFixMe we know it's not null + match[1]; + } + + var name = (0,_emotion_hash__WEBPACK_IMPORTED_MODULE_0__["default"])(styles) + identifierName; + + if (true) { + // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it) + return { + name: name, + styles: styles, + map: sourceMap, + next: cursor, + toString: function toString() { + return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; + } + }; + } + + return { + name: name, + styles: styles, + next: cursor + }; +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ StyleSheet: () => (/* binding */ StyleSheet) +/* harmony export */ }); +/* + +Based off glamor's StyleSheet, thanks Sunil ❤️ + +high performance StyleSheet for css-in-js systems + +- uses multiple style tags behind the scenes for millions of rules +- uses `insertRule` for appending in production for *much* faster performance + +// usage + +import { StyleSheet } from '@emotion/sheet' + +let styleSheet = new StyleSheet({ key: '', container: document.head }) + +styleSheet.insert('#box { border: 1px solid red; }') +- appends a css rule into the stylesheet + +styleSheet.flush() +- empties the stylesheet of all its contents + +*/ +// $FlowFixMe +function sheetForTag(tag) { + if (tag.sheet) { + // $FlowFixMe + return tag.sheet; + } // this weirdness brought to you by firefox + + /* istanbul ignore next */ + + + for (var i = 0; i < document.styleSheets.length; i++) { + if (document.styleSheets[i].ownerNode === tag) { + // $FlowFixMe + return document.styleSheets[i]; + } + } +} + +function createStyleElement(options) { + var tag = document.createElement('style'); + tag.setAttribute('data-emotion', options.key); + + if (options.nonce !== undefined) { + tag.setAttribute('nonce', options.nonce); + } + + tag.appendChild(document.createTextNode('')); + tag.setAttribute('data-s', ''); + return tag; +} + +var StyleSheet = /*#__PURE__*/function () { + // Using Node instead of HTMLElement since container may be a ShadowRoot + function StyleSheet(options) { + var _this = this; + + this._insertTag = function (tag) { + var before; + + if (_this.tags.length === 0) { + if (_this.insertionPoint) { + before = _this.insertionPoint.nextSibling; + } else if (_this.prepend) { + before = _this.container.firstChild; + } else { + before = _this.before; + } + } else { + before = _this.tags[_this.tags.length - 1].nextSibling; + } + + _this.container.insertBefore(tag, before); + + _this.tags.push(tag); + }; + + this.isSpeedy = options.speedy === undefined ? "development" === 'production' : options.speedy; + this.tags = []; + this.ctr = 0; + this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets + + this.key = options.key; + this.container = options.container; + this.prepend = options.prepend; + this.insertionPoint = options.insertionPoint; + this.before = null; + } + + var _proto = StyleSheet.prototype; + + _proto.hydrate = function hydrate(nodes) { + nodes.forEach(this._insertTag); + }; + + _proto.insert = function insert(rule) { + // the max length is how many rules we have per style tag, it's 65000 in speedy mode + // it's 1 in dev because we insert source maps that map a single rule to a location + // and you can only have one source map per style tag + if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { + this._insertTag(createStyleElement(this)); + } + + var tag = this.tags[this.tags.length - 1]; + + if (true) { + var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105; + + if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) { + // this would only cause problem in speedy mode + // but we don't want enabling speedy to affect the observable behavior + // so we report this error at all times + console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.'); + } + this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule; + } + + if (this.isSpeedy) { + var sheet = sheetForTag(tag); + + try { + // this is the ultrafast version, works across browsers + // the big drawback is that the css won't be editable in devtools + sheet.insertRule(rule, sheet.cssRules.length); + } catch (e) { + if ( true && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) { + console.error("There was a problem inserting the following rule: \"" + rule + "\"", e); + } + } + } else { + tag.appendChild(document.createTextNode(rule)); + } + + this.ctr++; + }; + + _proto.flush = function flush() { + // $FlowFixMe + this.tags.forEach(function (tag) { + return tag.parentNode && tag.parentNode.removeChild(tag); + }); + this.tags = []; + this.ctr = 0; + + if (true) { + this._alreadyInsertedOrderInsensitiveRule = false; + } + }; + + return StyleSheet; +}(); + + + + +/***/ }), + +/***/ "./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ unitlessKeys) +/* harmony export */ }); +var unitlessKeys = { + animationIterationCount: 1, + aspectRatio: 1, + borderImageOutset: 1, + borderImageSlice: 1, + borderImageWidth: 1, + boxFlex: 1, + boxFlexGroup: 1, + boxOrdinalGroup: 1, + columnCount: 1, + columns: 1, + flex: 1, + flexGrow: 1, + flexPositive: 1, + flexShrink: 1, + flexNegative: 1, + flexOrder: 1, + gridRow: 1, + gridRowEnd: 1, + gridRowSpan: 1, + gridRowStart: 1, + gridColumn: 1, + gridColumnEnd: 1, + gridColumnSpan: 1, + gridColumnStart: 1, + msGridRow: 1, + msGridRowSpan: 1, + msGridColumn: 1, + msGridColumnSpan: 1, + fontWeight: 1, + lineHeight: 1, + opacity: 1, + order: 1, + orphans: 1, + tabSize: 1, + widows: 1, + zIndex: 1, + zoom: 1, + WebkitLineClamp: 1, + // SVG-related properties + fillOpacity: 1, + floodOpacity: 1, + stopOpacity: 1, + strokeDasharray: 1, + strokeDashoffset: 1, + strokeMiterlimit: 1, + strokeOpacity: 1, + strokeWidth: 1 +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js": +/*!***********************************************************************************************************************************!*\ + !*** ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js ***! + \***********************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ useInsertionEffectAlwaysWithSyncFallback: () => (/* binding */ useInsertionEffectAlwaysWithSyncFallback), +/* harmony export */ useInsertionEffectWithLayoutFallback: () => (/* binding */ useInsertionEffectWithLayoutFallback) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); + + +var syncFallback = function syncFallback(create) { + return create(); +}; + +var useInsertionEffect = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))['useInsertion' + 'Effect'] ? /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))['useInsertion' + 'Effect'] : false; +var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback; +var useInsertionEffectWithLayoutFallback = useInsertionEffect || react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getRegisteredStyles: () => (/* binding */ getRegisteredStyles), +/* harmony export */ insertStyles: () => (/* binding */ insertStyles), +/* harmony export */ registerStyles: () => (/* binding */ registerStyles) +/* harmony export */ }); +var isBrowser = "object" !== 'undefined'; +function getRegisteredStyles(registered, registeredStyles, classNames) { + var rawClassName = ''; + classNames.split(' ').forEach(function (className) { + if (registered[className] !== undefined) { + registeredStyles.push(registered[className] + ";"); + } else { + rawClassName += className + " "; + } + }); + return rawClassName; +} +var registerStyles = function registerStyles(cache, serialized, isStringTag) { + var className = cache.key + "-" + serialized.name; + + if ( // we only need to add the styles to the registered cache if the + // class name could be used further down + // the tree but if it's a string tag, we know it won't + // so we don't have to add it to registered cache. + // this improves memory usage since we can avoid storing the whole style string + (isStringTag === false || // we need to always store it if we're in compat mode and + // in node since emotion-server relies on whether a style is in + // the registered cache to know whether a style is global or not + // also, note that this check will be dead code eliminated in the browser + isBrowser === false ) && cache.registered[className] === undefined) { + cache.registered[className] = serialized.styles; + } +}; +var insertStyles = function insertStyles(cache, serialized, isStringTag) { + registerStyles(cache, serialized, isStringTag); + var className = cache.key + "-" + serialized.name; + + if (cache.inserted[serialized.name] === undefined) { + var current = serialized; + + do { + cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); + + current = current.next; + } while (current !== undefined); + } +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ weakMemoize) +/* harmony export */ }); +var weakMemoize = function weakMemoize(func) { + // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps + var cache = new WeakMap(); + return function (arg) { + if (cache.has(arg)) { + // $FlowFixMe + return cache.get(arg); + } + + var ret = func(arg); + cache.set(arg, ret); + return ret; + }; +}; + + + + +/***/ }), + +/***/ "./node_modules/@inlang/sdk/dist/resolve-modules lazy recursive": +/*!*************************************************************************************!*\ + !*** ./node_modules/@inlang/sdk/dist/resolve-modules/ lazy strict namespace object ***! + \*************************************************************************************/ +/***/ ((module) => { + +function webpackEmptyAsyncContext(req) { + // Here Promise.resolve().then() is used instead of new Promise() to prevent + // uncaught exception popping up in devtools + return Promise.resolve().then(() => { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + }); +} +webpackEmptyAsyncContext.keys = () => ([]); +webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext; +webpackEmptyAsyncContext.id = "./node_modules/@inlang/sdk/dist/resolve-modules lazy recursive"; +module.exports = webpackEmptyAsyncContext; + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/client.js": +/*!****************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/client.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BrowserClient: () => (/* binding */ BrowserClient) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/baseclient.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/version.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/env.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/clientreport.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/dsn.js"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./eventbuilder.js */ "./node_modules/@sentry/browser/esm/eventbuilder.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers.js */ "./node_modules/@sentry/browser/esm/helpers.js"); +/* harmony import */ var _userfeedback_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./userfeedback.js */ "./node_modules/@sentry/browser/esm/userfeedback.js"); + + + + + + +/** + * Configuration options for the Sentry Browser SDK. + * @see @sentry/types Options for more information. + */ + +/** + * The Sentry Browser SDK Client. + * + * @see BrowserOptions for documentation on configuration options. + * @see SentryClient for usage documentation. + */ +class BrowserClient extends _sentry_core__WEBPACK_IMPORTED_MODULE_0__.BaseClient { + /** + * Creates a new Browser SDK instance. + * + * @param options Configuration options for this SDK. + */ + constructor(options) { + const sdkSource = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.SENTRY_SDK_SOURCE || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.getSDKSource)(); + + options._metadata = options._metadata || {}; + options._metadata.sdk = options._metadata.sdk || { + name: 'sentry.javascript.browser', + packages: [ + { + name: `${sdkSource}:@sentry/browser`, + version: _sentry_core__WEBPACK_IMPORTED_MODULE_3__.SDK_VERSION, + }, + ], + version: _sentry_core__WEBPACK_IMPORTED_MODULE_3__.SDK_VERSION, + }; + + super(options); + + if (options.sendClientReports && _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document) { + _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document.addEventListener('visibilitychange', () => { + if (_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document.visibilityState === 'hidden') { + this._flushOutcomes(); + } + }); + } + } + + /** + * @inheritDoc + */ + eventFromException(exception, hint) { + return (0,_eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__.eventFromException)(this._options.stackParser, exception, hint, this._options.attachStacktrace); + } + + /** + * @inheritDoc + */ + eventFromMessage( + message, + // eslint-disable-next-line deprecation/deprecation + level = 'info', + hint, + ) { + return (0,_eventbuilder_js__WEBPACK_IMPORTED_MODULE_4__.eventFromMessage)(this._options.stackParser, message, level, hint, this._options.attachStacktrace); + } + + /** + * Sends user feedback to Sentry. + */ + captureUserFeedback(feedback) { + if (!this._isEnabled()) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__.logger.warn('SDK not enabled, will not capture user feedback.'); + return; + } + + const envelope = (0,_userfeedback_js__WEBPACK_IMPORTED_MODULE_6__.createUserFeedbackEnvelope)(feedback, { + metadata: this.getSdkMetadata(), + dsn: this.getDsn(), + tunnel: this.getOptions().tunnel, + }); + void this._sendEnvelope(envelope); + } + + /** + * @inheritDoc + */ + _prepareEvent(event, hint, scope) { + event.platform = event.platform || 'javascript'; + return super._prepareEvent(event, hint, scope); + } + + /** + * Sends client reports as an envelope. + */ + _flushOutcomes() { + const outcomes = this._clearOutcomes(); + + if (outcomes.length === 0) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__.logger.log('No outcomes to send'); + return; + } + + // This is really the only place where we want to check for a DSN and only send outcomes then + if (!this._dsn) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__.logger.log('No dsn provided, will not send outcomes'); + return; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__.logger.log('Sending outcomes:', outcomes); + + const envelope = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__.createClientReportEnvelope)(outcomes, this._options.tunnel && (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.dsnToString)(this._dsn)); + void this._sendEnvelope(envelope); + } +} + + +//# sourceMappingURL=client.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/eventbuilder.js": +/*!**********************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/eventbuilder.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ eventFromError: () => (/* binding */ eventFromError), +/* harmony export */ eventFromException: () => (/* binding */ eventFromException), +/* harmony export */ eventFromMessage: () => (/* binding */ eventFromMessage), +/* harmony export */ eventFromPlainObject: () => (/* binding */ eventFromPlainObject), +/* harmony export */ eventFromString: () => (/* binding */ eventFromString), +/* harmony export */ eventFromUnknownInput: () => (/* binding */ eventFromUnknownInput), +/* harmony export */ exceptionFromError: () => (/* binding */ exceptionFromError), +/* harmony export */ parseStackFrames: () => (/* binding */ parseStackFrames) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/hub.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/normalize.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/syncpromise.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); + + + +/** + * This function creates an exception from a JavaScript Error + */ +function exceptionFromError(stackParser, ex) { + // Get the frames first since Opera can lose the stack if we touch anything else first + const frames = parseStackFrames(stackParser, ex); + + const exception = { + type: ex && ex.name, + value: extractMessage(ex), + }; + + if (frames.length) { + exception.stacktrace = { frames }; + } + + if (exception.type === undefined && exception.value === '') { + exception.value = 'Unrecoverable error caught'; + } + + return exception; +} + +/** + * @hidden + */ +function eventFromPlainObject( + stackParser, + exception, + syntheticException, + isUnhandledRejection, +) { + const hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)(); + const client = hub.getClient(); + const normalizeDepth = client && client.getOptions().normalizeDepth; + + const event = { + exception: { + values: [ + { + type: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isEvent)(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error', + value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }), + }, + ], + }, + extra: { + __serialized__: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.normalizeToSize)(exception, normalizeDepth), + }, + }; + + if (syntheticException) { + const frames = parseStackFrames(stackParser, syntheticException); + if (frames.length) { + // event.exception.values[0] has been set above + (event.exception ).values[0].stacktrace = { frames }; + } + } + + return event; +} + +/** + * @hidden + */ +function eventFromError(stackParser, ex) { + return { + exception: { + values: [exceptionFromError(stackParser, ex)], + }, + }; +} + +/** Parses stack frames from an error */ +function parseStackFrames( + stackParser, + ex, +) { + // Access and store the stacktrace property before doing ANYTHING + // else to it because Opera is not very good at providing it + // reliably in other circumstances. + const stacktrace = ex.stacktrace || ex.stack || ''; + + const popSize = getPopSize(ex); + + try { + return stackParser(stacktrace, popSize); + } catch (e) { + // no-empty + } + + return []; +} + +// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108 +const reactMinifiedRegexp = /Minified React error #\d+;/i; + +function getPopSize(ex) { + if (ex) { + if (typeof ex.framesToPop === 'number') { + return ex.framesToPop; + } + + if (reactMinifiedRegexp.test(ex.message)) { + return 1; + } + } + + return 0; +} + +/** + * There are cases where stacktrace.message is an Event object + * https://github.com/getsentry/sentry-javascript/issues/1949 + * In this specific case we try to extract stacktrace.message.error.message + */ +function extractMessage(ex) { + const message = ex && ex.message; + if (!message) { + return 'No error message'; + } + if (message.error && typeof message.error.message === 'string') { + return message.error.message; + } + return message; +} + +/** + * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. + * @hidden + */ +function eventFromException( + stackParser, + exception, + hint, + attachStacktrace, +) { + const syntheticException = (hint && hint.syntheticException) || undefined; + const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.addExceptionMechanism)(event); // defaults to { type: 'generic', handled: true } + event.level = 'error'; + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.resolvedSyncPromise)(event); +} + +/** + * Builds and Event from a Message + * @hidden + */ +function eventFromMessage( + stackParser, + message, + // eslint-disable-next-line deprecation/deprecation + level = 'info', + hint, + attachStacktrace, +) { + const syntheticException = (hint && hint.syntheticException) || undefined; + const event = eventFromString(stackParser, message, syntheticException, attachStacktrace); + event.level = level; + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.resolvedSyncPromise)(event); +} + +/** + * @hidden + */ +function eventFromUnknownInput( + stackParser, + exception, + syntheticException, + attachStacktrace, + isUnhandledRejection, +) { + let event; + + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isErrorEvent)(exception ) && (exception ).error) { + // If it is an ErrorEvent with `error` property, extract it to get actual Error + const errorEvent = exception ; + return eventFromError(stackParser, errorEvent.error ); + } + + // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name + // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be + // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`. + // + // https://developer.mozilla.org/en-US/docs/Web/API/DOMError + // https://developer.mozilla.org/en-US/docs/Web/API/DOMException + // https://webidl.spec.whatwg.org/#es-DOMException-specialness + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isDOMError)(exception) || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isDOMException)(exception )) { + const domException = exception ; + + if ('stack' in (exception )) { + event = eventFromError(stackParser, exception ); + } else { + const name = domException.name || ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isDOMError)(domException) ? 'DOMError' : 'DOMException'); + const message = domException.message ? `${name}: ${domException.message}` : name; + event = eventFromString(stackParser, message, syntheticException, attachStacktrace); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.addExceptionTypeValue)(event, message); + } + if ('code' in domException) { + // eslint-disable-next-line deprecation/deprecation + event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` }; + } + + return event; + } + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isError)(exception)) { + // we have a real Error object, do nothing + return eventFromError(stackParser, exception); + } + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(exception) || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isEvent)(exception)) { + // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize + // it manually. This will allow us to group events based on top-level keys which is much better than creating a new + // group on any key/value change. + const objectException = exception ; + event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.addExceptionMechanism)(event, { + synthetic: true, + }); + return event; + } + + // If none of previous checks were valid, then it means that it's not: + // - an instance of DOMError + // - an instance of DOMException + // - an instance of Event + // - an instance of Error + // - a valid ErrorEvent (one with an error property) + // - a plain Object + // + // So bail out and capture it as a simple message: + event = eventFromString(stackParser, exception , syntheticException, attachStacktrace); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.addExceptionTypeValue)(event, `${exception}`, undefined); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.addExceptionMechanism)(event, { + synthetic: true, + }); + + return event; +} + +/** + * @hidden + */ +function eventFromString( + stackParser, + input, + syntheticException, + attachStacktrace, +) { + const event = { + message: input, + }; + + if (attachStacktrace && syntheticException) { + const frames = parseStackFrames(stackParser, syntheticException); + if (frames.length) { + event.exception = { + values: [{ value: input, stacktrace: { frames } }], + }; + } + } + + return event; +} + +function getNonErrorObjectExceptionValue( + exception, + { isUnhandledRejection }, +) { + const keys = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__.extractExceptionKeysForMessage)(exception); + const captureType = isUnhandledRejection ? 'promise rejection' : 'exception'; + + // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before + // We still want to try to get a decent message for these cases + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isErrorEvent)(exception)) { + return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``; + } + + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isEvent)(exception)) { + const className = getObjectClassName(exception); + return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`; + } + + return `Object captured as ${captureType} with keys: ${keys}`; +} + +function getObjectClassName(obj) { + try { + const prototype = Object.getPrototypeOf(obj); + return prototype ? prototype.constructor.name : undefined; + } catch (e) { + // ignore errors here + } +} + + +//# sourceMappingURL=eventbuilder.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/helpers.js": +/*!*****************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/helpers.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ WINDOW: () => (/* binding */ WINDOW), +/* harmony export */ ignoreNextOnError: () => (/* binding */ ignoreNextOnError), +/* harmony export */ shouldIgnoreOnError: () => (/* binding */ shouldIgnoreOnError), +/* harmony export */ wrap: () => (/* binding */ wrap) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/exports.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/worldwide.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); + + + +const WINDOW = _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + +let ignoreOnError = 0; + +/** + * @hidden + */ +function shouldIgnoreOnError() { + return ignoreOnError > 0; +} + +/** + * @hidden + */ +function ignoreNextOnError() { + // onerror should trigger before setTimeout + ignoreOnError++; + setTimeout(() => { + ignoreOnError--; + }); +} + +/** + * Instruments the given function and sends an event to Sentry every time the + * function throws an exception. + * + * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always + * has a correct `this` context. + * @returns The wrapped function. + * @hidden + */ +function wrap( + fn, + options + + = {}, + before, + // eslint-disable-next-line @typescript-eslint/no-explicit-any +) { + // for future readers what this does is wrap a function and then create + // a bi-directional wrapping between them. + // + // example: wrapped = wrap(original); + // original.__sentry_wrapped__ -> wrapped + // wrapped.__sentry_original__ -> original + + if (typeof fn !== 'function') { + return fn; + } + + try { + // if we're dealing with a function that was previously wrapped, return + // the original wrapper. + const wrapper = fn.__sentry_wrapped__; + if (wrapper) { + return wrapper; + } + + // We don't wanna wrap it twice + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.getOriginalFunction)(fn)) { + return fn; + } + } catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + // Bail on wrapping and return the function as-is (defers to window.onerror). + return fn; + } + + /* eslint-disable prefer-rest-params */ + // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this` + const sentryWrapped = function () { + const args = Array.prototype.slice.call(arguments); + + try { + if (before && typeof before === 'function') { + before.apply(this, arguments); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access + const wrappedArguments = args.map((arg) => wrap(arg, options)); + + // Attempt to invoke user-land function + // NOTE: If you are a Sentry user, and you are seeing this stack frame, it + // means the sentry.javascript SDK caught an error invoking your application code. This + // is expected behavior and NOT indicative of a bug with sentry.javascript. + return fn.apply(this, wrappedArguments); + } catch (ex) { + ignoreNextOnError(); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.withScope)((scope) => { + scope.addEventProcessor((event) => { + if (options.mechanism) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.addExceptionTypeValue)(event, undefined, undefined); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.addExceptionMechanism)(event, options.mechanism); + } + + event.extra = { + ...event.extra, + arguments: args, + }; + + return event; + }); + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.captureException)(ex); + }); + + throw ex; + } + }; + /* eslint-enable prefer-rest-params */ + + // Accessing some objects may throw + // ref: https://github.com/getsentry/sentry-javascript/issues/1168 + try { + for (const property in fn) { + if (Object.prototype.hasOwnProperty.call(fn, property)) { + sentryWrapped[property] = fn[property]; + } + } + } catch (_oO) {} // eslint-disable-line no-empty + + // Signal that this function has been wrapped/filled already + // for both debugging and to prevent it to being wrapped/filled twice + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.markFunctionWrapped)(sentryWrapped, fn); + + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.addNonEnumerableProperty)(fn, '__sentry_wrapped__', sentryWrapped); + + // Restore original function name (not all browsers allow that) + try { + const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ; + if (descriptor.configurable) { + Object.defineProperty(sentryWrapped, 'name', { + get() { + return fn.name; + }, + }); + } + // eslint-disable-next-line no-empty + } catch (_oO) {} + + return sentryWrapped; +} + +/** + * All properties the report dialog supports + */ + + +//# sourceMappingURL=helpers.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/integrations/breadcrumbs.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/integrations/breadcrumbs.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Breadcrumbs: () => (/* binding */ Breadcrumbs) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/hub.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/instrument.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/browser.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/severity.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/string.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/url.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../helpers.js */ "./node_modules/@sentry/browser/esm/helpers.js"); + + + + +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ + +/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */ +const MAX_ALLOWED_STRING_LENGTH = 1024; + +/** + * Default Breadcrumbs instrumentations + * TODO: Deprecated - with v6, this will be renamed to `Instrument` + */ +class Breadcrumbs { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Breadcrumbs';} + + /** + * @inheritDoc + */ + + /** + * Options of the breadcrumbs integration. + */ + // This field is public, because we use it in the browser client to check if the `sentry` option is enabled. + + /** + * @inheritDoc + */ + constructor(options) { + this.name = Breadcrumbs.id; + this.options = { + console: true, + dom: true, + fetch: true, + history: true, + sentry: true, + xhr: true, + ...options, + }; + } + + /** + * Instrument browser built-ins w/ breadcrumb capturing + * - Console API + * - DOM API (click/typing) + * - XMLHttpRequest API + * - Fetch API + * - History API + */ + setupOnce() { + if (this.options.console) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)('console', _consoleBreadcrumb); + } + if (this.options.dom) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)('dom', _domBreadcrumb(this.options.dom)); + } + if (this.options.xhr) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)('xhr', _xhrBreadcrumb); + } + if (this.options.fetch) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)('fetch', _fetchBreadcrumb); + } + if (this.options.history) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)('history', _historyBreadcrumb); + } + if (this.options.sentry) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)().getClient(); + client && client.on && client.on('beforeSendEvent', addSentryBreadcrumb); + } + } +} Breadcrumbs.__initStatic(); + +/** + * Adds a breadcrumb for Sentry events or transactions if this option is enabled. + */ +function addSentryBreadcrumb(event) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)().addBreadcrumb( + { + category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`, + event_id: event.event_id, + level: event.level, + message: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.getEventDescription)(event), + }, + { + event, + }, + ); +} + +/** + * A HOC that creaes a function that creates breadcrumbs from DOM API calls. + * This is a HOC so that we get access to dom options in the closure. + */ +function _domBreadcrumb(dom) { + function _innerDomBreadcrumb(handlerData) { + let target; + let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined; + + let maxStringLength = + typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined; + if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.warn( + `\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`, + ); + maxStringLength = MAX_ALLOWED_STRING_LENGTH; + } + + if (typeof keyAttrs === 'string') { + keyAttrs = [keyAttrs]; + } + + // Accessing event.target can throw (see getsentry/raven-js#838, #768) + try { + const event = handlerData.event ; + target = _isEvent(event) + ? (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.htmlTreeAsString)(event.target, { keyAttrs, maxStringLength }) + : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.htmlTreeAsString)(event, { keyAttrs, maxStringLength }); + } catch (e) { + target = ''; + } + + if (target.length === 0) { + return; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)().addBreadcrumb( + { + category: `ui.${handlerData.name}`, + message: target, + }, + { + event: handlerData.event, + name: handlerData.name, + global: handlerData.global, + }, + ); + } + + return _innerDomBreadcrumb; +} + +/** + * Creates breadcrumbs from console API calls + */ +function _consoleBreadcrumb(handlerData) { + const breadcrumb = { + category: 'console', + data: { + arguments: handlerData.args, + logger: 'console', + }, + level: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_5__.severityLevelFromString)(handlerData.level), + message: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.safeJoin)(handlerData.args, ' '), + }; + + if (handlerData.level === 'assert') { + if (handlerData.args[0] === false) { + breadcrumb.message = `Assertion failed: ${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.safeJoin)(handlerData.args.slice(1), ' ') || 'console.assert'}`; + breadcrumb.data.arguments = handlerData.args.slice(1); + } else { + // Don't capture a breadcrumb for passed assertions + return; + } + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)().addBreadcrumb(breadcrumb, { + input: handlerData.args, + level: handlerData.level, + }); +} + +/** + * Creates breadcrumbs from XHR API calls + */ +function _xhrBreadcrumb(handlerData) { + const { startTimestamp, endTimestamp } = handlerData; + + const sentryXhrData = handlerData.xhr[_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.SENTRY_XHR_DATA_KEY]; + + // We only capture complete, non-sentry requests + if (!startTimestamp || !endTimestamp || !sentryXhrData) { + return; + } + + const { method, url, status_code, body } = sentryXhrData; + + const data = { + method, + url, + status_code, + }; + + const hint = { + xhr: handlerData.xhr, + input: body, + startTimestamp, + endTimestamp, + }; + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)().addBreadcrumb( + { + category: 'xhr', + data, + type: 'http', + }, + hint, + ); +} + +/** + * Creates breadcrumbs from fetch API calls + */ +function _fetchBreadcrumb(handlerData) { + const { startTimestamp, endTimestamp } = handlerData; + + // We only capture complete fetch requests + if (!endTimestamp) { + return; + } + + if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') { + // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests) + return; + } + + if (handlerData.error) { + const data = handlerData.fetchData; + const hint = { + data: handlerData.error, + input: handlerData.args, + startTimestamp, + endTimestamp, + }; + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)().addBreadcrumb( + { + category: 'fetch', + data, + level: 'error', + type: 'http', + }, + hint, + ); + } else { + const data = { + ...handlerData.fetchData, + status_code: handlerData.response && handlerData.response.status, + }; + const hint = { + input: handlerData.args, + response: handlerData.response, + startTimestamp, + endTimestamp, + }; + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)().addBreadcrumb( + { + category: 'fetch', + data, + type: 'http', + }, + hint, + ); + } +} + +/** + * Creates breadcrumbs from history API calls + */ +function _historyBreadcrumb(handlerData) { + let from = handlerData.from; + let to = handlerData.to; + const parsedLoc = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__.parseUrl)(_helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.location.href); + let parsedFrom = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__.parseUrl)(from); + const parsedTo = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_7__.parseUrl)(to); + + // Initial pushState doesn't provide `from` information + if (!parsedFrom.path) { + parsedFrom = parsedLoc; + } + + // Use only the path component of the URL if the URL matches the current + // document (almost all the time when using pushState) + if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { + to = parsedTo.relative; + } + if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { + from = parsedFrom.relative; + } + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)().addBreadcrumb({ + category: 'navigation', + data: { + from, + to, + }, + }); +} + +function _isEvent(event) { + return !!event && !!(event ).target; +} + + +//# sourceMappingURL=breadcrumbs.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/integrations/dedupe.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/integrations/dedupe.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Dedupe: () => (/* binding */ Dedupe) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); + + +/** Deduplication filter */ +class Dedupe { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Dedupe';} + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + constructor() { + this.name = Dedupe.id; + } + + /** @inheritDoc */ + setupOnce(_addGlobaleventProcessor, _getCurrentHub) { + // noop + } + + /** + * @inheritDoc + */ + processEvent(currentEvent) { + // We want to ignore any non-error type events, e.g. transactions or replays + // These should never be deduped, and also not be compared against as _previousEvent. + if (currentEvent.type) { + return currentEvent; + } + + // Juuust in case something goes wrong + try { + if (_shouldDropEvent(currentEvent, this._previousEvent)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.warn('Event dropped due to being a duplicate of previously captured event.'); + return null; + } + } catch (_oO) {} // eslint-disable-line no-empty + + return (this._previousEvent = currentEvent); + } +} Dedupe.__initStatic(); + +/** JSDoc */ +function _shouldDropEvent(currentEvent, previousEvent) { + if (!previousEvent) { + return false; + } + + if (_isSameMessageEvent(currentEvent, previousEvent)) { + return true; + } + + if (_isSameExceptionEvent(currentEvent, previousEvent)) { + return true; + } + + return false; +} + +/** JSDoc */ +function _isSameMessageEvent(currentEvent, previousEvent) { + const currentMessage = currentEvent.message; + const previousMessage = previousEvent.message; + + // If neither event has a message property, they were both exceptions, so bail out + if (!currentMessage && !previousMessage) { + return false; + } + + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) { + return false; + } + + if (currentMessage !== previousMessage) { + return false; + } + + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + + return true; +} + +/** JSDoc */ +function _isSameExceptionEvent(currentEvent, previousEvent) { + const previousException = _getExceptionFromEvent(previousEvent); + const currentException = _getExceptionFromEvent(currentEvent); + + if (!previousException || !currentException) { + return false; + } + + if (previousException.type !== currentException.type || previousException.value !== currentException.value) { + return false; + } + + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + + return true; +} + +/** JSDoc */ +function _isSameStacktrace(currentEvent, previousEvent) { + let currentFrames = _getFramesFromEvent(currentEvent); + let previousFrames = _getFramesFromEvent(previousEvent); + + // If neither event has a stacktrace, they are assumed to be the same + if (!currentFrames && !previousFrames) { + return true; + } + + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) { + return false; + } + + currentFrames = currentFrames ; + previousFrames = previousFrames ; + + // If number of frames differ, they are not the same + if (previousFrames.length !== currentFrames.length) { + return false; + } + + // Otherwise, compare the two + for (let i = 0; i < previousFrames.length; i++) { + const frameA = previousFrames[i]; + const frameB = currentFrames[i]; + + if ( + frameA.filename !== frameB.filename || + frameA.lineno !== frameB.lineno || + frameA.colno !== frameB.colno || + frameA.function !== frameB.function + ) { + return false; + } + } + + return true; +} + +/** JSDoc */ +function _isSameFingerprint(currentEvent, previousEvent) { + let currentFingerprint = currentEvent.fingerprint; + let previousFingerprint = previousEvent.fingerprint; + + // If neither event has a fingerprint, they are assumed to be the same + if (!currentFingerprint && !previousFingerprint) { + return true; + } + + // If only one event has a fingerprint, but not the other one, they are not the same + if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) { + return false; + } + + currentFingerprint = currentFingerprint ; + previousFingerprint = previousFingerprint ; + + // Otherwise, compare the two + try { + return !!(currentFingerprint.join('') === previousFingerprint.join('')); + } catch (_oO) { + return false; + } +} + +/** JSDoc */ +function _getExceptionFromEvent(event) { + return event.exception && event.exception.values && event.exception.values[0]; +} + +/** JSDoc */ +function _getFramesFromEvent(event) { + const exception = event.exception; + + if (exception) { + try { + // @ts-expect-error Object could be undefined + return exception.values[0].stacktrace.frames; + } catch (_oO) { + return undefined; + } + } + return undefined; +} + + +//# sourceMappingURL=dedupe.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/integrations/globalhandlers.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/integrations/globalhandlers.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ GlobalHandlers: () => (/* binding */ GlobalHandlers) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/hub.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/instrument.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/browser.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../eventbuilder.js */ "./node_modules/@sentry/browser/esm/eventbuilder.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers.js */ "./node_modules/@sentry/browser/esm/helpers.js"); + + + + + +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ + +/** Global handlers */ +class GlobalHandlers { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'GlobalHandlers';} + + /** + * @inheritDoc + */ + + /** JSDoc */ + + /** + * Stores references functions to installing handlers. Will set to undefined + * after they have been run so that they are not used twice. + */ + + /** JSDoc */ + constructor(options) { + this.name = GlobalHandlers.id; + this._options = { + onerror: true, + onunhandledrejection: true, + ...options, + }; + + this._installFunc = { + onerror: _installGlobalOnErrorHandler, + onunhandledrejection: _installGlobalOnUnhandledRejectionHandler, + }; + } + /** + * @inheritDoc + */ + setupOnce() { + Error.stackTraceLimit = 50; + const options = this._options; + + // We can disable guard-for-in as we construct the options object above + do checks against + // `this._installFunc` for the property. + // eslint-disable-next-line guard-for-in + for (const key in options) { + const installFunc = this._installFunc[key ]; + if (installFunc && options[key ]) { + globalHandlerLog(key); + installFunc(); + this._installFunc[key ] = undefined; + } + } + } +} GlobalHandlers.__initStatic(); + +/** JSDoc */ +function _installGlobalOnErrorHandler() { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)( + 'error', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (data) => { + const [hub, stackParser, attachStacktrace] = getHubAndOptions(); + if (!hub.getIntegration(GlobalHandlers)) { + return; + } + const { msg, url, line, column, error } = data; + if ((0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.shouldIgnoreOnError)() || (error && error.__sentry_own_request__)) { + return; + } + + const event = + error === undefined && (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.isString)(msg) + ? _eventFromIncompleteOnError(msg, url, line, column) + : _enhanceEventWithInitialFrame( + (0,_eventbuilder_js__WEBPACK_IMPORTED_MODULE_3__.eventFromUnknownInput)(stackParser, error || msg, undefined, attachStacktrace, false), + url, + line, + column, + ); + + event.level = 'error'; + + addMechanismAndCapture(hub, error, event, 'onerror'); + }, + ); +} + +/** JSDoc */ +function _installGlobalOnUnhandledRejectionHandler() { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)( + 'unhandledrejection', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (e) => { + const [hub, stackParser, attachStacktrace] = getHubAndOptions(); + if (!hub.getIntegration(GlobalHandlers)) { + return; + } + let error = e; + + // dig the object of the rejection out of known event types + try { + // PromiseRejectionEvents store the object of the rejection under 'reason' + // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent + if ('reason' in e) { + error = e.reason; + } + // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents + // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into + // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec + // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and + // https://github.com/getsentry/sentry-javascript/issues/2380 + else if ('detail' in e && 'reason' in e.detail) { + error = e.detail.reason; + } + } catch (_oO) { + // no-empty + } + + if ((0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.shouldIgnoreOnError)() || (error && error.__sentry_own_request__)) { + return true; + } + + const event = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.isPrimitive)(error) + ? _eventFromRejectionWithPrimitive(error) + : (0,_eventbuilder_js__WEBPACK_IMPORTED_MODULE_3__.eventFromUnknownInput)(stackParser, error, undefined, attachStacktrace, true); + + event.level = 'error'; + + addMechanismAndCapture(hub, error, event, 'onunhandledrejection'); + return; + }, + ); +} + +/** + * Create an event from a promise rejection where the `reason` is a primitive. + * + * @param reason: The `reason` property of the promise rejection + * @returns An Event object with an appropriate `exception` value + */ +function _eventFromRejectionWithPrimitive(reason) { + return { + exception: { + values: [ + { + type: 'UnhandledRejection', + // String() is needed because the Primitive type includes symbols (which can't be automatically stringified) + value: `Non-Error promise rejection captured with value: ${String(reason)}`, + }, + ], + }, + }; +} + +/** + * This function creates a stack from an old, error-less onerror handler. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _eventFromIncompleteOnError(msg, url, line, column) { + const ERROR_TYPES_RE = + /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; + + // If 'message' is ErrorEvent, get real message from inside + let message = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.isErrorEvent)(msg) ? msg.message : msg; + let name = 'Error'; + + const groups = message.match(ERROR_TYPES_RE); + if (groups) { + name = groups[1]; + message = groups[2]; + } + + const event = { + exception: { + values: [ + { + type: name, + value: message, + }, + ], + }, + }; + + return _enhanceEventWithInitialFrame(event, url, line, column); +} + +/** JSDoc */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _enhanceEventWithInitialFrame(event, url, line, column) { + // event.exception + const e = (event.exception = event.exception || {}); + // event.exception.values + const ev = (e.values = e.values || []); + // event.exception.values[0] + const ev0 = (ev[0] = ev[0] || {}); + // event.exception.values[0].stacktrace + const ev0s = (ev0.stacktrace = ev0.stacktrace || {}); + // event.exception.values[0].stacktrace.frames + const ev0sf = (ev0s.frames = ev0s.frames || []); + + const colno = isNaN(parseInt(column, 10)) ? undefined : column; + const lineno = isNaN(parseInt(line, 10)) ? undefined : line; + const filename = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.isString)(url) && url.length > 0 ? url : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.getLocationHref)(); + + // event.exception.values[0].stacktrace.frames + if (ev0sf.length === 0) { + ev0sf.push({ + colno, + filename, + function: '?', + in_app: true, + lineno, + }); + } + + return event; +} + +function globalHandlerLog(type) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_5__.logger.log(`Global Handler attached: ${type}`); +} + +function addMechanismAndCapture(hub, error, event, type) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.addExceptionMechanism)(event, { + handled: false, + type, + }); + hub.captureEvent(event, { + originalException: error, + }); +} + +function getHubAndOptions() { + const hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.getCurrentHub)(); + const client = hub.getClient(); + const options = (client && client.getOptions()) || { + stackParser: () => [], + attachStacktrace: false, + }; + return [hub, options.stackParser, options.attachStacktrace]; +} + + +//# sourceMappingURL=globalhandlers.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/integrations/httpcontext.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/integrations/httpcontext.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ HttpContext: () => (/* binding */ HttpContext) +/* harmony export */ }); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers.js */ "./node_modules/@sentry/browser/esm/helpers.js"); + + +/** HttpContext integration collects information about HTTP request headers */ +class HttpContext { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'HttpContext';} + + /** + * @inheritDoc + */ + + constructor() { + this.name = HttpContext.id; + } + + /** + * @inheritDoc + */ + setupOnce() { + // noop + } + + /** @inheritDoc */ + preprocessEvent(event) { + // if none of the information we want exists, don't bother + if (!_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator && !_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.location && !_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document) { + return; + } + + // grab as much info as exists and add it to the event + const url = (event.request && event.request.url) || (_helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.location && _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.location.href); + const { referrer } = _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.document || {}; + const { userAgent } = _helpers_js__WEBPACK_IMPORTED_MODULE_0__.WINDOW.navigator || {}; + + const headers = { + ...(event.request && event.request.headers), + ...(referrer && { Referer: referrer }), + ...(userAgent && { 'User-Agent': userAgent }), + }; + const request = { ...event.request, ...(url && { url }), headers }; + + event.request = request; + } +} HttpContext.__initStatic(); + + +//# sourceMappingURL=httpcontext.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/integrations/linkederrors.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/integrations/linkederrors.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ LinkedErrors: () => (/* binding */ LinkedErrors) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/aggregate-errors.js"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../eventbuilder.js */ "./node_modules/@sentry/browser/esm/eventbuilder.js"); + + + +const DEFAULT_KEY = 'cause'; +const DEFAULT_LIMIT = 5; + +/** Adds SDK info to an event. */ +class LinkedErrors { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'LinkedErrors';} + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + constructor(options = {}) { + this.name = LinkedErrors.id; + this._key = options.key || DEFAULT_KEY; + this._limit = options.limit || DEFAULT_LIMIT; + } + + /** @inheritdoc */ + setupOnce() { + // noop + } + + /** + * @inheritDoc + */ + preprocessEvent(event, hint, client) { + const options = client.getOptions(); + + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.applyAggregateErrorsToEvent)( + _eventbuilder_js__WEBPACK_IMPORTED_MODULE_1__.exceptionFromError, + options.stackParser, + options.maxValueLength, + this._key, + this._limit, + event, + hint, + ); + } +} LinkedErrors.__initStatic(); + + +//# sourceMappingURL=linkederrors.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/integrations/trycatch.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/integrations/trycatch.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TryCatch: () => (/* binding */ TryCatch) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/stacktrace.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers.js */ "./node_modules/@sentry/browser/esm/helpers.js"); + + + +const DEFAULT_EVENT_TARGET = [ + 'EventTarget', + 'Window', + 'Node', + 'ApplicationCache', + 'AudioTrackList', + 'BroadcastChannel', + 'ChannelMergerNode', + 'CryptoOperation', + 'EventSource', + 'FileReader', + 'HTMLUnknownElement', + 'IDBDatabase', + 'IDBRequest', + 'IDBTransaction', + 'KeyOperation', + 'MediaController', + 'MessagePort', + 'ModalWindow', + 'Notification', + 'SVGElementInstance', + 'Screen', + 'SharedWorker', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebSocket', + 'WebSocketWorker', + 'Worker', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload', +]; + +/** Wrap timer functions and event targets to catch errors and provide better meta data */ +class TryCatch { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'TryCatch';} + + /** + * @inheritDoc + */ + + /** JSDoc */ + + /** + * @inheritDoc + */ + constructor(options) { + this.name = TryCatch.id; + this._options = { + XMLHttpRequest: true, + eventTarget: true, + requestAnimationFrame: true, + setInterval: true, + setTimeout: true, + ...options, + }; + } + + /** + * Wrap timer functions and event targets to catch errors + * and provide better metadata. + */ + setupOnce() { + if (this._options.setTimeout) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.fill)(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW, 'setTimeout', _wrapTimeFunction); + } + + if (this._options.setInterval) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.fill)(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW, 'setInterval', _wrapTimeFunction); + } + + if (this._options.requestAnimationFrame) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.fill)(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW, 'requestAnimationFrame', _wrapRAF); + } + + if (this._options.XMLHttpRequest && "XMLHttpRequest" in _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW) { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.fill)(XMLHttpRequest.prototype, 'send', _wrapXHR); + } + + const eventTargetOption = this._options.eventTarget; + if (eventTargetOption) { + const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET; + eventTarget.forEach(_wrapEventTarget); + } + } +} TryCatch.__initStatic(); + +/** JSDoc */ +function _wrapTimeFunction(original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( ...args) { + const originalCallback = args[0]; + args[0] = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(originalCallback, { + mechanism: { + data: { function: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(original) }, + handled: false, + type: 'instrument', + }, + }); + return original.apply(this, args); + }; +} + +/** JSDoc */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _wrapRAF(original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( callback) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return original.apply(this, [ + (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(callback, { + mechanism: { + data: { + function: 'requestAnimationFrame', + handler: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(original), + }, + handled: false, + type: 'instrument', + }, + }), + ]); + }; +} + +/** JSDoc */ +function _wrapXHR(originalSend) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( ...args) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const xhr = this; + const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange']; + + xmlHttpRequestProps.forEach(prop => { + if (prop in xhr && typeof xhr[prop] === 'function') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.fill)(xhr, prop, function (original) { + const wrapOptions = { + mechanism: { + data: { + function: prop, + handler: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(original), + }, + handled: false, + type: 'instrument', + }, + }; + + // If Instrument integration has been called before TryCatch, get the name of original function + const originalFunction = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.getOriginalFunction)(original); + if (originalFunction) { + wrapOptions.mechanism.data.handler = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(originalFunction); + } + + // Otherwise wrap directly + return (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(original, wrapOptions); + }); + } + }); + + return originalSend.apply(this, args); + }; +} + +/** JSDoc */ +function _wrapEventTarget(target) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const globalObject = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW ; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const proto = globalObject[target] && globalObject[target].prototype; + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; + } + + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.fill)(proto, 'addEventListener', function (original) + + { + return function ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + eventName, + fn, + options, + ) { + try { + if (typeof fn.handleEvent === 'function') { + // ESlint disable explanation: + // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would + // introduce a bug here, because bind returns a new function that doesn't have our + // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping. + // Without those flags, every call to addEventListener wraps the function again, causing a memory leak. + // eslint-disable-next-line @typescript-eslint/unbound-method + fn.handleEvent = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(fn.handleEvent, { + mechanism: { + data: { + function: 'handleEvent', + handler: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(fn), + target, + }, + handled: false, + type: 'instrument', + }, + }); + } + } catch (err) { + // can sometimes get 'Permission denied to access property "handle Event' + } + + return original.apply(this, [ + eventName, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (0,_helpers_js__WEBPACK_IMPORTED_MODULE_1__.wrap)(fn , { + mechanism: { + data: { + function: 'addEventListener', + handler: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(fn), + target, + }, + handled: false, + type: 'instrument', + }, + }), + options, + ]); + }; + }); + + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.fill)( + proto, + 'removeEventListener', + function ( + originalRemoveEventListener, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) { + return function ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + eventName, + fn, + options, + ) { + /** + * There are 2 possible scenarios here: + * + * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified + * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function + * as a pass-through, and call original `removeEventListener` with it. + * + * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using + * our wrapped version of `addEventListener`, which internally calls `wrap` helper. + * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it, + * in order for us to make a distinction between wrapped/non-wrapped functions possible. + * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler. + * + * When someone adds a handler prior to initialization, and then do it again, but after, + * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible + * to get rid of the initial handler and it'd stick there forever. + */ + const wrappedEventHandler = fn ; + try { + const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__; + if (originalEventHandler) { + originalRemoveEventListener.call(this, eventName, originalEventHandler, options); + } + } catch (e) { + // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments + } + return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options); + }; + }, + ); +} + + +//# sourceMappingURL=trycatch.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/sdk.js": +/*!*************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/sdk.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ captureUserFeedback: () => (/* binding */ captureUserFeedback), +/* harmony export */ defaultIntegrations: () => (/* binding */ defaultIntegrations), +/* harmony export */ forceLoad: () => (/* binding */ forceLoad), +/* harmony export */ init: () => (/* binding */ init), +/* harmony export */ onLoad: () => (/* binding */ onLoad), +/* harmony export */ showReportDialog: () => (/* binding */ showReportDialog), +/* harmony export */ wrap: () => (/* binding */ wrap) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/integrations/inboundfilters.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/integrations/functiontostring.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/integration.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/sdk.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/hub.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/api.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/stacktrace.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/supports.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/instrument.js"); +/* harmony import */ var _client_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./client.js */ "./node_modules/@sentry/browser/esm/client.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers.js */ "./node_modules/@sentry/browser/esm/helpers.js"); +/* harmony import */ var _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./integrations/globalhandlers.js */ "./node_modules/@sentry/browser/esm/integrations/globalhandlers.js"); +/* harmony import */ var _integrations_trycatch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./integrations/trycatch.js */ "./node_modules/@sentry/browser/esm/integrations/trycatch.js"); +/* harmony import */ var _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./integrations/breadcrumbs.js */ "./node_modules/@sentry/browser/esm/integrations/breadcrumbs.js"); +/* harmony import */ var _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./integrations/linkederrors.js */ "./node_modules/@sentry/browser/esm/integrations/linkederrors.js"); +/* harmony import */ var _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./integrations/httpcontext.js */ "./node_modules/@sentry/browser/esm/integrations/httpcontext.js"); +/* harmony import */ var _integrations_dedupe_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./integrations/dedupe.js */ "./node_modules/@sentry/browser/esm/integrations/dedupe.js"); +/* harmony import */ var _stack_parsers_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./stack-parsers.js */ "./node_modules/@sentry/browser/esm/stack-parsers.js"); +/* harmony import */ var _transports_fetch_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./transports/fetch.js */ "./node_modules/@sentry/browser/esm/transports/fetch.js"); +/* harmony import */ var _transports_xhr_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./transports/xhr.js */ "./node_modules/@sentry/browser/esm/transports/xhr.js"); + + + + + + + + + + + + + + +const defaultIntegrations = [ + new _sentry_core__WEBPACK_IMPORTED_MODULE_0__.InboundFilters(), + new _sentry_core__WEBPACK_IMPORTED_MODULE_1__.FunctionToString(), + new _integrations_trycatch_js__WEBPACK_IMPORTED_MODULE_2__.TryCatch(), + new _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_3__.Breadcrumbs(), + new _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_4__.GlobalHandlers(), + new _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_5__.LinkedErrors(), + new _integrations_dedupe_js__WEBPACK_IMPORTED_MODULE_6__.Dedupe(), + new _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_7__.HttpContext(), +]; + +/** + * A magic string that build tooling can leverage in order to inject a release value into the SDK. + */ + +/** + * The Sentry Browser SDK Client. + * + * To use this SDK, call the {@link init} function as early as possible when + * loading the web page. To set context information or send manual events, use + * the provided methods. + * + * @example + * + * ``` + * + * import { init } from '@sentry/browser'; + * + * init({ + * dsn: '__DSN__', + * // ... + * }); + * ``` + * + * @example + * ``` + * + * import { configureScope } from '@sentry/browser'; + * configureScope((scope: Scope) => { + * scope.setExtra({ battery: 0.7 }); + * scope.setTag({ user_mode: 'admin' }); + * scope.setUser({ id: '4711' }); + * }); + * ``` + * + * @example + * ``` + * + * import { addBreadcrumb } from '@sentry/browser'; + * addBreadcrumb({ + * message: 'My Breadcrumb', + * // ... + * }); + * ``` + * + * @example + * + * ``` + * + * import * as Sentry from '@sentry/browser'; + * Sentry.captureMessage('Hello, world!'); + * Sentry.captureException(new Error('Good bye')); + * Sentry.captureEvent({ + * message: 'Manual', + * stacktrace: [ + * // ... + * ], + * }); + * ``` + * + * @see {@link BrowserOptions} for documentation on configuration options. + */ +function init(options = {}) { + if (options.defaultIntegrations === undefined) { + options.defaultIntegrations = defaultIntegrations; + } + if (options.release === undefined) { + // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value + if (typeof __SENTRY_RELEASE__ === 'string') { + options.release = __SENTRY_RELEASE__; + } + + // This supports the variable that sentry-webpack-plugin injects + if (_helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.SENTRY_RELEASE && _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.SENTRY_RELEASE.id) { + options.release = _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.SENTRY_RELEASE.id; + } + } + if (options.autoSessionTracking === undefined) { + options.autoSessionTracking = true; + } + if (options.sendClientReports === undefined) { + options.sendClientReports = true; + } + + const clientOptions = { + ...options, + stackParser: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_9__.stackParserFromStackParserOptions)(options.stackParser || _stack_parsers_js__WEBPACK_IMPORTED_MODULE_10__.defaultStackParser), + integrations: (0,_sentry_core__WEBPACK_IMPORTED_MODULE_11__.getIntegrationsToSetup)(options), + transport: options.transport || ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_12__.supportsFetch)() ? _transports_fetch_js__WEBPACK_IMPORTED_MODULE_13__.makeFetchTransport : _transports_xhr_js__WEBPACK_IMPORTED_MODULE_14__.makeXHRTransport), + }; + + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_15__.initAndBind)(_client_js__WEBPACK_IMPORTED_MODULE_16__.BrowserClient, clientOptions); + + if (options.autoSessionTracking) { + startSessionTracking(); + } +} + +/** + * Present the user with a report dialog. + * + * @param options Everything is optional, we try to fetch all info need from the global scope. + */ +function showReportDialog(options = {}, hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)()) { + // doesn't work without a document (React Native) + if (!_helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_18__.logger.error('Global document not defined in showReportDialog call'); + return; + } + + const { client, scope } = hub.getStackTop(); + const dsn = options.dsn || (client && client.getDsn()); + if (!dsn) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_18__.logger.error('DSN not configured for showReportDialog call'); + return; + } + + if (scope) { + options.user = { + ...scope.getUser(), + ...options.user, + }; + } + + if (!options.eventId) { + options.eventId = hub.lastEventId(); + } + + const script = _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document.createElement('script'); + script.async = true; + script.crossOrigin = 'anonymous'; + script.src = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_19__.getReportDialogEndpoint)(dsn, options); + + if (options.onLoad) { + script.onload = options.onLoad; + } + + const injectionPoint = _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document.head || _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document.body; + if (injectionPoint) { + injectionPoint.appendChild(script); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_18__.logger.error('Not injecting report dialog. No injection point found in HTML'); + } +} + +/** + * This function is here to be API compatible with the loader. + * @hidden + */ +function forceLoad() { + // Noop +} + +/** + * This function is here to be API compatible with the loader. + * @hidden + */ +function onLoad(callback) { + callback(); +} + +/** + * Wrap code within a try/catch block so the SDK is able to capture errors. + * + * @deprecated This function will be removed in v8. + * It is not part of Sentry's official API and it's easily replaceable by using a try/catch block + * and calling Sentry.captureException. + * + * @param fn A function to wrap. + * + * @returns The result of wrapped function call. + */ +// TODO(v8): Remove this function +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function wrap(fn) { + return (0,_helpers_js__WEBPACK_IMPORTED_MODULE_8__.wrap)(fn)(); +} + +function startSessionOnHub(hub) { + hub.startSession({ ignoreDuration: true }); + hub.captureSession(); +} + +/** + * Enable automatic Session Tracking for the initial page load. + */ +function startSessionTracking() { + if (typeof _helpers_js__WEBPACK_IMPORTED_MODULE_8__.WINDOW.document === 'undefined') { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_18__.logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.'); + return; + } + + const hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)(); + + // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and + // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are + // pinned at the same version in package.json, but there are edge cases where it's possible. See + // https://github.com/getsentry/sentry-javascript/issues/3207 and + // https://github.com/getsentry/sentry-javascript/issues/3234 and + // https://github.com/getsentry/sentry-javascript/issues/3278. + if (!hub.captureSession) { + return; + } + + // The session duration for browser sessions does not track a meaningful + // concept that can be used as a metric. + // Automatically captured sessions are akin to page views, and thus we + // discard their duration. + startSessionOnHub(hub); + + // We want to create a session for every navigation as well + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_20__.addInstrumentationHandler)('history', ({ from, to }) => { + // Don't create an additional session for the initial route or if the location did not change + if (!(from === undefined || from === to)) { + startSessionOnHub((0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)()); + } + }); +} + +/** + * Captures user feedback and sends it to Sentry. + */ +function captureUserFeedback(feedback) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_17__.getCurrentHub)().getClient(); + if (client) { + client.captureUserFeedback(feedback); + } +} + + +//# sourceMappingURL=sdk.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/stack-parsers.js": +/*!***********************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/stack-parsers.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ chromeStackLineParser: () => (/* binding */ chromeStackLineParser), +/* harmony export */ defaultStackLineParsers: () => (/* binding */ defaultStackLineParsers), +/* harmony export */ defaultStackParser: () => (/* binding */ defaultStackParser), +/* harmony export */ geckoStackLineParser: () => (/* binding */ geckoStackLineParser), +/* harmony export */ opera10StackLineParser: () => (/* binding */ opera10StackLineParser), +/* harmony export */ opera11StackLineParser: () => (/* binding */ opera11StackLineParser), +/* harmony export */ winjsStackLineParser: () => (/* binding */ winjsStackLineParser) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/stacktrace.js"); + + +// global reference to slice +const UNKNOWN_FUNCTION = '?'; + +const OPERA10_PRIORITY = 10; +const OPERA11_PRIORITY = 20; +const CHROME_PRIORITY = 30; +const WINJS_PRIORITY = 40; +const GECKO_PRIORITY = 50; + +function createFrame(filename, func, lineno, colno) { + const frame = { + filename, + function: func, + in_app: true, // All browser frames are considered in_app + }; + + if (lineno !== undefined) { + frame.lineno = lineno; + } + + if (colno !== undefined) { + frame.colno = colno; + } + + return frame; +} + +// Chromium based browsers: Chrome, Brave, new Opera, new Edge +const chromeRegex = + /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; +const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; + +const chrome = line => { + const parts = chromeRegex.exec(line); + + if (parts) { + const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line + + if (isEval) { + const subMatch = chromeEvalRegex.exec(parts[2]); + + if (subMatch) { + // throw out eval line/column and use top-most line/column number + parts[2] = subMatch[1]; // url + parts[3] = subMatch[2]; // line + parts[4] = subMatch[3]; // column + } + } + + // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now + // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable) + const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]); + + return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined); + } + + return; +}; + +const chromeStackLineParser = [CHROME_PRIORITY, chrome]; + +// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it +// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js +// We need this specific case for now because we want no other regex to match. +const geckoREgex = + /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; +const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; + +const gecko = line => { + const parts = geckoREgex.exec(line); + + if (parts) { + const isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + if (isEval) { + const subMatch = geckoEvalRegex.exec(parts[3]); + + if (subMatch) { + // throw out eval line/column and use top-most line number + parts[1] = parts[1] || 'eval'; + parts[3] = subMatch[1]; + parts[4] = subMatch[2]; + parts[5] = ''; // no column when eval + } + } + + let filename = parts[3]; + let func = parts[1] || UNKNOWN_FUNCTION; + [func, filename] = extractSafariExtensionDetails(func, filename); + + return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined); + } + + return; +}; + +const geckoStackLineParser = [GECKO_PRIORITY, gecko]; + +const winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i; + +const winjs = line => { + const parts = winjsRegex.exec(line); + + return parts + ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) + : undefined; +}; + +const winjsStackLineParser = [WINJS_PRIORITY, winjs]; + +const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i; + +const opera10 = line => { + const parts = opera10Regex.exec(line); + return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined; +}; + +const opera10StackLineParser = [OPERA10_PRIORITY, opera10]; + +const opera11Regex = + / line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i; + +const opera11 = line => { + const parts = opera11Regex.exec(line); + return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined; +}; + +const opera11StackLineParser = [OPERA11_PRIORITY, opera11]; + +const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser]; + +const defaultStackParser = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.createStackParser)(...defaultStackLineParsers); + +/** + * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces. + * What it means, is that instead of format like: + * + * Error: wat + * at function@url:row:col + * at function@url:row:col + * at function@url:row:col + * + * it produces something like: + * + * function@url:row:col + * function@url:row:col + * function@url:row:col + * + * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch. + * This function is extracted so that we can use it in both places without duplicating the logic. + * Unfortunately "just" changing RegExp is too complicated now and making it pass all tests + * and fix this case seems like an impossible, or at least way too time-consuming task. + */ +const extractSafariExtensionDetails = (func, filename) => { + const isSafariExtension = func.indexOf('safari-extension') !== -1; + const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1; + + return isSafariExtension || isSafariWebExtension + ? [ + func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION, + isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`, + ] + : [func, filename]; +}; + + +//# sourceMappingURL=stack-parsers.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/transports/fetch.js": +/*!**************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/transports/fetch.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ makeFetchTransport: () => (/* binding */ makeFetchTransport) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/transports/base.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/syncpromise.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/@sentry/browser/esm/transports/utils.js"); + + + + +/** + * Creates a Transport that uses the Fetch API to send events to Sentry. + */ +function makeFetchTransport( + options, + nativeFetch = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getNativeFetchImplementation)(), +) { + let pendingBodySize = 0; + let pendingCount = 0; + + function makeRequest(request) { + const requestSize = request.body.length; + pendingBodySize += requestSize; + pendingCount++; + + const requestOptions = { + body: request.body, + method: 'POST', + referrerPolicy: 'origin', + headers: options.headers, + // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to + // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)". + // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're + // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions). + // Gotchas: + // - `keepalive` isn't supported by Firefox + // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch): + // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error. + // We will therefore only activate the flag when we're below that limit. + // There is also a limit of requests that can be open at the same time, so we also limit this to 15 + // See https://github.com/getsentry/sentry-javascript/pull/7553 for details + keepalive: pendingBodySize <= 60000 && pendingCount < 15, + ...options.fetchOptions, + }; + + try { + return nativeFetch(options.url, requestOptions).then(response => { + pendingBodySize -= requestSize; + pendingCount--; + return { + statusCode: response.status, + headers: { + 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), + 'retry-after': response.headers.get('Retry-After'), + }, + }; + }); + } catch (e) { + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.clearCachedFetchImplementation)(); + pendingBodySize -= requestSize; + pendingCount--; + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.rejectedSyncPromise)(e); + } + } + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_2__.createTransport)(options, makeRequest); +} + + +//# sourceMappingURL=fetch.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/transports/utils.js": +/*!**************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/transports/utils.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ clearCachedFetchImplementation: () => (/* binding */ clearCachedFetchImplementation), +/* harmony export */ getNativeFetchImplementation: () => (/* binding */ getNativeFetchImplementation) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/supports.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers.js */ "./node_modules/@sentry/browser/esm/helpers.js"); + + + +let cachedFetchImpl = undefined; + +/** + * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers. + * Whenever someone wraps the Fetch API and returns the wrong promise chain, + * this chain becomes orphaned and there is no possible way to capture it's rejections + * other than allowing it bubble up to this very handler. eg. + * + * const f = window.fetch; + * window.fetch = function () { + * const p = f.apply(this, arguments); + * + * p.then(function() { + * console.log('hi.'); + * }); + * + * return p; + * } + * + * `p.then(function () { ... })` is producing a completely separate promise chain, + * however, what's returned is `p` - the result of original `fetch` call. + * + * This mean, that whenever we use the Fetch API to send our own requests, _and_ + * some ad-blocker blocks it, this orphaned chain will _always_ reject, + * effectively causing another event to be captured. + * This makes a whole process become an infinite loop, which we need to somehow + * deal with, and break it in one way or another. + * + * To deal with this issue, we are making sure that we _always_ use the real + * browser Fetch API, instead of relying on what `window.fetch` exposes. + * The only downside to this would be missing our own requests as breadcrumbs, + * but because we are already not doing this, it should be just fine. + * + * Possible failed fetch error messages per-browser: + * + * Chrome: Failed to fetch + * Edge: Failed to Fetch + * Firefox: NetworkError when attempting to fetch resource + * Safari: resource blocked by content blocker + */ +function getNativeFetchImplementation() { + if (cachedFetchImpl) { + return cachedFetchImpl; + } + + /* eslint-disable @typescript-eslint/unbound-method */ + + // Fast path to avoid DOM I/O + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.isNativeFetch)(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.fetch)) { + return (cachedFetchImpl = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.fetch.bind(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW)); + } + + const document = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.document; + let fetchImpl = _helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW.fetch; + // eslint-disable-next-line deprecation/deprecation + if (document && typeof document.createElement === 'function') { + try { + const sandbox = document.createElement('iframe'); + sandbox.hidden = true; + document.head.appendChild(sandbox); + const contentWindow = sandbox.contentWindow; + if (contentWindow && contentWindow.fetch) { + fetchImpl = contentWindow.fetch; + } + document.head.removeChild(sandbox); + } catch (e) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_2__.logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e); + } + } + + return (cachedFetchImpl = fetchImpl.bind(_helpers_js__WEBPACK_IMPORTED_MODULE_1__.WINDOW)); + /* eslint-enable @typescript-eslint/unbound-method */ +} + +/** Clears cached fetch impl */ +function clearCachedFetchImplementation() { + cachedFetchImpl = undefined; +} + + +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/transports/xhr.js": +/*!************************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/transports/xhr.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ makeXHRTransport: () => (/* binding */ makeXHRTransport) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/transports/base.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/syncpromise.js"); + + + +/** + * The DONE ready state for XmlHttpRequest + * + * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined + * (e.g. during testing, it is `undefined`) + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState} + */ +const XHR_READYSTATE_DONE = 4; + +/** + * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry. + */ +function makeXHRTransport(options) { + function makeRequest(request) { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.SyncPromise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + + xhr.onerror = reject; + + xhr.onreadystatechange = () => { + if (xhr.readyState === XHR_READYSTATE_DONE) { + resolve({ + statusCode: xhr.status, + headers: { + 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'), + 'retry-after': xhr.getResponseHeader('Retry-After'), + }, + }); + } + }; + + xhr.open('POST', options.url); + + for (const header in options.headers) { + if (Object.prototype.hasOwnProperty.call(options.headers, header)) { + xhr.setRequestHeader(header, options.headers[header]); + } + } + + xhr.send(request.body); + }); + } + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_1__.createTransport)(options, makeRequest); +} + + +//# sourceMappingURL=xhr.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/browser/esm/userfeedback.js": +/*!**********************************************************!*\ + !*** ./node_modules/@sentry/browser/esm/userfeedback.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createUserFeedbackEnvelope: () => (/* binding */ createUserFeedbackEnvelope) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/dsn.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/envelope.js"); + + +/** + * Creates an envelope from a user feedback. + */ +function createUserFeedbackEnvelope( + feedback, + { + metadata, + tunnel, + dsn, + } + +, +) { + const headers = { + event_id: feedback.event_id, + sent_at: new Date().toISOString(), + ...(metadata && + metadata.sdk && { + sdk: { + name: metadata.sdk.name, + version: metadata.sdk.version, + }, + }), + ...(!!tunnel && !!dsn && { dsn: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.dsnToString)(dsn) }), + }; + const item = createUserFeedbackEnvelopeItem(feedback); + + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.createEnvelope)(headers, [item]); +} + +function createUserFeedbackEnvelopeItem(feedback) { + const feedbackHeaders = { + type: 'user_report', + }; + return [feedbackHeaders, feedback]; +} + + +//# sourceMappingURL=userfeedback.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/api.js": +/*!**********************************************!*\ + !*** ./node_modules/@sentry/core/esm/api.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getEnvelopeEndpointWithUrlEncodedAuth: () => (/* binding */ getEnvelopeEndpointWithUrlEncodedAuth), +/* harmony export */ getReportDialogEndpoint: () => (/* binding */ getReportDialogEndpoint) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/dsn.js"); + + +const SENTRY_API_VERSION = '7'; + +/** Returns the prefix to construct Sentry ingestion API endpoints. */ +function getBaseApiEndpoint(dsn) { + const protocol = dsn.protocol ? `${dsn.protocol}:` : ''; + const port = dsn.port ? `:${dsn.port}` : ''; + return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`; +} + +/** Returns the ingest API endpoint for target. */ +function _getIngestEndpoint(dsn) { + return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; +} + +/** Returns a URL-encoded string with auth config suitable for a query string. */ +function _encodedAuth(dsn, sdkInfo) { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.urlEncode)({ + // We send only the minimum set of required information. See + // https://github.com/getsentry/sentry-javascript/issues/2572. + sentry_key: dsn.publicKey, + sentry_version: SENTRY_API_VERSION, + ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }), + }); +} + +/** + * Returns the envelope endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ +function getEnvelopeEndpointWithUrlEncodedAuth( + dsn, + // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below + // options: ClientOptions = {} as ClientOptions, + tunnelOrOptions = {} , +) { + // TODO (v8): Use this code instead + // const { tunnel, _metadata = {} } = options; + // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`; + + const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel; + const sdkInfo = + typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk; + + return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; +} + +/** Returns the url to the report dialog endpoint. */ +function getReportDialogEndpoint( + dsnLike, + dialogOptions + +, +) { + const dsn = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.makeDsn)(dsnLike); + if (!dsn) { + return ''; + } + + const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`; + + let encodedOptions = `dsn=${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.dsnToString)(dsn)}`; + for (const key in dialogOptions) { + if (key === 'dsn') { + continue; + } + + if (key === 'user') { + const user = dialogOptions.user; + if (!user) { + continue; + } + if (user.name) { + encodedOptions += `&name=${encodeURIComponent(user.name)}`; + } + if (user.email) { + encodedOptions += `&email=${encodeURIComponent(user.email)}`; + } + } else { + encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`; + } + } + + return `${endpoint}?${encodedOptions}`; +} + + +//# sourceMappingURL=api.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/baseclient.js": +/*!*****************************************************!*\ + !*** ./node_modules/@sentry/core/esm/baseclient.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BaseClient: () => (/* binding */ BaseClient) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/dsn.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/syncpromise.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/envelope.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/error.js"); +/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./api.js */ "./node_modules/@sentry/core/esm/api.js"); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./envelope.js */ "./node_modules/@sentry/core/esm/envelope.js"); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./integration.js */ "./node_modules/@sentry/core/esm/integration.js"); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./session.js */ "./node_modules/@sentry/core/esm/session.js"); +/* harmony import */ var _tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./tracing/dynamicSamplingContext.js */ "./node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _utils_prepareEvent_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/prepareEvent.js */ "./node_modules/@sentry/core/esm/utils/prepareEvent.js"); + + + + + + + + +const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; + +/** + * Base implementation for all JavaScript SDK clients. + * + * Call the constructor with the corresponding options + * specific to the client subclass. To access these options later, use + * {@link Client.getOptions}. + * + * If a Dsn is specified in the options, it will be parsed and stored. Use + * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is + * invalid, the constructor will throw a {@link SentryException}. Note that + * without a valid Dsn, the SDK will not send any events to Sentry. + * + * Before sending an event, it is passed through + * {@link BaseClient._prepareEvent} to add SDK information and scope data + * (breadcrumbs and context). To add more custom information, override this + * method and extend the resulting prepared event. + * + * To issue automatically created events (e.g. via instrumentation), use + * {@link Client.captureEvent}. It will prepare the event and pass it through + * the callback lifecycle. To issue auto-breadcrumbs, use + * {@link Client.addBreadcrumb}. + * + * @example + * class NodeClient extends BaseClient { + * public constructor(options: NodeOptions) { + * super(options); + * } + * + * // ... + * } + */ +class BaseClient { + /** Options passed to the SDK. */ + + /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ + + /** Array of set up integrations. */ + + /** Indicates whether this client's integrations have been set up. */ + + /** Number of calls being processed */ + + /** Holds flushable */ + + // eslint-disable-next-line @typescript-eslint/ban-types + + /** + * Initializes this client instance. + * + * @param options Options for the client. + */ + constructor(options) { + this._options = options; + this._integrations = {}; + this._integrationsInitialized = false; + this._numProcessing = 0; + this._outcomes = {}; + this._hooks = {}; + this._eventProcessors = []; + + if (options.dsn) { + this._dsn = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.makeDsn)(options.dsn); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn('No DSN provided, client will not send events.'); + } + + if (this._dsn) { + const url = (0,_api_js__WEBPACK_IMPORTED_MODULE_2__.getEnvelopeEndpointWithUrlEncodedAuth)(this._dsn, options); + this._transport = options.transport({ + recordDroppedEvent: this.recordDroppedEvent.bind(this), + ...options.transportOptions, + url, + }); + } + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + captureException(exception, hint, scope) { + // ensure we haven't captured this very object before + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.checkOrSetAlreadyCaught)(exception)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log(ALREADY_SEEN_ERROR); + return; + } + + let eventId = hint && hint.event_id; + + this._process( + this.eventFromException(exception, hint) + .then(event => this._captureEvent(event, hint, scope)) + .then(result => { + eventId = result; + }), + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureMessage( + message, + // eslint-disable-next-line deprecation/deprecation + level, + hint, + scope, + ) { + let eventId = hint && hint.event_id; + + const promisedEvent = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.isPrimitive)(message) + ? this.eventFromMessage(String(message), level, hint) + : this.eventFromException(message, hint); + + this._process( + promisedEvent + .then(event => this._captureEvent(event, hint, scope)) + .then(result => { + eventId = result; + }), + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureEvent(event, hint, scope) { + // ensure we haven't captured this very object before + if (hint && hint.originalException && (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.checkOrSetAlreadyCaught)(hint.originalException)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log(ALREADY_SEEN_ERROR); + return; + } + + let eventId = hint && hint.event_id; + + this._process( + this._captureEvent(event, hint, scope).then(result => { + eventId = result; + }), + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureSession(session) { + if (!(typeof session.release === 'string')) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Discarded session because of missing or non-string release'); + } else { + this.sendSession(session); + // After sending, we set init false to indicate it's not the first occurrence + (0,_session_js__WEBPACK_IMPORTED_MODULE_5__.updateSession)(session, { init: false }); + } + } + + /** + * @inheritDoc + */ + getDsn() { + return this._dsn; + } + + /** + * @inheritDoc + */ + getOptions() { + return this._options; + } + + /** + * @see SdkMetadata in @sentry/types + * + * @return The metadata of the SDK + */ + getSdkMetadata() { + return this._options._metadata; + } + + /** + * @inheritDoc + */ + getTransport() { + return this._transport; + } + + /** + * @inheritDoc + */ + flush(timeout) { + const transport = this._transport; + if (transport) { + return this._isClientDoneProcessing(timeout).then(clientFinished => { + return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed); + }); + } else { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.resolvedSyncPromise)(true); + } + } + + /** + * @inheritDoc + */ + close(timeout) { + return this.flush(timeout).then(result => { + this.getOptions().enabled = false; + return result; + }); + } + + /** Get all installed event processors. */ + getEventProcessors() { + return this._eventProcessors; + } + + /** @inheritDoc */ + addEventProcessor(eventProcessor) { + this._eventProcessors.push(eventProcessor); + } + + /** + * Sets up the integrations + */ + setupIntegrations(forceInitialize) { + if ((forceInitialize && !this._integrationsInitialized) || (this._isEnabled() && !this._integrationsInitialized)) { + this._integrations = (0,_integration_js__WEBPACK_IMPORTED_MODULE_7__.setupIntegrations)(this, this._options.integrations); + this._integrationsInitialized = true; + } + } + + /** + * Gets an installed integration by its `id`. + * + * @returns The installed integration or `undefined` if no integration with that `id` was installed. + */ + getIntegrationById(integrationId) { + return this._integrations[integrationId]; + } + + /** + * @inheritDoc + */ + getIntegration(integration) { + try { + return (this._integrations[integration.id] ) || null; + } catch (_oO) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`); + return null; + } + } + + /** + * @inheritDoc + */ + addIntegration(integration) { + (0,_integration_js__WEBPACK_IMPORTED_MODULE_7__.setupIntegration)(this, integration, this._integrations); + } + + /** + * @inheritDoc + */ + sendEvent(event, hint = {}) { + this.emit('beforeSendEvent', event, hint); + + let env = (0,_envelope_js__WEBPACK_IMPORTED_MODULE_8__.createEventEnvelope)(event, this._dsn, this._options._metadata, this._options.tunnel); + + for (const attachment of hint.attachments || []) { + env = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_9__.addItemToEnvelope)( + env, + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_9__.createAttachmentEnvelopeItem)( + attachment, + this._options.transportOptions && this._options.transportOptions.textEncoder, + ), + ); + } + + const promise = this._sendEnvelope(env); + if (promise) { + promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null); + } + } + + /** + * @inheritDoc + */ + sendSession(session) { + const env = (0,_envelope_js__WEBPACK_IMPORTED_MODULE_8__.createSessionEnvelope)(session, this._dsn, this._options._metadata, this._options.tunnel); + void this._sendEnvelope(env); + } + + /** + * @inheritDoc + */ + recordDroppedEvent(reason, category, _event) { + // Note: we use `event` in replay, where we overwrite this hook. + + if (this._options.sendClientReports) { + // We want to track each category (error, transaction, session, replay_event) separately + // but still keep the distinction between different type of outcomes. + // We could use nested maps, but it's much easier to read and type this way. + // A correct type for map-based implementation if we want to go that route + // would be `Partial>>>` + // With typescript 4.1 we could even use template literal types + const key = `${reason}:${category}`; + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log(`Adding outcome: "${key}"`); + + // The following works because undefined + 1 === NaN and NaN is falsy + this._outcomes[key] = this._outcomes[key] + 1 || 1; + } + } + + // Keep on() & emit() signatures in sync with types' client.ts interface + /* eslint-disable @typescript-eslint/unified-signatures */ + + /** @inheritdoc */ + + /** @inheritdoc */ + on(hook, callback) { + if (!this._hooks[hook]) { + this._hooks[hook] = []; + } + + // @ts-expect-error We assue the types are correct + this._hooks[hook].push(callback); + } + + /** @inheritdoc */ + + /** @inheritdoc */ + emit(hook, ...rest) { + if (this._hooks[hook]) { + this._hooks[hook].forEach(callback => callback(...rest)); + } + } + + /* eslint-enable @typescript-eslint/unified-signatures */ + + /** Updates existing session based on the provided event */ + _updateSessionFromEvent(session, event) { + let crashed = false; + let errored = false; + const exceptions = event.exception && event.exception.values; + + if (exceptions) { + errored = true; + + for (const ex of exceptions) { + const mechanism = ex.mechanism; + if (mechanism && mechanism.handled === false) { + crashed = true; + break; + } + } + } + + // A session is updated and that session update is sent in only one of the two following scenarios: + // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update + // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update + const sessionNonTerminal = session.status === 'ok'; + const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed); + + if (shouldUpdateAndSend) { + (0,_session_js__WEBPACK_IMPORTED_MODULE_5__.updateSession)(session, { + ...(crashed && { status: 'crashed' }), + errors: session.errors || Number(errored || crashed), + }); + this.captureSession(session); + } + } + + /** + * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying + * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not + * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to + * `true`. + * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and + * `false` otherwise + */ + _isClientDoneProcessing(timeout) { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_6__.SyncPromise(resolve => { + let ticked = 0; + const tick = 1; + + const interval = setInterval(() => { + if (this._numProcessing == 0) { + clearInterval(interval); + resolve(true); + } else { + ticked += tick; + if (timeout && ticked >= timeout) { + clearInterval(interval); + resolve(false); + } + } + }, tick); + }); + } + + /** Determines whether this SDK is enabled and a transport is present. */ + _isEnabled() { + return this.getOptions().enabled !== false && this._transport !== undefined; + } + + /** + * Adds common information to events. + * + * The information includes release and environment from `options`, + * breadcrumbs and context (extra, tags and user) from the scope. + * + * Information that is already present in the event is never overwritten. For + * nested objects, such as the context, keys are merged. + * + * @param event The original event. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A new event with more information. + */ + _prepareEvent(event, hint, scope) { + const options = this.getOptions(); + const integrations = Object.keys(this._integrations); + if (!hint.integrations && integrations.length > 0) { + hint.integrations = integrations; + } + + this.emit('preprocessEvent', event, hint); + + return (0,_utils_prepareEvent_js__WEBPACK_IMPORTED_MODULE_10__.prepareEvent)(options, event, hint, scope, this).then(evt => { + if (evt === null) { + return evt; + } + + // If a trace context is not set on the event, we use the propagationContext set on the event to + // generate a trace context. If the propagationContext does not have a dynamic sampling context, we + // also generate one for it. + const { propagationContext } = evt.sdkProcessingMetadata || {}; + const trace = evt.contexts && evt.contexts.trace; + if (!trace && propagationContext) { + const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext ; + evt.contexts = { + trace: { + trace_id, + span_id: spanId, + parent_span_id: parentSpanId, + }, + ...evt.contexts, + }; + + const dynamicSamplingContext = dsc ? dsc : (0,_tracing_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_11__.getDynamicSamplingContextFromClient)(trace_id, this, scope); + + evt.sdkProcessingMetadata = { + dynamicSamplingContext, + ...evt.sdkProcessingMetadata, + }; + } + return evt; + }); + } + + /** + * Processes the event and logs an error in case of rejection + * @param event + * @param hint + * @param scope + */ + _captureEvent(event, hint = {}, scope) { + return this._processEvent(event, hint, scope).then( + finalEvent => { + return finalEvent.event_id; + }, + reason => { + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for + // control flow, log just the message (no stack) as a log-level log. + const sentryError = reason ; + if (sentryError.logLevel === 'log') { + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log(sentryError.message); + } else { + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn(sentryError); + } + } + return undefined; + }, + ); + } + + /** + * Processes an event (either error or message) and sends it to Sentry. + * + * This also adds breadcrumbs and context information to the event. However, + * platform specific meta data (such as the User's IP address) must be added + * by the SDK implementor. + * + * + * @param event The event to send to Sentry. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. + */ + _processEvent(event, hint, scope) { + const options = this.getOptions(); + const { sampleRate } = options; + + const isTransaction = isTransactionEvent(event); + const isError = isErrorEvent(event); + const eventType = event.type || 'error'; + const beforeSendLabel = `before send for type \`${eventType}\``; + + // 1.0 === 100% events are sent + // 0.0 === 0% events are sent + // Sampling for transaction happens somewhere else + if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) { + this.recordDroppedEvent('sample_rate', 'error', event); + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.rejectedSyncPromise)( + new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__.SentryError( + `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, + 'log', + ), + ); + } + + const dataCategory = eventType === 'replay_event' ? 'replay' : eventType; + + return this._prepareEvent(event, hint, scope) + .then(prepared => { + if (prepared === null) { + this.recordDroppedEvent('event_processor', dataCategory, event); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__.SentryError('An event processor returned `null`, will not send event.', 'log'); + } + + const isInternalException = hint.data && (hint.data ).__sentry__ === true; + if (isInternalException) { + return prepared; + } + + const result = processBeforeSend(options, prepared, hint); + return _validateBeforeSendResult(result, beforeSendLabel); + }) + .then(processedEvent => { + if (processedEvent === null) { + this.recordDroppedEvent('before_send', dataCategory, event); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__.SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log'); + } + + const session = scope && scope.getSession(); + if (!isTransaction && session) { + this._updateSessionFromEvent(session, processedEvent); + } + + // None of the Sentry built event processor will update transaction name, + // so if the transaction name has been changed by an event processor, we know + // it has to come from custom event processor added by a user + const transactionInfo = processedEvent.transaction_info; + if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { + const source = 'custom'; + processedEvent.transaction_info = { + ...transactionInfo, + source, + }; + } + + this.sendEvent(processedEvent, hint); + return processedEvent; + }) + .then(null, reason => { + if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_12__.SentryError) { + throw reason; + } + + this.captureException(reason, { + data: { + __sentry__: true, + }, + originalException: reason, + }); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__.SentryError( + `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`, + ); + }); + } + + /** + * Occupies the client with processing and event + */ + _process(promise) { + this._numProcessing++; + void promise.then( + value => { + this._numProcessing--; + return value; + }, + reason => { + this._numProcessing--; + return reason; + }, + ); + } + + /** + * @inheritdoc + */ + _sendEnvelope(envelope) { + this.emit('beforeEnvelope', envelope); + + if (this._isEnabled() && this._transport) { + return this._transport.send(envelope).then(null, reason => { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.error('Error while sending event:', reason); + }); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.error('Transport disabled'); + } + } + + /** + * Clears outcomes on this client and returns them. + */ + _clearOutcomes() { + const outcomes = this._outcomes; + this._outcomes = {}; + return Object.keys(outcomes).map(key => { + const [reason, category] = key.split(':') ; + return { + reason, + category, + quantity: outcomes[key], + }; + }); + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + +} + +/** + * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so. + */ +function _validateBeforeSendResult( + beforeSendResult, + beforeSendLabel, +) { + const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`; + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.isThenable)(beforeSendResult)) { + return beforeSendResult.then( + event => { + if (!(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.isPlainObject)(event) && event !== null) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__.SentryError(invalidValueError); + } + return event; + }, + e => { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__.SentryError(`${beforeSendLabel} rejected with ${e}`); + }, + ); + } else if (!(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.isPlainObject)(beforeSendResult) && beforeSendResult !== null) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_12__.SentryError(invalidValueError); + } + return beforeSendResult; +} + +/** + * Process the matching `beforeSendXXX` callback. + */ +function processBeforeSend( + options, + event, + hint, +) { + const { beforeSend, beforeSendTransaction } = options; + + if (isErrorEvent(event) && beforeSend) { + return beforeSend(event, hint); + } + + if (isTransactionEvent(event) && beforeSendTransaction) { + return beforeSendTransaction(event, hint); + } + + return event; +} + +function isErrorEvent(event) { + return event.type === undefined; +} + +function isTransactionEvent(event) { + return event.type === 'transaction'; +} + + +//# sourceMappingURL=baseclient.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/constants.js": +/*!****************************************************!*\ + !*** ./node_modules/@sentry/core/esm/constants.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEFAULT_ENVIRONMENT: () => (/* binding */ DEFAULT_ENVIRONMENT) +/* harmony export */ }); +const DEFAULT_ENVIRONMENT = 'production'; + + +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/envelope.js": +/*!***************************************************!*\ + !*** ./node_modules/@sentry/core/esm/envelope.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createEventEnvelope: () => (/* binding */ createEventEnvelope), +/* harmony export */ createSessionEnvelope: () => (/* binding */ createSessionEnvelope) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/envelope.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/dsn.js"); + + +/** + * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key. + * Merge with existing data if any. + **/ +function enhanceEventWithSdkInfo(event, sdkInfo) { + if (!sdkInfo) { + return event; + } + event.sdk = event.sdk || {}; + event.sdk.name = event.sdk.name || sdkInfo.name; + event.sdk.version = event.sdk.version || sdkInfo.version; + event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])]; + event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])]; + return event; +} + +/** Creates an envelope from a Session */ +function createSessionEnvelope( + session, + dsn, + metadata, + tunnel, +) { + const sdkInfo = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.getSdkMetadataForEnvelopeHeader)(metadata); + const envelopeHeaders = { + sent_at: new Date().toISOString(), + ...(sdkInfo && { sdk: sdkInfo }), + ...(!!tunnel && dsn && { dsn: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.dsnToString)(dsn) }), + }; + + const envelopeItem = + 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()]; + + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.createEnvelope)(envelopeHeaders, [envelopeItem]); +} + +/** + * Create an Envelope from an event. + */ +function createEventEnvelope( + event, + dsn, + metadata, + tunnel, +) { + const sdkInfo = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.getSdkMetadataForEnvelopeHeader)(metadata); + + /* + Note: Due to TS, event.type may be `replay_event`, theoretically. + In practice, we never call `createEventEnvelope` with `replay_event` type, + and we'd have to adjut a looot of types to make this work properly. + We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type) + So the safe choice is to really guard against the replay_event type here. + */ + const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event'; + + enhanceEventWithSdkInfo(event, metadata && metadata.sdk); + + const envelopeHeaders = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.createEventEnvelopeHeaders)(event, sdkInfo, tunnel, dsn); + + // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to + // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may + // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid + // of this `delete`, lest we miss putting it back in the next time the property is in use.) + delete event.sdkProcessingMetadata; + + const eventItem = [{ type: eventType }, event]; + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.createEnvelope)(envelopeHeaders, [eventItem]); +} + + +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/eventProcessors.js": +/*!**********************************************************!*\ + !*** ./node_modules/@sentry/core/esm/eventProcessors.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addGlobalEventProcessor: () => (/* binding */ addGlobalEventProcessor), +/* harmony export */ getGlobalEventProcessors: () => (/* binding */ getGlobalEventProcessors), +/* harmony export */ notifyEventProcessors: () => (/* binding */ notifyEventProcessors) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/worldwide.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/syncpromise.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/is.js"); + + +/** + * Returns the global event processors. + */ +function getGlobalEventProcessors() { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.getGlobalSingleton)('globalEventProcessors', () => []); +} + +/** + * Add a EventProcessor to be kept globally. + * @param callback EventProcessor to add + */ +function addGlobalEventProcessor(callback) { + getGlobalEventProcessors().push(callback); +} + +/** + * Process an array of event processors, returning the processed event (or `null` if the event was dropped). + */ +function notifyEventProcessors( + processors, + event, + hint, + index = 0, +) { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.SyncPromise((resolve, reject) => { + const processor = processors[index]; + if (event === null || typeof processor !== 'function') { + resolve(event); + } else { + const result = processor({ ...event }, hint) ; + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + processor.id && + result === null && + _sentry_utils__WEBPACK_IMPORTED_MODULE_2__.logger.log(`Event processor "${processor.id}" dropped event`); + + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.isThenable)(result)) { + void result + .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve)) + .then(null, reject); + } else { + void notifyEventProcessors(processors, result, hint, index + 1) + .then(resolve) + .then(null, reject); + } + } + }); +} + + +//# sourceMappingURL=eventProcessors.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/exports.js": +/*!**************************************************!*\ + !*** ./node_modules/@sentry/core/esm/exports.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addBreadcrumb: () => (/* binding */ addBreadcrumb), +/* harmony export */ captureCheckIn: () => (/* binding */ captureCheckIn), +/* harmony export */ captureEvent: () => (/* binding */ captureEvent), +/* harmony export */ captureException: () => (/* binding */ captureException), +/* harmony export */ captureMessage: () => (/* binding */ captureMessage), +/* harmony export */ close: () => (/* binding */ close), +/* harmony export */ configureScope: () => (/* binding */ configureScope), +/* harmony export */ flush: () => (/* binding */ flush), +/* harmony export */ lastEventId: () => (/* binding */ lastEventId), +/* harmony export */ setContext: () => (/* binding */ setContext), +/* harmony export */ setExtra: () => (/* binding */ setExtra), +/* harmony export */ setExtras: () => (/* binding */ setExtras), +/* harmony export */ setTag: () => (/* binding */ setTag), +/* harmony export */ setTags: () => (/* binding */ setTags), +/* harmony export */ setUser: () => (/* binding */ setUser), +/* harmony export */ startTransaction: () => (/* binding */ startTransaction), +/* harmony export */ withScope: () => (/* binding */ withScope) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hub.js */ "./node_modules/@sentry/core/esm/hub.js"); + + + +// Note: All functions in this file are typed with a return value of `ReturnType`, +// where HUB_FUNCTION is some method on the Hub class. +// +// This is done to make sure the top level SDK methods stay in sync with the hub methods. +// Although every method here has an explicit return type, some of them (that map to void returns) do not +// contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable. + +/** + * Captures an exception event and sends it to Sentry. + * + * @param exception An exception-like object. + * @param captureContext Additional scope data to apply to exception event. + * @returns The generated eventId. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types +function captureException(exception, captureContext) { + return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().captureException(exception, { captureContext }); +} + +/** + * Captures a message event and sends it to Sentry. + * + * @param message The message to send to Sentry. + * @param Severity Define the level of the message. + * @returns The generated eventId. + */ +function captureMessage( + message, + // eslint-disable-next-line deprecation/deprecation + captureContext, +) { + // This is necessary to provide explicit scopes upgrade, without changing the original + // arity of the `captureMessage(message, level)` method. + const level = typeof captureContext === 'string' ? captureContext : undefined; + const context = typeof captureContext !== 'string' ? { captureContext } : undefined; + return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().captureMessage(message, level, context); +} + +/** + * Captures a manually created event and sends it to Sentry. + * + * @param event The event to send to Sentry. + * @returns The generated eventId. + */ +function captureEvent(event, hint) { + return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().captureEvent(event, hint); +} + +/** + * Callback to set context information onto the scope. + * @param callback Callback function that receives Scope. + */ +function configureScope(callback) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().configureScope(callback); +} + +/** + * Records a new breadcrumb which will be attached to future events. + * + * Breadcrumbs will be added to subsequent events to provide more context on + * user's actions prior to an error or crash. + * + * @param breadcrumb The breadcrumb to record. + */ +function addBreadcrumb(breadcrumb) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().addBreadcrumb(breadcrumb); +} + +/** + * Sets context data with the given name. + * @param name of the context + * @param context Any kind of data. This data will be normalized. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setContext(name, context) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setContext(name, context); +} + +/** + * Set an object that will be merged sent as extra data with the event. + * @param extras Extras object to merge into current context. + */ +function setExtras(extras) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setExtras(extras); +} + +/** + * Set key:value that will be sent as extra data with the event. + * @param key String of extra + * @param extra Any kind of data. This data will be normalized. + */ +function setExtra(key, extra) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setExtra(key, extra); +} + +/** + * Set an object that will be merged sent as tags data with the event. + * @param tags Tags context object to merge into current context. + */ +function setTags(tags) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setTags(tags); +} + +/** + * Set key:value that will be sent as tags data with the event. + * + * Can also be used to unset a tag, by passing `undefined`. + * + * @param key String key of tag + * @param value Value of tag + */ +function setTag(key, value) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setTag(key, value); +} + +/** + * Updates user context information for future events. + * + * @param user User context object to be set in the current context. Pass `null` to unset the user. + */ +function setUser(user) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setUser(user); +} + +/** + * Creates a new scope with and executes the given operation within. + * The scope is automatically removed once the operation + * finishes or throws. + * + * This is essentially a convenience function for: + * + * pushScope(); + * callback(); + * popScope(); + * + * @param callback that will be enclosed into push/popScope. + */ +function withScope(callback) { + (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().withScope(callback); +} + +/** + * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation. + * + * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a + * new child span within the transaction or any span, call the respective `.startChild()` method. + * + * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded. + * + * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its + * finished child spans will be sent to Sentry. + * + * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call + * `startTransaction` directly on the hub. + * + * @param context Properties of the new `Transaction`. + * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent + * default values). See {@link Options.tracesSampler}. + * + * @returns The transaction which was just started + */ +function startTransaction( + context, + customSamplingContext, +) { + return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().startTransaction({ ...context }, customSamplingContext); +} + +/** + * Create a cron monitor check in and send it to Sentry. + * + * @param checkIn An object that describes a check in. + * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want + * to create a monitor automatically when sending a check in. + */ +function captureCheckIn(checkIn, upsertMonitorConfig) { + const hub = (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)(); + const scope = hub.getScope(); + const client = hub.getClient(); + if (!client) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Cannot capture check-in. No client defined.'); + } else if (!client.captureCheckIn) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Cannot capture check-in. Client does not support sending check-ins.'); + } else { + return client.captureCheckIn(checkIn, upsertMonitorConfig, scope); + } + + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.uuid4)(); +} + +/** + * Call `flush()` on the current client, if there is one. See {@link Client.flush}. + * + * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause + * the client to wait until all events are sent before resolving the promise. + * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it + * doesn't (or if there's no client defined). + */ +async function flush(timeout) { + const client = (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().getClient(); + if (client) { + return client.flush(timeout); + } + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Cannot flush events. No client defined.'); + return Promise.resolve(false); +} + +/** + * Call `close()` on the current client, if there is one. See {@link Client.close}. + * + * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this + * parameter will cause the client to wait until all events are sent before disabling itself. + * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it + * doesn't (or if there's no client defined). + */ +async function close(timeout) { + const client = (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().getClient(); + if (client) { + return client.close(timeout); + } + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Cannot flush events and disable SDK. No client defined.'); + return Promise.resolve(false); +} + +/** + * This is the getter for lastEventId. + * + * @returns The last event id of a captured event. + */ +function lastEventId() { + return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().lastEventId(); +} + + +//# sourceMappingURL=exports.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/hub.js": +/*!**********************************************!*\ + !*** ./node_modules/@sentry/core/esm/hub.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ API_VERSION: () => (/* binding */ API_VERSION), +/* harmony export */ Hub: () => (/* binding */ Hub), +/* harmony export */ ensureHubOnCarrier: () => (/* binding */ ensureHubOnCarrier), +/* harmony export */ getCurrentHub: () => (/* binding */ getCurrentHub), +/* harmony export */ getHubFromCarrier: () => (/* binding */ getHubFromCarrier), +/* harmony export */ getMainCarrier: () => (/* binding */ getMainCarrier), +/* harmony export */ makeMain: () => (/* binding */ makeMain), +/* harmony export */ runWithAsyncContext: () => (/* binding */ runWithAsyncContext), +/* harmony export */ setAsyncContextStrategy: () => (/* binding */ setAsyncContextStrategy), +/* harmony export */ setHubOnCarrier: () => (/* binding */ setHubOnCarrier) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/time.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/worldwide.js"); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@sentry/core/esm/constants.js"); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scope.js */ "./node_modules/@sentry/core/esm/scope.js"); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./session.js */ "./node_modules/@sentry/core/esm/session.js"); + + + + + +/** + * API compatibility version of this hub. + * + * WARNING: This number should only be increased when the global interface + * changes and new methods are introduced. + * + * @hidden + */ +const API_VERSION = 4; + +/** + * Default maximum number of breadcrumbs added to an event. Can be overwritten + * with {@link Options.maxBreadcrumbs}. + */ +const DEFAULT_BREADCRUMBS = 100; + +/** + * @inheritDoc + */ +class Hub { + /** Is a {@link Layer}[] containing the client and scope */ + + /** Contains the last event id of a captured event. */ + + /** + * Creates a new instance of the hub, will push one {@link Layer} into the + * internal stack on creation. + * + * @param client bound to the hub. + * @param scope bound to the hub. + * @param version number, higher number means higher priority. + */ + constructor(client, scope = new _scope_js__WEBPACK_IMPORTED_MODULE_0__.Scope(), _version = API_VERSION) {this._version = _version; + this._stack = [{ scope }]; + if (client) { + this.bindClient(client); + } + } + + /** + * @inheritDoc + */ + isOlderThan(version) { + return this._version < version; + } + + /** + * @inheritDoc + */ + bindClient(client) { + const top = this.getStackTop(); + top.client = client; + if (client && client.setupIntegrations) { + client.setupIntegrations(); + } + } + + /** + * @inheritDoc + */ + pushScope() { + // We want to clone the content of prev scope + const scope = _scope_js__WEBPACK_IMPORTED_MODULE_0__.Scope.clone(this.getScope()); + this.getStack().push({ + client: this.getClient(), + scope, + }); + return scope; + } + + /** + * @inheritDoc + */ + popScope() { + if (this.getStack().length <= 1) return false; + return !!this.getStack().pop(); + } + + /** + * @inheritDoc + */ + withScope(callback) { + const scope = this.pushScope(); + try { + callback(scope); + } finally { + this.popScope(); + } + } + + /** + * @inheritDoc + */ + getClient() { + return this.getStackTop().client ; + } + + /** Returns the scope of the top stack. */ + getScope() { + return this.getStackTop().scope; + } + + /** Returns the scope stack for domains or the process. */ + getStack() { + return this._stack; + } + + /** Returns the topmost scope layer in the order domain > local > process. */ + getStackTop() { + return this._stack[this._stack.length - 1]; + } + + /** + * @inheritDoc + */ + captureException(exception, hint) { + const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.uuid4)()); + const syntheticException = new Error('Sentry syntheticException'); + this._withClient((client, scope) => { + client.captureException( + exception, + { + originalException: exception, + syntheticException, + ...hint, + event_id: eventId, + }, + scope, + ); + }); + return eventId; + } + + /** + * @inheritDoc + */ + captureMessage( + message, + // eslint-disable-next-line deprecation/deprecation + level, + hint, + ) { + const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.uuid4)()); + const syntheticException = new Error(message); + this._withClient((client, scope) => { + client.captureMessage( + message, + level, + { + originalException: message, + syntheticException, + ...hint, + event_id: eventId, + }, + scope, + ); + }); + return eventId; + } + + /** + * @inheritDoc + */ + captureEvent(event, hint) { + const eventId = hint && hint.event_id ? hint.event_id : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.uuid4)(); + if (!event.type) { + this._lastEventId = eventId; + } + + this._withClient((client, scope) => { + client.captureEvent(event, { ...hint, event_id: eventId }, scope); + }); + return eventId; + } + + /** + * @inheritDoc + */ + lastEventId() { + return this._lastEventId; + } + + /** + * @inheritDoc + */ + addBreadcrumb(breadcrumb, hint) { + const { scope, client } = this.getStackTop(); + + if (!client) return; + + const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = + (client.getOptions && client.getOptions()) || {}; + + if (maxBreadcrumbs <= 0) return; + + const timestamp = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.dateTimestampInSeconds)(); + const mergedBreadcrumb = { timestamp, ...breadcrumb }; + const finalBreadcrumb = beforeBreadcrumb + ? ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.consoleSandbox)(() => beforeBreadcrumb(mergedBreadcrumb, hint)) ) + : mergedBreadcrumb; + + if (finalBreadcrumb === null) return; + + if (client.emit) { + client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint); + } + + scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); + } + + /** + * @inheritDoc + */ + setUser(user) { + this.getScope().setUser(user); + } + + /** + * @inheritDoc + */ + setTags(tags) { + this.getScope().setTags(tags); + } + + /** + * @inheritDoc + */ + setExtras(extras) { + this.getScope().setExtras(extras); + } + + /** + * @inheritDoc + */ + setTag(key, value) { + this.getScope().setTag(key, value); + } + + /** + * @inheritDoc + */ + setExtra(key, extra) { + this.getScope().setExtra(key, extra); + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + setContext(name, context) { + this.getScope().setContext(name, context); + } + + /** + * @inheritDoc + */ + configureScope(callback) { + const { scope, client } = this.getStackTop(); + if (client) { + callback(scope); + } + } + + /** + * @inheritDoc + */ + run(callback) { + const oldHub = makeMain(this); + try { + callback(this); + } finally { + makeMain(oldHub); + } + } + + /** + * @inheritDoc + */ + getIntegration(integration) { + const client = this.getClient(); + if (!client) return null; + try { + return client.getIntegration(integration); + } catch (_oO) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`); + return null; + } + } + + /** + * @inheritDoc + */ + startTransaction(context, customSamplingContext) { + const result = this._callExtensionMethod('startTransaction', context, customSamplingContext); + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && !result) { + const client = this.getClient(); + if (!client) { + // eslint-disable-next-line no-console + console.warn( + "Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'", + ); + } else { + // eslint-disable-next-line no-console + console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': +Sentry.addTracingExtensions(); +Sentry.init({...}); +`); + } + } + + return result; + } + + /** + * @inheritDoc + */ + traceHeaders() { + return this._callExtensionMethod('traceHeaders'); + } + + /** + * @inheritDoc + */ + captureSession(endSession = false) { + // both send the update and pull the session from the scope + if (endSession) { + return this.endSession(); + } + + // only send the update + this._sendSessionUpdate(); + } + + /** + * @inheritDoc + */ + endSession() { + const layer = this.getStackTop(); + const scope = layer.scope; + const session = scope.getSession(); + if (session) { + (0,_session_js__WEBPACK_IMPORTED_MODULE_4__.closeSession)(session); + } + this._sendSessionUpdate(); + + // the session is over; take it off of the scope + scope.setSession(); + } + + /** + * @inheritDoc + */ + startSession(context) { + const { scope, client } = this.getStackTop(); + const { release, environment = _constants_js__WEBPACK_IMPORTED_MODULE_5__.DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {}; + + // Will fetch userAgent if called from browser sdk + const { userAgent } = _sentry_utils__WEBPACK_IMPORTED_MODULE_6__.GLOBAL_OBJ.navigator || {}; + + const session = (0,_session_js__WEBPACK_IMPORTED_MODULE_4__.makeSession)({ + release, + environment, + user: scope.getUser(), + ...(userAgent && { userAgent }), + ...context, + }); + + // End existing session if there's one + const currentSession = scope.getSession && scope.getSession(); + if (currentSession && currentSession.status === 'ok') { + (0,_session_js__WEBPACK_IMPORTED_MODULE_4__.updateSession)(currentSession, { status: 'exited' }); + } + this.endSession(); + + // Afterwards we set the new session on the scope + scope.setSession(session); + + return session; + } + + /** + * Returns if default PII should be sent to Sentry and propagated in ourgoing requests + * when Tracing is used. + */ + shouldSendDefaultPii() { + const client = this.getClient(); + const options = client && client.getOptions(); + return Boolean(options && options.sendDefaultPii); + } + + /** + * Sends the current Session on the scope + */ + _sendSessionUpdate() { + const { scope, client } = this.getStackTop(); + + const session = scope.getSession(); + if (session && client && client.captureSession) { + client.captureSession(session); + } + } + + /** + * Internal helper function to call a method on the top client if it exists. + * + * @param method The method to call on the client. + * @param args Arguments to pass to the client function. + */ + _withClient(callback) { + const { scope, client } = this.getStackTop(); + if (client) { + callback(client, scope); + } + } + + /** + * Calls global extension method and binding current instance to the function call + */ + // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + _callExtensionMethod(method, ...args) { + const carrier = getMainCarrier(); + const sentry = carrier.__SENTRY__; + if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') { + return sentry.extensions[method].apply(this, args); + } + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.warn(`Extension method ${method} couldn't be found, doing nothing.`); + } +} + +/** + * Returns the global shim registry. + * + * FIXME: This function is problematic, because despite always returning a valid Carrier, + * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check + * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there. + **/ +function getMainCarrier() { + _sentry_utils__WEBPACK_IMPORTED_MODULE_6__.GLOBAL_OBJ.__SENTRY__ = _sentry_utils__WEBPACK_IMPORTED_MODULE_6__.GLOBAL_OBJ.__SENTRY__ || { + extensions: {}, + hub: undefined, + }; + return _sentry_utils__WEBPACK_IMPORTED_MODULE_6__.GLOBAL_OBJ; +} + +/** + * Replaces the current main hub with the passed one on the global object + * + * @returns The old replaced hub + */ +function makeMain(hub) { + const registry = getMainCarrier(); + const oldHub = getHubFromCarrier(registry); + setHubOnCarrier(registry, hub); + return oldHub; +} + +/** + * Returns the default hub instance. + * + * If a hub is already registered in the global carrier but this module + * contains a more recent version, it replaces the registered version. + * Otherwise, the currently registered hub will be returned. + */ +function getCurrentHub() { + // Get main carrier (global for every environment) + const registry = getMainCarrier(); + + if (registry.__SENTRY__ && registry.__SENTRY__.acs) { + const hub = registry.__SENTRY__.acs.getCurrentHub(); + + if (hub) { + return hub; + } + } + + // Return hub that lives on a global object + return getGlobalHub(registry); +} + +function getGlobalHub(registry = getMainCarrier()) { + // If there's no hub, or its an old API, assign a new one + if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) { + setHubOnCarrier(registry, new Hub()); + } + + // Return hub that lives on a global object + return getHubFromCarrier(registry); +} + +/** + * @private Private API with no semver guarantees! + * + * If the carrier does not contain a hub, a new hub is created with the global hub client and scope. + */ +function ensureHubOnCarrier(carrier, parent = getGlobalHub()) { + // If there's no hub on current domain, or it's an old API, assign a new one + if (!hasHubOnCarrier(carrier) || getHubFromCarrier(carrier).isOlderThan(API_VERSION)) { + const globalHubTopStack = parent.getStackTop(); + setHubOnCarrier(carrier, new Hub(globalHubTopStack.client, _scope_js__WEBPACK_IMPORTED_MODULE_0__.Scope.clone(globalHubTopStack.scope))); + } +} + +/** + * @private Private API with no semver guarantees! + * + * Sets the global async context strategy + */ +function setAsyncContextStrategy(strategy) { + // Get main carrier (global for every environment) + const registry = getMainCarrier(); + registry.__SENTRY__ = registry.__SENTRY__ || {}; + registry.__SENTRY__.acs = strategy; +} + +/** + * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK. + * + * @param callback The callback to run in its own async context + * @param options Options to pass to the async context strategy + * @returns The result of the callback + */ +function runWithAsyncContext(callback, options = {}) { + const registry = getMainCarrier(); + + if (registry.__SENTRY__ && registry.__SENTRY__.acs) { + return registry.__SENTRY__.acs.runWithAsyncContext(callback, options); + } + + // if there was no strategy, fallback to just calling the callback + return callback(); +} + +/** + * This will tell whether a carrier has a hub on it or not + * @param carrier object + */ +function hasHubOnCarrier(carrier) { + return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub); +} + +/** + * This will create a new {@link Hub} and add to the passed object on + * __SENTRY__.hub. + * @param carrier object + * @hidden + */ +function getHubFromCarrier(carrier) { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.getGlobalSingleton)('hub', () => new Hub(), carrier); +} + +/** + * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute + * @param carrier object + * @param hub Hub + * @returns A boolean indicating success or failure + */ +function setHubOnCarrier(carrier, hub) { + if (!carrier) return false; + const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {}); + __SENTRY__.hub = hub; + return true; +} + + +//# sourceMappingURL=hub.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/integration.js": +/*!******************************************************!*\ + !*** ./node_modules/@sentry/core/esm/integration.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getIntegrationsToSetup: () => (/* binding */ getIntegrationsToSetup), +/* harmony export */ installedIntegrations: () => (/* binding */ installedIntegrations), +/* harmony export */ setupIntegration: () => (/* binding */ setupIntegration), +/* harmony export */ setupIntegrations: () => (/* binding */ setupIntegrations) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _eventProcessors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eventProcessors.js */ "./node_modules/@sentry/core/esm/eventProcessors.js"); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hub.js */ "./node_modules/@sentry/core/esm/hub.js"); + + + + +const installedIntegrations = []; + +/** Map of integrations assigned to a client */ + +/** + * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to + * preseve the order of integrations in the array. + * + * @private + */ +function filterDuplicates(integrations) { + const integrationsByName = {}; + + integrations.forEach(currentInstance => { + const { name } = currentInstance; + + const existingInstance = integrationsByName[name]; + + // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a + // default instance to overwrite an existing user instance + if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { + return; + } + + integrationsByName[name] = currentInstance; + }); + + return Object.keys(integrationsByName).map(k => integrationsByName[k]); +} + +/** Gets integrations to install */ +function getIntegrationsToSetup(options) { + const defaultIntegrations = options.defaultIntegrations || []; + const userIntegrations = options.integrations; + + // We flag default instances, so that later we can tell them apart from any user-created instances of the same class + defaultIntegrations.forEach(integration => { + integration.isDefaultInstance = true; + }); + + let integrations; + + if (Array.isArray(userIntegrations)) { + integrations = [...defaultIntegrations, ...userIntegrations]; + } else if (typeof userIntegrations === 'function') { + integrations = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.arrayify)(userIntegrations(defaultIntegrations)); + } else { + integrations = defaultIntegrations; + } + + const finalIntegrations = filterDuplicates(integrations); + + // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or + // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event + // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore + // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array. + const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug'); + if (debugIndex !== -1) { + const [debugInstance] = finalIntegrations.splice(debugIndex, 1); + finalIntegrations.push(debugInstance); + } + + return finalIntegrations; +} + +/** + * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default + * integrations are added unless they were already provided before. + * @param integrations array of integration instances + * @param withDefault should enable default integrations + */ +function setupIntegrations(client, integrations) { + const integrationIndex = {}; + + integrations.forEach(integration => { + // guard against empty provided integrations + if (integration) { + setupIntegration(client, integration, integrationIndex); + } + }); + + return integrationIndex; +} + +/** Setup a single integration. */ +function setupIntegration(client, integration, integrationIndex) { + integrationIndex[integration.name] = integration; + + if (installedIntegrations.indexOf(integration.name) === -1) { + integration.setupOnce(_eventProcessors_js__WEBPACK_IMPORTED_MODULE_1__.addGlobalEventProcessor, _hub_js__WEBPACK_IMPORTED_MODULE_2__.getCurrentHub); + installedIntegrations.push(integration.name); + } + + if (client.on && typeof integration.preprocessEvent === 'function') { + const callback = integration.preprocessEvent.bind(integration) ; + client.on('preprocessEvent', (event, hint) => callback(event, hint, client)); + } + + if (client.addEventProcessor && typeof integration.processEvent === 'function') { + const callback = integration.processEvent.bind(integration) ; + + const processor = Object.assign((event, hint) => callback(event, hint, client), { + id: integration.name, + }); + + client.addEventProcessor(processor); + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log(`Integration installed: ${integration.name}`); +} + +// Polyfill for Array.findIndex(), which is not supported in ES5 +function findIndex(arr, callback) { + for (let i = 0; i < arr.length; i++) { + if (callback(arr[i]) === true) { + return i; + } + } + + return -1; +} + + +//# sourceMappingURL=integration.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/integrations/functiontostring.js": +/*!************************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/integrations/functiontostring.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ FunctionToString: () => (/* binding */ FunctionToString) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); + + +let originalFunctionToString; + +/** Patch toString calls to return proper name for wrapped functions */ +class FunctionToString { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'FunctionToString';} + + /** + * @inheritDoc + */ + + constructor() { + this.name = FunctionToString.id; + } + + /** + * @inheritDoc + */ + setupOnce() { + // eslint-disable-next-line @typescript-eslint/unbound-method + originalFunctionToString = Function.prototype.toString; + + // intrinsics (like Function.prototype) might be immutable in some environments + // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal) + try { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Function.prototype.toString = function ( ...args) { + const context = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.getOriginalFunction)(this) || this; + return originalFunctionToString.apply(context, args); + }; + } catch (e) { + // ignore errors here, just don't patch this + } + } +} FunctionToString.__initStatic(); + + +//# sourceMappingURL=functiontostring.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/integrations/inboundfilters.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/integrations/inboundfilters.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ InboundFilters: () => (/* binding */ InboundFilters), +/* harmony export */ _mergeOptions: () => (/* binding */ _mergeOptions), +/* harmony export */ _shouldDropEvent: () => (/* binding */ _shouldDropEvent) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/string.js"); + + +// "Script error." is hard coded into browsers for errors that it can't read. +// this is the result of a script being pulled in from an external domain and CORS. +const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/]; + +const DEFAULT_IGNORE_TRANSACTIONS = [ + /^.*healthcheck.*$/, + /^.*healthy.*$/, + /^.*live.*$/, + /^.*ready.*$/, + /^.*heartbeat.*$/, + /^.*\/health$/, + /^.*\/healthz$/, +]; + +/** Options for the InboundFilters integration */ + +/** Inbound filters configurable by the user */ +class InboundFilters { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'InboundFilters';} + + /** + * @inheritDoc + */ + + constructor(options = {}) { + this.name = InboundFilters.id; + this._options = options; + } + + /** + * @inheritDoc + */ + setupOnce(_addGlobaleventProcessor, _getCurrentHub) { + // noop + } + + /** @inheritDoc */ + processEvent(event, _eventHint, client) { + const clientOptions = client.getOptions(); + const options = _mergeOptions(this._options, clientOptions); + return _shouldDropEvent(event, options) ? null : event; + } +} InboundFilters.__initStatic(); + +/** JSDoc */ +function _mergeOptions( + internalOptions = {}, + clientOptions = {}, +) { + return { + allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])], + denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])], + ignoreErrors: [ + ...(internalOptions.ignoreErrors || []), + ...(clientOptions.ignoreErrors || []), + ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS), + ], + ignoreTransactions: [ + ...(internalOptions.ignoreTransactions || []), + ...(clientOptions.ignoreTransactions || []), + ...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS), + ], + ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, + }; +} + +/** JSDoc */ +function _shouldDropEvent(event, options) { + if (options.ignoreInternal && _isSentryError(event)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.getEventDescription)(event)}`); + return true; + } + if (_isIgnoredError(event, options.ignoreErrors)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.warn( + `Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.getEventDescription)(event)}`, + ); + return true; + } + if (_isIgnoredTransaction(event, options.ignoreTransactions)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.warn( + `Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.getEventDescription)(event)}`, + ); + return true; + } + if (_isDeniedUrl(event, options.denyUrls)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.warn( + `Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.getEventDescription)( + event, + )}.\nUrl: ${_getEventFilterUrl(event)}`, + ); + return true; + } + if (!_isAllowedUrl(event, options.allowUrls)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.warn( + `Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.getEventDescription)( + event, + )}.\nUrl: ${_getEventFilterUrl(event)}`, + ); + return true; + } + return false; +} + +function _isIgnoredError(event, ignoreErrors) { + // If event.type, this is not an error + if (event.type || !ignoreErrors || !ignoreErrors.length) { + return false; + } + + return _getPossibleEventMessages(event).some(message => (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.stringMatchesSomePattern)(message, ignoreErrors)); +} + +function _isIgnoredTransaction(event, ignoreTransactions) { + if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) { + return false; + } + + const name = event.transaction; + return name ? (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.stringMatchesSomePattern)(name, ignoreTransactions) : false; +} + +function _isDeniedUrl(event, denyUrls) { + // TODO: Use Glob instead? + if (!denyUrls || !denyUrls.length) { + return false; + } + const url = _getEventFilterUrl(event); + return !url ? false : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.stringMatchesSomePattern)(url, denyUrls); +} + +function _isAllowedUrl(event, allowUrls) { + // TODO: Use Glob instead? + if (!allowUrls || !allowUrls.length) { + return true; + } + const url = _getEventFilterUrl(event); + return !url ? true : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.stringMatchesSomePattern)(url, allowUrls); +} + +function _getPossibleEventMessages(event) { + const possibleMessages = []; + + if (event.message) { + possibleMessages.push(event.message); + } + + let lastException; + try { + // @ts-expect-error Try catching to save bundle size + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + lastException = event.exception.values[event.exception.values.length - 1]; + } catch (e) { + // try catching to save bundle size checking existence of variables + } + + if (lastException) { + if (lastException.value) { + possibleMessages.push(lastException.value); + if (lastException.type) { + possibleMessages.push(`${lastException.type}: ${lastException.value}`); + } + } + } + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && possibleMessages.length === 0) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Could not extract message for event ${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.getEventDescription)(event)}`); + } + + return possibleMessages; +} + +function _isSentryError(event) { + try { + // @ts-expect-error can't be a sentry error if undefined + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return event.exception.values[0].type === 'SentryError'; + } catch (e) { + // ignore + } + return false; +} + +function _getLastValidUrl(frames = []) { + for (let i = frames.length - 1; i >= 0; i--) { + const frame = frames[i]; + + if (frame && frame.filename !== '' && frame.filename !== '[native code]') { + return frame.filename || null; + } + } + + return null; +} + +function _getEventFilterUrl(event) { + try { + let frames; + try { + // @ts-expect-error we only care about frames if the whole thing here is defined + frames = event.exception.values[0].stacktrace.frames; + } catch (e) { + // ignore + } + return frames ? _getLastValidUrl(frames) : null; + } catch (oO) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Cannot extract url for event ${(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.getEventDescription)(event)}`); + return null; + } +} + + +//# sourceMappingURL=inboundfilters.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/scope.js": +/*!************************************************!*\ + !*** ./node_modules/@sentry/core/esm/scope.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Scope: () => (/* binding */ Scope) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/time.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _eventProcessors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./eventProcessors.js */ "./node_modules/@sentry/core/esm/eventProcessors.js"); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./session.js */ "./node_modules/@sentry/core/esm/session.js"); + + + + +/** + * Default value for maximum number of breadcrumbs added to an event. + */ +const DEFAULT_MAX_BREADCRUMBS = 100; + +/** + * Holds additional event information. {@link Scope.applyToEvent} will be + * called by the client before an event will be sent. + */ +class Scope { + /** Flag if notifying is happening. */ + + /** Callback for client to receive scope changes. */ + + /** Callback list that will be called after {@link applyToEvent}. */ + + /** Array of breadcrumbs. */ + + /** User */ + + /** Tags */ + + /** Extra */ + + /** Contexts */ + + /** Attachments */ + + /** Propagation Context for distributed tracing */ + + /** + * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get + * sent to Sentry + */ + + /** Fingerprint */ + + /** Severity */ + // eslint-disable-next-line deprecation/deprecation + + /** Transaction Name */ + + /** Span */ + + /** Session */ + + /** Request Mode Session Status */ + + // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. + + constructor() { + this._notifyingListeners = false; + this._scopeListeners = []; + this._eventProcessors = []; + this._breadcrumbs = []; + this._attachments = []; + this._user = {}; + this._tags = {}; + this._extra = {}; + this._contexts = {}; + this._sdkProcessingMetadata = {}; + this._propagationContext = generatePropagationContext(); + } + + /** + * Inherit values from the parent scope. + * @param scope to clone. + */ + static clone(scope) { + const newScope = new Scope(); + if (scope) { + newScope._breadcrumbs = [...scope._breadcrumbs]; + newScope._tags = { ...scope._tags }; + newScope._extra = { ...scope._extra }; + newScope._contexts = { ...scope._contexts }; + newScope._user = scope._user; + newScope._level = scope._level; + newScope._span = scope._span; + newScope._session = scope._session; + newScope._transactionName = scope._transactionName; + newScope._fingerprint = scope._fingerprint; + newScope._eventProcessors = [...scope._eventProcessors]; + newScope._requestSession = scope._requestSession; + newScope._attachments = [...scope._attachments]; + newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata }; + newScope._propagationContext = { ...scope._propagationContext }; + } + return newScope; + } + + /** + * Add internal on change listener. Used for sub SDKs that need to store the scope. + * @hidden + */ + addScopeListener(callback) { + this._scopeListeners.push(callback); + } + + /** + * @inheritDoc + */ + addEventProcessor(callback) { + this._eventProcessors.push(callback); + return this; + } + + /** + * @inheritDoc + */ + setUser(user) { + this._user = user || {}; + if (this._session) { + (0,_session_js__WEBPACK_IMPORTED_MODULE_0__.updateSession)(this._session, { user }); + } + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getUser() { + return this._user; + } + + /** + * @inheritDoc + */ + getRequestSession() { + return this._requestSession; + } + + /** + * @inheritDoc + */ + setRequestSession(requestSession) { + this._requestSession = requestSession; + return this; + } + + /** + * @inheritDoc + */ + setTags(tags) { + this._tags = { + ...this._tags, + ...tags, + }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setTag(key, value) { + this._tags = { ...this._tags, [key]: value }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setExtras(extras) { + this._extra = { + ...this._extra, + ...extras, + }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setExtra(key, extra) { + this._extra = { ...this._extra, [key]: extra }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setFingerprint(fingerprint) { + this._fingerprint = fingerprint; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setLevel( + // eslint-disable-next-line deprecation/deprecation + level, + ) { + this._level = level; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setTransactionName(name) { + this._transactionName = name; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setContext(key, context) { + if (context === null) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this._contexts[key]; + } else { + this._contexts[key] = context; + } + + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setSpan(span) { + this._span = span; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getSpan() { + return this._span; + } + + /** + * @inheritDoc + */ + getTransaction() { + // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will + // have a pointer to the currently-active transaction. + const span = this.getSpan(); + return span && span.transaction; + } + + /** + * @inheritDoc + */ + setSession(session) { + if (!session) { + delete this._session; + } else { + this._session = session; + } + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getSession() { + return this._session; + } + + /** + * @inheritDoc + */ + update(captureContext) { + if (!captureContext) { + return this; + } + + if (typeof captureContext === 'function') { + const updatedScope = (captureContext )(this); + return updatedScope instanceof Scope ? updatedScope : this; + } + + if (captureContext instanceof Scope) { + this._tags = { ...this._tags, ...captureContext._tags }; + this._extra = { ...this._extra, ...captureContext._extra }; + this._contexts = { ...this._contexts, ...captureContext._contexts }; + if (captureContext._user && Object.keys(captureContext._user).length) { + this._user = captureContext._user; + } + if (captureContext._level) { + this._level = captureContext._level; + } + if (captureContext._fingerprint) { + this._fingerprint = captureContext._fingerprint; + } + if (captureContext._requestSession) { + this._requestSession = captureContext._requestSession; + } + if (captureContext._propagationContext) { + this._propagationContext = captureContext._propagationContext; + } + } else if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(captureContext)) { + // eslint-disable-next-line no-param-reassign + captureContext = captureContext ; + this._tags = { ...this._tags, ...captureContext.tags }; + this._extra = { ...this._extra, ...captureContext.extra }; + this._contexts = { ...this._contexts, ...captureContext.contexts }; + if (captureContext.user) { + this._user = captureContext.user; + } + if (captureContext.level) { + this._level = captureContext.level; + } + if (captureContext.fingerprint) { + this._fingerprint = captureContext.fingerprint; + } + if (captureContext.requestSession) { + this._requestSession = captureContext.requestSession; + } + if (captureContext.propagationContext) { + this._propagationContext = captureContext.propagationContext; + } + } + + return this; + } + + /** + * @inheritDoc + */ + clear() { + this._breadcrumbs = []; + this._tags = {}; + this._extra = {}; + this._user = {}; + this._contexts = {}; + this._level = undefined; + this._transactionName = undefined; + this._fingerprint = undefined; + this._requestSession = undefined; + this._span = undefined; + this._session = undefined; + this._notifyScopeListeners(); + this._attachments = []; + this._propagationContext = generatePropagationContext(); + return this; + } + + /** + * @inheritDoc + */ + addBreadcrumb(breadcrumb, maxBreadcrumbs) { + const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; + + // No data has been changed, so don't notify scope listeners + if (maxCrumbs <= 0) { + return this; + } + + const mergedBreadcrumb = { + timestamp: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.dateTimestampInSeconds)(), + ...breadcrumb, + }; + + const breadcrumbs = this._breadcrumbs; + breadcrumbs.push(mergedBreadcrumb); + this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs; + + this._notifyScopeListeners(); + + return this; + } + + /** + * @inheritDoc + */ + getLastBreadcrumb() { + return this._breadcrumbs[this._breadcrumbs.length - 1]; + } + + /** + * @inheritDoc + */ + clearBreadcrumbs() { + this._breadcrumbs = []; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + addAttachment(attachment) { + this._attachments.push(attachment); + return this; + } + + /** + * @inheritDoc + */ + getAttachments() { + return this._attachments; + } + + /** + * @inheritDoc + */ + clearAttachments() { + this._attachments = []; + return this; + } + + /** + * Applies data from the scope to the event and runs all event processors on it. + * + * @param event Event + * @param hint Object containing additional information about the original exception, for use by the event processors. + * @hidden + */ + applyToEvent( + event, + hint = {}, + additionalEventProcessors, + ) { + if (this._extra && Object.keys(this._extra).length) { + event.extra = { ...this._extra, ...event.extra }; + } + if (this._tags && Object.keys(this._tags).length) { + event.tags = { ...this._tags, ...event.tags }; + } + if (this._user && Object.keys(this._user).length) { + event.user = { ...this._user, ...event.user }; + } + if (this._contexts && Object.keys(this._contexts).length) { + event.contexts = { ...this._contexts, ...event.contexts }; + } + if (this._level) { + event.level = this._level; + } + if (this._transactionName) { + event.transaction = this._transactionName; + } + + // We want to set the trace context for normal events only if there isn't already + // a trace context on the event. There is a product feature in place where we link + // errors with transaction and it relies on that. + if (this._span) { + event.contexts = { trace: this._span.getTraceContext(), ...event.contexts }; + const transaction = this._span.transaction; + if (transaction) { + event.sdkProcessingMetadata = { + dynamicSamplingContext: transaction.getDynamicSamplingContext(), + ...event.sdkProcessingMetadata, + }; + const transactionName = transaction.name; + if (transactionName) { + event.tags = { transaction: transactionName, ...event.tags }; + } + } + } + + this._applyFingerprint(event); + + const scopeBreadcrumbs = this._getBreadcrumbs(); + const breadcrumbs = [...(event.breadcrumbs || []), ...scopeBreadcrumbs]; + event.breadcrumbs = breadcrumbs.length > 0 ? breadcrumbs : undefined; + + event.sdkProcessingMetadata = { + ...event.sdkProcessingMetadata, + ...this._sdkProcessingMetadata, + propagationContext: this._propagationContext, + }; + + // TODO (v8): Update this order to be: Global > Client > Scope + return (0,_eventProcessors_js__WEBPACK_IMPORTED_MODULE_3__.notifyEventProcessors)( + [...(additionalEventProcessors || []), ...(0,_eventProcessors_js__WEBPACK_IMPORTED_MODULE_3__.getGlobalEventProcessors)(), ...this._eventProcessors], + event, + hint, + ); + } + + /** + * Add data which will be accessible during event processing but won't get sent to Sentry + */ + setSDKProcessingMetadata(newData) { + this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData }; + + return this; + } + + /** + * @inheritDoc + */ + setPropagationContext(context) { + this._propagationContext = context; + return this; + } + + /** + * @inheritDoc + */ + getPropagationContext() { + return this._propagationContext; + } + + /** + * Get the breadcrumbs for this scope. + */ + _getBreadcrumbs() { + return this._breadcrumbs; + } + + /** + * This will be called on every set call. + */ + _notifyScopeListeners() { + // We need this check for this._notifyingListeners to be able to work on scope during updates + // If this check is not here we'll produce endless recursion when something is done with the scope + // during the callback. + if (!this._notifyingListeners) { + this._notifyingListeners = true; + this._scopeListeners.forEach(callback => { + callback(this); + }); + this._notifyingListeners = false; + } + } + + /** + * Applies fingerprint from the scope to the event if there's one, + * uses message if there's one instead or get rid of empty fingerprint + */ + _applyFingerprint(event) { + // Make sure it's an array first and we actually have something in place + event.fingerprint = event.fingerprint ? (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.arrayify)(event.fingerprint) : []; + + // If we have something on the scope, then merge it with event + if (this._fingerprint) { + event.fingerprint = event.fingerprint.concat(this._fingerprint); + } + + // If we have no data at all, remove empty array default + if (event.fingerprint && !event.fingerprint.length) { + delete event.fingerprint; + } + } +} + +function generatePropagationContext() { + return { + traceId: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.uuid4)(), + spanId: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.uuid4)().substring(16), + }; +} + + +//# sourceMappingURL=scope.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/sdk.js": +/*!**********************************************!*\ + !*** ./node_modules/@sentry/core/esm/sdk.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ initAndBind: () => (/* binding */ initAndBind) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hub.js */ "./node_modules/@sentry/core/esm/hub.js"); + + + +/** A class object that can instantiate Client objects. */ + +/** + * Internal function to create a new SDK client instance. The client is + * installed and then bound to the current scope. + * + * @param clientClass The client class to instantiate. + * @param options Options to pass to the client. + */ +function initAndBind( + clientClass, + options, +) { + if (options.debug === true) { + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.logger.enable(); + } else { + // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped + // eslint-disable-next-line no-console + console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); + } + } + const hub = (0,_hub_js__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)(); + const scope = hub.getScope(); + scope.update(options.initialScope); + + const client = new clientClass(options); + hub.bindClient(client); +} + + +//# sourceMappingURL=sdk.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/session.js": +/*!**************************************************!*\ + !*** ./node_modules/@sentry/core/esm/session.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ closeSession: () => (/* binding */ closeSession), +/* harmony export */ makeSession: () => (/* binding */ makeSession), +/* harmony export */ updateSession: () => (/* binding */ updateSession) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/time.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); + + +/** + * Creates a new `Session` object by setting certain default parameters. If optional @param context + * is passed, the passed properties are applied to the session object. + * + * @param context (optional) additional properties to be applied to the returned session object + * + * @returns a new `Session` object + */ +function makeSession(context) { + // Both timestamp and started are in seconds since the UNIX epoch. + const startingTime = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.timestampInSeconds)(); + + const session = { + sid: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.uuid4)(), + init: true, + timestamp: startingTime, + started: startingTime, + duration: 0, + status: 'ok', + errors: 0, + ignoreDuration: false, + toJSON: () => sessionToJSON(session), + }; + + if (context) { + updateSession(session, context); + } + + return session; +} + +/** + * Updates a session object with the properties passed in the context. + * + * Note that this function mutates the passed object and returns void. + * (Had to do this instead of returning a new and updated session because closing and sending a session + * makes an update to the session after it was passed to the sending logic. + * @see BaseClient.captureSession ) + * + * @param session the `Session` to update + * @param context the `SessionContext` holding the properties that should be updated in @param session + */ +// eslint-disable-next-line complexity +function updateSession(session, context = {}) { + if (context.user) { + if (!session.ipAddress && context.user.ip_address) { + session.ipAddress = context.user.ip_address; + } + + if (!session.did && !context.did) { + session.did = context.user.id || context.user.email || context.user.username; + } + } + + session.timestamp = context.timestamp || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.timestampInSeconds)(); + + if (context.ignoreDuration) { + session.ignoreDuration = context.ignoreDuration; + } + if (context.sid) { + // Good enough uuid validation. — Kamil + session.sid = context.sid.length === 32 ? context.sid : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.uuid4)(); + } + if (context.init !== undefined) { + session.init = context.init; + } + if (!session.did && context.did) { + session.did = `${context.did}`; + } + if (typeof context.started === 'number') { + session.started = context.started; + } + if (session.ignoreDuration) { + session.duration = undefined; + } else if (typeof context.duration === 'number') { + session.duration = context.duration; + } else { + const duration = session.timestamp - session.started; + session.duration = duration >= 0 ? duration : 0; + } + if (context.release) { + session.release = context.release; + } + if (context.environment) { + session.environment = context.environment; + } + if (!session.ipAddress && context.ipAddress) { + session.ipAddress = context.ipAddress; + } + if (!session.userAgent && context.userAgent) { + session.userAgent = context.userAgent; + } + if (typeof context.errors === 'number') { + session.errors = context.errors; + } + if (context.status) { + session.status = context.status; + } +} + +/** + * Closes a session by setting its status and updating the session object with it. + * Internally calls `updateSession` to update the passed session object. + * + * Note that this function mutates the passed session (@see updateSession for explanation). + * + * @param session the `Session` object to be closed + * @param status the `SessionStatus` with which the session was closed. If you don't pass a status, + * this function will keep the previously set status, unless it was `'ok'` in which case + * it is changed to `'exited'`. + */ +function closeSession(session, status) { + let context = {}; + if (status) { + context = { status }; + } else if (session.status === 'ok') { + context = { status: 'exited' }; + } + + updateSession(session, context); +} + +/** + * Serializes a passed session object to a JSON object with a slightly different structure. + * This is necessary because the Sentry backend requires a slightly different schema of a session + * than the one the JS SDKs use internally. + * + * @param session the session to be converted + * + * @returns a JSON object of the passed session + */ +function sessionToJSON(session) { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.dropUndefinedKeys)({ + sid: `${session.sid}`, + init: session.init, + // Make sure that sec is converted to ms for date constructor + started: new Date(session.started * 1000).toISOString(), + timestamp: new Date(session.timestamp * 1000).toISOString(), + status: session.status, + errors: session.errors, + did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined, + duration: session.duration, + attrs: { + release: session.release, + environment: session.environment, + ip_address: session.ipAddress, + user_agent: session.userAgent, + }, + }); +} + + +//# sourceMappingURL=session.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getDynamicSamplingContextFromClient: () => (/* binding */ getDynamicSamplingContextFromClient) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants.js */ "./node_modules/@sentry/core/esm/constants.js"); + + + +/** + * Creates a dynamic sampling context from a client. + * + * Dispatchs the `createDsc` lifecycle hook as a side effect. + */ +function getDynamicSamplingContextFromClient( + trace_id, + client, + scope, +) { + const options = client.getOptions(); + + const { publicKey: public_key } = client.getDsn() || {}; + const { segment: user_segment } = (scope && scope.getUser()) || {}; + + const dsc = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.dropUndefinedKeys)({ + environment: options.environment || _constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ENVIRONMENT, + release: options.release, + user_segment, + public_key, + trace_id, + }) ; + + client.emit && client.emit('createDsc', dsc); + + return dsc; +} + + +//# sourceMappingURL=dynamicSamplingContext.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/tracing/errors.js": +/*!*********************************************************!*\ + !*** ./node_modules/@sentry/core/esm/tracing/errors.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ registerErrorInstrumentation: () => (/* binding */ registerErrorInstrumentation) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/instrument.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./node_modules/@sentry/core/esm/tracing/utils.js"); + + + +let errorsInstrumented = false; + +/** + * Configures global error listeners + */ +function registerErrorInstrumentation() { + if (errorsInstrumented) { + return; + } + + errorsInstrumented = true; + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)('error', errorCallback); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.addInstrumentationHandler)('unhandledrejection', errorCallback); +} + +/** + * If an error or unhandled promise occurs, we mark the active transaction as failed + */ +function errorCallback() { + const activeTransaction = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.getActiveTransaction)(); + if (activeTransaction) { + const status = 'internal_error'; + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__.logger.log(`[Tracing] Transaction: ${status} -> Global error occured`); + activeTransaction.setStatus(status); + } +} + +// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the +// node.js default exit behaviour +errorCallback.tag = 'sentry_tracingErrorCallback'; + + +//# sourceMappingURL=errors.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/tracing/hubextensions.js": +/*!****************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/tracing/hubextensions.js ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addTracingExtensions: () => (/* binding */ addTracingExtensions), +/* harmony export */ startIdleTransaction: () => (/* binding */ startIdleTransaction) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../hub.js */ "./node_modules/@sentry/core/esm/hub.js"); +/* harmony import */ var _utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/hasTracingEnabled.js */ "./node_modules/@sentry/core/esm/utils/hasTracingEnabled.js"); +/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./errors.js */ "./node_modules/@sentry/core/esm/tracing/errors.js"); +/* harmony import */ var _idletransaction_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./idletransaction.js */ "./node_modules/@sentry/core/esm/tracing/idletransaction.js"); +/* harmony import */ var _transaction_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./transaction.js */ "./node_modules/@sentry/core/esm/tracing/transaction.js"); + + + + + + + +/** Returns all trace headers that are currently on the top scope. */ +function traceHeaders() { + const scope = this.getScope(); + const span = scope.getSpan(); + + return span + ? { + 'sentry-trace': span.toTraceparent(), + } + : {}; +} + +/** + * Makes a sampling decision for the given transaction and stores it on the transaction. + * + * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be + * sent to Sentry. + * + * @param transaction: The transaction needing a sampling decision + * @param options: The current client's options, so we can access `tracesSampleRate` and/or `tracesSampler` + * @param samplingContext: Default and user-provided data which may be used to help make the decision + * + * @returns The given transaction with its `sampled` value set + */ +function sample( + transaction, + options, + samplingContext, +) { + // nothing to do if tracing is not enabled + if (!(0,_utils_hasTracingEnabled_js__WEBPACK_IMPORTED_MODULE_0__.hasTracingEnabled)(options)) { + transaction.sampled = false; + return transaction; + } + + // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that + if (transaction.sampled !== undefined) { + transaction.setMetadata({ + sampleRate: Number(transaction.sampled), + }); + return transaction; + } + + // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should + // work; prefer the hook if so + let sampleRate; + if (typeof options.tracesSampler === 'function') { + sampleRate = options.tracesSampler(samplingContext); + transaction.setMetadata({ + sampleRate: Number(sampleRate), + }); + } else if (samplingContext.parentSampled !== undefined) { + sampleRate = samplingContext.parentSampled; + } else if (typeof options.tracesSampleRate !== 'undefined') { + sampleRate = options.tracesSampleRate; + transaction.setMetadata({ + sampleRate: Number(sampleRate), + }); + } else { + // When `enableTracing === true`, we use a sample rate of 100% + sampleRate = 1; + transaction.setMetadata({ + sampleRate, + }); + } + + // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The + // only valid values are booleans or numbers between 0 and 1.) + if (!isValidSampleRate(sampleRate)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn('[Tracing] Discarding transaction because of invalid sample rate.'); + transaction.sampled = false; + return transaction; + } + + // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped + if (!sampleRate) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log( + `[Tracing] Discarding transaction because ${ + typeof options.tracesSampler === 'function' + ? 'tracesSampler returned 0 or false' + : 'a negative sampling decision was inherited or tracesSampleRate is set to 0' + }`, + ); + transaction.sampled = false; + return transaction; + } + + // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is + // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false. + transaction.sampled = Math.random() < (sampleRate ); + + // if we're not going to keep it, we're done + if (!transaction.sampled) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log( + `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( + sampleRate, + )})`, + ); + return transaction; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.log(`[Tracing] starting ${transaction.op} transaction - ${transaction.name}`); + return transaction; +} + +/** + * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1). + */ +function isValidSampleRate(rate) { + // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.isNaN)(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn( + `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( + rate, + )} of type ${JSON.stringify(typeof rate)}.`, + ); + return false; + } + + // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false + if (rate < 0 || rate > 1) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`); + return false; + } + return true; +} + +/** + * Creates a new transaction and adds a sampling decision if it doesn't yet have one. + * + * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if + * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an + * "extension method." + * + * @param this: The Hub starting the transaction + * @param transactionContext: Data used to configure the transaction + * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any) + * + * @returns The new transaction + * + * @see {@link Hub.startTransaction} + */ +function _startTransaction( + + transactionContext, + customSamplingContext, +) { + const client = this.getClient(); + const options = (client && client.getOptions()) || {}; + + const configInstrumenter = options.instrumenter || 'sentry'; + const transactionInstrumenter = transactionContext.instrumenter || 'sentry'; + + if (configInstrumenter !== transactionInstrumenter) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.logger.error( + `A transaction was started with instrumenter=\`${transactionInstrumenter}\`, but the SDK is configured with the \`${configInstrumenter}\` instrumenter. +The transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`, + ); + + transactionContext.sampled = false; + } + + let transaction = new _transaction_js__WEBPACK_IMPORTED_MODULE_3__.Transaction(transactionContext, this); + transaction = sample(transaction, options, { + parentSampled: transactionContext.parentSampled, + transactionContext, + ...customSamplingContext, + }); + if (transaction.sampled) { + transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans )); + } + if (client && client.emit) { + client.emit('startTransaction', transaction); + } + return transaction; +} + +/** + * Create new idle transaction. + */ +function startIdleTransaction( + hub, + transactionContext, + idleTimeout, + finalTimeout, + onScope, + customSamplingContext, + heartbeatInterval, +) { + const client = hub.getClient(); + const options = (client && client.getOptions()) || {}; + + let transaction = new _idletransaction_js__WEBPACK_IMPORTED_MODULE_4__.IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope); + transaction = sample(transaction, options, { + parentSampled: transactionContext.parentSampled, + transactionContext, + ...customSamplingContext, + }); + if (transaction.sampled) { + transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans )); + } + if (client && client.emit) { + client.emit('startTransaction', transaction); + } + return transaction; +} + +/** + * Adds tracing extensions to the global hub. + */ +function addTracingExtensions() { + const carrier = (0,_hub_js__WEBPACK_IMPORTED_MODULE_5__.getMainCarrier)(); + if (!carrier.__SENTRY__) { + return; + } + carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {}; + if (!carrier.__SENTRY__.extensions.startTransaction) { + carrier.__SENTRY__.extensions.startTransaction = _startTransaction; + } + if (!carrier.__SENTRY__.extensions.traceHeaders) { + carrier.__SENTRY__.extensions.traceHeaders = traceHeaders; + } + + (0,_errors_js__WEBPACK_IMPORTED_MODULE_6__.registerErrorInstrumentation)(); +} + + +//# sourceMappingURL=hubextensions.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/tracing/idletransaction.js": +/*!******************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/tracing/idletransaction.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ IdleTransaction: () => (/* binding */ IdleTransaction), +/* harmony export */ IdleTransactionSpanRecorder: () => (/* binding */ IdleTransactionSpanRecorder), +/* harmony export */ TRACING_DEFAULTS: () => (/* binding */ TRACING_DEFAULTS) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/time.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _span_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./span.js */ "./node_modules/@sentry/core/esm/tracing/span.js"); +/* harmony import */ var _transaction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transaction.js */ "./node_modules/@sentry/core/esm/tracing/transaction.js"); + + + + +const TRACING_DEFAULTS = { + idleTimeout: 1000, + finalTimeout: 30000, + heartbeatInterval: 5000, +}; + +const FINISH_REASON_TAG = 'finishReason'; + +const IDLE_TRANSACTION_FINISH_REASONS = [ + 'heartbeatFailed', + 'idleTimeout', + 'documentHidden', + 'finalTimeout', + 'externalFinish', + 'cancelled', +]; + +/** + * @inheritDoc + */ +class IdleTransactionSpanRecorder extends _span_js__WEBPACK_IMPORTED_MODULE_0__.SpanRecorder { + constructor( + _pushActivity, + _popActivity, + transactionSpanId, + maxlen, + ) { + super(maxlen);this._pushActivity = _pushActivity;this._popActivity = _popActivity;this.transactionSpanId = transactionSpanId; } + + /** + * @inheritDoc + */ + add(span) { + // We should make sure we do not push and pop activities for + // the transaction that this span recorder belongs to. + if (span.spanId !== this.transactionSpanId) { + // We patch span.finish() to pop an activity after setting an endTimestamp. + span.finish = (endTimestamp) => { + span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)(); + this._popActivity(span.spanId); + }; + + // We should only push new activities if the span does not have an end timestamp. + if (span.endTimestamp === undefined) { + this._pushActivity(span.spanId); + } + } + + super.add(span); + } +} + +/** + * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities. + * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will + * put itself on the scope on creation. + */ +class IdleTransaction extends _transaction_js__WEBPACK_IMPORTED_MODULE_2__.Transaction { + // Activities store a list of active spans + + // Track state of activities in previous heartbeat + + // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats. + + // We should not use heartbeat if we finished a transaction + + // Idle timeout was canceled and we should finish the transaction with the last span end. + + /** + * Timer that tracks Transaction idleTimeout + */ + + constructor( + transactionContext, + _idleHub, + /** + * The time to wait in ms until the idle transaction will be finished. This timer is started each time + * there are no active spans on this transaction. + */ + _idleTimeout = TRACING_DEFAULTS.idleTimeout, + /** + * The final value in ms that a transaction cannot exceed + */ + _finalTimeout = TRACING_DEFAULTS.finalTimeout, + _heartbeatInterval = TRACING_DEFAULTS.heartbeatInterval, + // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends + _onScope = false, + ) { + super(transactionContext, _idleHub);this._idleHub = _idleHub;this._idleTimeout = _idleTimeout;this._finalTimeout = _finalTimeout;this._heartbeatInterval = _heartbeatInterval;this._onScope = _onScope; + this.activities = {}; + this._heartbeatCounter = 0; + this._finished = false; + this._idleTimeoutCanceledPermanently = false; + this._beforeFinishCallbacks = []; + this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[4]; + + if (_onScope) { + // We set the transaction here on the scope so error events pick up the trace + // context and attach it to the error. + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`); + _idleHub.configureScope(scope => scope.setSpan(this)); + } + + this._restartIdleTimeout(); + setTimeout(() => { + if (!this._finished) { + this.setStatus('deadline_exceeded'); + this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3]; + this.finish(); + } + }, this._finalTimeout); + } + + /** {@inheritDoc} */ + finish(endTimestamp = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)()) { + this._finished = true; + this.activities = {}; + + if (this.op === 'ui.action.click') { + this.setTag(FINISH_REASON_TAG, this._finishReason); + } + + if (this.spanRecorder) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestamp * 1000).toISOString(), this.op); + + for (const callback of this._beforeFinishCallbacks) { + callback(this, endTimestamp); + } + + this.spanRecorder.spans = this.spanRecorder.spans.filter((span) => { + // If we are dealing with the transaction itself, we just return it + if (span.spanId === this.spanId) { + return true; + } + + // We cancel all pending spans with status "cancelled" to indicate the idle transaction was finished early + if (!span.endTimestamp) { + span.endTimestamp = endTimestamp; + span.setStatus('cancelled'); + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2)); + } + + const spanStartedBeforeTransactionFinish = span.startTimestamp < endTimestamp; + + // Add a delta with idle timeout so that we prevent false positives + const timeoutWithMarginOfError = (this._finalTimeout + this._idleTimeout) / 1000; + const spanEndedBeforeFinalTimeout = span.endTimestamp - this.startTimestamp < timeoutWithMarginOfError; + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + const stringifiedSpan = JSON.stringify(span, undefined, 2); + if (!spanStartedBeforeTransactionFinish) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] discarding Span since it happened after Transaction was finished', stringifiedSpan); + } else if (!spanEndedBeforeFinalTimeout) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] discarding Span since it finished after Transaction final timeout', stringifiedSpan); + } + } + + return spanStartedBeforeTransactionFinish && spanEndedBeforeFinalTimeout; + }); + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] flushing IdleTransaction'); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] No active IdleTransaction'); + } + + // if `this._onScope` is `true`, the transaction put itself on the scope when it started + if (this._onScope) { + const scope = this._idleHub.getScope(); + if (scope.getTransaction() === this) { + scope.setSpan(undefined); + } + } + + return super.finish(endTimestamp); + } + + /** + * Register a callback function that gets excecuted before the transaction finishes. + * Useful for cleanup or if you want to add any additional spans based on current context. + * + * This is exposed because users have no other way of running something before an idle transaction + * finishes. + */ + registerBeforeFinishCallback(callback) { + this._beforeFinishCallbacks.push(callback); + } + + /** + * @inheritDoc + */ + initSpanRecorder(maxlen) { + if (!this.spanRecorder) { + const pushActivity = (id) => { + if (this._finished) { + return; + } + this._pushActivity(id); + }; + const popActivity = (id) => { + if (this._finished) { + return; + } + this._popActivity(id); + }; + + this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen); + + // Start heartbeat so that transactions do not run forever. + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('Starting heartbeat'); + this._pingHeartbeat(); + } + this.spanRecorder.add(this); + } + + /** + * Cancels the existing idle timeout, if there is one. + * @param restartOnChildSpanChange Default is `true`. + * If set to false the transaction will end + * with the last child span. + */ + cancelIdleTimeout( + endTimestamp, + { + restartOnChildSpanChange, + } + + = { + restartOnChildSpanChange: true, + }, + ) { + this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false; + if (this._idleTimeoutID) { + clearTimeout(this._idleTimeoutID); + this._idleTimeoutID = undefined; + + if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) { + this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5]; + this.finish(endTimestamp); + } + } + } + + /** + * Temporary method used to externally set the transaction's `finishReason` + * + * ** WARNING** + * This is for the purpose of experimentation only and will be removed in the near future, do not use! + * + * @internal + * + */ + setFinishReason(reason) { + this._finishReason = reason; + } + + /** + * Restarts idle timeout, if there is no running idle timeout it will start one. + */ + _restartIdleTimeout(endTimestamp) { + this.cancelIdleTimeout(); + this._idleTimeoutID = setTimeout(() => { + if (!this._finished && Object.keys(this.activities).length === 0) { + this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1]; + this.finish(endTimestamp); + } + }, this._idleTimeout); + } + + /** + * Start tracking a specific activity. + * @param spanId The span id that represents the activity + */ + _pushActivity(spanId) { + this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently }); + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log(`[Tracing] pushActivity: ${spanId}`); + this.activities[spanId] = true; + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] new activities count', Object.keys(this.activities).length); + } + + /** + * Remove an activity from usage + * @param spanId The span id that represents the activity + */ + _popActivity(spanId) { + if (this.activities[spanId]) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log(`[Tracing] popActivity ${spanId}`); + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this.activities[spanId]; + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] new activities count', Object.keys(this.activities).length); + } + + if (Object.keys(this.activities).length === 0) { + const endTimestamp = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)(); + if (this._idleTimeoutCanceledPermanently) { + this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5]; + this.finish(endTimestamp); + } else { + // We need to add the timeout here to have the real endtimestamp of the transaction + // Remember timestampInSeconds is in seconds, timeout is in ms + this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000); + } + } + } + + /** + * Checks when entries of this.activities are not changing for 3 beats. + * If this occurs we finish the transaction. + */ + _beat() { + // We should not be running heartbeat if the idle transaction is finished. + if (this._finished) { + return; + } + + const heartbeatString = Object.keys(this.activities).join(''); + + if (heartbeatString === this._prevHeartbeatString) { + this._heartbeatCounter++; + } else { + this._heartbeatCounter = 1; + } + + this._prevHeartbeatString = heartbeatString; + + if (this._heartbeatCounter >= 3) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log('[Tracing] Transaction finished because of no change for 3 heart beats'); + this.setStatus('deadline_exceeded'); + this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0]; + this.finish(); + } else { + this._pingHeartbeat(); + } + } + + /** + * Pings the heartbeat + */ + _pingHeartbeat() { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__.logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`); + setTimeout(() => { + this._beat(); + }, this._heartbeatInterval); + } +} + + +//# sourceMappingURL=idletransaction.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/tracing/span.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sentry/core/esm/tracing/span.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Span: () => (/* binding */ Span), +/* harmony export */ SpanRecorder: () => (/* binding */ SpanRecorder), +/* harmony export */ spanStatusfromHttpCode: () => (/* binding */ spanStatusfromHttpCode) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/time.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/tracing.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); + + +/** + * Keeps track of finished spans for a given transaction + * @internal + * @hideconstructor + * @hidden + */ +class SpanRecorder { + + constructor(maxlen = 1000) { + this._maxlen = maxlen; + this.spans = []; + } + + /** + * This is just so that we don't run out of memory while recording a lot + * of spans. At some point we just stop and flush out the start of the + * trace tree (i.e.the first n spans with the smallest + * start_timestamp). + */ + add(span) { + if (this.spans.length > this._maxlen) { + span.spanRecorder = undefined; + } else { + this.spans.push(span); + } + } +} + +/** + * Span contains all data about a span + */ +class Span { + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + /** + * Internal keeper of the status + */ + + /** + * @inheritDoc + */ + + /** + * Timestamp in seconds when the span was created. + */ + + /** + * Timestamp in seconds when the span ended. + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + /** + * List of spans that were finalized + */ + + /** + * @inheritDoc + */ + + /** + * The instrumenter that created this span. + */ + + /** + * The origin of the span, giving context about what created the span. + */ + + /** + * You should never call the constructor manually, always use `Sentry.startTransaction()` + * or call `startChild()` on an existing span. + * @internal + * @hideconstructor + * @hidden + */ + constructor(spanContext = {}) { + this.traceId = spanContext.traceId || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.uuid4)(); + this.spanId = spanContext.spanId || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.uuid4)().substring(16); + this.startTimestamp = spanContext.startTimestamp || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)(); + this.tags = spanContext.tags || {}; + this.data = spanContext.data || {}; + this.instrumenter = spanContext.instrumenter || 'sentry'; + this.origin = spanContext.origin || 'manual'; + + if (spanContext.parentSpanId) { + this.parentSpanId = spanContext.parentSpanId; + } + // We want to include booleans as well here + if ('sampled' in spanContext) { + this.sampled = spanContext.sampled; + } + if (spanContext.op) { + this.op = spanContext.op; + } + if (spanContext.description) { + this.description = spanContext.description; + } + if (spanContext.name) { + this.description = spanContext.name; + } + if (spanContext.status) { + this.status = spanContext.status; + } + if (spanContext.endTimestamp) { + this.endTimestamp = spanContext.endTimestamp; + } + } + + /** An alias for `description` of the Span. */ + get name() { + return this.description || ''; + } + /** Update the name of the span. */ + set name(name) { + this.setName(name); + } + + /** + * @inheritDoc + */ + startChild( + spanContext, + ) { + const childSpan = new Span({ + ...spanContext, + parentSpanId: this.spanId, + sampled: this.sampled, + traceId: this.traceId, + }); + + childSpan.spanRecorder = this.spanRecorder; + if (childSpan.spanRecorder) { + childSpan.spanRecorder.add(childSpan); + } + + childSpan.transaction = this.transaction; + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && childSpan.transaction) { + const opStr = (spanContext && spanContext.op) || '< unknown op >'; + const nameStr = childSpan.transaction.name || '< unknown name >'; + const idStr = childSpan.transaction.spanId; + + const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`; + childSpan.transaction.metadata.spanMetadata[childSpan.spanId] = { logMessage }; + _sentry_utils__WEBPACK_IMPORTED_MODULE_2__.logger.log(logMessage); + } + + return childSpan; + } + + /** + * @inheritDoc + */ + setTag(key, value) { + this.tags = { ...this.tags, [key]: value }; + return this; + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + setData(key, value) { + this.data = { ...this.data, [key]: value }; + return this; + } + + /** + * @inheritDoc + */ + setStatus(value) { + this.status = value; + return this; + } + + /** + * @inheritDoc + */ + setHttpStatus(httpStatus) { + this.setTag('http.status_code', String(httpStatus)); + this.setData('http.response.status_code', httpStatus); + const spanStatus = spanStatusfromHttpCode(httpStatus); + if (spanStatus !== 'unknown_error') { + this.setStatus(spanStatus); + } + return this; + } + + /** + * @inheritDoc + */ + setName(name) { + this.description = name; + } + + /** + * @inheritDoc + */ + isSuccess() { + return this.status === 'ok'; + } + + /** + * @inheritDoc + */ + finish(endTimestamp) { + if ( + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + // Don't call this for transactions + this.transaction && + this.transaction.spanId !== this.spanId + ) { + const { logMessage } = this.transaction.metadata.spanMetadata[this.spanId]; + if (logMessage) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_2__.logger.log((logMessage ).replace('Starting', 'Finishing')); + } + } + + this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.timestampInSeconds)(); + } + + /** + * @inheritDoc + */ + toTraceparent() { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.generateSentryTraceHeader)(this.traceId, this.spanId, this.sampled); + } + + /** + * @inheritDoc + */ + toContext() { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.dropUndefinedKeys)({ + data: this.data, + description: this.description, + endTimestamp: this.endTimestamp, + op: this.op, + parentSpanId: this.parentSpanId, + sampled: this.sampled, + spanId: this.spanId, + startTimestamp: this.startTimestamp, + status: this.status, + tags: this.tags, + traceId: this.traceId, + }); + } + + /** + * @inheritDoc + */ + updateWithContext(spanContext) { + this.data = spanContext.data || {}; + this.description = spanContext.description; + this.endTimestamp = spanContext.endTimestamp; + this.op = spanContext.op; + this.parentSpanId = spanContext.parentSpanId; + this.sampled = spanContext.sampled; + this.spanId = spanContext.spanId || this.spanId; + this.startTimestamp = spanContext.startTimestamp || this.startTimestamp; + this.status = spanContext.status; + this.tags = spanContext.tags || {}; + this.traceId = spanContext.traceId || this.traceId; + + return this; + } + + /** + * @inheritDoc + */ + getTraceContext() { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.dropUndefinedKeys)({ + data: Object.keys(this.data).length > 0 ? this.data : undefined, + description: this.description, + op: this.op, + parent_span_id: this.parentSpanId, + span_id: this.spanId, + status: this.status, + tags: Object.keys(this.tags).length > 0 ? this.tags : undefined, + trace_id: this.traceId, + }); + } + + /** + * @inheritDoc + */ + toJSON() + + { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_4__.dropUndefinedKeys)({ + data: Object.keys(this.data).length > 0 ? this.data : undefined, + description: this.description, + op: this.op, + parent_span_id: this.parentSpanId, + span_id: this.spanId, + start_timestamp: this.startTimestamp, + status: this.status, + tags: Object.keys(this.tags).length > 0 ? this.tags : undefined, + timestamp: this.endTimestamp, + trace_id: this.traceId, + origin: this.origin, + }); + } +} + +/** + * Converts a HTTP status code into a {@link SpanStatusType}. + * + * @param httpStatus The HTTP response status code. + * @returns The span status or unknown_error. + */ +function spanStatusfromHttpCode(httpStatus) { + if (httpStatus < 400 && httpStatus >= 100) { + return 'ok'; + } + + if (httpStatus >= 400 && httpStatus < 500) { + switch (httpStatus) { + case 401: + return 'unauthenticated'; + case 403: + return 'permission_denied'; + case 404: + return 'not_found'; + case 409: + return 'already_exists'; + case 413: + return 'failed_precondition'; + case 429: + return 'resource_exhausted'; + default: + return 'invalid_argument'; + } + } + + if (httpStatus >= 500 && httpStatus < 600) { + switch (httpStatus) { + case 501: + return 'unimplemented'; + case 503: + return 'unavailable'; + case 504: + return 'deadline_exceeded'; + default: + return 'internal_error'; + } + } + + return 'unknown_error'; +} + + +//# sourceMappingURL=span.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/tracing/transaction.js": +/*!**************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/tracing/transaction.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Transaction: () => (/* binding */ Transaction) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hub.js */ "./node_modules/@sentry/core/esm/hub.js"); +/* harmony import */ var _dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dynamicSamplingContext.js */ "./node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"); +/* harmony import */ var _span_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./span.js */ "./node_modules/@sentry/core/esm/tracing/span.js"); + + + + + +/** JSDoc */ +class Transaction extends _span_js__WEBPACK_IMPORTED_MODULE_0__.Span { + + /** + * The reference to the current hub. + */ + + /** + * This constructor should never be called manually. Those instrumenting tracing should use + * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`. + * @internal + * @hideconstructor + * @hidden + */ + constructor(transactionContext, hub) { + super(transactionContext); + // We need to delete description since it's set by the Span class constructor + // but not needed for transactions. + delete this.description; + + this._measurements = {}; + this._contexts = {}; + + this._hub = hub || (0,_hub_js__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)(); + + this._name = transactionContext.name || ''; + + this.metadata = { + source: 'custom', + ...transactionContext.metadata, + spanMetadata: {}, + }; + + this._trimEnd = transactionContext.trimEnd; + + // this is because transactions are also spans, and spans have a transaction pointer + this.transaction = this; + + // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means + // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means) + const incomingDynamicSamplingContext = this.metadata.dynamicSamplingContext; + if (incomingDynamicSamplingContext) { + // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext` + this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext }; + } + } + + /** Getter for `name` property */ + get name() { + return this._name; + } + + /** Setter for `name` property, which also sets `source` as custom */ + set name(newName) { + this.setName(newName); + } + + /** + * JSDoc + */ + setName(name, source = 'custom') { + this._name = name; + this.metadata.source = source; + } + + /** + * Attaches SpanRecorder to the span itself + * @param maxlen maximum number of spans that can be recorded + */ + initSpanRecorder(maxlen = 1000) { + if (!this.spanRecorder) { + this.spanRecorder = new _span_js__WEBPACK_IMPORTED_MODULE_0__.SpanRecorder(maxlen); + } + this.spanRecorder.add(this); + } + + /** + * @inheritDoc + */ + setContext(key, context) { + if (context === null) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this._contexts[key]; + } else { + this._contexts[key] = context; + } + } + + /** + * @inheritDoc + */ + setMeasurement(name, value, unit = '') { + this._measurements[name] = { value, unit }; + } + + /** + * @inheritDoc + */ + setMetadata(newMetadata) { + this.metadata = { ...this.metadata, ...newMetadata }; + } + + /** + * @inheritDoc + */ + finish(endTimestamp) { + const transaction = this._finishTransaction(endTimestamp); + if (!transaction) { + return undefined; + } + return this._hub.captureEvent(transaction); + } + + /** + * @inheritDoc + */ + toContext() { + const spanContext = super.toContext(); + + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.dropUndefinedKeys)({ + ...spanContext, + name: this.name, + trimEnd: this._trimEnd, + }); + } + + /** + * @inheritDoc + */ + updateWithContext(transactionContext) { + super.updateWithContext(transactionContext); + + this.name = transactionContext.name || ''; + + this._trimEnd = transactionContext.trimEnd; + + return this; + } + + /** + * @inheritdoc + * + * @experimental + */ + getDynamicSamplingContext() { + if (this._frozenDynamicSamplingContext) { + return this._frozenDynamicSamplingContext; + } + + const hub = this._hub || (0,_hub_js__WEBPACK_IMPORTED_MODULE_1__.getCurrentHub)(); + const client = hub.getClient(); + + if (!client) return {}; + + const scope = hub.getScope(); + const dsc = (0,_dynamicSamplingContext_js__WEBPACK_IMPORTED_MODULE_3__.getDynamicSamplingContextFromClient)(this.traceId, client, scope); + + const maybeSampleRate = this.metadata.sampleRate; + if (maybeSampleRate !== undefined) { + dsc.sample_rate = `${maybeSampleRate}`; + } + + // We don't want to have a transaction name in the DSC if the source is "url" because URLs might contain PII + const source = this.metadata.source; + if (source && source !== 'url') { + dsc.transaction = this.name; + } + + if (this.sampled !== undefined) { + dsc.sampled = String(this.sampled); + } + + // Uncomment if we want to make DSC immutable + // this._frozenDynamicSamplingContext = dsc; + + return dsc; + } + + /** + * Override the current hub with a new one. + * Used if you want another hub to finish the transaction. + * + * @internal + */ + setHub(hub) { + this._hub = hub; + } + + /** + * Finish the transaction & prepare the event to send to Sentry. + */ + _finishTransaction(endTimestamp) { + // This transaction is already finished, so we should not flush it again. + if (this.endTimestamp !== undefined) { + return undefined; + } + + if (!this.name) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.warn('Transaction has no name, falling back to ``.'); + this.name = ''; + } + + // just sets the end timestamp + super.finish(endTimestamp); + + const client = this._hub.getClient(); + if (client && client.emit) { + client.emit('finishTransaction', this); + } + + if (this.sampled !== true) { + // At this point if `sampled !== true` we want to discard the transaction. + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.'); + + if (client) { + client.recordDroppedEvent('sample_rate', 'transaction'); + } + + return undefined; + } + + const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(s => s !== this && s.endTimestamp) : []; + + if (this._trimEnd && finishedSpans.length > 0) { + this.endTimestamp = finishedSpans.reduce((prev, current) => { + if (prev.endTimestamp && current.endTimestamp) { + return prev.endTimestamp > current.endTimestamp ? prev : current; + } + return prev; + }).endTimestamp; + } + + const metadata = this.metadata; + + const transaction = { + contexts: { + ...this._contexts, + // We don't want to override trace context + trace: this.getTraceContext(), + }, + spans: finishedSpans, + start_timestamp: this.startTimestamp, + tags: this.tags, + timestamp: this.endTimestamp, + transaction: this.name, + type: 'transaction', + sdkProcessingMetadata: { + ...metadata, + dynamicSamplingContext: this.getDynamicSamplingContext(), + }, + ...(metadata.source && { + transaction_info: { + source: metadata.source, + }, + }), + }; + + const hasMeasurements = Object.keys(this._measurements).length > 0; + + if (hasMeasurements) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.log( + '[Measurements] Adding measurements to transaction', + JSON.stringify(this._measurements, undefined, 2), + ); + transaction.measurements = this._measurements; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`); + + return transaction; + } +} + + +//# sourceMappingURL=transaction.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/tracing/utils.js": +/*!********************************************************!*\ + !*** ./node_modules/@sentry/core/esm/tracing/utils.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TRACEPARENT_REGEXP: () => (/* reexport safe */ _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.TRACEPARENT_REGEXP), +/* harmony export */ extractTraceparentData: () => (/* reexport safe */ _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.extractTraceparentData), +/* harmony export */ getActiveTransaction: () => (/* binding */ getActiveTransaction), +/* harmony export */ stripUrlQueryAndFragment: () => (/* reexport safe */ _sentry_utils__WEBPACK_IMPORTED_MODULE_1__.stripUrlQueryAndFragment) +/* harmony export */ }); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hub.js */ "./node_modules/@sentry/core/esm/hub.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/tracing.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/url.js"); + + + +/** Grabs active transaction off scope, if any */ +function getActiveTransaction(maybeHub) { + const hub = maybeHub || (0,_hub_js__WEBPACK_IMPORTED_MODULE_2__.getCurrentHub)(); + const scope = hub.getScope(); + return scope.getTransaction() ; +} + + +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/transports/base.js": +/*!**********************************************************!*\ + !*** ./node_modules/@sentry/core/esm/transports/base.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEFAULT_TRANSPORT_BUFFER_SIZE: () => (/* binding */ DEFAULT_TRANSPORT_BUFFER_SIZE), +/* harmony export */ createTransport: () => (/* binding */ createTransport) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/promisebuffer.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/envelope.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/ratelimit.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/syncpromise.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/error.js"); + + +const DEFAULT_TRANSPORT_BUFFER_SIZE = 30; + +/** + * Creates an instance of a Sentry `Transport` + * + * @param options + * @param makeRequest + */ +function createTransport( + options, + makeRequest, + buffer = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.makePromiseBuffer)( + options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE, + ), +) { + let rateLimits = {}; + const flush = (timeout) => buffer.drain(timeout); + + function send(envelope) { + const filteredEnvelopeItems = []; + + // Drop rate limited items from envelope + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.forEachEnvelopeItem)(envelope, (item, type) => { + const envelopeItemDataCategory = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.envelopeItemTypeToDataCategory)(type); + if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.isRateLimited)(rateLimits, envelopeItemDataCategory)) { + const event = getEventForEnvelopeItem(item, type); + options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event); + } else { + filteredEnvelopeItems.push(item); + } + }); + + // Skip sending if envelope is empty after filtering out rate limited events + if (filteredEnvelopeItems.length === 0) { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.resolvedSyncPromise)(); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const filteredEnvelope = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.createEnvelope)(envelope[0], filteredEnvelopeItems ); + + // Creates client report for each item in an envelope + const recordEnvelopeLoss = (reason) => { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.forEachEnvelopeItem)(filteredEnvelope, (item, type) => { + const event = getEventForEnvelopeItem(item, type); + options.recordDroppedEvent(reason, (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.envelopeItemTypeToDataCategory)(type), event); + }); + }; + + const requestTask = () => + makeRequest({ body: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.serializeEnvelope)(filteredEnvelope, options.textEncoder) }).then( + response => { + // We don't want to throw on NOK responses, but we want to at least log them + if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); + } + + rateLimits = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.updateRateLimits)(rateLimits, response); + return response; + }, + error => { + recordEnvelopeLoss('network_error'); + throw error; + }, + ); + + return buffer.add(requestTask).then( + result => result, + error => { + if (error instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_5__.SentryError) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('Skipped sending event because buffer is full.'); + recordEnvelopeLoss('queue_overflow'); + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.resolvedSyncPromise)(); + } else { + throw error; + } + }, + ); + } + + // We use this to identifify if the transport is the base transport + // TODO (v8): Remove this again as we'll no longer need it + send.__sentry__baseTransport__ = true; + + return { + send, + flush, + }; +} + +function getEventForEnvelopeItem(item, type) { + if (type !== 'event' && type !== 'transaction') { + return undefined; + } + + return Array.isArray(item) ? (item )[1] : undefined; +} + + +//# sourceMappingURL=base.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/utils/hasTracingEnabled.js": +/*!******************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/utils/hasTracingEnabled.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ hasTracingEnabled: () => (/* binding */ hasTracingEnabled) +/* harmony export */ }); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../hub.js */ "./node_modules/@sentry/core/esm/hub.js"); + + +// Treeshakable guard to remove all code related to tracing + +/** + * Determines if tracing is currently enabled. + * + * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config. + */ +function hasTracingEnabled( + maybeOptions, +) { + if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) { + return false; + } + + const client = (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().getClient(); + const options = maybeOptions || (client && client.getOptions()); + return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options); +} + + +//# sourceMappingURL=hasTracingEnabled.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/utils/isSentryRequestUrl.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/utils/isSentryRequestUrl.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isSentryRequestUrl: () => (/* binding */ isSentryRequestUrl) +/* harmony export */ }); +/** + * Checks whether given url points to Sentry server + * @param url url to verify + */ +function isSentryRequestUrl(url, hub) { + const client = hub.getClient(); + const dsn = client && client.getDsn(); + const tunnel = client && client.getOptions().tunnel; + + return checkDsn(url, dsn) || checkTunnel(url, tunnel); +} + +function checkTunnel(url, tunnel) { + if (!tunnel) { + return false; + } + + return removeTrailingSlash(url) === removeTrailingSlash(tunnel); +} + +function checkDsn(url, dsn) { + return dsn ? url.includes(dsn.host) : false; +} + +function removeTrailingSlash(str) { + return str[str.length - 1] === '/' ? str.slice(0, -1) : str; +} + + +//# sourceMappingURL=isSentryRequestUrl.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/utils/prepareEvent.js": +/*!*************************************************************!*\ + !*** ./node_modules/@sentry/core/esm/utils/prepareEvent.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applyDebugIds: () => (/* binding */ applyDebugIds), +/* harmony export */ applyDebugMeta: () => (/* binding */ applyDebugMeta), +/* harmony export */ prepareEvent: () => (/* binding */ prepareEvent) +/* harmony export */ }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/time.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/syncpromise.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/string.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/worldwide.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/normalize.js"); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants.js */ "./node_modules/@sentry/core/esm/constants.js"); +/* harmony import */ var _eventProcessors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../eventProcessors.js */ "./node_modules/@sentry/core/esm/eventProcessors.js"); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scope.js */ "./node_modules/@sentry/core/esm/scope.js"); + + + + + +/** + * Adds common information to events. + * + * The information includes release and environment from `options`, + * breadcrumbs and context (extra, tags and user) from the scope. + * + * Information that is already present in the event is never overwritten. For + * nested objects, such as the context, keys are merged. + * + * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`. + * + * @param event The original event. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A new event with more information. + * @hidden + */ +function prepareEvent( + options, + event, + hint, + scope, + client, +) { + const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options; + const prepared = { + ...event, + event_id: event.event_id || hint.event_id || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.uuid4)(), + timestamp: event.timestamp || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.dateTimestampInSeconds)(), + }; + const integrations = hint.integrations || options.integrations.map(i => i.name); + + applyClientOptions(prepared, options); + applyIntegrationsMetadata(prepared, integrations); + + // Only put debug IDs onto frames for error events. + if (event.type === undefined) { + applyDebugIds(prepared, options.stackParser); + } + + // If we have scope given to us, use it as the base for further modifications. + // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. + let finalScope = scope; + if (hint.captureContext) { + finalScope = _scope_js__WEBPACK_IMPORTED_MODULE_2__.Scope.clone(finalScope).update(hint.captureContext); + } + + // We prepare the result here with a resolved Event. + let result = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.resolvedSyncPromise)(prepared); + + const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : []; + + // This should be the last thing called, since we want that + // {@link Hub.addEventProcessor} gets the finished prepared event. + // + // We need to check for the existence of `finalScope.getAttachments` + // because `getAttachments` can be undefined if users are using an older version + // of `@sentry/core` that does not have the `getAttachments` method. + // See: https://github.com/getsentry/sentry-javascript/issues/5229 + if (finalScope) { + // Collect attachments from the hint and scope + if (finalScope.getAttachments) { + const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()]; + + if (attachments.length) { + hint.attachments = attachments; + } + } + + // In case we have a hub we reassign it. + result = finalScope.applyToEvent(prepared, hint, clientEventProcessors); + } else { + // Apply client & global event processors even if there is no scope + // TODO (v8): Update the order to be Global > Client + result = (0,_eventProcessors_js__WEBPACK_IMPORTED_MODULE_4__.notifyEventProcessors)([...clientEventProcessors, ...(0,_eventProcessors_js__WEBPACK_IMPORTED_MODULE_4__.getGlobalEventProcessors)()], prepared, hint); + } + + return result.then(evt => { + if (evt) { + // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified + // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed. + // This should not cause any PII issues, since we're only moving data that is already on the event and not adding + // any new data + applyDebugMeta(evt); + } + + if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { + return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); + } + return evt; + }); +} + +/** + * Enhances event using the client configuration. + * It takes care of all "static" values like environment, release and `dist`, + * as well as truncating overly long values. + * @param event event instance to be enhanced + */ +function applyClientOptions(event, options) { + const { environment, release, dist, maxValueLength = 250 } = options; + + if (!('environment' in event)) { + event.environment = 'environment' in options ? environment : _constants_js__WEBPACK_IMPORTED_MODULE_5__.DEFAULT_ENVIRONMENT; + } + + if (event.release === undefined && release !== undefined) { + event.release = release; + } + + if (event.dist === undefined && dist !== undefined) { + event.dist = dist; + } + + if (event.message) { + event.message = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.truncate)(event.message, maxValueLength); + } + + const exception = event.exception && event.exception.values && event.exception.values[0]; + if (exception && exception.value) { + exception.value = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.truncate)(exception.value, maxValueLength); + } + + const request = event.request; + if (request && request.url) { + request.url = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.truncate)(request.url, maxValueLength); + } +} + +const debugIdStackParserCache = new WeakMap(); + +/** + * Puts debug IDs into the stack frames of an error event. + */ +function applyDebugIds(event, stackParser) { + const debugIdMap = _sentry_utils__WEBPACK_IMPORTED_MODULE_7__.GLOBAL_OBJ._sentryDebugIds; + + if (!debugIdMap) { + return; + } + + let debugIdStackFramesCache; + const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser); + if (cachedDebugIdStackFrameCache) { + debugIdStackFramesCache = cachedDebugIdStackFrameCache; + } else { + debugIdStackFramesCache = new Map(); + debugIdStackParserCache.set(stackParser, debugIdStackFramesCache); + } + + // Build a map of filename -> debug_id + const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => { + let parsedStack; + const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace); + if (cachedParsedStack) { + parsedStack = cachedParsedStack; + } else { + parsedStack = stackParser(debugIdStackTrace); + debugIdStackFramesCache.set(debugIdStackTrace, parsedStack); + } + + for (let i = parsedStack.length - 1; i >= 0; i--) { + const stackFrame = parsedStack[i]; + if (stackFrame.filename) { + acc[stackFrame.filename] = debugIdMap[debugIdStackTrace]; + break; + } + } + return acc; + }, {}); + + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + exception.stacktrace.frames.forEach(frame => { + if (frame.filename) { + frame.debug_id = filenameDebugIdMap[frame.filename]; + } + }); + }); + } catch (e) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } +} + +/** + * Moves debug IDs from the stack frames of an error event into the debug_meta field. + */ +function applyDebugMeta(event) { + // Extract debug IDs and filenames from the stack frames on the event. + const filenameDebugIdMap = {}; + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + event.exception.values.forEach(exception => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + exception.stacktrace.frames.forEach(frame => { + if (frame.debug_id) { + if (frame.abs_path) { + filenameDebugIdMap[frame.abs_path] = frame.debug_id; + } else if (frame.filename) { + filenameDebugIdMap[frame.filename] = frame.debug_id; + } + delete frame.debug_id; + } + }); + }); + } catch (e) { + // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. + } + + if (Object.keys(filenameDebugIdMap).length === 0) { + return; + } + + // Fill debug_meta information + event.debug_meta = event.debug_meta || {}; + event.debug_meta.images = event.debug_meta.images || []; + const images = event.debug_meta.images; + Object.keys(filenameDebugIdMap).forEach(filename => { + images.push({ + type: 'sourcemap', + code_file: filename, + debug_id: filenameDebugIdMap[filename], + }); + }); +} + +/** + * This function adds all used integrations to the SDK info in the event. + * @param event The event that will be filled with all integrations. + */ +function applyIntegrationsMetadata(event, integrationNames) { + if (integrationNames.length > 0) { + event.sdk = event.sdk || {}; + event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames]; + } +} + +/** + * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. + * Normalized keys: + * - `breadcrumbs.data` + * - `user` + * - `contexts` + * - `extra` + * @param event Event + * @returns Normalized event + */ +function normalizeEvent(event, depth, maxBreadth) { + if (!event) { + return null; + } + + const normalized = { + ...event, + ...(event.breadcrumbs && { + breadcrumbs: event.breadcrumbs.map(b => ({ + ...b, + ...(b.data && { + data: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.normalize)(b.data, depth, maxBreadth), + }), + })), + }), + ...(event.user && { + user: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.normalize)(event.user, depth, maxBreadth), + }), + ...(event.contexts && { + contexts: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.normalize)(event.contexts, depth, maxBreadth), + }), + ...(event.extra && { + extra: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.normalize)(event.extra, depth, maxBreadth), + }), + }; + + // event.contexts.trace stores information about a Transaction. Similarly, + // event.spans[] stores information about child Spans. Given that a + // Transaction is conceptually a Span, normalization should apply to both + // Transactions and Spans consistently. + // For now the decision is to skip normalization of Transactions and Spans, + // so this block overwrites the normalized event to add back the original + // Transaction information prior to normalization. + if (event.contexts && event.contexts.trace && normalized.contexts) { + normalized.contexts.trace = event.contexts.trace; + + // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it + if (event.contexts.trace.data) { + normalized.contexts.trace.data = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.normalize)(event.contexts.trace.data, depth, maxBreadth); + } + } + + // event.spans[].data may contain circular/dangerous data so we need to normalize it + if (event.spans) { + normalized.spans = event.spans.map(span => { + // We cannot use the spread operator here because `toJSON` on `span` is non-enumerable + if (span.data) { + span.data = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.normalize)(span.data, depth, maxBreadth); + } + return span; + }); + } + + return normalized; +} + + +//# sourceMappingURL=prepareEvent.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/core/esm/version.js": +/*!**************************************************!*\ + !*** ./node_modules/@sentry/core/esm/version.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SDK_VERSION: () => (/* binding */ SDK_VERSION) +/* harmony export */ }); +const SDK_VERSION = '7.73.0'; + + +//# sourceMappingURL=version.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/react/esm/sdk.js": +/*!***********************************************!*\ + !*** ./node_modules/@sentry/react/esm/sdk.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ init: () => (/* binding */ init) +/* harmony export */ }); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/browser */ "./node_modules/@sentry/core/esm/version.js"); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/browser */ "./node_modules/@sentry/browser/esm/sdk.js"); + + +/** + * Inits the React SDK + */ +function init(options) { + options._metadata = options._metadata || {}; + options._metadata.sdk = options._metadata.sdk || { + name: 'sentry.javascript.react', + packages: [ + { + name: 'npm:@sentry/react', + version: _sentry_browser__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION, + }, + ], + version: _sentry_browser__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION, + }; + (0,_sentry_browser__WEBPACK_IMPORTED_MODULE_1__.init)(options); +} + + +//# sourceMappingURL=sdk.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/replay/esm/index.js": +/*!**************************************************!*\ + !*** ./node_modules/@sentry/replay/esm/index.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Replay: () => (/* binding */ Replay) +/* harmony export */ }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/hub.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/utils/isSentryRequestUrl.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/eventProcessors.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/utils/prepareEvent.js"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @sentry/core */ "./node_modules/@sentry/core/esm/exports.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/worldwide.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/normalize.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/browser.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/misc.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/instrument.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/string.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/time.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/envelope.js"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @sentry/utils */ "./node_modules/@sentry/utils/esm/node.js"); + + + +// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser` +// prevents the browser package from being bundled in the CDN bundle, and avoids a +// circular dependency between the browser and replay packages should `@sentry/browser` import +// from `@sentry/replay` in the future +const WINDOW = _sentry_utils__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + +const REPLAY_SESSION_KEY = 'sentryReplaySession'; +const REPLAY_EVENT_NAME = 'replay_event'; +const UNABLE_TO_SEND_REPLAY = 'Unable to send Replay'; + +// The idle limit for a session after which recording is paused. +const SESSION_IDLE_PAUSE_DURATION = 300000; // 5 minutes in ms + +// The idle limit for a session after which the session expires. +const SESSION_IDLE_EXPIRE_DURATION = 900000; // 15 minutes in ms + +/** Default flush delays */ +const DEFAULT_FLUSH_MIN_DELAY = 5000; +// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it +// was the same as `wait` +const DEFAULT_FLUSH_MAX_DELAY = 5500; + +/* How long to wait for error checkouts */ +const BUFFER_CHECKOUT_TIME = 60000; + +const RETRY_BASE_INTERVAL = 5000; +const RETRY_MAX_COUNT = 3; + +/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be truncated. */ +const NETWORK_BODY_MAX_SIZE = 150000; + +/* The max size of a single console arg that is captured. Any arg larger than this will be truncated. */ +const CONSOLE_ARG_MAX_SIZE = 5000; + +/* Min. time to wait before we consider something a slow click. */ +const SLOW_CLICK_THRESHOLD = 3000; +/* For scroll actions after a click, we only look for a very short time period to detect programmatic scrolling. */ +const SLOW_CLICK_SCROLL_TIMEOUT = 300; + +/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */ +const REPLAY_MAX_EVENT_BUFFER_SIZE = 20000000; // ~20MB + +/** Replays must be min. 5s long before we send them. */ +const MIN_REPLAY_DURATION = 4999; +/* The max. allowed value that the minReplayDuration can be set to. */ +const MIN_REPLAY_DURATION_LIMIT = 15000; + +/** The max. length of a replay. */ +const MAX_REPLAY_DURATION = 3600000; // 60 minutes in ms; + +var NodeType$1; +(function (NodeType) { + NodeType[NodeType["Document"] = 0] = "Document"; + NodeType[NodeType["DocumentType"] = 1] = "DocumentType"; + NodeType[NodeType["Element"] = 2] = "Element"; + NodeType[NodeType["Text"] = 3] = "Text"; + NodeType[NodeType["CDATA"] = 4] = "CDATA"; + NodeType[NodeType["Comment"] = 5] = "Comment"; +})(NodeType$1 || (NodeType$1 = {})); + +function isElement$1(n) { + return n.nodeType === n.ELEMENT_NODE; +} +function isShadowRoot(n) { + const host = n === null || n === void 0 ? void 0 : n.host; + return Boolean((host === null || host === void 0 ? void 0 : host.shadowRoot) === n); +} +function isNativeShadowDom(shadowRoot) { + return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]'; +} +function fixBrowserCompatibilityIssuesInCSS(cssText) { + if (cssText.includes(' background-clip: text;') && + !cssText.includes(' -webkit-background-clip: text;')) { + cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;'); + } + return cssText; +} +function escapeImportStatement(rule) { + const { cssText } = rule; + if (cssText.split('"').length < 3) + return cssText; + const statement = ['@import', `url(${JSON.stringify(rule.href)})`]; + if (rule.layerName === '') { + statement.push(`layer`); + } + else if (rule.layerName) { + statement.push(`layer(${rule.layerName})`); + } + if (rule.supportsText) { + statement.push(`supports(${rule.supportsText})`); + } + if (rule.media.length) { + statement.push(rule.media.mediaText); + } + return statement.join(' ') + ';'; +} +function stringifyStylesheet(s) { + try { + const rules = s.rules || s.cssRules; + return rules + ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join('')) + : null; + } + catch (error) { + return null; + } +} +function stringifyRule(rule) { + let importStringified; + if (isCSSImportRule(rule)) { + try { + importStringified = + stringifyStylesheet(rule.styleSheet) || + escapeImportStatement(rule); + } + catch (error) { + } + } + else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) { + return fixSafariColons(rule.cssText); + } + return importStringified || rule.cssText; +} +function fixSafariColons(cssStringified) { + const regex = /(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm; + return cssStringified.replace(regex, '$1\\$2'); +} +function isCSSImportRule(rule) { + return 'styleSheet' in rule; +} +function isCSSStyleRule(rule) { + return 'selectorText' in rule; +} +class Mirror { + constructor() { + this.idNodeMap = new Map(); + this.nodeMetaMap = new WeakMap(); + } + getId(n) { + var _a; + if (!n) + return -1; + const id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id; + return id !== null && id !== void 0 ? id : -1; + } + getNode(id) { + return this.idNodeMap.get(id) || null; + } + getIds() { + return Array.from(this.idNodeMap.keys()); + } + getMeta(n) { + return this.nodeMetaMap.get(n) || null; + } + removeNodeFromMap(n) { + const id = this.getId(n); + this.idNodeMap.delete(id); + if (n.childNodes) { + n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode)); + } + } + has(id) { + return this.idNodeMap.has(id); + } + hasNode(node) { + return this.nodeMetaMap.has(node); + } + add(n, meta) { + const id = meta.id; + this.idNodeMap.set(id, n); + this.nodeMetaMap.set(n, meta); + } + replace(id, n) { + const oldNode = this.getNode(id); + if (oldNode) { + const meta = this.nodeMetaMap.get(oldNode); + if (meta) + this.nodeMetaMap.set(n, meta); + } + this.idNodeMap.set(id, n); + } + reset() { + this.idNodeMap = new Map(); + this.nodeMetaMap = new WeakMap(); + } +} +function createMirror() { + return new Mirror(); +} +function shouldMaskInput({ maskInputOptions, tagName, type, }) { + if (tagName === 'OPTION') { + tagName = 'SELECT'; + } + return Boolean(maskInputOptions[tagName.toLowerCase()] || + (type && maskInputOptions[type]) || + type === 'password' || + (tagName === 'INPUT' && !type && maskInputOptions['text'])); +} +function maskInputValue({ isMasked, element, value, maskInputFn, }) { + let text = value || ''; + if (!isMasked) { + return text; + } + if (maskInputFn) { + text = maskInputFn(text, element); + } + return '*'.repeat(text.length); +} +function toLowerCase(str) { + return str.toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +const ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__'; +function is2DCanvasBlank(canvas) { + const ctx = canvas.getContext('2d'); + if (!ctx) + return true; + const chunkSize = 50; + for (let x = 0; x < canvas.width; x += chunkSize) { + for (let y = 0; y < canvas.height; y += chunkSize) { + const getImageData = ctx.getImageData; + const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData + ? getImageData[ORIGINAL_ATTRIBUTE_NAME] + : getImageData; + const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer); + if (pixelBuffer.some((pixel) => pixel !== 0)) + return false; + } + } + return true; +} +function getInputType(element) { + const type = element.type; + return element.hasAttribute('data-rr-is-password') + ? 'password' + : type + ? + toLowerCase(type) + : null; +} +function getInputValue(el, tagName, type) { + if (tagName === 'INPUT' && (type === 'radio' || type === 'checkbox')) { + return el.getAttribute('value') || ''; + } + return el.value; +} + +let _id = 1; +const tagNameRegex = new RegExp('[^a-z0-9-_:]'); +const IGNORED_NODE = -2; +function genId() { + return _id++; +} +function getValidTagName(element) { + if (element instanceof HTMLFormElement) { + return 'form'; + } + const processedTagName = toLowerCase(element.tagName); + if (tagNameRegex.test(processedTagName)) { + return 'div'; + } + return processedTagName; +} +function extractOrigin(url) { + let origin = ''; + if (url.indexOf('//') > -1) { + origin = url.split('/').slice(0, 3).join('/'); + } + else { + origin = url.split('/')[0]; + } + origin = origin.split('?')[0]; + return origin; +} +let canvasService; +let canvasCtx; +const URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm; +const URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\/\//i; +const URL_WWW_MATCH = /^www\..*/i; +const DATA_URI = /^(data:)([^,]*),(.*)/i; +function absoluteToStylesheet(cssText, href) { + return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => { + const filePath = path1 || path2 || path3; + const maybeQuote = quote1 || quote2 || ''; + if (!filePath) { + return origin; + } + if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) { + return `url(${maybeQuote}${filePath}${maybeQuote})`; + } + if (DATA_URI.test(filePath)) { + return `url(${maybeQuote}${filePath}${maybeQuote})`; + } + if (filePath[0] === '/') { + return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`; + } + const stack = href.split('/'); + const parts = filePath.split('/'); + stack.pop(); + for (const part of parts) { + if (part === '.') { + continue; + } + else if (part === '..') { + stack.pop(); + } + else { + stack.push(part); + } + } + return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`; + }); +} +const SRCSET_NOT_SPACES = /^[^ \t\n\r\u000c]+/; +const SRCSET_COMMAS_OR_SPACES = /^[, \t\n\r\u000c]+/; +function getAbsoluteSrcsetString(doc, attributeValue) { + if (attributeValue.trim() === '') { + return attributeValue; + } + let pos = 0; + function collectCharacters(regEx) { + let chars; + const match = regEx.exec(attributeValue.substring(pos)); + if (match) { + chars = match[0]; + pos += chars.length; + return chars; + } + return ''; + } + const output = []; + while (true) { + collectCharacters(SRCSET_COMMAS_OR_SPACES); + if (pos >= attributeValue.length) { + break; + } + let url = collectCharacters(SRCSET_NOT_SPACES); + if (url.slice(-1) === ',') { + url = absoluteToDoc(doc, url.substring(0, url.length - 1)); + output.push(url); + } + else { + let descriptorsStr = ''; + url = absoluteToDoc(doc, url); + let inParens = false; + while (true) { + const c = attributeValue.charAt(pos); + if (c === '') { + output.push((url + descriptorsStr).trim()); + break; + } + else if (!inParens) { + if (c === ',') { + pos += 1; + output.push((url + descriptorsStr).trim()); + break; + } + else if (c === '(') { + inParens = true; + } + } + else { + if (c === ')') { + inParens = false; + } + } + descriptorsStr += c; + pos += 1; + } + } + } + return output.join(', '); +} +function absoluteToDoc(doc, attributeValue) { + if (!attributeValue || attributeValue.trim() === '') { + return attributeValue; + } + const a = doc.createElement('a'); + a.href = attributeValue; + return a.href; +} +function isSVGElement(el) { + return Boolean(el.tagName === 'svg' || el.ownerSVGElement); +} +function getHref() { + const a = document.createElement('a'); + a.href = ''; + return a.href; +} +function transformAttribute(doc, tagName, name, value, element, maskAttributeFn) { + if (!value) { + return value; + } + if (name === 'src' || + (name === 'href' && !(tagName === 'use' && value[0] === '#'))) { + return absoluteToDoc(doc, value); + } + else if (name === 'xlink:href' && value[0] !== '#') { + return absoluteToDoc(doc, value); + } + else if (name === 'background' && + (tagName === 'table' || tagName === 'td' || tagName === 'th')) { + return absoluteToDoc(doc, value); + } + else if (name === 'srcset') { + return getAbsoluteSrcsetString(doc, value); + } + else if (name === 'style') { + return absoluteToStylesheet(value, getHref()); + } + else if (tagName === 'object' && name === 'data') { + return absoluteToDoc(doc, value); + } + if (typeof maskAttributeFn === 'function') { + return maskAttributeFn(name, value, element); + } + return value; +} +function ignoreAttribute(tagName, name, _value) { + return (tagName === 'video' || tagName === 'audio') && name === 'autoplay'; +} +function _isBlockedElement(element, blockClass, blockSelector, unblockSelector) { + try { + if (unblockSelector && element.matches(unblockSelector)) { + return false; + } + if (typeof blockClass === 'string') { + if (element.classList.contains(blockClass)) { + return true; + } + } + else { + for (let eIndex = element.classList.length; eIndex--;) { + const className = element.classList[eIndex]; + if (blockClass.test(className)) { + return true; + } + } + } + if (blockSelector) { + return element.matches(blockSelector); + } + } + catch (e) { + } + return false; +} +function elementClassMatchesRegex(el, regex) { + for (let eIndex = el.classList.length; eIndex--;) { + const className = el.classList[eIndex]; + if (regex.test(className)) { + return true; + } + } + return false; +} +function distanceToMatch(node, matchPredicate, limit = Infinity, distance = 0) { + if (!node) + return -1; + if (node.nodeType !== node.ELEMENT_NODE) + return -1; + if (distance > limit) + return -1; + if (matchPredicate(node)) + return distance; + return distanceToMatch(node.parentNode, matchPredicate, limit, distance + 1); +} +function createMatchPredicate(className, selector) { + return (node) => { + const el = node; + if (el === null) + return false; + if (className) { + if (typeof className === 'string') { + if (el.matches(`.${className}`)) + return true; + } + else if (elementClassMatchesRegex(el, className)) { + return true; + } + } + if (selector && el.matches(selector)) + return true; + return false; + }; +} +function needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText) { + try { + const el = node.nodeType === node.ELEMENT_NODE + ? node + : node.parentElement; + if (el === null) + return false; + let maskDistance = -1; + let unmaskDistance = -1; + if (maskAllText) { + unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector)); + if (unmaskDistance < 0) { + return true; + } + maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector), unmaskDistance >= 0 ? unmaskDistance : Infinity); + } + else { + maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector)); + if (maskDistance < 0) { + return false; + } + unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector), maskDistance >= 0 ? maskDistance : Infinity); + } + return maskDistance >= 0 + ? unmaskDistance >= 0 + ? maskDistance <= unmaskDistance + : true + : unmaskDistance >= 0 + ? false + : !!maskAllText; + } + catch (e) { + } + return !!maskAllText; +} +function onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) { + const win = iframeEl.contentWindow; + if (!win) { + return; + } + let fired = false; + let readyState; + try { + readyState = win.document.readyState; + } + catch (error) { + return; + } + if (readyState !== 'complete') { + const timer = setTimeout(() => { + if (!fired) { + listener(); + fired = true; + } + }, iframeLoadTimeout); + iframeEl.addEventListener('load', () => { + clearTimeout(timer); + fired = true; + listener(); + }); + return; + } + const blankUrl = 'about:blank'; + if (win.location.href !== blankUrl || + iframeEl.src === blankUrl || + iframeEl.src === '') { + setTimeout(listener, 0); + return iframeEl.addEventListener('load', listener); + } + iframeEl.addEventListener('load', listener); +} +function onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) { + let fired = false; + let styleSheetLoaded; + try { + styleSheetLoaded = link.sheet; + } + catch (error) { + return; + } + if (styleSheetLoaded) + return; + const timer = setTimeout(() => { + if (!fired) { + listener(); + fired = true; + } + }, styleSheetLoadTimeout); + link.addEventListener('load', () => { + clearTimeout(timer); + fired = true; + listener(); + }); +} +function serializeNode(n, options) { + const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskAttributeFn, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, } = options; + const rootId = getRootId(doc, mirror); + switch (n.nodeType) { + case n.DOCUMENT_NODE: + if (n.compatMode !== 'CSS1Compat') { + return { + type: NodeType$1.Document, + childNodes: [], + compatMode: n.compatMode, + }; + } + else { + return { + type: NodeType$1.Document, + childNodes: [], + }; + } + case n.DOCUMENT_TYPE_NODE: + return { + type: NodeType$1.DocumentType, + name: n.name, + publicId: n.publicId, + systemId: n.systemId, + rootId, + }; + case n.ELEMENT_NODE: + return serializeElementNode(n, { + doc, + blockClass, + blockSelector, + unblockSelector, + inlineStylesheet, + maskAttributeFn, + maskInputOptions, + maskInputFn, + dataURLOptions, + inlineImages, + recordCanvas, + keepIframeSrcFn, + newlyAddedElement, + rootId, + maskAllText, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + }); + case n.TEXT_NODE: + return serializeTextNode(n, { + maskAllText, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + maskTextFn, + maskInputOptions, + maskInputFn, + rootId, + }); + case n.CDATA_SECTION_NODE: + return { + type: NodeType$1.CDATA, + textContent: '', + rootId, + }; + case n.COMMENT_NODE: + return { + type: NodeType$1.Comment, + textContent: n.textContent || '', + rootId, + }; + default: + return false; + } +} +function getRootId(doc, mirror) { + if (!mirror.hasNode(doc)) + return undefined; + const docId = mirror.getId(doc); + return docId === 1 ? undefined : docId; +} +function serializeTextNode(n, options) { + var _a; + const { maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, maskTextFn, maskInputOptions, maskInputFn, rootId, } = options; + const parentTagName = n.parentNode && n.parentNode.tagName; + let textContent = n.textContent; + const isStyle = parentTagName === 'STYLE' ? true : undefined; + const isScript = parentTagName === 'SCRIPT' ? true : undefined; + const isTextarea = parentTagName === 'TEXTAREA' ? true : undefined; + if (isStyle && textContent) { + try { + if (n.nextSibling || n.previousSibling) { + } + else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) { + textContent = stringifyStylesheet(n.parentNode.sheet); + } + } + catch (err) { + console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n); + } + textContent = absoluteToStylesheet(textContent, getHref()); + } + if (isScript) { + textContent = 'SCRIPT_PLACEHOLDER'; + } + const forceMask = needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText); + if (!isStyle && !isScript && !isTextarea && textContent && forceMask) { + textContent = maskTextFn + ? maskTextFn(textContent) + : textContent.replace(/[\S]/g, '*'); + } + if (isTextarea && textContent && (maskInputOptions.textarea || forceMask)) { + textContent = maskInputFn + ? maskInputFn(textContent, n.parentNode) + : textContent.replace(/[\S]/g, '*'); + } + if (parentTagName === 'OPTION' && textContent) { + const isInputMasked = shouldMaskInput({ + type: null, + tagName: parentTagName, + maskInputOptions, + }); + textContent = maskInputValue({ + isMasked: needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked), + element: n, + value: textContent, + maskInputFn, + }); + } + return { + type: NodeType$1.Text, + textContent: textContent || '', + isStyle, + rootId, + }; +} +function serializeElementNode(n, options) { + const { doc, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, } = options; + const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector); + const tagName = getValidTagName(n); + let attributes = {}; + const len = n.attributes.length; + for (let i = 0; i < len; i++) { + const attr = n.attributes[i]; + if (!ignoreAttribute(tagName, attr.name, attr.value)) { + attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value, n, maskAttributeFn); + } + } + if (tagName === 'link' && inlineStylesheet) { + const stylesheet = Array.from(doc.styleSheets).find((s) => { + return s.href === n.href; + }); + let cssText = null; + if (stylesheet) { + cssText = stringifyStylesheet(stylesheet); + } + if (cssText) { + delete attributes.rel; + delete attributes.href; + attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href); + } + } + if (tagName === 'style' && + n.sheet && + !(n.innerText || n.textContent || '').trim().length) { + const cssText = stringifyStylesheet(n.sheet); + if (cssText) { + attributes._cssText = absoluteToStylesheet(cssText, getHref()); + } + } + if (tagName === 'input' || + tagName === 'textarea' || + tagName === 'select' || + tagName === 'option') { + const el = n; + const type = getInputType(el); + const value = getInputValue(el, toUpperCase(tagName), type); + const checked = el.checked; + if (type !== 'submit' && type !== 'button' && value) { + const forceMask = needMaskingText(el, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, shouldMaskInput({ + type, + tagName: toUpperCase(tagName), + maskInputOptions, + })); + attributes.value = maskInputValue({ + isMasked: forceMask, + element: el, + value, + maskInputFn, + }); + } + if (checked) { + attributes.checked = checked; + } + } + if (tagName === 'option') { + if (n.selected && !maskInputOptions['select']) { + attributes.selected = true; + } + else { + delete attributes.selected; + } + } + if (tagName === 'canvas' && recordCanvas) { + if (n.__context === '2d') { + if (!is2DCanvasBlank(n)) { + attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality); + } + } + else if (!('__context' in n)) { + const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality); + const blankCanvas = document.createElement('canvas'); + blankCanvas.width = n.width; + blankCanvas.height = n.height; + const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality); + if (canvasDataURL !== blankCanvasDataURL) { + attributes.rr_dataURL = canvasDataURL; + } + } + } + if (tagName === 'img' && inlineImages) { + if (!canvasService) { + canvasService = doc.createElement('canvas'); + canvasCtx = canvasService.getContext('2d'); + } + const image = n; + const oldValue = image.crossOrigin; + image.crossOrigin = 'anonymous'; + const recordInlineImage = () => { + image.removeEventListener('load', recordInlineImage); + try { + canvasService.width = image.naturalWidth; + canvasService.height = image.naturalHeight; + canvasCtx.drawImage(image, 0, 0); + attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality); + } + catch (err) { + console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`); + } + oldValue + ? (attributes.crossOrigin = oldValue) + : image.removeAttribute('crossorigin'); + }; + if (image.complete && image.naturalWidth !== 0) + recordInlineImage(); + else + image.addEventListener('load', recordInlineImage); + } + if (tagName === 'audio' || tagName === 'video') { + attributes.rr_mediaState = n.paused + ? 'paused' + : 'played'; + attributes.rr_mediaCurrentTime = n.currentTime; + } + if (!newlyAddedElement) { + if (n.scrollLeft) { + attributes.rr_scrollLeft = n.scrollLeft; + } + if (n.scrollTop) { + attributes.rr_scrollTop = n.scrollTop; + } + } + if (needBlock) { + const { width, height } = n.getBoundingClientRect(); + attributes = { + class: attributes.class, + rr_width: `${width}px`, + rr_height: `${height}px`, + }; + } + if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) { + if (!n.contentDocument) { + attributes.rr_src = attributes.src; + } + delete attributes.src; + } + let isCustomElement; + try { + if (customElements.get(tagName)) + isCustomElement = true; + } + catch (e) { + } + return { + type: NodeType$1.Element, + tagName, + attributes, + childNodes: [], + isSVG: isSVGElement(n) || undefined, + needBlock, + rootId, + isCustom: isCustomElement, + }; +} +function lowerIfExists(maybeAttr) { + if (maybeAttr === undefined || maybeAttr === null) { + return ''; + } + else { + return maybeAttr.toLowerCase(); + } +} +function slimDOMExcluded(sn, slimDOMOptions) { + if (slimDOMOptions.comment && sn.type === NodeType$1.Comment) { + return true; + } + else if (sn.type === NodeType$1.Element) { + if (slimDOMOptions.script && + (sn.tagName === 'script' || + (sn.tagName === 'link' && + (sn.attributes.rel === 'preload' || + sn.attributes.rel === 'modulepreload') && + sn.attributes.as === 'script') || + (sn.tagName === 'link' && + sn.attributes.rel === 'prefetch' && + typeof sn.attributes.href === 'string' && + sn.attributes.href.endsWith('.js')))) { + return true; + } + else if (slimDOMOptions.headFavicon && + ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') || + (sn.tagName === 'meta' && + (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) || + lowerIfExists(sn.attributes.name) === 'application-name' || + lowerIfExists(sn.attributes.rel) === 'icon' || + lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' || + lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) { + return true; + } + else if (sn.tagName === 'meta') { + if (slimDOMOptions.headMetaDescKeywords && + lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) { + return true; + } + else if (slimDOMOptions.headMetaSocial && + (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) || + lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) || + lowerIfExists(sn.attributes.name) === 'pinterest')) { + return true; + } + else if (slimDOMOptions.headMetaRobots && + (lowerIfExists(sn.attributes.name) === 'robots' || + lowerIfExists(sn.attributes.name) === 'googlebot' || + lowerIfExists(sn.attributes.name) === 'bingbot')) { + return true; + } + else if (slimDOMOptions.headMetaHttpEquiv && + sn.attributes['http-equiv'] !== undefined) { + return true; + } + else if (slimDOMOptions.headMetaAuthorship && + (lowerIfExists(sn.attributes.name) === 'author' || + lowerIfExists(sn.attributes.name) === 'generator' || + lowerIfExists(sn.attributes.name) === 'framework' || + lowerIfExists(sn.attributes.name) === 'publisher' || + lowerIfExists(sn.attributes.name) === 'progid' || + lowerIfExists(sn.attributes.property).match(/^article:/) || + lowerIfExists(sn.attributes.property).match(/^product:/))) { + return true; + } + else if (slimDOMOptions.headMetaVerification && + (lowerIfExists(sn.attributes.name) === 'google-site-verification' || + lowerIfExists(sn.attributes.name) === 'yandex-verification' || + lowerIfExists(sn.attributes.name) === 'csrf-token' || + lowerIfExists(sn.attributes.name) === 'p:domain_verify' || + lowerIfExists(sn.attributes.name) === 'verify-v1' || + lowerIfExists(sn.attributes.name) === 'verification' || + lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) { + return true; + } + } + } + return false; +} +function serializeNodeWithId(n, options) { + const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskAttributeFn, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, onStylesheetLoad, stylesheetLoadTimeout = 5000, keepIframeSrcFn = () => false, newlyAddedElement = false, } = options; + let { preserveWhiteSpace = true } = options; + const _serializedNode = serializeNode(n, { + doc, + mirror, + blockClass, + blockSelector, + maskAllText, + unblockSelector, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + inlineStylesheet, + maskInputOptions, + maskAttributeFn, + maskTextFn, + maskInputFn, + dataURLOptions, + inlineImages, + recordCanvas, + keepIframeSrcFn, + newlyAddedElement, + }); + if (!_serializedNode) { + console.warn(n, 'not serialized'); + return null; + } + let id; + if (mirror.hasNode(n)) { + id = mirror.getId(n); + } + else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || + (!preserveWhiteSpace && + _serializedNode.type === NodeType$1.Text && + !_serializedNode.isStyle && + !_serializedNode.textContent.replace(/^\s+|\s+$/gm, '').length)) { + id = IGNORED_NODE; + } + else { + id = genId(); + } + const serializedNode = Object.assign(_serializedNode, { id }); + mirror.add(n, serializedNode); + if (id === IGNORED_NODE) { + return null; + } + if (onSerialize) { + onSerialize(n); + } + let recordChild = !skipChild; + if (serializedNode.type === NodeType$1.Element) { + recordChild = recordChild && !serializedNode.needBlock; + delete serializedNode.needBlock; + const shadowRoot = n.shadowRoot; + if (shadowRoot && isNativeShadowDom(shadowRoot)) + serializedNode.isShadowHost = true; + } + if ((serializedNode.type === NodeType$1.Document || + serializedNode.type === NodeType$1.Element) && + recordChild) { + if (slimDOMOptions.headWhitespace && + serializedNode.type === NodeType$1.Element && + serializedNode.tagName === 'head') { + preserveWhiteSpace = false; + } + const bypassOptions = { + doc, + mirror, + blockClass, + blockSelector, + maskAllText, + unblockSelector, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + skipChild, + inlineStylesheet, + maskInputOptions, + maskAttributeFn, + maskTextFn, + maskInputFn, + slimDOMOptions, + dataURLOptions, + inlineImages, + recordCanvas, + preserveWhiteSpace, + onSerialize, + onIframeLoad, + iframeLoadTimeout, + onStylesheetLoad, + stylesheetLoadTimeout, + keepIframeSrcFn, + }; + for (const childN of Array.from(n.childNodes)) { + const serializedChildNode = serializeNodeWithId(childN, bypassOptions); + if (serializedChildNode) { + serializedNode.childNodes.push(serializedChildNode); + } + } + if (isElement$1(n) && n.shadowRoot) { + for (const childN of Array.from(n.shadowRoot.childNodes)) { + const serializedChildNode = serializeNodeWithId(childN, bypassOptions); + if (serializedChildNode) { + isNativeShadowDom(n.shadowRoot) && + (serializedChildNode.isShadow = true); + serializedNode.childNodes.push(serializedChildNode); + } + } + } + } + if (n.parentNode && + isShadowRoot(n.parentNode) && + isNativeShadowDom(n.parentNode)) { + serializedNode.isShadow = true; + } + if (serializedNode.type === NodeType$1.Element && + serializedNode.tagName === 'iframe') { + onceIframeLoaded(n, () => { + const iframeDoc = n.contentDocument; + if (iframeDoc && onIframeLoad) { + const serializedIframeNode = serializeNodeWithId(iframeDoc, { + doc: iframeDoc, + mirror, + blockClass, + blockSelector, + unblockSelector, + maskAllText, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + skipChild: false, + inlineStylesheet, + maskInputOptions, + maskAttributeFn, + maskTextFn, + maskInputFn, + slimDOMOptions, + dataURLOptions, + inlineImages, + recordCanvas, + preserveWhiteSpace, + onSerialize, + onIframeLoad, + iframeLoadTimeout, + onStylesheetLoad, + stylesheetLoadTimeout, + keepIframeSrcFn, + }); + if (serializedIframeNode) { + onIframeLoad(n, serializedIframeNode); + } + } + }, iframeLoadTimeout); + } + if (serializedNode.type === NodeType$1.Element && + serializedNode.tagName === 'link' && + serializedNode.attributes.rel === 'stylesheet') { + onceStylesheetLoaded(n, () => { + if (onStylesheetLoad) { + const serializedLinkNode = serializeNodeWithId(n, { + doc, + mirror, + blockClass, + blockSelector, + unblockSelector, + maskAllText, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + skipChild: false, + inlineStylesheet, + maskInputOptions, + maskAttributeFn, + maskTextFn, + maskInputFn, + slimDOMOptions, + dataURLOptions, + inlineImages, + recordCanvas, + preserveWhiteSpace, + onSerialize, + onIframeLoad, + iframeLoadTimeout, + onStylesheetLoad, + stylesheetLoadTimeout, + keepIframeSrcFn, + }); + if (serializedLinkNode) { + onStylesheetLoad(n, serializedLinkNode); + } + } + }, stylesheetLoadTimeout); + } + return serializedNode; +} +function snapshot(n, options) { + const { mirror = new Mirror(), blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskAttributeFn, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = () => false, } = options || {}; + const maskInputOptions = maskAllInputs === true + ? { + color: true, + date: true, + 'datetime-local': true, + email: true, + month: true, + number: true, + range: true, + search: true, + tel: true, + text: true, + time: true, + url: true, + week: true, + textarea: true, + select: true, + } + : maskAllInputs === false + ? {} + : maskAllInputs; + const slimDOMOptions = slimDOM === true || slimDOM === 'all' + ? + { + script: true, + comment: true, + headFavicon: true, + headWhitespace: true, + headMetaDescKeywords: slimDOM === 'all', + headMetaSocial: true, + headMetaRobots: true, + headMetaHttpEquiv: true, + headMetaAuthorship: true, + headMetaVerification: true, + } + : slimDOM === false + ? {} + : slimDOM; + return serializeNodeWithId(n, { + doc: n, + mirror, + blockClass, + blockSelector, + unblockSelector, + maskAllText, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + skipChild: false, + inlineStylesheet, + maskInputOptions, + maskAttributeFn, + maskTextFn, + maskInputFn, + slimDOMOptions, + dataURLOptions, + inlineImages, + recordCanvas, + preserveWhiteSpace, + onSerialize, + onIframeLoad, + iframeLoadTimeout, + onStylesheetLoad, + stylesheetLoadTimeout, + keepIframeSrcFn, + newlyAddedElement: false, + }); +} + +function on(type, fn, target = document) { + const options = { capture: true, passive: true }; + target.addEventListener(type, fn, options); + return () => target.removeEventListener(type, fn, options); +} +const DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' + + '\r\n' + + 'now you can use replayer.getMirror() to access the mirror instance of a replayer,' + + '\r\n' + + 'or you can use record.mirror to access the mirror instance during recording.'; +let _mirror = { + map: {}, + getId() { + console.error(DEPARTED_MIRROR_ACCESS_WARNING); + return -1; + }, + getNode() { + console.error(DEPARTED_MIRROR_ACCESS_WARNING); + return null; + }, + removeNodeFromMap() { + console.error(DEPARTED_MIRROR_ACCESS_WARNING); + }, + has() { + console.error(DEPARTED_MIRROR_ACCESS_WARNING); + return false; + }, + reset() { + console.error(DEPARTED_MIRROR_ACCESS_WARNING); + }, +}; +if (typeof window !== 'undefined' && window.Proxy && window.Reflect) { + _mirror = new Proxy(_mirror, { + get(target, prop, receiver) { + if (prop === 'map') { + console.error(DEPARTED_MIRROR_ACCESS_WARNING); + } + return Reflect.get(target, prop, receiver); + }, + }); +} +function throttle$1(func, wait, options = {}) { + let timeout = null; + let previous = 0; + return function (...args) { + const now = Date.now(); + if (!previous && options.leading === false) { + previous = now; + } + const remaining = wait - (now - previous); + const context = this; + if (remaining <= 0 || remaining > wait) { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + previous = now; + func.apply(context, args); + } + else if (!timeout && options.trailing !== false) { + timeout = setTimeout(() => { + previous = options.leading === false ? 0 : Date.now(); + timeout = null; + func.apply(context, args); + }, remaining); + } + }; +} +function hookSetter(target, key, d, isRevoked, win = window) { + const original = win.Object.getOwnPropertyDescriptor(target, key); + win.Object.defineProperty(target, key, isRevoked + ? d + : { + set(value) { + setTimeout(() => { + d.set.call(this, value); + }, 0); + if (original && original.set) { + original.set.call(this, value); + } + }, + }); + return () => hookSetter(target, key, original || {}, true); +} +function patch(source, name, replacement) { + try { + if (!(name in source)) { + return () => { + }; + } + const original = source[name]; + const wrapped = replacement(original); + if (typeof wrapped === 'function') { + wrapped.prototype = wrapped.prototype || {}; + Object.defineProperties(wrapped, { + __rrweb_original__: { + enumerable: false, + value: original, + }, + }); + } + source[name] = wrapped; + return () => { + source[name] = original; + }; + } + catch (_a) { + return () => { + }; + } +} +let nowTimestamp = Date.now; +if (!(/[1-9][0-9]{12}/.test(Date.now().toString()))) { + nowTimestamp = () => new Date().getTime(); +} +function getWindowScroll(win) { + var _a, _b, _c, _d, _e, _f; + const doc = win.document; + return { + left: doc.scrollingElement + ? doc.scrollingElement.scrollLeft + : win.pageXOffset !== undefined + ? win.pageXOffset + : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollLeft) || + ((_b = (_a = doc === null || doc === void 0 ? void 0 : doc.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) || + ((_c = doc === null || doc === void 0 ? void 0 : doc.body) === null || _c === void 0 ? void 0 : _c.scrollLeft) || + 0, + top: doc.scrollingElement + ? doc.scrollingElement.scrollTop + : win.pageYOffset !== undefined + ? win.pageYOffset + : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollTop) || + ((_e = (_d = doc === null || doc === void 0 ? void 0 : doc.body) === null || _d === void 0 ? void 0 : _d.parentElement) === null || _e === void 0 ? void 0 : _e.scrollTop) || + ((_f = doc === null || doc === void 0 ? void 0 : doc.body) === null || _f === void 0 ? void 0 : _f.scrollTop) || + 0, + }; +} +function getWindowHeight() { + return (window.innerHeight || + (document.documentElement && document.documentElement.clientHeight) || + (document.body && document.body.clientHeight)); +} +function getWindowWidth() { + return (window.innerWidth || + (document.documentElement && document.documentElement.clientWidth) || + (document.body && document.body.clientWidth)); +} +function isBlocked(node, blockClass, blockSelector, unblockSelector, checkAncestors) { + if (!node) { + return false; + } + const el = node.nodeType === node.ELEMENT_NODE + ? node + : node.parentElement; + if (!el) + return false; + const blockedPredicate = createMatchPredicate(blockClass, blockSelector); + if (!checkAncestors) { + const isUnblocked = unblockSelector && el.matches(unblockSelector); + return blockedPredicate(el) && !isUnblocked; + } + const blockDistance = distanceToMatch(el, blockedPredicate); + let unblockDistance = -1; + if (blockDistance < 0) { + return false; + } + if (unblockSelector) { + unblockDistance = distanceToMatch(el, createMatchPredicate(null, unblockSelector)); + } + if (blockDistance > -1 && unblockDistance < 0) { + return true; + } + return blockDistance < unblockDistance; +} +function isSerialized(n, mirror) { + return mirror.getId(n) !== -1; +} +function isIgnored(n, mirror) { + return mirror.getId(n) === IGNORED_NODE; +} +function isAncestorRemoved(target, mirror) { + if (isShadowRoot(target)) { + return false; + } + const id = mirror.getId(target); + if (!mirror.has(id)) { + return true; + } + if (target.parentNode && + target.parentNode.nodeType === target.DOCUMENT_NODE) { + return false; + } + if (!target.parentNode) { + return true; + } + return isAncestorRemoved(target.parentNode, mirror); +} +function legacy_isTouchEvent(event) { + return Boolean(event.changedTouches); +} +function polyfill(win = window) { + if ('NodeList' in win && !win.NodeList.prototype.forEach) { + win.NodeList.prototype.forEach = Array.prototype + .forEach; + } + if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) { + win.DOMTokenList.prototype.forEach = Array.prototype + .forEach; + } + if (!Node.prototype.contains) { + Node.prototype.contains = (...args) => { + let node = args[0]; + if (!(0 in args)) { + throw new TypeError('1 argument is required'); + } + do { + if (this === node) { + return true; + } + } while ((node = node && node.parentNode)); + return false; + }; + } +} +function isSerializedIframe(n, mirror) { + return Boolean(n.nodeName === 'IFRAME' && mirror.getMeta(n)); +} +function isSerializedStylesheet(n, mirror) { + return Boolean(n.nodeName === 'LINK' && + n.nodeType === n.ELEMENT_NODE && + n.getAttribute && + n.getAttribute('rel') === 'stylesheet' && + mirror.getMeta(n)); +} +function hasShadowRoot(n) { + return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot); +} +class StyleSheetMirror { + constructor() { + this.id = 1; + this.styleIDMap = new WeakMap(); + this.idStyleMap = new Map(); + } + getId(stylesheet) { + var _a; + return (_a = this.styleIDMap.get(stylesheet)) !== null && _a !== void 0 ? _a : -1; + } + has(stylesheet) { + return this.styleIDMap.has(stylesheet); + } + add(stylesheet, id) { + if (this.has(stylesheet)) + return this.getId(stylesheet); + let newId; + if (id === undefined) { + newId = this.id++; + } + else + newId = id; + this.styleIDMap.set(stylesheet, newId); + this.idStyleMap.set(newId, stylesheet); + return newId; + } + getStyle(id) { + return this.idStyleMap.get(id) || null; + } + reset() { + this.styleIDMap = new WeakMap(); + this.idStyleMap = new Map(); + this.id = 1; + } + generateId() { + return this.id++; + } +} +function getShadowHost(n) { + var _a, _b; + let shadowHost = null; + if (((_b = (_a = n.getRootNode) === null || _a === void 0 ? void 0 : _a.call(n)) === null || _b === void 0 ? void 0 : _b.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && + n.getRootNode().host) + shadowHost = n.getRootNode().host; + return shadowHost; +} +function getRootShadowHost(n) { + let rootShadowHost = n; + let shadowHost; + while ((shadowHost = getShadowHost(rootShadowHost))) + rootShadowHost = shadowHost; + return rootShadowHost; +} +function shadowHostInDom(n) { + const doc = n.ownerDocument; + if (!doc) + return false; + const shadowHost = getRootShadowHost(n); + return doc.contains(shadowHost); +} +function inDom(n) { + const doc = n.ownerDocument; + if (!doc) + return false; + return doc.contains(n) || shadowHostInDom(n); +} + +var EventType = /* @__PURE__ */ ((EventType2) => { + EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded"; + EventType2[EventType2["Load"] = 1] = "Load"; + EventType2[EventType2["FullSnapshot"] = 2] = "FullSnapshot"; + EventType2[EventType2["IncrementalSnapshot"] = 3] = "IncrementalSnapshot"; + EventType2[EventType2["Meta"] = 4] = "Meta"; + EventType2[EventType2["Custom"] = 5] = "Custom"; + EventType2[EventType2["Plugin"] = 6] = "Plugin"; + return EventType2; +})(EventType || {}); +var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => { + IncrementalSource2[IncrementalSource2["Mutation"] = 0] = "Mutation"; + IncrementalSource2[IncrementalSource2["MouseMove"] = 1] = "MouseMove"; + IncrementalSource2[IncrementalSource2["MouseInteraction"] = 2] = "MouseInteraction"; + IncrementalSource2[IncrementalSource2["Scroll"] = 3] = "Scroll"; + IncrementalSource2[IncrementalSource2["ViewportResize"] = 4] = "ViewportResize"; + IncrementalSource2[IncrementalSource2["Input"] = 5] = "Input"; + IncrementalSource2[IncrementalSource2["TouchMove"] = 6] = "TouchMove"; + IncrementalSource2[IncrementalSource2["MediaInteraction"] = 7] = "MediaInteraction"; + IncrementalSource2[IncrementalSource2["StyleSheetRule"] = 8] = "StyleSheetRule"; + IncrementalSource2[IncrementalSource2["CanvasMutation"] = 9] = "CanvasMutation"; + IncrementalSource2[IncrementalSource2["Font"] = 10] = "Font"; + IncrementalSource2[IncrementalSource2["Log"] = 11] = "Log"; + IncrementalSource2[IncrementalSource2["Drag"] = 12] = "Drag"; + IncrementalSource2[IncrementalSource2["StyleDeclaration"] = 13] = "StyleDeclaration"; + IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection"; + IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet"; + IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement"; + return IncrementalSource2; +})(IncrementalSource || {}); +var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => { + MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp"; + MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown"; + MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click"; + MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu"; + MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick"; + MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus"; + MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur"; + MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart"; + MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed"; + MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd"; + MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel"; + return MouseInteractions2; +})(MouseInteractions || {}); +var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => { + PointerTypes2[PointerTypes2["Mouse"] = 0] = "Mouse"; + PointerTypes2[PointerTypes2["Pen"] = 1] = "Pen"; + PointerTypes2[PointerTypes2["Touch"] = 2] = "Touch"; + return PointerTypes2; +})(PointerTypes || {}); +var CanvasContext = /* @__PURE__ */ ((CanvasContext2) => { + CanvasContext2[CanvasContext2["2D"] = 0] = "2D"; + CanvasContext2[CanvasContext2["WebGL"] = 1] = "WebGL"; + CanvasContext2[CanvasContext2["WebGL2"] = 2] = "WebGL2"; + return CanvasContext2; +})(CanvasContext || {}); + +function isNodeInLinkedList(n) { + return '__ln' in n; +} +class DoubleLinkedList { + constructor() { + this.length = 0; + this.head = null; + this.tail = null; + } + get(position) { + if (position >= this.length) { + throw new Error('Position outside of list range'); + } + let current = this.head; + for (let index = 0; index < position; index++) { + current = (current === null || current === void 0 ? void 0 : current.next) || null; + } + return current; + } + addNode(n) { + const node = { + value: n, + previous: null, + next: null, + }; + n.__ln = node; + if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) { + const current = n.previousSibling.__ln.next; + node.next = current; + node.previous = n.previousSibling.__ln; + n.previousSibling.__ln.next = node; + if (current) { + current.previous = node; + } + } + else if (n.nextSibling && + isNodeInLinkedList(n.nextSibling) && + n.nextSibling.__ln.previous) { + const current = n.nextSibling.__ln.previous; + node.previous = current; + node.next = n.nextSibling.__ln; + n.nextSibling.__ln.previous = node; + if (current) { + current.next = node; + } + } + else { + if (this.head) { + this.head.previous = node; + } + node.next = this.head; + this.head = node; + } + if (node.next === null) { + this.tail = node; + } + this.length++; + } + removeNode(n) { + const current = n.__ln; + if (!this.head) { + return; + } + if (!current.previous) { + this.head = current.next; + if (this.head) { + this.head.previous = null; + } + else { + this.tail = null; + } + } + else { + current.previous.next = current.next; + if (current.next) { + current.next.previous = current.previous; + } + else { + this.tail = current.previous; + } + } + if (n.__ln) { + delete n.__ln; + } + this.length--; + } +} +const moveKey = (id, parentId) => `${id}@${parentId}`; +class MutationBuffer { + constructor() { + this.frozen = false; + this.locked = false; + this.texts = []; + this.attributes = []; + this.removes = []; + this.mapRemoves = []; + this.movedMap = {}; + this.addedSet = new Set(); + this.movedSet = new Set(); + this.droppedSet = new Set(); + this.processMutations = (mutations) => { + mutations.forEach(this.processMutation); + this.emit(); + }; + this.emit = () => { + if (this.frozen || this.locked) { + return; + } + const adds = []; + const addedIds = new Set(); + const addList = new DoubleLinkedList(); + const getNextId = (n) => { + let ns = n; + let nextId = IGNORED_NODE; + while (nextId === IGNORED_NODE) { + ns = ns && ns.nextSibling; + nextId = ns && this.mirror.getId(ns); + } + return nextId; + }; + const pushAdd = (n) => { + if (!n.parentNode || !inDom(n)) { + return; + } + const parentId = isShadowRoot(n.parentNode) + ? this.mirror.getId(getShadowHost(n)) + : this.mirror.getId(n.parentNode); + const nextId = getNextId(n); + if (parentId === -1 || nextId === -1) { + return addList.addNode(n); + } + const sn = serializeNodeWithId(n, { + doc: this.doc, + mirror: this.mirror, + blockClass: this.blockClass, + blockSelector: this.blockSelector, + maskAllText: this.maskAllText, + unblockSelector: this.unblockSelector, + maskTextClass: this.maskTextClass, + unmaskTextClass: this.unmaskTextClass, + maskTextSelector: this.maskTextSelector, + unmaskTextSelector: this.unmaskTextSelector, + skipChild: true, + newlyAddedElement: true, + inlineStylesheet: this.inlineStylesheet, + maskInputOptions: this.maskInputOptions, + maskAttributeFn: this.maskAttributeFn, + maskTextFn: this.maskTextFn, + maskInputFn: this.maskInputFn, + slimDOMOptions: this.slimDOMOptions, + dataURLOptions: this.dataURLOptions, + recordCanvas: this.recordCanvas, + inlineImages: this.inlineImages, + onSerialize: (currentN) => { + if (isSerializedIframe(currentN, this.mirror)) { + this.iframeManager.addIframe(currentN); + } + if (isSerializedStylesheet(currentN, this.mirror)) { + this.stylesheetManager.trackLinkElement(currentN); + } + if (hasShadowRoot(n)) { + this.shadowDomManager.addShadowRoot(n.shadowRoot, this.doc); + } + }, + onIframeLoad: (iframe, childSn) => { + this.iframeManager.attachIframe(iframe, childSn); + this.shadowDomManager.observeAttachShadow(iframe); + }, + onStylesheetLoad: (link, childSn) => { + this.stylesheetManager.attachLinkElement(link, childSn); + }, + }); + if (sn) { + adds.push({ + parentId, + nextId, + node: sn, + }); + addedIds.add(sn.id); + } + }; + while (this.mapRemoves.length) { + this.mirror.removeNodeFromMap(this.mapRemoves.shift()); + } + for (const n of this.movedSet) { + if (isParentRemoved(this.removes, n, this.mirror) && + !this.movedSet.has(n.parentNode)) { + continue; + } + pushAdd(n); + } + for (const n of this.addedSet) { + if (!isAncestorInSet(this.droppedSet, n) && + !isParentRemoved(this.removes, n, this.mirror)) { + pushAdd(n); + } + else if (isAncestorInSet(this.movedSet, n)) { + pushAdd(n); + } + else { + this.droppedSet.add(n); + } + } + let candidate = null; + while (addList.length) { + let node = null; + if (candidate) { + const parentId = this.mirror.getId(candidate.value.parentNode); + const nextId = getNextId(candidate.value); + if (parentId !== -1 && nextId !== -1) { + node = candidate; + } + } + if (!node) { + let tailNode = addList.tail; + while (tailNode) { + const _node = tailNode; + tailNode = tailNode.previous; + if (_node) { + const parentId = this.mirror.getId(_node.value.parentNode); + const nextId = getNextId(_node.value); + if (nextId === -1) + continue; + else if (parentId !== -1) { + node = _node; + break; + } + else { + const unhandledNode = _node.value; + if (unhandledNode.parentNode && + unhandledNode.parentNode.nodeType === + Node.DOCUMENT_FRAGMENT_NODE) { + const shadowHost = unhandledNode.parentNode + .host; + const parentId = this.mirror.getId(shadowHost); + if (parentId !== -1) { + node = _node; + break; + } + } + } + } + } + } + if (!node) { + while (addList.head) { + addList.removeNode(addList.head.value); + } + break; + } + candidate = node.previous; + addList.removeNode(node.value); + pushAdd(node.value); + } + const payload = { + texts: this.texts + .map((text) => ({ + id: this.mirror.getId(text.node), + value: text.value, + })) + .filter((text) => !addedIds.has(text.id)) + .filter((text) => this.mirror.has(text.id)), + attributes: this.attributes + .map((attribute) => { + const { attributes } = attribute; + if (typeof attributes.style === 'string') { + const diffAsStr = JSON.stringify(attribute.styleDiff); + const unchangedAsStr = JSON.stringify(attribute._unchangedStyles); + if (diffAsStr.length < attributes.style.length) { + if ((diffAsStr + unchangedAsStr).split('var(').length === + attributes.style.split('var(').length) { + attributes.style = attribute.styleDiff; + } + } + } + return { + id: this.mirror.getId(attribute.node), + attributes: attributes, + }; + }) + .filter((attribute) => !addedIds.has(attribute.id)) + .filter((attribute) => this.mirror.has(attribute.id)), + removes: this.removes, + adds, + }; + if (!payload.texts.length && + !payload.attributes.length && + !payload.removes.length && + !payload.adds.length) { + return; + } + this.texts = []; + this.attributes = []; + this.removes = []; + this.addedSet = new Set(); + this.movedSet = new Set(); + this.droppedSet = new Set(); + this.movedMap = {}; + this.mutationCb(payload); + }; + this.processMutation = (m) => { + if (isIgnored(m.target, this.mirror)) { + return; + } + let unattachedDoc; + try { + unattachedDoc = document.implementation.createHTMLDocument(); + } + catch (e) { + unattachedDoc = this.doc; + } + switch (m.type) { + case 'characterData': { + const value = m.target.textContent; + if (!isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) && + value !== m.oldValue) { + this.texts.push({ + value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, this.maskAllText) && value + ? this.maskTextFn + ? this.maskTextFn(value) + : value.replace(/[\S]/g, '*') + : value, + node: m.target, + }); + } + break; + } + case 'attributes': { + const target = m.target; + let attributeName = m.attributeName; + let value = m.target.getAttribute(attributeName); + if (attributeName === 'value') { + const type = getInputType(target); + const tagName = target.tagName; + value = getInputValue(target, tagName, type); + const isInputMasked = shouldMaskInput({ + maskInputOptions: this.maskInputOptions, + tagName, + type, + }); + const forceMask = needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, isInputMasked); + value = maskInputValue({ + isMasked: forceMask, + element: target, + value, + maskInputFn: this.maskInputFn, + }); + } + if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) || + value === m.oldValue) { + return; + } + let item = this.attributes.find((a) => a.node === m.target); + if (target.tagName === 'IFRAME' && + attributeName === 'src' && + !this.keepIframeSrcFn(value)) { + if (!target.contentDocument) { + attributeName = 'rr_src'; + } + else { + return; + } + } + if (!item) { + item = { + node: m.target, + attributes: {}, + styleDiff: {}, + _unchangedStyles: {}, + }; + this.attributes.push(item); + } + if (attributeName === 'type' && + target.tagName === 'INPUT' && + (m.oldValue || '').toLowerCase() === 'password') { + target.setAttribute('data-rr-is-password', 'true'); + } + if (!ignoreAttribute(target.tagName, attributeName)) { + item.attributes[attributeName] = transformAttribute(this.doc, toLowerCase(target.tagName), toLowerCase(attributeName), value, target, this.maskAttributeFn); + if (attributeName === 'style') { + const old = unattachedDoc.createElement('span'); + if (m.oldValue) { + old.setAttribute('style', m.oldValue); + } + for (const pname of Array.from(target.style)) { + const newValue = target.style.getPropertyValue(pname); + const newPriority = target.style.getPropertyPriority(pname); + if (newValue !== old.style.getPropertyValue(pname) || + newPriority !== old.style.getPropertyPriority(pname)) { + if (newPriority === '') { + item.styleDiff[pname] = newValue; + } + else { + item.styleDiff[pname] = [newValue, newPriority]; + } + } + else { + item._unchangedStyles[pname] = [newValue, newPriority]; + } + } + for (const pname of Array.from(old.style)) { + if (target.style.getPropertyValue(pname) === '') { + item.styleDiff[pname] = false; + } + } + } + } + break; + } + case 'childList': { + if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, true)) { + return; + } + m.addedNodes.forEach((n) => this.genAdds(n, m.target)); + m.removedNodes.forEach((n) => { + const nodeId = this.mirror.getId(n); + const parentId = isShadowRoot(m.target) + ? this.mirror.getId(m.target.host) + : this.mirror.getId(m.target); + if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) || + isIgnored(n, this.mirror) || + !isSerialized(n, this.mirror)) { + return; + } + if (this.addedSet.has(n)) { + deepDelete(this.addedSet, n); + this.droppedSet.add(n); + } + else if (this.addedSet.has(m.target) && nodeId === -1) ; + else if (isAncestorRemoved(m.target, this.mirror)) ; + else if (this.movedSet.has(n) && + this.movedMap[moveKey(nodeId, parentId)]) { + deepDelete(this.movedSet, n); + } + else { + this.removes.push({ + parentId, + id: nodeId, + isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target) + ? true + : undefined, + }); + } + this.mapRemoves.push(n); + }); + break; + } + } + }; + this.genAdds = (n, target) => { + if (this.processedNodeManager.inOtherBuffer(n, this)) + return; + if (this.addedSet.has(n) || this.movedSet.has(n)) + return; + if (this.mirror.hasNode(n)) { + if (isIgnored(n, this.mirror)) { + return; + } + this.movedSet.add(n); + let targetId = null; + if (target && this.mirror.hasNode(target)) { + targetId = this.mirror.getId(target); + } + if (targetId && targetId !== -1) { + this.movedMap[moveKey(this.mirror.getId(n), targetId)] = true; + } + } + else { + this.addedSet.add(n); + this.droppedSet.delete(n); + } + if (!isBlocked(n, this.blockClass, this.blockSelector, this.unblockSelector, false)) { + n.childNodes.forEach((childN) => this.genAdds(childN)); + if (hasShadowRoot(n)) { + n.shadowRoot.childNodes.forEach((childN) => { + this.processedNodeManager.add(childN, this); + this.genAdds(childN, n); + }); + } + } + }; + } + init(options) { + [ + 'mutationCb', + 'blockClass', + 'blockSelector', + 'unblockSelector', + 'maskAllText', + 'maskTextClass', + 'unmaskTextClass', + 'maskTextSelector', + 'unmaskTextSelector', + 'inlineStylesheet', + 'maskInputOptions', + 'maskAttributeFn', + 'maskTextFn', + 'maskInputFn', + 'keepIframeSrcFn', + 'recordCanvas', + 'inlineImages', + 'slimDOMOptions', + 'dataURLOptions', + 'doc', + 'mirror', + 'iframeManager', + 'stylesheetManager', + 'shadowDomManager', + 'canvasManager', + 'processedNodeManager', + ].forEach((key) => { + this[key] = options[key]; + }); + } + freeze() { + this.frozen = true; + this.canvasManager.freeze(); + } + unfreeze() { + this.frozen = false; + this.canvasManager.unfreeze(); + this.emit(); + } + isFrozen() { + return this.frozen; + } + lock() { + this.locked = true; + this.canvasManager.lock(); + } + unlock() { + this.locked = false; + this.canvasManager.unlock(); + this.emit(); + } + reset() { + this.shadowDomManager.reset(); + this.canvasManager.reset(); + } +} +function deepDelete(addsSet, n) { + addsSet.delete(n); + n.childNodes.forEach((childN) => deepDelete(addsSet, childN)); +} +function isParentRemoved(removes, n, mirror) { + if (removes.length === 0) + return false; + return _isParentRemoved(removes, n, mirror); +} +function _isParentRemoved(removes, n, mirror) { + const { parentNode } = n; + if (!parentNode) { + return false; + } + const parentId = mirror.getId(parentNode); + if (removes.some((r) => r.id === parentId)) { + return true; + } + return _isParentRemoved(removes, parentNode, mirror); +} +function isAncestorInSet(set, n) { + if (set.size === 0) + return false; + return _isAncestorInSet(set, n); +} +function _isAncestorInSet(set, n) { + const { parentNode } = n; + if (!parentNode) { + return false; + } + if (set.has(parentNode)) { + return true; + } + return _isAncestorInSet(set, parentNode); +} + +let errorHandler; +function registerErrorHandler(handler) { + errorHandler = handler; +} +function unregisterErrorHandler() { + errorHandler = undefined; +} +const callbackWrapper = (cb) => { + if (!errorHandler) { + return cb; + } + const rrwebWrapped = ((...rest) => { + try { + return cb(...rest); + } + catch (error) { + if (errorHandler && errorHandler(error) === true) { + return () => { + }; + } + throw error; + } + }); + return rrwebWrapped; +}; + +const mutationBuffers = []; +function getEventTarget(event) { + try { + if ('composedPath' in event) { + const path = event.composedPath(); + if (path.length) { + return path[0]; + } + } + else if ('path' in event && event.path.length) { + return event.path[0]; + } + } + catch (_a) { + } + return event && event.target; +} +function initMutationObserver(options, rootEl) { + var _a, _b; + const mutationBuffer = new MutationBuffer(); + mutationBuffers.push(mutationBuffer); + mutationBuffer.init(options); + let mutationObserverCtor = window.MutationObserver || + window.__rrMutationObserver; + const angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver'); + if (angularZoneSymbol && + window[angularZoneSymbol]) { + mutationObserverCtor = window[angularZoneSymbol]; + } + const observer = new mutationObserverCtor(callbackWrapper((mutations) => { + if (options.onMutation && options.onMutation(mutations) === false) { + return; + } + mutationBuffer.processMutations.bind(mutationBuffer)(mutations); + })); + observer.observe(rootEl, { + attributes: true, + attributeOldValue: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, + }); + return observer; +} +function initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) { + if (sampling.mousemove === false) { + return () => { + }; + } + const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50; + const callbackThreshold = typeof sampling.mousemoveCallback === 'number' + ? sampling.mousemoveCallback + : 500; + let positions = []; + let timeBaseline; + const wrappedCb = throttle$1(callbackWrapper((source) => { + const totalOffset = Date.now() - timeBaseline; + mousemoveCb(positions.map((p) => { + p.timeOffset -= totalOffset; + return p; + }), source); + positions = []; + timeBaseline = null; + }), callbackThreshold); + const updatePosition = callbackWrapper(throttle$1(callbackWrapper((evt) => { + const target = getEventTarget(evt); + const { clientX, clientY } = legacy_isTouchEvent(evt) + ? evt.changedTouches[0] + : evt; + if (!timeBaseline) { + timeBaseline = nowTimestamp(); + } + positions.push({ + x: clientX, + y: clientY, + id: mirror.getId(target), + timeOffset: nowTimestamp() - timeBaseline, + }); + wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent + ? IncrementalSource.Drag + : evt instanceof MouseEvent + ? IncrementalSource.MouseMove + : IncrementalSource.TouchMove); + }), threshold, { + trailing: false, + })); + const handlers = [ + on('mousemove', updatePosition, doc), + on('touchmove', updatePosition, doc), + on('drag', updatePosition, doc), + ]; + return callbackWrapper(() => { + handlers.forEach((h) => h()); + }); +} +function initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) { + if (sampling.mouseInteraction === false) { + return () => { + }; + } + const disableMap = sampling.mouseInteraction === true || + sampling.mouseInteraction === undefined + ? {} + : sampling.mouseInteraction; + const handlers = []; + let currentPointerType = null; + const getHandler = (eventKey) => { + return (event) => { + const target = getEventTarget(event); + if (isBlocked(target, blockClass, blockSelector, unblockSelector, true)) { + return; + } + let pointerType = null; + let thisEventKey = eventKey; + if ('pointerType' in event) { + switch (event.pointerType) { + case 'mouse': + pointerType = PointerTypes.Mouse; + break; + case 'touch': + pointerType = PointerTypes.Touch; + break; + case 'pen': + pointerType = PointerTypes.Pen; + break; + } + if (pointerType === PointerTypes.Touch) { + if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) { + thisEventKey = 'TouchStart'; + } + else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) { + thisEventKey = 'TouchEnd'; + } + } + else if (pointerType === PointerTypes.Pen) ; + } + else if (legacy_isTouchEvent(event)) { + pointerType = PointerTypes.Touch; + } + if (pointerType !== null) { + currentPointerType = pointerType; + if ((thisEventKey.startsWith('Touch') && + pointerType === PointerTypes.Touch) || + (thisEventKey.startsWith('Mouse') && + pointerType === PointerTypes.Mouse)) { + pointerType = null; + } + } + else if (MouseInteractions[eventKey] === MouseInteractions.Click) { + pointerType = currentPointerType; + currentPointerType = null; + } + const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event; + if (!e) { + return; + } + const id = mirror.getId(target); + const { clientX, clientY } = e; + callbackWrapper(mouseInteractionCb)(Object.assign({ type: MouseInteractions[thisEventKey], id, x: clientX, y: clientY }, (pointerType !== null && { pointerType }))); + }; + }; + Object.keys(MouseInteractions) + .filter((key) => Number.isNaN(Number(key)) && + !key.endsWith('_Departed') && + disableMap[key] !== false) + .forEach((eventKey) => { + let eventName = toLowerCase(eventKey); + const handler = getHandler(eventKey); + if (window.PointerEvent) { + switch (MouseInteractions[eventKey]) { + case MouseInteractions.MouseDown: + case MouseInteractions.MouseUp: + eventName = eventName.replace('mouse', 'pointer'); + break; + case MouseInteractions.TouchStart: + case MouseInteractions.TouchEnd: + return; + } + } + handlers.push(on(eventName, handler, doc)); + }); + return callbackWrapper(() => { + handlers.forEach((h) => h()); + }); +} +function initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) { + const updatePosition = callbackWrapper(throttle$1(callbackWrapper((evt) => { + const target = getEventTarget(evt); + if (!target || + isBlocked(target, blockClass, blockSelector, unblockSelector, true)) { + return; + } + const id = mirror.getId(target); + if (target === doc && doc.defaultView) { + const scrollLeftTop = getWindowScroll(doc.defaultView); + scrollCb({ + id, + x: scrollLeftTop.left, + y: scrollLeftTop.top, + }); + } + else { + scrollCb({ + id, + x: target.scrollLeft, + y: target.scrollTop, + }); + } + }), sampling.scroll || 100)); + return on('scroll', updatePosition, doc); +} +function initViewportResizeObserver({ viewportResizeCb }, { win }) { + let lastH = -1; + let lastW = -1; + const updateDimension = callbackWrapper(throttle$1(callbackWrapper(() => { + const height = getWindowHeight(); + const width = getWindowWidth(); + if (lastH !== height || lastW !== width) { + viewportResizeCb({ + width: Number(width), + height: Number(height), + }); + lastH = height; + lastW = width; + } + }), 200)); + return on('resize', updateDimension, win); +} +function wrapEventWithUserTriggeredFlag(v, enable) { + const value = Object.assign({}, v); + if (!enable) + delete value.userTriggered; + return value; +} +const INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT']; +const lastInputValueMap = new WeakMap(); +function initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, }) { + function eventHandler(event) { + let target = getEventTarget(event); + const userTriggered = event.isTrusted; + const tagName = target && toUpperCase(target.tagName); + if (tagName === 'OPTION') + target = target.parentElement; + if (!target || + !tagName || + INPUT_TAGS.indexOf(tagName) < 0 || + isBlocked(target, blockClass, blockSelector, unblockSelector, true)) { + return; + } + const el = target; + if (el.classList.contains(ignoreClass) || + (ignoreSelector && el.matches(ignoreSelector))) { + return; + } + const type = getInputType(target); + let text = getInputValue(el, tagName, type); + let isChecked = false; + const isInputMasked = shouldMaskInput({ + maskInputOptions, + tagName, + type, + }); + const forceMask = needMaskingText(target, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked); + if (type === 'radio' || type === 'checkbox') { + isChecked = target.checked; + } + text = maskInputValue({ + isMasked: forceMask, + element: target, + value: text, + maskInputFn, + }); + cbWithDedup(target, callbackWrapper(wrapEventWithUserTriggeredFlag)({ text, isChecked, userTriggered }, userTriggeredOnInput)); + const name = target.name; + if (type === 'radio' && name && isChecked) { + doc + .querySelectorAll(`input[type="radio"][name="${name}"]`) + .forEach((el) => { + if (el !== target) { + const text = maskInputValue({ + isMasked: forceMask, + element: el, + value: getInputValue(el, tagName, type), + maskInputFn, + }); + cbWithDedup(el, callbackWrapper(wrapEventWithUserTriggeredFlag)({ + text, + isChecked: !isChecked, + userTriggered: false, + }, userTriggeredOnInput)); + } + }); + } + } + function cbWithDedup(target, v) { + const lastInputValue = lastInputValueMap.get(target); + if (!lastInputValue || + lastInputValue.text !== v.text || + lastInputValue.isChecked !== v.isChecked) { + lastInputValueMap.set(target, v); + const id = mirror.getId(target); + callbackWrapper(inputCb)(Object.assign(Object.assign({}, v), { id })); + } + } + const events = sampling.input === 'last' ? ['change'] : ['input', 'change']; + const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc)); + const currentWindow = doc.defaultView; + if (!currentWindow) { + return () => { + handlers.forEach((h) => h()); + }; + } + const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype, 'value'); + const hookProperties = [ + [currentWindow.HTMLInputElement.prototype, 'value'], + [currentWindow.HTMLInputElement.prototype, 'checked'], + [currentWindow.HTMLSelectElement.prototype, 'value'], + [currentWindow.HTMLTextAreaElement.prototype, 'value'], + [currentWindow.HTMLSelectElement.prototype, 'selectedIndex'], + [currentWindow.HTMLOptionElement.prototype, 'selected'], + ]; + if (propertyDescriptor && propertyDescriptor.set) { + handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], { + set() { + callbackWrapper(eventHandler)({ + target: this, + isTrusted: false, + }); + }, + }, false, currentWindow))); + } + return callbackWrapper(() => { + handlers.forEach((h) => h()); + }); +} +function getNestedCSSRulePositions(rule) { + const positions = []; + function recurse(childRule, pos) { + if ((hasNestedCSSRule('CSSGroupingRule') && + childRule.parentRule instanceof CSSGroupingRule) || + (hasNestedCSSRule('CSSMediaRule') && + childRule.parentRule instanceof CSSMediaRule) || + (hasNestedCSSRule('CSSSupportsRule') && + childRule.parentRule instanceof CSSSupportsRule) || + (hasNestedCSSRule('CSSConditionRule') && + childRule.parentRule instanceof CSSConditionRule)) { + const rules = Array.from(childRule.parentRule.cssRules); + const index = rules.indexOf(childRule); + pos.unshift(index); + } + else if (childRule.parentStyleSheet) { + const rules = Array.from(childRule.parentStyleSheet.cssRules); + const index = rules.indexOf(childRule); + pos.unshift(index); + } + return pos; + } + return recurse(rule, positions); +} +function getIdAndStyleId(sheet, mirror, styleMirror) { + let id, styleId; + if (!sheet) + return {}; + if (sheet.ownerNode) + id = mirror.getId(sheet.ownerNode); + else + styleId = styleMirror.getId(sheet); + return { + styleId, + id, + }; +} +function initStyleSheetObserver({ styleSheetRuleCb, mirror, stylesheetManager }, { win }) { + if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) { + return () => { + }; + } + const insertRule = win.CSSStyleSheet.prototype.insertRule; + win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, { + apply: callbackWrapper((target, thisArg, argumentsList) => { + const [rule, index] = argumentsList; + const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror); + if ((id && id !== -1) || (styleId && styleId !== -1)) { + styleSheetRuleCb({ + id, + styleId, + adds: [{ rule, index }], + }); + } + return target.apply(thisArg, argumentsList); + }), + }); + const deleteRule = win.CSSStyleSheet.prototype.deleteRule; + win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, { + apply: callbackWrapper((target, thisArg, argumentsList) => { + const [index] = argumentsList; + const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror); + if ((id && id !== -1) || (styleId && styleId !== -1)) { + styleSheetRuleCb({ + id, + styleId, + removes: [{ index }], + }); + } + return target.apply(thisArg, argumentsList); + }), + }); + let replace; + if (win.CSSStyleSheet.prototype.replace) { + replace = win.CSSStyleSheet.prototype.replace; + win.CSSStyleSheet.prototype.replace = new Proxy(replace, { + apply: callbackWrapper((target, thisArg, argumentsList) => { + const [text] = argumentsList; + const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror); + if ((id && id !== -1) || (styleId && styleId !== -1)) { + styleSheetRuleCb({ + id, + styleId, + replace: text, + }); + } + return target.apply(thisArg, argumentsList); + }), + }); + } + let replaceSync; + if (win.CSSStyleSheet.prototype.replaceSync) { + replaceSync = win.CSSStyleSheet.prototype.replaceSync; + win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, { + apply: callbackWrapper((target, thisArg, argumentsList) => { + const [text] = argumentsList; + const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror); + if ((id && id !== -1) || (styleId && styleId !== -1)) { + styleSheetRuleCb({ + id, + styleId, + replaceSync: text, + }); + } + return target.apply(thisArg, argumentsList); + }), + }); + } + const supportedNestedCSSRuleTypes = {}; + if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) { + supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule; + } + else { + if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) { + supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule; + } + if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) { + supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule; + } + if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) { + supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule; + } + } + const unmodifiedFunctions = {}; + Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => { + unmodifiedFunctions[typeKey] = { + insertRule: type.prototype.insertRule, + deleteRule: type.prototype.deleteRule, + }; + type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, { + apply: callbackWrapper((target, thisArg, argumentsList) => { + const [rule, index] = argumentsList; + const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror); + if ((id && id !== -1) || (styleId && styleId !== -1)) { + styleSheetRuleCb({ + id, + styleId, + adds: [ + { + rule, + index: [ + ...getNestedCSSRulePositions(thisArg), + index || 0, + ], + }, + ], + }); + } + return target.apply(thisArg, argumentsList); + }), + }); + type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, { + apply: callbackWrapper((target, thisArg, argumentsList) => { + const [index] = argumentsList; + const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror); + if ((id && id !== -1) || (styleId && styleId !== -1)) { + styleSheetRuleCb({ + id, + styleId, + removes: [ + { index: [...getNestedCSSRulePositions(thisArg), index] }, + ], + }); + } + return target.apply(thisArg, argumentsList); + }), + }); + }); + return callbackWrapper(() => { + win.CSSStyleSheet.prototype.insertRule = insertRule; + win.CSSStyleSheet.prototype.deleteRule = deleteRule; + replace && (win.CSSStyleSheet.prototype.replace = replace); + replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync); + Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => { + type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule; + type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule; + }); + }); +} +function initAdoptedStyleSheetObserver({ mirror, stylesheetManager, }, host) { + var _a, _b, _c; + let hostId = null; + if (host.nodeName === '#document') + hostId = mirror.getId(host); + else + hostId = mirror.getId(host.host); + const patchTarget = host.nodeName === '#document' + ? (_a = host.defaultView) === null || _a === void 0 ? void 0 : _a.Document + : (_c = (_b = host.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) === null || _c === void 0 ? void 0 : _c.ShadowRoot; + const originalPropertyDescriptor = Object.getOwnPropertyDescriptor(patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype, 'adoptedStyleSheets'); + if (hostId === null || + hostId === -1 || + !patchTarget || + !originalPropertyDescriptor) + return () => { + }; + Object.defineProperty(host, 'adoptedStyleSheets', { + configurable: originalPropertyDescriptor.configurable, + enumerable: originalPropertyDescriptor.enumerable, + get() { + var _a; + return (_a = originalPropertyDescriptor.get) === null || _a === void 0 ? void 0 : _a.call(this); + }, + set(sheets) { + var _a; + const result = (_a = originalPropertyDescriptor.set) === null || _a === void 0 ? void 0 : _a.call(this, sheets); + if (hostId !== null && hostId !== -1) { + try { + stylesheetManager.adoptStyleSheets(sheets, hostId); + } + catch (e) { + } + } + return result; + }, + }); + return callbackWrapper(() => { + Object.defineProperty(host, 'adoptedStyleSheets', { + configurable: originalPropertyDescriptor.configurable, + enumerable: originalPropertyDescriptor.enumerable, + get: originalPropertyDescriptor.get, + set: originalPropertyDescriptor.set, + }); + }); +} +function initStyleDeclarationObserver({ styleDeclarationCb, mirror, ignoreCSSAttributes, stylesheetManager, }, { win }) { + const setProperty = win.CSSStyleDeclaration.prototype.setProperty; + win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, { + apply: callbackWrapper((target, thisArg, argumentsList) => { + var _a; + const [property, value, priority] = argumentsList; + if (ignoreCSSAttributes.has(property)) { + return setProperty.apply(thisArg, [property, value, priority]); + } + const { id, styleId } = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror); + if ((id && id !== -1) || (styleId && styleId !== -1)) { + styleDeclarationCb({ + id, + styleId, + set: { + property, + value, + priority, + }, + index: getNestedCSSRulePositions(thisArg.parentRule), + }); + } + return target.apply(thisArg, argumentsList); + }), + }); + const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty; + win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, { + apply: callbackWrapper((target, thisArg, argumentsList) => { + var _a; + const [property] = argumentsList; + if (ignoreCSSAttributes.has(property)) { + return removeProperty.apply(thisArg, [property]); + } + const { id, styleId } = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror); + if ((id && id !== -1) || (styleId && styleId !== -1)) { + styleDeclarationCb({ + id, + styleId, + remove: { + property, + }, + index: getNestedCSSRulePositions(thisArg.parentRule), + }); + } + return target.apply(thisArg, argumentsList); + }), + }); + return callbackWrapper(() => { + win.CSSStyleDeclaration.prototype.setProperty = setProperty; + win.CSSStyleDeclaration.prototype.removeProperty = removeProperty; + }); +} +function initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror, sampling, doc, }) { + const handler = callbackWrapper((type) => throttle$1(callbackWrapper((event) => { + const target = getEventTarget(event); + if (!target || + isBlocked(target, blockClass, blockSelector, unblockSelector, true)) { + return; + } + const { currentTime, volume, muted, playbackRate } = target; + mediaInteractionCb({ + type, + id: mirror.getId(target), + currentTime, + volume, + muted, + playbackRate, + }); + }), sampling.media || 500)); + const handlers = [ + on('play', handler(0), doc), + on('pause', handler(1), doc), + on('seeked', handler(2), doc), + on('volumechange', handler(3), doc), + on('ratechange', handler(4), doc), + ]; + return callbackWrapper(() => { + handlers.forEach((h) => h()); + }); +} +function initFontObserver({ fontCb, doc }) { + const win = doc.defaultView; + if (!win) { + return () => { + }; + } + const handlers = []; + const fontMap = new WeakMap(); + const originalFontFace = win.FontFace; + win.FontFace = function FontFace(family, source, descriptors) { + const fontFace = new originalFontFace(family, source, descriptors); + fontMap.set(fontFace, { + family, + buffer: typeof source !== 'string', + descriptors, + fontSource: typeof source === 'string' + ? source + : JSON.stringify(Array.from(new Uint8Array(source))), + }); + return fontFace; + }; + const restoreHandler = patch(doc.fonts, 'add', function (original) { + return function (fontFace) { + setTimeout(callbackWrapper(() => { + const p = fontMap.get(fontFace); + if (p) { + fontCb(p); + fontMap.delete(fontFace); + } + }), 0); + return original.apply(this, [fontFace]); + }; + }); + handlers.push(() => { + win.FontFace = originalFontFace; + }); + handlers.push(restoreHandler); + return callbackWrapper(() => { + handlers.forEach((h) => h()); + }); +} +function initSelectionObserver(param) { + const { doc, mirror, blockClass, blockSelector, unblockSelector, selectionCb, } = param; + let collapsed = true; + const updateSelection = callbackWrapper(() => { + const selection = doc.getSelection(); + if (!selection || (collapsed && (selection === null || selection === void 0 ? void 0 : selection.isCollapsed))) + return; + collapsed = selection.isCollapsed || false; + const ranges = []; + const count = selection.rangeCount || 0; + for (let i = 0; i < count; i++) { + const range = selection.getRangeAt(i); + const { startContainer, startOffset, endContainer, endOffset } = range; + const blocked = isBlocked(startContainer, blockClass, blockSelector, unblockSelector, true) || + isBlocked(endContainer, blockClass, blockSelector, unblockSelector, true); + if (blocked) + continue; + ranges.push({ + start: mirror.getId(startContainer), + startOffset, + end: mirror.getId(endContainer), + endOffset, + }); + } + selectionCb({ ranges }); + }); + updateSelection(); + return on('selectionchange', updateSelection); +} +function initCustomElementObserver({ doc, customElementCb, }) { + const win = doc.defaultView; + if (!win || !win.customElements) { + return () => { + }; + } + const restoreHandler = patch(win.customElements, 'define', function (original) { + return function (name, constructor, options) { + try { + customElementCb({ + define: { + name, + }, + }); + } + catch (e) { + } + return original.apply(this, [name, constructor, options]); + }; + }); + return restoreHandler; +} +function mergeHooks(o, hooks) { + const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, selectionCb, customElementCb, } = o; + o.mutationCb = (...p) => { + if (hooks.mutation) { + hooks.mutation(...p); + } + mutationCb(...p); + }; + o.mousemoveCb = (...p) => { + if (hooks.mousemove) { + hooks.mousemove(...p); + } + mousemoveCb(...p); + }; + o.mouseInteractionCb = (...p) => { + if (hooks.mouseInteraction) { + hooks.mouseInteraction(...p); + } + mouseInteractionCb(...p); + }; + o.scrollCb = (...p) => { + if (hooks.scroll) { + hooks.scroll(...p); + } + scrollCb(...p); + }; + o.viewportResizeCb = (...p) => { + if (hooks.viewportResize) { + hooks.viewportResize(...p); + } + viewportResizeCb(...p); + }; + o.inputCb = (...p) => { + if (hooks.input) { + hooks.input(...p); + } + inputCb(...p); + }; + o.mediaInteractionCb = (...p) => { + if (hooks.mediaInteaction) { + hooks.mediaInteaction(...p); + } + mediaInteractionCb(...p); + }; + o.styleSheetRuleCb = (...p) => { + if (hooks.styleSheetRule) { + hooks.styleSheetRule(...p); + } + styleSheetRuleCb(...p); + }; + o.styleDeclarationCb = (...p) => { + if (hooks.styleDeclaration) { + hooks.styleDeclaration(...p); + } + styleDeclarationCb(...p); + }; + o.canvasMutationCb = (...p) => { + if (hooks.canvasMutation) { + hooks.canvasMutation(...p); + } + canvasMutationCb(...p); + }; + o.fontCb = (...p) => { + if (hooks.font) { + hooks.font(...p); + } + fontCb(...p); + }; + o.selectionCb = (...p) => { + if (hooks.selection) { + hooks.selection(...p); + } + selectionCb(...p); + }; + o.customElementCb = (...c) => { + if (hooks.customElement) { + hooks.customElement(...c); + } + customElementCb(...c); + }; +} +function initObservers(o, hooks = {}) { + const currentWindow = o.doc.defaultView; + if (!currentWindow) { + return () => { + }; + } + mergeHooks(o, hooks); + const mutationObserver = initMutationObserver(o, o.doc); + const mousemoveHandler = initMoveObserver(o); + const mouseInteractionHandler = initMouseInteractionObserver(o); + const scrollHandler = initScrollObserver(o); + const viewportResizeHandler = initViewportResizeObserver(o, { + win: currentWindow, + }); + const inputHandler = initInputObserver(o); + const mediaInteractionHandler = initMediaInteractionObserver(o); + const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow }); + const adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc); + const styleDeclarationObserver = initStyleDeclarationObserver(o, { + win: currentWindow, + }); + const fontObserver = o.collectFonts + ? initFontObserver(o) + : () => { + }; + const selectionObserver = initSelectionObserver(o); + const customElementObserver = initCustomElementObserver(o); + const pluginHandlers = []; + for (const plugin of o.plugins) { + pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options)); + } + return callbackWrapper(() => { + mutationBuffers.forEach((b) => b.reset()); + mutationObserver.disconnect(); + mousemoveHandler(); + mouseInteractionHandler(); + scrollHandler(); + viewportResizeHandler(); + inputHandler(); + mediaInteractionHandler(); + styleSheetObserver(); + adoptedStyleSheetObserver(); + styleDeclarationObserver(); + fontObserver(); + selectionObserver(); + customElementObserver(); + pluginHandlers.forEach((h) => h()); + }); +} +function hasNestedCSSRule(prop) { + return typeof window[prop] !== 'undefined'; +} +function canMonkeyPatchNestedCSSRule(prop) { + return Boolean(typeof window[prop] !== 'undefined' && + window[prop].prototype && + 'insertRule' in window[prop].prototype && + 'deleteRule' in window[prop].prototype); +} + +class CrossOriginIframeMirror { + constructor(generateIdFn) { + this.generateIdFn = generateIdFn; + this.iframeIdToRemoteIdMap = new WeakMap(); + this.iframeRemoteIdToIdMap = new WeakMap(); + } + getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) { + const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe); + const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe); + let id = idToRemoteIdMap.get(remoteId); + if (!id) { + id = this.generateIdFn(); + idToRemoteIdMap.set(remoteId, id); + remoteIdToIdMap.set(id, remoteId); + } + return id; + } + getIds(iframe, remoteId) { + const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe); + const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe); + return remoteId.map((id) => this.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap)); + } + getRemoteId(iframe, id, map) { + const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe); + if (typeof id !== 'number') + return id; + const remoteId = remoteIdToIdMap.get(id); + if (!remoteId) + return -1; + return remoteId; + } + getRemoteIds(iframe, ids) { + const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe); + return ids.map((id) => this.getRemoteId(iframe, id, remoteIdToIdMap)); + } + reset(iframe) { + if (!iframe) { + this.iframeIdToRemoteIdMap = new WeakMap(); + this.iframeRemoteIdToIdMap = new WeakMap(); + return; + } + this.iframeIdToRemoteIdMap.delete(iframe); + this.iframeRemoteIdToIdMap.delete(iframe); + } + getIdToRemoteIdMap(iframe) { + let idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe); + if (!idToRemoteIdMap) { + idToRemoteIdMap = new Map(); + this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap); + } + return idToRemoteIdMap; + } + getRemoteIdToIdMap(iframe) { + let remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe); + if (!remoteIdToIdMap) { + remoteIdToIdMap = new Map(); + this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap); + } + return remoteIdToIdMap; + } +} + +class IframeManager { + constructor(options) { + this.iframes = new WeakMap(); + this.crossOriginIframeMap = new WeakMap(); + this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId); + this.crossOriginIframeRootIdMap = new WeakMap(); + this.mutationCb = options.mutationCb; + this.wrappedEmit = options.wrappedEmit; + this.stylesheetManager = options.stylesheetManager; + this.recordCrossOriginIframes = options.recordCrossOriginIframes; + this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)); + this.mirror = options.mirror; + if (this.recordCrossOriginIframes) { + window.addEventListener('message', this.handleMessage.bind(this)); + } + } + addIframe(iframeEl) { + this.iframes.set(iframeEl, true); + if (iframeEl.contentWindow) + this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl); + } + addLoadListener(cb) { + this.loadListener = cb; + } + attachIframe(iframeEl, childSn) { + var _a; + this.mutationCb({ + adds: [ + { + parentId: this.mirror.getId(iframeEl), + nextId: null, + node: childSn, + }, + ], + removes: [], + texts: [], + attributes: [], + isAttachIframe: true, + }); + (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl); + if (iframeEl.contentDocument && + iframeEl.contentDocument.adoptedStyleSheets && + iframeEl.contentDocument.adoptedStyleSheets.length > 0) + this.stylesheetManager.adoptStyleSheets(iframeEl.contentDocument.adoptedStyleSheets, this.mirror.getId(iframeEl.contentDocument)); + } + handleMessage(message) { + const crossOriginMessageEvent = message; + if (crossOriginMessageEvent.data.type !== 'rrweb' || + crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin) + return; + const iframeSourceWindow = message.source; + if (!iframeSourceWindow) + return; + const iframeEl = this.crossOriginIframeMap.get(message.source); + if (!iframeEl) + return; + const transformedEvent = this.transformCrossOriginEvent(iframeEl, crossOriginMessageEvent.data.event); + if (transformedEvent) + this.wrappedEmit(transformedEvent, crossOriginMessageEvent.data.isCheckout); + } + transformCrossOriginEvent(iframeEl, e) { + var _a; + switch (e.type) { + case EventType.FullSnapshot: { + this.crossOriginIframeMirror.reset(iframeEl); + this.crossOriginIframeStyleMirror.reset(iframeEl); + this.replaceIdOnNode(e.data.node, iframeEl); + const rootId = e.data.node.id; + this.crossOriginIframeRootIdMap.set(iframeEl, rootId); + this.patchRootIdOnNode(e.data.node, rootId); + return { + timestamp: e.timestamp, + type: EventType.IncrementalSnapshot, + data: { + source: IncrementalSource.Mutation, + adds: [ + { + parentId: this.mirror.getId(iframeEl), + nextId: null, + node: e.data.node, + }, + ], + removes: [], + texts: [], + attributes: [], + isAttachIframe: true, + }, + }; + } + case EventType.Meta: + case EventType.Load: + case EventType.DomContentLoaded: { + return false; + } + case EventType.Plugin: { + return e; + } + case EventType.Custom: { + this.replaceIds(e.data.payload, iframeEl, ['id', 'parentId', 'previousId', 'nextId']); + return e; + } + case EventType.IncrementalSnapshot: { + switch (e.data.source) { + case IncrementalSource.Mutation: { + e.data.adds.forEach((n) => { + this.replaceIds(n, iframeEl, [ + 'parentId', + 'nextId', + 'previousId', + ]); + this.replaceIdOnNode(n.node, iframeEl); + const rootId = this.crossOriginIframeRootIdMap.get(iframeEl); + rootId && this.patchRootIdOnNode(n.node, rootId); + }); + e.data.removes.forEach((n) => { + this.replaceIds(n, iframeEl, ['parentId', 'id']); + }); + e.data.attributes.forEach((n) => { + this.replaceIds(n, iframeEl, ['id']); + }); + e.data.texts.forEach((n) => { + this.replaceIds(n, iframeEl, ['id']); + }); + return e; + } + case IncrementalSource.Drag: + case IncrementalSource.TouchMove: + case IncrementalSource.MouseMove: { + e.data.positions.forEach((p) => { + this.replaceIds(p, iframeEl, ['id']); + }); + return e; + } + case IncrementalSource.ViewportResize: { + return false; + } + case IncrementalSource.MediaInteraction: + case IncrementalSource.MouseInteraction: + case IncrementalSource.Scroll: + case IncrementalSource.CanvasMutation: + case IncrementalSource.Input: { + this.replaceIds(e.data, iframeEl, ['id']); + return e; + } + case IncrementalSource.StyleSheetRule: + case IncrementalSource.StyleDeclaration: { + this.replaceIds(e.data, iframeEl, ['id']); + this.replaceStyleIds(e.data, iframeEl, ['styleId']); + return e; + } + case IncrementalSource.Font: { + return e; + } + case IncrementalSource.Selection: { + e.data.ranges.forEach((range) => { + this.replaceIds(range, iframeEl, ['start', 'end']); + }); + return e; + } + case IncrementalSource.AdoptedStyleSheet: { + this.replaceIds(e.data, iframeEl, ['id']); + this.replaceStyleIds(e.data, iframeEl, ['styleIds']); + (_a = e.data.styles) === null || _a === void 0 ? void 0 : _a.forEach((style) => { + this.replaceStyleIds(style, iframeEl, ['styleId']); + }); + return e; + } + } + } + } + return false; + } + replace(iframeMirror, obj, iframeEl, keys) { + for (const key of keys) { + if (!Array.isArray(obj[key]) && typeof obj[key] !== 'number') + continue; + if (Array.isArray(obj[key])) { + obj[key] = iframeMirror.getIds(iframeEl, obj[key]); + } + else { + obj[key] = iframeMirror.getId(iframeEl, obj[key]); + } + } + return obj; + } + replaceIds(obj, iframeEl, keys) { + return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys); + } + replaceStyleIds(obj, iframeEl, keys) { + return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys); + } + replaceIdOnNode(node, iframeEl) { + this.replaceIds(node, iframeEl, ['id', 'rootId']); + if ('childNodes' in node) { + node.childNodes.forEach((child) => { + this.replaceIdOnNode(child, iframeEl); + }); + } + } + patchRootIdOnNode(node, rootId) { + if (node.type !== NodeType$1.Document && !node.rootId) + node.rootId = rootId; + if ('childNodes' in node) { + node.childNodes.forEach((child) => { + this.patchRootIdOnNode(child, rootId); + }); + } + } +} + +class ShadowDomManager { + constructor(options) { + this.shadowDoms = new WeakSet(); + this.restoreHandlers = []; + this.mutationCb = options.mutationCb; + this.scrollCb = options.scrollCb; + this.bypassOptions = options.bypassOptions; + this.mirror = options.mirror; + this.init(); + } + init() { + this.reset(); + this.patchAttachShadow(Element, document); + } + addShadowRoot(shadowRoot, doc) { + if (!isNativeShadowDom(shadowRoot)) + return; + if (this.shadowDoms.has(shadowRoot)) + return; + this.shadowDoms.add(shadowRoot); + const observer = initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot); + this.restoreHandlers.push(() => observer.disconnect()); + this.restoreHandlers.push(initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror }))); + setTimeout(() => { + if (shadowRoot.adoptedStyleSheets && + shadowRoot.adoptedStyleSheets.length > 0) + this.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets, this.mirror.getId(shadowRoot.host)); + this.restoreHandlers.push(initAdoptedStyleSheetObserver({ + mirror: this.mirror, + stylesheetManager: this.bypassOptions.stylesheetManager, + }, shadowRoot)); + }, 0); + } + observeAttachShadow(iframeElement) { + if (!iframeElement.contentWindow || !iframeElement.contentDocument) + return; + this.patchAttachShadow(iframeElement.contentWindow.Element, iframeElement.contentDocument); + } + patchAttachShadow(element, doc) { + const manager = this; + this.restoreHandlers.push(patch(element.prototype, 'attachShadow', function (original) { + return function (option) { + const shadowRoot = original.call(this, option); + if (this.shadowRoot && inDom(this)) + manager.addShadowRoot(this.shadowRoot, doc); + return shadowRoot; + }; + })); + } + reset() { + this.restoreHandlers.forEach((handler) => { + try { + handler(); + } + catch (e) { + } + }); + this.restoreHandlers = []; + this.shadowDoms = new WeakSet(); + } +} + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + 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) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +/* + * base64-arraybuffer 1.0.1 + * Copyright (c) 2021 Niklas von Hertzen + * Released under MIT License + */ +var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +// Use a lookup table to find the index. +var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256); +for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; +} +var encode = function (arraybuffer) { + var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ''; + for (i = 0; i < len; i += 3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + if (len % 3 === 2) { + base64 = base64.substring(0, base64.length - 1) + '='; + } + else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + '=='; + } + return base64; +}; + +const canvasVarMap = new Map(); +function variableListFor(ctx, ctor) { + let contextMap = canvasVarMap.get(ctx); + if (!contextMap) { + contextMap = new Map(); + canvasVarMap.set(ctx, contextMap); + } + if (!contextMap.has(ctor)) { + contextMap.set(ctor, []); + } + return contextMap.get(ctor); +} +const saveWebGLVar = (value, win, ctx) => { + if (!value || + !(isInstanceOfWebGLObject(value, win) || typeof value === 'object')) + return; + const name = value.constructor.name; + const list = variableListFor(ctx, name); + let index = list.indexOf(value); + if (index === -1) { + index = list.length; + list.push(value); + } + return index; +}; +function serializeArg(value, win, ctx) { + if (value instanceof Array) { + return value.map((arg) => serializeArg(arg, win, ctx)); + } + else if (value === null) { + return value; + } + else if (value instanceof Float32Array || + value instanceof Float64Array || + value instanceof Int32Array || + value instanceof Uint32Array || + value instanceof Uint8Array || + value instanceof Uint16Array || + value instanceof Int16Array || + value instanceof Int8Array || + value instanceof Uint8ClampedArray) { + const name = value.constructor.name; + return { + rr_type: name, + args: [Object.values(value)], + }; + } + else if (value instanceof ArrayBuffer) { + const name = value.constructor.name; + const base64 = encode(value); + return { + rr_type: name, + base64, + }; + } + else if (value instanceof DataView) { + const name = value.constructor.name; + return { + rr_type: name, + args: [ + serializeArg(value.buffer, win, ctx), + value.byteOffset, + value.byteLength, + ], + }; + } + else if (value instanceof HTMLImageElement) { + const name = value.constructor.name; + const { src } = value; + return { + rr_type: name, + src, + }; + } + else if (value instanceof HTMLCanvasElement) { + const name = 'HTMLImageElement'; + const src = value.toDataURL(); + return { + rr_type: name, + src, + }; + } + else if (value instanceof ImageData) { + const name = value.constructor.name; + return { + rr_type: name, + args: [serializeArg(value.data, win, ctx), value.width, value.height], + }; + } + else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') { + const name = value.constructor.name; + const index = saveWebGLVar(value, win, ctx); + return { + rr_type: name, + index: index, + }; + } + return value; +} +const serializeArgs = (args, win, ctx) => { + return [...args].map((arg) => serializeArg(arg, win, ctx)); +}; +const isInstanceOfWebGLObject = (value, win) => { + const webGLConstructorNames = [ + 'WebGLActiveInfo', + 'WebGLBuffer', + 'WebGLFramebuffer', + 'WebGLProgram', + 'WebGLRenderbuffer', + 'WebGLShader', + 'WebGLShaderPrecisionFormat', + 'WebGLTexture', + 'WebGLUniformLocation', + 'WebGLVertexArrayObject', + 'WebGLVertexArrayObjectOES', + ]; + const supportedWebGLConstructorNames = webGLConstructorNames.filter((name) => typeof win[name] === 'function'); + return Boolean(supportedWebGLConstructorNames.find((name) => value instanceof win[name])); +}; + +function initCanvas2DMutationObserver(cb, win, blockClass, blockSelector, unblockSelector) { + const handlers = []; + const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype); + for (const prop of props2D) { + try { + if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') { + continue; + } + const restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) { + return function (...args) { + if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector, true)) { + setTimeout(() => { + const recordArgs = serializeArgs([...args], win, this); + cb(this.canvas, { + type: CanvasContext['2D'], + property: prop, + args: recordArgs, + }); + }, 0); + } + return original.apply(this, args); + }; + }); + handlers.push(restoreHandler); + } + catch (_a) { + const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, { + set(v) { + cb(this.canvas, { + type: CanvasContext['2D'], + property: prop, + args: [v], + setter: true, + }); + }, + }); + handlers.push(hookHandler); + } + } + return () => { + handlers.forEach((h) => h()); + }; +} + +function getNormalizedContextName(contextType) { + return contextType === 'experimental-webgl' ? 'webgl' : contextType; +} +function initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, setPreserveDrawingBufferToTrue) { + const handlers = []; + try { + const restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) { + return function (contextType, ...args) { + if (!isBlocked(this, blockClass, blockSelector, unblockSelector, true)) { + const ctxName = getNormalizedContextName(contextType); + if (!('__context' in this)) + this.__context = ctxName; + if (setPreserveDrawingBufferToTrue && + ['webgl', 'webgl2'].includes(ctxName)) { + if (args[0] && typeof args[0] === 'object') { + const contextAttributes = args[0]; + if (!contextAttributes.preserveDrawingBuffer) { + contextAttributes.preserveDrawingBuffer = true; + } + } + else { + args.splice(0, 1, { + preserveDrawingBuffer: true, + }); + } + } + } + return original.apply(this, [contextType, ...args]); + }; + }); + handlers.push(restoreHandler); + } + catch (_a) { + console.error('failed to patch HTMLCanvasElement.prototype.getContext'); + } + return () => { + handlers.forEach((h) => h()); + }; +} + +function patchGLPrototype(prototype, type, cb, blockClass, blockSelector, unblockSelector, mirror, win) { + const handlers = []; + const props = Object.getOwnPropertyNames(prototype); + for (const prop of props) { + if ([ + 'isContextLost', + 'canvas', + 'drawingBufferWidth', + 'drawingBufferHeight', + ].includes(prop)) { + continue; + } + try { + if (typeof prototype[prop] !== 'function') { + continue; + } + const restoreHandler = patch(prototype, prop, function (original) { + return function (...args) { + const result = original.apply(this, args); + saveWebGLVar(result, win, this); + if ('tagName' in this.canvas && + !isBlocked(this.canvas, blockClass, blockSelector, unblockSelector, true)) { + const recordArgs = serializeArgs([...args], win, this); + const mutation = { + type, + property: prop, + args: recordArgs, + }; + cb(this.canvas, mutation); + } + return result; + }; + }); + handlers.push(restoreHandler); + } + catch (_a) { + const hookHandler = hookSetter(prototype, prop, { + set(v) { + cb(this.canvas, { + type, + property: prop, + args: [v], + setter: true, + }); + }, + }); + handlers.push(hookHandler); + } + } + return handlers; +} +function initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, unblockSelector, mirror) { + const handlers = []; + handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, unblockSelector, mirror, win)); + if (typeof win.WebGL2RenderingContext !== 'undefined') { + handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, unblockSelector, mirror, win)); + } + return () => { + handlers.forEach((h) => h()); + }; +} + +function decodeBase64(base64, enableUnicode) { + var binaryString = atob(base64); + if (enableUnicode) { + var binaryView = new Uint8Array(binaryString.length); + for (var i = 0, n = binaryString.length; i < n; ++i) { + binaryView[i] = binaryString.charCodeAt(i); + } + return String.fromCharCode.apply(null, new Uint16Array(binaryView.buffer)); + } + return binaryString; +} + +function createURL(base64, sourcemapArg, enableUnicodeArg) { + var sourcemap = sourcemapArg === undefined ? null : sourcemapArg; + var enableUnicode = enableUnicodeArg === undefined ? false : enableUnicodeArg; + var source = decodeBase64(base64, enableUnicode); + var start = source.indexOf('\n', 10) + 1; + var body = source.substring(start) + (sourcemap ? '\/\/# sourceMappingURL=' + sourcemap : ''); + var blob = new Blob([body], { type: 'application/javascript' }); + return URL.createObjectURL(blob); +} + +function createBase64WorkerFactory(base64, sourcemapArg, enableUnicodeArg) { + var url; + return function WorkerFactory(options) { + url = url || createURL(base64, sourcemapArg, enableUnicodeArg); + return new Worker(url, options); + }; +} + +var WorkerFactory = createBase64WorkerFactory('Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=', null, false); + +class CanvasManager { + reset() { + this.pendingCanvasMutations.clear(); + this.resetObservers && this.resetObservers(); + } + freeze() { + this.frozen = true; + } + unfreeze() { + this.frozen = false; + } + lock() { + this.locked = true; + } + unlock() { + this.locked = false; + } + constructor(options) { + this.pendingCanvasMutations = new Map(); + this.rafStamps = { latestId: 0, invokeId: null }; + this.frozen = false; + this.locked = false; + this.processMutation = (target, mutation) => { + const newFrame = this.rafStamps.invokeId && + this.rafStamps.latestId !== this.rafStamps.invokeId; + if (newFrame || !this.rafStamps.invokeId) + this.rafStamps.invokeId = this.rafStamps.latestId; + if (!this.pendingCanvasMutations.has(target)) { + this.pendingCanvasMutations.set(target, []); + } + this.pendingCanvasMutations.get(target).push(mutation); + }; + const { sampling = 'all', win, blockClass, blockSelector, unblockSelector, recordCanvas, dataURLOptions, } = options; + this.mutationCb = options.mutationCb; + this.mirror = options.mirror; + if (recordCanvas && sampling === 'all') + this.initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector); + if (recordCanvas && typeof sampling === 'number') + this.initCanvasFPSObserver(sampling, win, blockClass, blockSelector, unblockSelector, { + dataURLOptions, + }); + } + initCanvasFPSObserver(fps, win, blockClass, blockSelector, unblockSelector, options) { + const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, true); + const snapshotInProgressMap = new Map(); + const worker = new WorkerFactory(); + worker.onmessage = (e) => { + const { id } = e.data; + snapshotInProgressMap.set(id, false); + if (!('base64' in e.data)) + return; + const { base64, type, width, height } = e.data; + this.mutationCb({ + id, + type: CanvasContext['2D'], + commands: [ + { + property: 'clearRect', + args: [0, 0, width, height], + }, + { + property: 'drawImage', + args: [ + { + rr_type: 'ImageBitmap', + args: [ + { + rr_type: 'Blob', + data: [{ rr_type: 'ArrayBuffer', base64 }], + type, + }, + ], + }, + 0, + 0, + ], + }, + ], + }); + }; + const timeBetweenSnapshots = 1000 / fps; + let lastSnapshotTime = 0; + let rafId; + const getCanvas = () => { + const matchedCanvas = []; + win.document.querySelectorAll('canvas').forEach((canvas) => { + if (!isBlocked(canvas, blockClass, blockSelector, unblockSelector, true)) { + matchedCanvas.push(canvas); + } + }); + return matchedCanvas; + }; + const takeCanvasSnapshots = (timestamp) => { + if (lastSnapshotTime && + timestamp - lastSnapshotTime < timeBetweenSnapshots) { + rafId = requestAnimationFrame(takeCanvasSnapshots); + return; + } + lastSnapshotTime = timestamp; + getCanvas() + .forEach((canvas) => __awaiter(this, void 0, void 0, function* () { + var _a; + const id = this.mirror.getId(canvas); + if (snapshotInProgressMap.get(id)) + return; + snapshotInProgressMap.set(id, true); + if (['webgl', 'webgl2'].includes(canvas.__context)) { + const context = canvas.getContext(canvas.__context); + if (((_a = context === null || context === void 0 ? void 0 : context.getContextAttributes()) === null || _a === void 0 ? void 0 : _a.preserveDrawingBuffer) === false) { + context.clear(context.COLOR_BUFFER_BIT); + } + } + const bitmap = yield createImageBitmap(canvas); + worker.postMessage({ + id, + bitmap, + width: canvas.width, + height: canvas.height, + dataURLOptions: options.dataURLOptions, + }, [bitmap]); + })); + rafId = requestAnimationFrame(takeCanvasSnapshots); + }; + rafId = requestAnimationFrame(takeCanvasSnapshots); + this.resetObservers = () => { + canvasContextReset(); + cancelAnimationFrame(rafId); + }; + } + initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector) { + this.startRAFTimestamping(); + this.startPendingCanvasMutationFlusher(); + const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, false); + const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector); + const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror); + this.resetObservers = () => { + canvasContextReset(); + canvas2DReset(); + canvasWebGL1and2Reset(); + }; + } + startPendingCanvasMutationFlusher() { + requestAnimationFrame(() => this.flushPendingCanvasMutations()); + } + startRAFTimestamping() { + const setLatestRAFTimestamp = (timestamp) => { + this.rafStamps.latestId = timestamp; + requestAnimationFrame(setLatestRAFTimestamp); + }; + requestAnimationFrame(setLatestRAFTimestamp); + } + flushPendingCanvasMutations() { + this.pendingCanvasMutations.forEach((values, canvas) => { + const id = this.mirror.getId(canvas); + this.flushPendingCanvasMutationFor(canvas, id); + }); + requestAnimationFrame(() => this.flushPendingCanvasMutations()); + } + flushPendingCanvasMutationFor(canvas, id) { + if (this.frozen || this.locked) { + return; + } + const valuesWithType = this.pendingCanvasMutations.get(canvas); + if (!valuesWithType || id === -1) + return; + const values = valuesWithType.map((value) => { + const rest = __rest(value, ["type"]); + return rest; + }); + const { type } = valuesWithType[0]; + this.mutationCb({ id, type, commands: values }); + this.pendingCanvasMutations.delete(canvas); + } +} + +class StylesheetManager { + constructor(options) { + this.trackedLinkElements = new WeakSet(); + this.styleMirror = new StyleSheetMirror(); + this.mutationCb = options.mutationCb; + this.adoptedStyleSheetCb = options.adoptedStyleSheetCb; + } + attachLinkElement(linkEl, childSn) { + if ('_cssText' in childSn.attributes) + this.mutationCb({ + adds: [], + removes: [], + texts: [], + attributes: [ + { + id: childSn.id, + attributes: childSn + .attributes, + }, + ], + }); + this.trackLinkElement(linkEl); + } + trackLinkElement(linkEl) { + if (this.trackedLinkElements.has(linkEl)) + return; + this.trackedLinkElements.add(linkEl); + this.trackStylesheetInLinkElement(linkEl); + } + adoptStyleSheets(sheets, hostId) { + if (sheets.length === 0) + return; + const adoptedStyleSheetData = { + id: hostId, + styleIds: [], + }; + const styles = []; + for (const sheet of sheets) { + let styleId; + if (!this.styleMirror.has(sheet)) { + styleId = this.styleMirror.add(sheet); + styles.push({ + styleId, + rules: Array.from(sheet.rules || CSSRule, (r, index) => ({ + rule: stringifyRule(r), + index, + })), + }); + } + else + styleId = this.styleMirror.getId(sheet); + adoptedStyleSheetData.styleIds.push(styleId); + } + if (styles.length > 0) + adoptedStyleSheetData.styles = styles; + this.adoptedStyleSheetCb(adoptedStyleSheetData); + } + reset() { + this.styleMirror.reset(); + this.trackedLinkElements = new WeakSet(); + } + trackStylesheetInLinkElement(linkEl) { + } +} + +class ProcessedNodeManager { + constructor() { + this.nodeMap = new WeakMap(); + this.loop = true; + this.periodicallyClear(); + } + periodicallyClear() { + requestAnimationFrame(() => { + this.clear(); + if (this.loop) + this.periodicallyClear(); + }); + } + inOtherBuffer(node, thisBuffer) { + const buffers = this.nodeMap.get(node); + return (buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer)); + } + add(node, buffer) { + this.nodeMap.set(node, (this.nodeMap.get(node) || new Set()).add(buffer)); + } + clear() { + this.nodeMap = new WeakMap(); + } + destroy() { + this.loop = false; + } +} + +function wrapEvent(e) { + return Object.assign(Object.assign({}, e), { timestamp: nowTimestamp() }); +} +let wrappedEmit; +let takeFullSnapshot; +let canvasManager; +let recording = false; +const mirror = createMirror(); +function record(options = {}) { + const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskAttributeFn, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options.recordAfter === 'DOMContentLoaded' + ? options.recordAfter + : 'load', userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, ignoreCSSAttributes = new Set([]), errorHandler, onMutation, } = options; + registerErrorHandler(errorHandler); + const inEmittingFrame = recordCrossOriginIframes + ? window.parent === window + : true; + let passEmitsToParent = false; + if (!inEmittingFrame) { + try { + if (window.parent.document) { + passEmitsToParent = false; + } + } + catch (e) { + passEmitsToParent = true; + } + } + if (inEmittingFrame && !emit) { + throw new Error('emit function is required'); + } + if (mousemoveWait !== undefined && sampling.mousemove === undefined) { + sampling.mousemove = mousemoveWait; + } + mirror.reset(); + const maskInputOptions = maskAllInputs === true + ? { + color: true, + date: true, + 'datetime-local': true, + email: true, + month: true, + number: true, + range: true, + search: true, + tel: true, + text: true, + time: true, + url: true, + week: true, + textarea: true, + select: true, + radio: true, + checkbox: true, + } + : _maskInputOptions !== undefined + ? _maskInputOptions + : {}; + const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all' + ? { + script: true, + comment: true, + headFavicon: true, + headWhitespace: true, + headMetaSocial: true, + headMetaRobots: true, + headMetaHttpEquiv: true, + headMetaVerification: true, + headMetaAuthorship: _slimDOMOptions === 'all', + headMetaDescKeywords: _slimDOMOptions === 'all', + } + : _slimDOMOptions + ? _slimDOMOptions + : {}; + polyfill(); + let lastFullSnapshotEvent; + let incrementalSnapshotCount = 0; + const eventProcessor = (e) => { + for (const plugin of plugins || []) { + if (plugin.eventProcessor) { + e = plugin.eventProcessor(e); + } + } + if (packFn && + !passEmitsToParent) { + e = packFn(e); + } + return e; + }; + wrappedEmit = (e, isCheckout) => { + var _a; + if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) && + e.type !== EventType.FullSnapshot && + !(e.type === EventType.IncrementalSnapshot && + e.data.source === IncrementalSource.Mutation)) { + mutationBuffers.forEach((buf) => buf.unfreeze()); + } + if (inEmittingFrame) { + emit === null || emit === void 0 ? void 0 : emit(eventProcessor(e), isCheckout); + } + else if (passEmitsToParent) { + const message = { + type: 'rrweb', + event: eventProcessor(e), + origin: window.location.origin, + isCheckout, + }; + window.parent.postMessage(message, '*'); + } + if (e.type === EventType.FullSnapshot) { + lastFullSnapshotEvent = e; + incrementalSnapshotCount = 0; + } + else if (e.type === EventType.IncrementalSnapshot) { + if (e.data.source === IncrementalSource.Mutation && + e.data.isAttachIframe) { + return; + } + incrementalSnapshotCount++; + const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth; + const exceedTime = checkoutEveryNms && + e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms; + if (exceedCount || exceedTime) { + takeFullSnapshot(true); + } + } + }; + const wrappedMutationEmit = (m) => { + wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.Mutation }, m), + })); + }; + const wrappedScrollEmit = (p) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.Scroll }, p), + })); + const wrappedCanvasMutationEmit = (p) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.CanvasMutation }, p), + })); + const wrappedAdoptedStyleSheetEmit = (a) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.AdoptedStyleSheet }, a), + })); + const stylesheetManager = new StylesheetManager({ + mutationCb: wrappedMutationEmit, + adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit, + }); + const iframeManager = new IframeManager({ + mirror, + mutationCb: wrappedMutationEmit, + stylesheetManager: stylesheetManager, + recordCrossOriginIframes, + wrappedEmit, + }); + for (const plugin of plugins || []) { + if (plugin.getMirror) + plugin.getMirror({ + nodeMirror: mirror, + crossOriginIframeMirror: iframeManager.crossOriginIframeMirror, + crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror, + }); + } + const processedNodeManager = new ProcessedNodeManager(); + canvasManager = new CanvasManager({ + recordCanvas, + mutationCb: wrappedCanvasMutationEmit, + win: window, + blockClass, + blockSelector, + unblockSelector, + mirror, + sampling: sampling.canvas, + dataURLOptions, + }); + const shadowDomManager = new ShadowDomManager({ + mutationCb: wrappedMutationEmit, + scrollCb: wrappedScrollEmit, + bypassOptions: { + onMutation, + blockClass, + blockSelector, + unblockSelector, + maskAllText, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + inlineStylesheet, + maskInputOptions, + dataURLOptions, + maskAttributeFn, + maskTextFn, + maskInputFn, + recordCanvas, + inlineImages, + sampling, + slimDOMOptions, + iframeManager, + stylesheetManager, + canvasManager, + keepIframeSrcFn, + processedNodeManager, + }, + mirror, + }); + takeFullSnapshot = (isCheckout = false) => { + wrappedEmit(wrapEvent({ + type: EventType.Meta, + data: { + href: window.location.href, + width: getWindowWidth(), + height: getWindowHeight(), + }, + }), isCheckout); + stylesheetManager.reset(); + shadowDomManager.init(); + mutationBuffers.forEach((buf) => buf.lock()); + const node = snapshot(document, { + mirror, + blockClass, + blockSelector, + unblockSelector, + maskAllText, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + inlineStylesheet, + maskAllInputs: maskInputOptions, + maskAttributeFn, + maskInputFn, + maskTextFn, + slimDOM: slimDOMOptions, + dataURLOptions, + recordCanvas, + inlineImages, + onSerialize: (n) => { + if (isSerializedIframe(n, mirror)) { + iframeManager.addIframe(n); + } + if (isSerializedStylesheet(n, mirror)) { + stylesheetManager.trackLinkElement(n); + } + if (hasShadowRoot(n)) { + shadowDomManager.addShadowRoot(n.shadowRoot, document); + } + }, + onIframeLoad: (iframe, childSn) => { + iframeManager.attachIframe(iframe, childSn); + shadowDomManager.observeAttachShadow(iframe); + }, + onStylesheetLoad: (linkEl, childSn) => { + stylesheetManager.attachLinkElement(linkEl, childSn); + }, + keepIframeSrcFn, + }); + if (!node) { + return console.warn('Failed to snapshot the document'); + } + wrappedEmit(wrapEvent({ + type: EventType.FullSnapshot, + data: { + node, + initialOffset: getWindowScroll(window), + }, + }), isCheckout); + mutationBuffers.forEach((buf) => buf.unlock()); + if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0) + stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets, mirror.getId(document)); + }; + try { + const handlers = []; + const observe = (doc) => { + var _a; + return callbackWrapper(initObservers)({ + onMutation, + mutationCb: wrappedMutationEmit, + mousemoveCb: (positions, source) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: { + source, + positions, + }, + })), + mouseInteractionCb: (d) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.MouseInteraction }, d), + })), + scrollCb: wrappedScrollEmit, + viewportResizeCb: (d) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.ViewportResize }, d), + })), + inputCb: (v) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.Input }, v), + })), + mediaInteractionCb: (p) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.MediaInteraction }, p), + })), + styleSheetRuleCb: (r) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.StyleSheetRule }, r), + })), + styleDeclarationCb: (r) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.StyleDeclaration }, r), + })), + canvasMutationCb: wrappedCanvasMutationEmit, + fontCb: (p) => wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.Font }, p), + })), + selectionCb: (p) => { + wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.Selection }, p), + })); + }, + customElementCb: (c) => { + wrappedEmit(wrapEvent({ + type: EventType.IncrementalSnapshot, + data: Object.assign({ source: IncrementalSource.CustomElement }, c), + })); + }, + blockClass, + ignoreClass, + ignoreSelector, + maskAllText, + maskTextClass, + unmaskTextClass, + maskTextSelector, + unmaskTextSelector, + maskInputOptions, + inlineStylesheet, + sampling, + recordCanvas, + inlineImages, + userTriggeredOnInput, + collectFonts, + doc, + maskAttributeFn, + maskInputFn, + maskTextFn, + keepIframeSrcFn, + blockSelector, + unblockSelector, + slimDOMOptions, + dataURLOptions, + mirror, + iframeManager, + stylesheetManager, + shadowDomManager, + processedNodeManager, + canvasManager, + ignoreCSSAttributes, + plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter((p) => p.observer)) === null || _a === void 0 ? void 0 : _a.map((p) => ({ + observer: p.observer, + options: p.options, + callback: (payload) => wrappedEmit(wrapEvent({ + type: EventType.Plugin, + data: { + plugin: p.name, + payload, + }, + })), + }))) || [], + }, hooks); + }; + iframeManager.addLoadListener((iframeEl) => { + try { + handlers.push(observe(iframeEl.contentDocument)); + } + catch (error) { + console.warn(error); + } + }); + const init = () => { + takeFullSnapshot(); + handlers.push(observe(document)); + recording = true; + }; + if (document.readyState === 'interactive' || + document.readyState === 'complete') { + init(); + } + else { + handlers.push(on('DOMContentLoaded', () => { + wrappedEmit(wrapEvent({ + type: EventType.DomContentLoaded, + data: {}, + })); + if (recordAfter === 'DOMContentLoaded') + init(); + })); + handlers.push(on('load', () => { + wrappedEmit(wrapEvent({ + type: EventType.Load, + data: {}, + })); + if (recordAfter === 'load') + init(); + }, window)); + } + return () => { + handlers.forEach((h) => h()); + processedNodeManager.destroy(); + recording = false; + unregisterErrorHandler(); + }; + } + catch (error) { + console.warn(error); + } +} +record.addCustomEvent = (tag, payload) => { + if (!recording) { + throw new Error('please add custom event after start recording'); + } + wrappedEmit(wrapEvent({ + type: EventType.Custom, + data: { + tag, + payload, + }, + })); +}; +record.freezePage = () => { + mutationBuffers.forEach((buf) => buf.freeze()); +}; +record.takeFullSnapshot = (isCheckout) => { + if (!recording) { + throw new Error('please take full snapshot after start recording'); + } + takeFullSnapshot(isCheckout); +}; +record.mirror = mirror; + +/** + * Converts a timestamp to ms, if it was in s, or keeps it as ms. + */ +function timestampToMs(timestamp) { + const isMs = timestamp > 9999999999; + return isMs ? timestamp : timestamp * 1000; +} + +/** + * Converts a timestamp to s, if it was in ms, or keeps it as s. + */ +function timestampToS(timestamp) { + const isMs = timestamp > 9999999999; + return isMs ? timestamp / 1000 : timestamp; +} + +/** + * Add a breadcrumb event to replay. + */ +function addBreadcrumbEvent(replay, breadcrumb) { + if (breadcrumb.category === 'sentry.transaction') { + return; + } + + if (['ui.click', 'ui.input'].includes(breadcrumb.category )) { + replay.triggerUserActivity(); + } else { + replay.checkAndHandleExpiredSession(); + } + + replay.addUpdate(() => { + void replay.throttledAddEvent({ + type: EventType.Custom, + // TODO: We were converting from ms to seconds for breadcrumbs, spans, + // but maybe we should just keep them as milliseconds + timestamp: (breadcrumb.timestamp || 0) * 1000, + data: { + tag: 'breadcrumb', + // normalize to max. 10 depth and 1_000 properties per object + payload: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.normalize)(breadcrumb, 10, 1000), + }, + }); + + // Do not flush after console log messages + return breadcrumb.category === 'console'; + }); +} + +const INTERACTIVE_SELECTOR = 'button,a'; + +/** + * For clicks, we check if the target is inside of a button or link + * If so, we use this as the target instead + * This is useful because if you click on the image in , + * The target will be the image, not the button, which we don't want here + */ +function getClickTargetNode(event) { + const target = getTargetNode(event); + + if (!target || !(target instanceof Element)) { + return target; + } + + const closestInteractive = target.closest(INTERACTIVE_SELECTOR); + return closestInteractive || target; +} + +/** Get the event target node. */ +function getTargetNode(event) { + if (isEventWithTarget(event)) { + return event.target ; + } + + return event; +} + +function isEventWithTarget(event) { + return typeof event === 'object' && !!event && 'target' in event; +} + +let handlers; + +/** + * Register a handler to be called when `window.open()` is called. + * Returns a cleanup function. + */ +function onWindowOpen(cb) { + // Ensure to only register this once + if (!handlers) { + handlers = []; + monkeyPatchWindowOpen(); + } + + handlers.push(cb); + + return () => { + const pos = handlers ? handlers.indexOf(cb) : -1; + if (pos > -1) { + (handlers ).splice(pos, 1); + } + }; +} + +function monkeyPatchWindowOpen() { + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.fill)(WINDOW, 'open', function (originalWindowOpen) { + return function (...args) { + if (handlers) { + try { + handlers.forEach(handler => handler()); + } catch (e) { + // ignore errors in here + } + } + + return originalWindowOpen.apply(WINDOW, args); + }; + }); +} + +/** Handle a click. */ +function handleClick(clickDetector, clickBreadcrumb, node) { + clickDetector.handleClick(clickBreadcrumb, node); +} + +/** A click detector class that can be used to detect slow or rage clicks on elements. */ +class ClickDetector { + // protected for testing + + constructor( + replay, + slowClickConfig, + // Just for easier testing + _addBreadcrumbEvent = addBreadcrumbEvent, + ) { + this._lastMutation = 0; + this._lastScroll = 0; + this._clicks = []; + + // We want everything in s, but options are in ms + this._timeout = slowClickConfig.timeout / 1000; + this._threshold = slowClickConfig.threshold / 1000; + this._scollTimeout = slowClickConfig.scrollTimeout / 1000; + this._replay = replay; + this._ignoreSelector = slowClickConfig.ignoreSelector; + this._addBreadcrumbEvent = _addBreadcrumbEvent; + } + + /** Register click detection handlers on mutation or scroll. */ + addListeners() { + const mutationHandler = () => { + this._lastMutation = nowInSeconds(); + }; + + const scrollHandler = () => { + this._lastScroll = nowInSeconds(); + }; + + const cleanupWindowOpen = onWindowOpen(() => { + // Treat window.open as mutation + this._lastMutation = nowInSeconds(); + }); + + const clickHandler = (event) => { + if (!event.target) { + return; + } + + const node = getClickTargetNode(event); + if (node) { + this._handleMultiClick(node ); + } + }; + + const obs = new MutationObserver(mutationHandler); + + obs.observe(WINDOW.document.documentElement, { + attributes: true, + characterData: true, + childList: true, + subtree: true, + }); + + WINDOW.addEventListener('scroll', scrollHandler, { passive: true }); + WINDOW.addEventListener('click', clickHandler, { passive: true }); + + this._teardown = () => { + WINDOW.removeEventListener('scroll', scrollHandler); + WINDOW.removeEventListener('click', clickHandler); + cleanupWindowOpen(); + + obs.disconnect(); + this._clicks = []; + this._lastMutation = 0; + this._lastScroll = 0; + }; + } + + /** Clean up listeners. */ + removeListeners() { + if (this._teardown) { + this._teardown(); + } + + if (this._checkClickTimeout) { + clearTimeout(this._checkClickTimeout); + } + } + + /** Handle a click */ + handleClick(breadcrumb, node) { + if (ignoreElement(node, this._ignoreSelector) || !isClickBreadcrumb(breadcrumb)) { + return; + } + + const newClick = { + timestamp: timestampToS(breadcrumb.timestamp), + clickBreadcrumb: breadcrumb, + // Set this to 0 so we know it originates from the click breadcrumb + clickCount: 0, + node, + }; + + // If there was a click in the last 1s on the same element, ignore it - only keep a single reference per second + if ( + this._clicks.some(click => click.node === newClick.node && Math.abs(click.timestamp - newClick.timestamp) < 1) + ) { + return; + } + + this._clicks.push(newClick); + + // If this is the first new click, set a timeout to check for multi clicks + if (this._clicks.length === 1) { + this._scheduleCheckClicks(); + } + } + + /** Count multiple clicks on elements. */ + _handleMultiClick(node) { + this._getClicks(node).forEach(click => { + click.clickCount++; + }); + } + + /** Get all pending clicks for a given node. */ + _getClicks(node) { + return this._clicks.filter(click => click.node === node); + } + + /** Check the clicks that happened. */ + _checkClicks() { + const timedOutClicks = []; + + const now = nowInSeconds(); + + this._clicks.forEach(click => { + if (!click.mutationAfter && this._lastMutation) { + click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : undefined; + } + if (!click.scrollAfter && this._lastScroll) { + click.scrollAfter = click.timestamp <= this._lastScroll ? this._lastScroll - click.timestamp : undefined; + } + + // All of these are in seconds! + if (click.timestamp + this._timeout <= now) { + timedOutClicks.push(click); + } + }); + + // Remove "old" clicks + for (const click of timedOutClicks) { + const pos = this._clicks.indexOf(click); + + if (pos > -1) { + this._generateBreadcrumbs(click); + this._clicks.splice(pos, 1); + } + } + + // Trigger new check, unless no clicks left + if (this._clicks.length) { + this._scheduleCheckClicks(); + } + } + + /** Generate matching breadcrumb(s) for the click. */ + _generateBreadcrumbs(click) { + const replay = this._replay; + const hadScroll = click.scrollAfter && click.scrollAfter <= this._scollTimeout; + const hadMutation = click.mutationAfter && click.mutationAfter <= this._threshold; + + const isSlowClick = !hadScroll && !hadMutation; + const { clickCount, clickBreadcrumb } = click; + + // Slow click + if (isSlowClick) { + // If `mutationAfter` is set, it means a mutation happened after the threshold, but before the timeout + // If not, it means we just timed out without scroll & mutation + const timeAfterClickMs = Math.min(click.mutationAfter || this._timeout, this._timeout) * 1000; + const endReason = timeAfterClickMs < this._timeout * 1000 ? 'mutation' : 'timeout'; + + const breadcrumb = { + type: 'default', + message: clickBreadcrumb.message, + timestamp: clickBreadcrumb.timestamp, + category: 'ui.slowClickDetected', + data: { + ...clickBreadcrumb.data, + url: WINDOW.location.href, + route: replay.getCurrentRoute(), + timeAfterClickMs, + endReason, + // If clickCount === 0, it means multiClick was not correctly captured here + // - we still want to send 1 in this case + clickCount: clickCount || 1, + }, + }; + + this._addBreadcrumbEvent(replay, breadcrumb); + return; + } + + // Multi click + if (clickCount > 1) { + const breadcrumb = { + type: 'default', + message: clickBreadcrumb.message, + timestamp: clickBreadcrumb.timestamp, + category: 'ui.multiClick', + data: { + ...clickBreadcrumb.data, + url: WINDOW.location.href, + route: replay.getCurrentRoute(), + clickCount, + metric: true, + }, + }; + + this._addBreadcrumbEvent(replay, breadcrumb); + } + } + + /** Schedule to check current clicks. */ + _scheduleCheckClicks() { + if (this._checkClickTimeout) { + clearTimeout(this._checkClickTimeout); + } + + this._checkClickTimeout = setTimeout(() => this._checkClicks(), 1000); + } +} + +const SLOW_CLICK_TAGS = ['A', 'BUTTON', 'INPUT']; + +/** exported for tests only */ +function ignoreElement(node, ignoreSelector) { + if (!SLOW_CLICK_TAGS.includes(node.tagName)) { + return true; + } + + // If tag, we only want to consider input[type='submit'] & input[type='button'] + if (node.tagName === 'INPUT' && !['submit', 'button'].includes(node.getAttribute('type') || '')) { + return true; + } + + // If tag, detect special variants that may not lead to an action + // If target !== _self, we may open the link somewhere else, which would lead to no action + // Also, when downloading a file, we may not leave the page, but still not trigger an action + if ( + node.tagName === 'A' && + (node.hasAttribute('download') || (node.hasAttribute('target') && node.getAttribute('target') !== '_self')) + ) { + return true; + } + + if (ignoreSelector && node.matches(ignoreSelector)) { + return true; + } + + return false; +} + +function isClickBreadcrumb(breadcrumb) { + return !!(breadcrumb.data && typeof breadcrumb.data.nodeId === 'number' && breadcrumb.timestamp); +} + +// This is good enough for us, and is easier to test/mock than `timestampInSeconds` +function nowInSeconds() { + return Date.now() / 1000; +} + +/** + * Create a breadcrumb for a replay. + */ +function createBreadcrumb( + breadcrumb, +) { + return { + timestamp: Date.now() / 1000, + type: 'default', + ...breadcrumb, + }; +} + +var NodeType; +(function (NodeType) { + NodeType[NodeType["Document"] = 0] = "Document"; + NodeType[NodeType["DocumentType"] = 1] = "DocumentType"; + NodeType[NodeType["Element"] = 2] = "Element"; + NodeType[NodeType["Text"] = 3] = "Text"; + NodeType[NodeType["CDATA"] = 4] = "CDATA"; + NodeType[NodeType["Comment"] = 5] = "Comment"; +})(NodeType || (NodeType = {})); + +// Note that these are the serialized attributes and not attributes directly on +// the DOM Node. Attributes we are interested in: +const ATTRIBUTES_TO_RECORD = new Set([ + 'id', + 'class', + 'aria-label', + 'role', + 'name', + 'alt', + 'title', + 'data-test-id', + 'data-testid', + 'disabled', + 'aria-disabled', +]); + +/** + * Inclusion list of attributes that we want to record from the DOM element + */ +function getAttributesToRecord(attributes) { + const obj = {}; + for (const key in attributes) { + if (ATTRIBUTES_TO_RECORD.has(key)) { + let normalizedKey = key; + + if (key === 'data-testid' || key === 'data-test-id') { + normalizedKey = 'testId'; + } + + obj[normalizedKey] = attributes[key]; + } + } + + return obj; +} + +const handleDomListener = ( + replay, +) => { + return (handlerData) => { + if (!replay.isEnabled()) { + return; + } + + const result = handleDom(handlerData); + + if (!result) { + return; + } + + const isClick = handlerData.name === 'click'; + const event = isClick && (handlerData.event ); + // Ignore clicks if ctrl/alt/meta/shift keys are held down as they alter behavior of clicks (e.g. open in new tab) + if ( + isClick && + replay.clickDetector && + event && + !event.altKey && + !event.metaKey && + !event.ctrlKey && + !event.shiftKey + ) { + handleClick( + replay.clickDetector, + result , + getClickTargetNode(handlerData.event) , + ); + } + + addBreadcrumbEvent(replay, result); + }; +}; + +/** Get the base DOM breadcrumb. */ +function getBaseDomBreadcrumb(target, message) { + const nodeId = record.mirror.getId(target); + const node = nodeId && record.mirror.getNode(nodeId); + const meta = node && record.mirror.getMeta(node); + const element = meta && isElement(meta) ? meta : null; + + return { + message, + data: element + ? { + nodeId, + node: { + id: nodeId, + tagName: element.tagName, + textContent: Array.from(element.childNodes) + .map((node) => node.type === NodeType.Text && node.textContent) + .filter(Boolean) // filter out empty values + .map(text => (text ).trim()) + .join(''), + attributes: getAttributesToRecord(element.attributes), + }, + } + : {}, + }; +} + +/** + * An event handler to react to DOM events. + * Exported for tests. + */ +function handleDom(handlerData) { + const { target, message } = getDomTarget(handlerData); + + return createBreadcrumb({ + category: `ui.${handlerData.name}`, + ...getBaseDomBreadcrumb(target, message), + }); +} + +function getDomTarget(handlerData) { + const isClick = handlerData.name === 'click'; + + let message; + let target = null; + + // Accessing event.target can throw (see getsentry/raven-js#838, #768) + try { + target = isClick ? getClickTargetNode(handlerData.event) : getTargetNode(handlerData.event); + message = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.htmlTreeAsString)(target, { maxStringLength: 200 }) || ''; + } catch (e) { + message = ''; + } + + return { target, message }; +} + +function isElement(node) { + return node.type === NodeType.Element; +} + +/** Handle keyboard events & create breadcrumbs. */ +function handleKeyboardEvent(replay, event) { + if (!replay.isEnabled()) { + return; + } + + // Update user activity, but do not restart recording as it can create + // noisy/low-value replays (e.g. user comes back from idle, hits alt-tab, new + // session with a single "keydown" breadcrumb is created) + replay.updateUserActivity(); + + const breadcrumb = getKeyboardBreadcrumb(event); + + if (!breadcrumb) { + return; + } + + addBreadcrumbEvent(replay, breadcrumb); +} + +/** exported only for tests */ +function getKeyboardBreadcrumb(event) { + const { metaKey, shiftKey, ctrlKey, altKey, key, target } = event; + + // never capture for input fields + if (!target || isInputElement(target ) || !key) { + return null; + } + + // Note: We do not consider shift here, as that means "uppercase" + const hasModifierKey = metaKey || ctrlKey || altKey; + const isCharacterKey = key.length === 1; // other keys like Escape, Tab, etc have a longer length + + // Do not capture breadcrumb if only a word key is pressed + // This could leak e.g. user input + if (!hasModifierKey && isCharacterKey) { + return null; + } + + const message = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.htmlTreeAsString)(target, { maxStringLength: 200 }) || ''; + const baseBreadcrumb = getBaseDomBreadcrumb(target , message); + + return createBreadcrumb({ + category: 'ui.keyDown', + message, + data: { + ...baseBreadcrumb.data, + metaKey, + shiftKey, + ctrlKey, + altKey, + key, + }, + }); +} + +function isInputElement(target) { + return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable; +} + +const NAVIGATION_ENTRY_KEYS = [ + 'name', + 'type', + 'startTime', + 'transferSize', + 'duration', +]; + +function isNavigationEntryEqual(a) { + return function (b) { + return NAVIGATION_ENTRY_KEYS.every(key => a[key] === b[key]); + }; +} + +/** + * There are some difficulties diagnosing why there are duplicate navigation + * entries. We've witnessed several intermittent results: + * - duplicate entries have duration = 0 + * - duplicate entries are the same object reference + * - none of the above + * + * Compare the values of several keys to determine if the entries are duplicates or not. + */ +// TODO (high-prio): Figure out wth is returned here +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +function dedupePerformanceEntries( + currentList, + newList, +) { + // Partition `currentList` into 3 different lists based on entryType + const [existingNavigationEntries, existingLcpEntries, existingEntries] = currentList.reduce( + (acc, entry) => { + if (entry.entryType === 'navigation') { + acc[0].push(entry ); + } else if (entry.entryType === 'largest-contentful-paint') { + acc[1].push(entry ); + } else { + acc[2].push(entry); + } + return acc; + }, + [[], [], []], + ); + + const newEntries = []; + const newNavigationEntries = []; + let newLcpEntry = existingLcpEntries.length + ? existingLcpEntries[existingLcpEntries.length - 1] // Take the last element as list is sorted + : undefined; + + newList.forEach(entry => { + if (entry.entryType === 'largest-contentful-paint') { + // We want the latest LCP event only + if (!newLcpEntry || newLcpEntry.startTime < entry.startTime) { + newLcpEntry = entry; + } + return; + } + + if (entry.entryType === 'navigation') { + const navigationEntry = entry ; + + // Check if the navigation entry is contained in currentList or newList + if ( + // Ignore any navigation entries with duration 0, as they are likely duplicates + entry.duration > 0 && + // Ensure new entry does not already exist in existing entries + !existingNavigationEntries.find(isNavigationEntryEqual(navigationEntry)) && + // Ensure new entry does not already exist in new list of navigation entries + !newNavigationEntries.find(isNavigationEntryEqual(navigationEntry)) + ) { + newNavigationEntries.push(navigationEntry); + } + + // Otherwise this navigation entry is considered a duplicate and is thrown away + return; + } + + newEntries.push(entry); + }); + + // Re-combine and sort by startTime + return [ + ...(newLcpEntry ? [newLcpEntry] : []), + ...existingNavigationEntries, + ...existingEntries, + ...newEntries, + ...newNavigationEntries, + ].sort((a, b) => a.startTime - b.startTime); +} + +/** + * Sets up a PerformanceObserver to listen to all performance entry types. + */ +function setupPerformanceObserver(replay) { + const performanceObserverHandler = (list) => { + // For whatever reason the observer was returning duplicate navigation + // entries (the other entry types were not duplicated). + const newPerformanceEntries = dedupePerformanceEntries( + replay.performanceEvents, + list.getEntries() , + ); + replay.performanceEvents = newPerformanceEntries; + }; + + const performanceObserver = new PerformanceObserver(performanceObserverHandler); + + [ + 'element', + 'event', + 'first-input', + 'largest-contentful-paint', + 'layout-shift', + 'longtask', + 'navigation', + 'paint', + 'resource', + ].forEach(type => { + try { + performanceObserver.observe({ + type, + buffered: true, + }); + } catch (e) { + // This can throw if an entry type is not supported in the browser. + // Ignore these errors. + } + }); + + return performanceObserver; +} + +const r = `/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ +function t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},I={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindexi&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindexi&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:"pako deflate (from Nodeca project)"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Nt(e.dictionary):"[object ArrayBuffer]"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,"string"==typeof t?a.input=Nt(t):"[object ArrayBuffer]"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<>>=p,c-=p),c<15&&(f+=z[a++]<>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<o){t.msg="invalid distance too far back",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whavexe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=me;break}if((15&h)!==we){t.msg="unknown compression method",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=me;break}a.dmax=1<>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg="invalid literal/length code",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):"[object ArrayBuffer]"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,"[object ArrayBuffer]"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if("string"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const e=this._hasEvents?",":"";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push("]",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push("[",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener("message",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&"function"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});`; + +function e(){const e=new Blob([r]);return URL.createObjectURL(e)} + +/** + * Log a message in debug mode, and add a breadcrumb when _experiment.traceInternals is enabled. + */ +function logInfo(message, shouldAddBreadcrumb) { + if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + return; + } + + _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.info(message); + + if (shouldAddBreadcrumb) { + addBreadcrumb(message); + } +} + +/** + * Log a message, and add a breadcrumb in the next tick. + * This is necessary when the breadcrumb may be added before the replay is initialized. + */ +function logInfoNextTick(message, shouldAddBreadcrumb) { + if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + return; + } + + _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.info(message); + + if (shouldAddBreadcrumb) { + // Wait a tick here to avoid race conditions for some initial logs + // which may be added before replay is initialized + setTimeout(() => { + addBreadcrumb(message); + }, 0); + } +} + +function addBreadcrumb(message) { + const hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)(); + hub.addBreadcrumb( + { + category: 'console', + data: { + logger: 'replay', + }, + level: 'info', + message, + }, + { level: 'info' }, + ); +} + +/** This error indicates that the event buffer size exceeded the limit.. */ +class EventBufferSizeExceededError extends Error { + constructor() { + super(`Event buffer exceeded maximum size of ${REPLAY_MAX_EVENT_BUFFER_SIZE}.`); + } +} + +/** + * A basic event buffer that does not do any compression. + * Used as fallback if the compression worker cannot be loaded or is disabled. + */ +class EventBufferArray { + /** All the events that are buffered to be sent. */ + + /** @inheritdoc */ + + constructor() { + this.events = []; + this._totalSize = 0; + this.hasCheckout = false; + } + + /** @inheritdoc */ + get hasEvents() { + return this.events.length > 0; + } + + /** @inheritdoc */ + get type() { + return 'sync'; + } + + /** @inheritdoc */ + destroy() { + this.events = []; + } + + /** @inheritdoc */ + async addEvent(event) { + const eventSize = JSON.stringify(event).length; + this._totalSize += eventSize; + if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) { + throw new EventBufferSizeExceededError(); + } + + this.events.push(event); + } + + /** @inheritdoc */ + finish() { + return new Promise(resolve => { + // Make a copy of the events array reference and immediately clear the + // events member so that we do not lose new events while uploading + // attachment. + const eventsRet = this.events; + this.clear(); + resolve(JSON.stringify(eventsRet)); + }); + } + + /** @inheritdoc */ + clear() { + this.events = []; + this._totalSize = 0; + this.hasCheckout = false; + } + + /** @inheritdoc */ + getEarliestTimestamp() { + const timestamp = this.events.map(event => event.timestamp).sort()[0]; + + if (!timestamp) { + return null; + } + + return timestampToMs(timestamp); + } +} + +/** + * Event buffer that uses a web worker to compress events. + * Exported only for testing. + */ +class WorkerHandler { + + constructor(worker) { + this._worker = worker; + this._id = 0; + } + + /** + * Ensure the worker is ready (or not). + * This will either resolve when the worker is ready, or reject if an error occured. + */ + ensureReady() { + // Ensure we only check once + if (this._ensureReadyPromise) { + return this._ensureReadyPromise; + } + + this._ensureReadyPromise = new Promise((resolve, reject) => { + this._worker.addEventListener( + 'message', + ({ data }) => { + if ((data ).success) { + resolve(); + } else { + reject(); + } + }, + { once: true }, + ); + + this._worker.addEventListener( + 'error', + error => { + reject(error); + }, + { once: true }, + ); + }); + + return this._ensureReadyPromise; + } + + /** + * Destroy the worker. + */ + destroy() { + logInfo('[Replay] Destroying compression worker'); + this._worker.terminate(); + } + + /** + * Post message to worker and wait for response before resolving promise. + */ + postMessage(method, arg) { + const id = this._getAndIncrementId(); + + return new Promise((resolve, reject) => { + const listener = ({ data }) => { + const response = data ; + if (response.method !== method) { + return; + } + + // There can be multiple listeners for a single method, the id ensures + // that the response matches the caller. + if (response.id !== id) { + return; + } + + // At this point, we'll always want to remove listener regardless of result status + this._worker.removeEventListener('message', listener); + + if (!response.success) { + // TODO: Do some error handling, not sure what + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('[Replay]', response.response); + + reject(new Error('Error in compression worker')); + return; + } + + resolve(response.response ); + }; + + // Note: we can't use `once` option because it's possible it needs to + // listen to multiple messages + this._worker.addEventListener('message', listener); + this._worker.postMessage({ id, method, arg }); + }); + } + + /** Get the current ID and increment it for the next call. */ + _getAndIncrementId() { + return this._id++; + } +} + +/** + * Event buffer that uses a web worker to compress events. + * Exported only for testing. + */ +class EventBufferCompressionWorker { + /** @inheritdoc */ + + constructor(worker) { + this._worker = new WorkerHandler(worker); + this._earliestTimestamp = null; + this._totalSize = 0; + this.hasCheckout = false; + } + + /** @inheritdoc */ + get hasEvents() { + return !!this._earliestTimestamp; + } + + /** @inheritdoc */ + get type() { + return 'worker'; + } + + /** + * Ensure the worker is ready (or not). + * This will either resolve when the worker is ready, or reject if an error occured. + */ + ensureReady() { + return this._worker.ensureReady(); + } + + /** + * Destroy the event buffer. + */ + destroy() { + this._worker.destroy(); + } + + /** + * Add an event to the event buffer. + * + * Returns true if event was successfuly received and processed by worker. + */ + addEvent(event) { + const timestamp = timestampToMs(event.timestamp); + if (!this._earliestTimestamp || timestamp < this._earliestTimestamp) { + this._earliestTimestamp = timestamp; + } + + const data = JSON.stringify(event); + this._totalSize += data.length; + + if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) { + return Promise.reject(new EventBufferSizeExceededError()); + } + + return this._sendEventToWorker(data); + } + + /** + * Finish the event buffer and return the compressed data. + */ + finish() { + return this._finishRequest(); + } + + /** @inheritdoc */ + clear() { + this._earliestTimestamp = null; + this._totalSize = 0; + this.hasCheckout = false; + + // We do not wait on this, as we assume the order of messages is consistent for the worker + void this._worker.postMessage('clear'); + } + + /** @inheritdoc */ + getEarliestTimestamp() { + return this._earliestTimestamp; + } + + /** + * Send the event to the worker. + */ + _sendEventToWorker(data) { + return this._worker.postMessage('addEvent', data); + } + + /** + * Finish the request and return the compressed data from the worker. + */ + async _finishRequest() { + const response = await this._worker.postMessage('finish'); + + this._earliestTimestamp = null; + this._totalSize = 0; + + return response; + } +} + +/** + * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there. + * This can happen e.g. if the worker cannot be loaded. + * Exported only for testing. + */ +class EventBufferProxy { + + constructor(worker) { + this._fallback = new EventBufferArray(); + this._compression = new EventBufferCompressionWorker(worker); + this._used = this._fallback; + + this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded(); + } + + /** @inheritdoc */ + get type() { + return this._used.type; + } + + /** @inheritDoc */ + get hasEvents() { + return this._used.hasEvents; + } + + /** @inheritdoc */ + get hasCheckout() { + return this._used.hasCheckout; + } + /** @inheritdoc */ + set hasCheckout(value) { + this._used.hasCheckout = value; + } + + /** @inheritDoc */ + destroy() { + this._fallback.destroy(); + this._compression.destroy(); + } + + /** @inheritdoc */ + clear() { + return this._used.clear(); + } + + /** @inheritdoc */ + getEarliestTimestamp() { + return this._used.getEarliestTimestamp(); + } + + /** + * Add an event to the event buffer. + * + * Returns true if event was successfully added. + */ + addEvent(event) { + return this._used.addEvent(event); + } + + /** @inheritDoc */ + async finish() { + // Ensure the worker is loaded, so the sent event is compressed + await this.ensureWorkerIsLoaded(); + + return this._used.finish(); + } + + /** Ensure the worker has loaded. */ + ensureWorkerIsLoaded() { + return this._ensureWorkerIsLoadedPromise; + } + + /** Actually check if the worker has been loaded. */ + async _ensureWorkerIsLoaded() { + try { + await this._compression.ensureReady(); + } catch (error) { + // If the worker fails to load, we fall back to the simple buffer. + // Nothing more to do from our side here + logInfo('[Replay] Failed to load the compression worker, falling back to simple buffer'); + return; + } + + // Now we need to switch over the array buffer to the compression worker + await this._switchToCompressionWorker(); + } + + /** Switch the used buffer to the compression worker. */ + async _switchToCompressionWorker() { + const { events, hasCheckout } = this._fallback; + + const addEventPromises = []; + for (const event of events) { + addEventPromises.push(this._compression.addEvent(event)); + } + + this._compression.hasCheckout = hasCheckout; + + // We switch over to the new buffer immediately - any further events will be added + // after the previously buffered ones + this._used = this._compression; + + // Wait for original events to be re-added before resolving + try { + await Promise.all(addEventPromises); + } catch (error) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.warn('[Replay] Failed to add events when switching buffers.', error); + } + } +} + +/** + * Create an event buffer for replays. + */ +function createEventBuffer({ useCompression }) { + // eslint-disable-next-line no-restricted-globals + if (useCompression && window.Worker) { + try { + const workerUrl = e(); + + logInfo('[Replay] Using compression worker'); + const worker = new Worker(workerUrl); + return new EventBufferProxy(worker); + } catch (error) { + logInfo('[Replay] Failed to create compression worker'); + // Fall back to use simple event buffer array + } + } + + logInfo('[Replay] Using simple buffer'); + return new EventBufferArray(); +} + +/** If sessionStorage is available. */ +function hasSessionStorage() { + try { + // This can throw, e.g. when being accessed in a sandboxed iframe + return 'sessionStorage' in WINDOW && !!WINDOW.sessionStorage; + } catch (e) { + return false; + } +} + +/** + * Removes the session from Session Storage and unsets session in replay instance + */ +function clearSession(replay) { + deleteSession(); + replay.session = undefined; +} + +/** + * Deletes a session from storage + */ +function deleteSession() { + if (!hasSessionStorage()) { + return; + } + + try { + WINDOW.sessionStorage.removeItem(REPLAY_SESSION_KEY); + } catch (e) { + // Ignore potential SecurityError exceptions + } +} + +/** + * Given a sample rate, returns true if replay should be sampled. + * + * 1.0 = 100% sampling + * 0.0 = 0% sampling + */ +function isSampled(sampleRate) { + if (sampleRate === undefined) { + return false; + } + + // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1) + return Math.random() < sampleRate; +} + +/** + * Save a session to session storage. + */ +function saveSession(session) { + if (!hasSessionStorage()) { + return; + } + + try { + WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session)); + } catch (e) { + // Ignore potential SecurityError exceptions + } +} + +/** + * Get a session with defaults & applied sampling. + */ +function makeSession(session) { + const now = Date.now(); + const id = session.id || (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_6__.uuid4)(); + // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests. + const started = session.started || now; + const lastActivity = session.lastActivity || now; + const segmentId = session.segmentId || 0; + const sampled = session.sampled; + const previousSessionId = session.previousSessionId; + + return { + id, + started, + lastActivity, + segmentId, + sampled, + previousSessionId, + }; +} + +/** + * Get the sampled status for a session based on sample rates & current sampled status. + */ +function getSessionSampleType(sessionSampleRate, allowBuffering) { + return isSampled(sessionSampleRate) ? 'session' : allowBuffering ? 'buffer' : false; +} + +/** + * Create a new session, which in its current implementation is a Sentry event + * that all replays will be saved to as attachments. Currently, we only expect + * one of these Sentry events per "replay session". + */ +function createSession( + { sessionSampleRate, allowBuffering, stickySession = false }, + { previousSessionId } = {}, +) { + const sampled = getSessionSampleType(sessionSampleRate, allowBuffering); + const session = makeSession({ + sampled, + previousSessionId, + }); + + if (stickySession) { + saveSession(session); + } + + return session; +} + +/** + * Fetches a session from storage + */ +function fetchSession(traceInternals) { + if (!hasSessionStorage()) { + return null; + } + + try { + // This can throw if cookies are disabled + const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY); + + if (!sessionStringFromStorage) { + return null; + } + + const sessionObj = JSON.parse(sessionStringFromStorage) ; + + logInfoNextTick('[Replay] Loading existing session', traceInternals); + + return makeSession(sessionObj); + } catch (e) { + return null; + } +} + +/** + * Given an initial timestamp and an expiry duration, checks to see if current + * time should be considered as expired. + */ +function isExpired( + initialTime, + expiry, + targetTime = +new Date(), +) { + // Always expired if < 0 + if (initialTime === null || expiry === undefined || expiry < 0) { + return true; + } + + // Never expires if == 0 + if (expiry === 0) { + return false; + } + + return initialTime + expiry <= targetTime; +} + +/** + * Checks to see if session is expired + */ +function isSessionExpired( + session, + { + maxReplayDuration, + sessionIdleExpire, + targetTime = Date.now(), + }, +) { + return ( + // First, check that maximum session length has not been exceeded + isExpired(session.started, maxReplayDuration, targetTime) || + // check that the idle timeout has not been exceeded (i.e. user has + // performed an action within the last `sessionIdleExpire` ms) + isExpired(session.lastActivity, sessionIdleExpire, targetTime) + ); +} + +/** If the session should be refreshed or not. */ +function shouldRefreshSession( + session, + { sessionIdleExpire, maxReplayDuration }, +) { + // If not expired, all good, just keep the session + if (!isSessionExpired(session, { sessionIdleExpire, maxReplayDuration })) { + return false; + } + + // If we are buffering & haven't ever flushed yet, always continue + if (session.sampled === 'buffer' && session.segmentId === 0) { + return false; + } + + return true; +} + +/** + * Get or create a session, when initializing the replay. + * Returns a session that may be unsampled. + */ +function loadOrCreateSession( + { + traceInternals, + sessionIdleExpire, + maxReplayDuration, + previousSessionId, + } + +, + sessionOptions, +) { + const existingSession = sessionOptions.stickySession && fetchSession(traceInternals); + + // No session exists yet, just create a new one + if (!existingSession) { + logInfoNextTick('[Replay] Creating new session', traceInternals); + return createSession(sessionOptions, { previousSessionId }); + } + + if (!shouldRefreshSession(existingSession, { sessionIdleExpire, maxReplayDuration })) { + return existingSession; + } + + logInfoNextTick('[Replay] Session in sessionStorage is expired, creating new one...'); + return createSession(sessionOptions, { previousSessionId: existingSession.id }); +} + +const ReplayEventTypeCustom = 5; + +function isCustomEvent(event) { + return event.type === EventType.Custom; +} + +/** + * Add an event to the event buffer. + * In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail. + * Instead this returns `true` if we tried to add the event, else false. + * It returns `false` e.g. if we are paused, disabled, or out of the max replay duration. + * + * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`. + */ +function addEventSync(replay, event, isCheckout) { + if (!shouldAddEvent(replay, event)) { + return false; + } + + void _addEvent(replay, event, isCheckout); + + return true; +} + +/** + * Add an event to the event buffer. + * Resolves to `null` if no event was added, else to `void`. + * + * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`. + */ +function addEvent( + replay, + event, + isCheckout, +) { + if (!shouldAddEvent(replay, event)) { + return Promise.resolve(null); + } + + return _addEvent(replay, event, isCheckout); +} + +async function _addEvent( + replay, + event, + isCheckout, +) { + if (!replay.eventBuffer) { + return null; + } + + try { + if (isCheckout && replay.recordingMode === 'buffer') { + replay.eventBuffer.clear(); + } + + if (isCheckout) { + replay.eventBuffer.hasCheckout = true; + } + + const replayOptions = replay.getOptions(); + + const eventAfterPossibleCallback = maybeApplyCallback(event, replayOptions.beforeAddRecordingEvent); + + if (!eventAfterPossibleCallback) { + return; + } + + return await replay.eventBuffer.addEvent(eventAfterPossibleCallback); + } catch (error) { + const reason = error && error instanceof EventBufferSizeExceededError ? 'addEventSizeExceeded' : 'addEvent'; + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error(error); + await replay.stop({ reason }); + + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)().getClient(); + + if (client) { + client.recordDroppedEvent('internal_sdk_error', 'replay'); + } + } +} + +/** Exported only for tests. */ +function shouldAddEvent(replay, event) { + if (!replay.eventBuffer || replay.isPaused() || !replay.isEnabled()) { + return false; + } + + const timestampInMs = timestampToMs(event.timestamp); + + // Throw out events that happen more than 5 minutes ago. This can happen if + // page has been left open and idle for a long period of time and user + // comes back to trigger a new session. The performance entries rely on + // `performance.timeOrigin`, which is when the page first opened. + if (timestampInMs + replay.timeouts.sessionIdlePause < Date.now()) { + return false; + } + + // Throw out events that are +60min from the initial timestamp + if (timestampInMs > replay.getContext().initialTimestamp + replay.getOptions().maxReplayDuration) { + logInfo( + `[Replay] Skipping event with timestamp ${timestampInMs} because it is after maxReplayDuration`, + replay.getOptions()._experiments.traceInternals, + ); + return false; + } + + return true; +} + +function maybeApplyCallback( + event, + callback, +) { + try { + if (typeof callback === 'function' && isCustomEvent(event)) { + return callback(event); + } + } catch (error) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...', error); + return null; + } + + return event; +} + +/** If the event is an error event */ +function isErrorEvent(event) { + return !event.type; +} + +/** If the event is a transaction event */ +function isTransactionEvent(event) { + return event.type === 'transaction'; +} + +/** If the event is an replay event */ +function isReplayEvent(event) { + return event.type === 'replay_event'; +} + +/** + * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`. + */ +function handleAfterSendEvent(replay) { + // Custom transports may still be returning `Promise`, which means we cannot expect the status code to be available there + // TODO (v8): remove this check as it will no longer be necessary + const enforceStatusCode = isBaseTransportSend(); + + return (event, sendResponse) => { + if (!replay.isEnabled() || (!isErrorEvent(event) && !isTransactionEvent(event))) { + return; + } + + const statusCode = sendResponse && sendResponse.statusCode; + + // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached + // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet) + // If we do use the base transport, we skip if we encountered an non-OK status code + if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) { + return; + } + + if (isTransactionEvent(event)) { + handleTransactionEvent(replay, event); + return; + } + + handleErrorEvent(replay, event); + }; +} + +function handleTransactionEvent(replay, event) { + const replayContext = replay.getContext(); + + // Collect traceIds in _context regardless of `recordingMode` + // In error mode, _context gets cleared on every checkout + // We limit to max. 100 transactions linked + if (event.contexts && event.contexts.trace && event.contexts.trace.trace_id && replayContext.traceIds.size < 100) { + replayContext.traceIds.add(event.contexts.trace.trace_id ); + } +} + +function handleErrorEvent(replay, event) { + const replayContext = replay.getContext(); + + // Add error to list of errorIds of replay. This is ok to do even if not + // sampled because context will get reset at next checkout. + // XXX: There is also a race condition where it's possible to capture an + // error to Sentry before Replay SDK has loaded, but response returns after + // it was loaded, and this gets called. + // We limit to max. 100 errors linked + if (event.event_id && replayContext.errorIds.size < 100) { + replayContext.errorIds.add(event.event_id); + } + + // If error event is tagged with replay id it means it was sampled (when in buffer mode) + // Need to be very careful that this does not cause an infinite loop + if (replay.recordingMode === 'buffer' && event.tags && event.tags.replayId) { + setTimeout(() => { + // Capture current event buffer as new replay + void replay.sendBufferedReplayOrFlush(); + }); + } +} + +function isBaseTransportSend() { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)().getClient(); + if (!client) { + return false; + } + + const transport = client.getTransport(); + if (!transport) { + return false; + } + + return ( + (transport.send ).__sentry__baseTransport__ || false + ); +} + +/** + * Returns true if we think the given event is an error originating inside of rrweb. + */ +function isRrwebError(event, hint) { + if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) { + return false; + } + + // @ts-expect-error this may be set by rrweb when it finds errors + if (hint.originalException && hint.originalException.__rrweb__) { + return true; + } + + // Check if any exception originates from rrweb + return event.exception.values.some(exception => { + if (!exception.stacktrace || !exception.stacktrace.frames || !exception.stacktrace.frames.length) { + return false; + } + + return exception.stacktrace.frames.some(frame => frame.filename && frame.filename.includes('/rrweb/src/')); + }); +} + +/** + * Determine if event should be sampled (only applies in buffer mode). + * When an event is captured by `hanldleGlobalEvent`, when in buffer mode + * we determine if we want to sample the error or not. + */ +function shouldSampleForBufferEvent(replay, event) { + if (replay.recordingMode !== 'buffer') { + return false; + } + + // ignore this error because otherwise we could loop indefinitely with + // trying to capture replay and failing + if (event.message === UNABLE_TO_SEND_REPLAY) { + return false; + } + + // Require the event to be an error event & to have an exception + if (!event.exception || event.type) { + return false; + } + + return isSampled(replay.getOptions().errorSampleRate); +} + +/** + * Returns a listener to be added to `addGlobalEventProcessor(listener)`. + */ +function handleGlobalEventListener( + replay, + includeAfterSendEventHandling = false, +) { + const afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined; + + return Object.assign( + (event, hint) => { + // Do nothing if replay has been disabled + if (!replay.isEnabled()) { + return event; + } + + if (isReplayEvent(event)) { + // Replays have separate set of breadcrumbs, do not include breadcrumbs + // from core SDK + delete event.breadcrumbs; + return event; + } + + // We only want to handle errors & transactions, nothing else + if (!isErrorEvent(event) && !isTransactionEvent(event)) { + return event; + } + + // Ensure we do not add replay_id if the session is expired + const isSessionActive = replay.checkAndHandleExpiredSession(); + if (!isSessionActive) { + return event; + } + + // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb + // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users + if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.log('[Replay] Ignoring error from rrweb internals', event); + return null; + } + + // When in buffer mode, we decide to sample here. + // Later, in `handleAfterSendEvent`, if the replayId is set, we know that we sampled + // And convert the buffer session to a full session + const isErrorEventSampled = shouldSampleForBufferEvent(replay, event); + + // Tag errors if it has been sampled in buffer mode, or if it is session mode + // Only tag transactions if in session mode + const shouldTagReplayId = isErrorEventSampled || replay.recordingMode === 'session'; + + if (shouldTagReplayId) { + event.tags = { ...event.tags, replayId: replay.getSessionId() }; + } + + // In cases where a custom client is used that does not support the new hooks (yet), + // we manually call this hook method here + if (afterSendHandler) { + // Pretend the error had a 200 response so we always capture it + afterSendHandler(event, { statusCode: 200 }); + } + + return event; + }, + { id: 'Replay' }, + ); +} + +/** + * Create a "span" for each performance entry. + */ +function createPerformanceSpans( + replay, + entries, +) { + return entries.map(({ type, start, end, name, data }) => { + const response = replay.throttledAddEvent({ + type: EventType.Custom, + timestamp: start, + data: { + tag: 'performanceSpan', + payload: { + op: type, + description: name, + startTimestamp: start, + endTimestamp: end, + data, + }, + }, + }); + + // If response is a string, it means its either THROTTLED or SKIPPED + return typeof response === 'string' ? Promise.resolve(null) : response; + }); +} + +function handleHistory(handlerData) { + const { from, to } = handlerData; + + const now = Date.now() / 1000; + + return { + type: 'navigation.push', + start: now, + end: now, + name: to, + data: { + previous: from, + }, + }; +} + +/** + * Returns a listener to be added to `addInstrumentationHandler('history', listener)`. + */ +function handleHistorySpanListener(replay) { + return (handlerData) => { + if (!replay.isEnabled()) { + return; + } + + const result = handleHistory(handlerData); + + if (result === null) { + return; + } + + // Need to collect visited URLs + replay.getContext().urls.push(result.name); + replay.triggerUserActivity(); + + replay.addUpdate(() => { + createPerformanceSpans(replay, [result]); + // Returning false to flush + return false; + }); + }; +} + +/** + * Check whether a given request URL should be filtered out. This is so we + * don't log Sentry ingest requests. + */ +function shouldFilterRequest(replay, url) { + // If we enabled the `traceInternals` experiment, we want to trace everything + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && replay.getOptions()._experiments.traceInternals) { + return false; + } + + return (0,_sentry_core__WEBPACK_IMPORTED_MODULE_7__.isSentryRequestUrl)(url, (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)()); +} + +/** Add a performance entry breadcrumb */ +function addNetworkBreadcrumb( + replay, + result, +) { + if (!replay.isEnabled()) { + return; + } + + if (result === null) { + return; + } + + if (shouldFilterRequest(replay, result.name)) { + return; + } + + replay.addUpdate(() => { + createPerformanceSpans(replay, [result]); + // Returning true will cause `addUpdate` to not flush + // We do not want network requests to cause a flush. This will prevent + // recurring/polling requests from keeping the replay session alive. + return true; + }); +} + +/** only exported for tests */ +function handleFetch(handlerData) { + const { startTimestamp, endTimestamp, fetchData, response } = handlerData; + + if (!endTimestamp) { + return null; + } + + // This is only used as a fallback, so we know the body sizes are never set here + const { method, url } = fetchData; + + return { + type: 'resource.fetch', + start: startTimestamp / 1000, + end: endTimestamp / 1000, + name: url, + data: { + method, + statusCode: response ? (response ).status : undefined, + }, + }; +} + +/** + * Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`. + */ +function handleFetchSpanListener(replay) { + return (handlerData) => { + if (!replay.isEnabled()) { + return; + } + + const result = handleFetch(handlerData); + + addNetworkBreadcrumb(replay, result); + }; +} + +/** only exported for tests */ +function handleXhr(handlerData) { + const { startTimestamp, endTimestamp, xhr } = handlerData; + + const sentryXhrData = xhr[_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.SENTRY_XHR_DATA_KEY]; + + if (!startTimestamp || !endTimestamp || !sentryXhrData) { + return null; + } + + // This is only used as a fallback, so we know the body sizes are never set here + const { method, url, status_code: statusCode } = sentryXhrData; + + if (url === undefined) { + return null; + } + + return { + type: 'resource.xhr', + name: url, + start: startTimestamp / 1000, + end: endTimestamp / 1000, + data: { + method, + statusCode, + }, + }; +} + +/** + * Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`. + */ +function handleXhrSpanListener(replay) { + return (handlerData) => { + if (!replay.isEnabled()) { + return; + } + + const result = handleXhr(handlerData); + + addNetworkBreadcrumb(replay, result); + }; +} + +const OBJ = 10; +const OBJ_KEY = 11; +const OBJ_KEY_STR = 12; +const OBJ_VAL = 13; +const OBJ_VAL_STR = 14; +const OBJ_VAL_COMPLETED = 15; + +const ARR = 20; +const ARR_VAL = 21; +const ARR_VAL_STR = 22; +const ARR_VAL_COMPLETED = 23; + +const ALLOWED_PRIMITIVES = ['true', 'false', 'null']; + +/** + * Complete an incomplete JSON string. + * This will ensure that the last element always has a `"~~"` to indicate it was truncated. + * For example, `[1,2,` will be completed to `[1,2,"~~"]` + * and `{"aa":"b` will be completed to `{"aa":"b~~"}` + */ +function completeJson(incompleteJson, stack) { + if (!stack.length) { + return incompleteJson; + } + + let json = incompleteJson; + + // Most checks are only needed for the last step in the stack + const lastPos = stack.length - 1; + const lastStep = stack[lastPos]; + + json = _fixLastStep(json, lastStep); + + // Complete remaining steps - just add closing brackets + for (let i = lastPos; i >= 0; i--) { + const step = stack[i]; + + switch (step) { + case OBJ: + json = `${json}}`; + break; + case ARR: + json = `${json}]`; + break; + } + } + + return json; +} + +function _fixLastStep(json, lastStep) { + switch (lastStep) { + // Object cases + case OBJ: + return `${json}"~~":"~~"`; + case OBJ_KEY: + return `${json}:"~~"`; + case OBJ_KEY_STR: + return `${json}~~":"~~"`; + case OBJ_VAL: + return _maybeFixIncompleteObjValue(json); + case OBJ_VAL_STR: + return `${json}~~"`; + case OBJ_VAL_COMPLETED: + return `${json},"~~":"~~"`; + + // Array cases + case ARR: + return `${json}"~~"`; + case ARR_VAL: + return _maybeFixIncompleteArrValue(json); + case ARR_VAL_STR: + return `${json}~~"`; + case ARR_VAL_COMPLETED: + return `${json},"~~"`; + } + + return json; +} + +function _maybeFixIncompleteArrValue(json) { + const pos = _findLastArrayDelimiter(json); + + if (pos > -1) { + const part = json.slice(pos + 1); + + if (ALLOWED_PRIMITIVES.includes(part.trim())) { + return `${json},"~~"`; + } + + // Everything else is replaced with `"~~"` + return `${json.slice(0, pos + 1)}"~~"`; + } + + // fallback, this shouldn't happen, to be save + return json; +} + +function _findLastArrayDelimiter(json) { + for (let i = json.length - 1; i >= 0; i--) { + const char = json[i]; + + if (char === ',' || char === '[') { + return i; + } + } + + return -1; +} + +function _maybeFixIncompleteObjValue(json) { + const startPos = json.lastIndexOf(':'); + + const part = json.slice(startPos + 1); + + if (ALLOWED_PRIMITIVES.includes(part.trim())) { + return `${json},"~~":"~~"`; + } + + // Everything else is replaced with `"~~"` + // This also means we do not have incomplete numbers, e.g `[1` is replaced with `["~~"]` + return `${json.slice(0, startPos + 1)}"~~"`; +} + +/** + * Evaluate an (incomplete) JSON string. + */ +function evaluateJson(json) { + const stack = []; + + for (let pos = 0; pos < json.length; pos++) { + _evaluateJsonPos(stack, json, pos); + } + + return stack; +} + +function _evaluateJsonPos(stack, json, pos) { + const curStep = stack[stack.length - 1]; + + const char = json[pos]; + + const whitespaceRegex = /\s/; + + if (whitespaceRegex.test(char)) { + return; + } + + if (char === '"' && !_isEscaped(json, pos)) { + _handleQuote(stack, curStep); + return; + } + + switch (char) { + case '{': + _handleObj(stack, curStep); + break; + case '[': + _handleArr(stack, curStep); + break; + case ':': + _handleColon(stack, curStep); + break; + case ',': + _handleComma(stack, curStep); + break; + case '}': + _handleObjClose(stack, curStep); + break; + case ']': + _handleArrClose(stack, curStep); + break; + } +} + +function _handleQuote(stack, curStep) { + // End of obj value + if (curStep === OBJ_VAL_STR) { + stack.pop(); + stack.push(OBJ_VAL_COMPLETED); + return; + } + + // End of arr value + if (curStep === ARR_VAL_STR) { + stack.pop(); + stack.push(ARR_VAL_COMPLETED); + return; + } + + // Start of obj value + if (curStep === OBJ_VAL) { + stack.push(OBJ_VAL_STR); + return; + } + + // Start of arr value + if (curStep === ARR_VAL) { + stack.push(ARR_VAL_STR); + return; + } + + // Start of obj key + if (curStep === OBJ) { + stack.push(OBJ_KEY_STR); + return; + } + + // End of obj key + if (curStep === OBJ_KEY_STR) { + stack.pop(); + stack.push(OBJ_KEY); + return; + } +} + +function _handleObj(stack, curStep) { + // Initial object + if (!curStep) { + stack.push(OBJ); + return; + } + + // New object as obj value + if (curStep === OBJ_VAL) { + stack.push(OBJ); + return; + } + + // New object as array element + if (curStep === ARR_VAL) { + stack.push(OBJ); + } + + // New object as first array element + if (curStep === ARR) { + stack.push(OBJ); + return; + } +} + +function _handleArr(stack, curStep) { + // Initial array + if (!curStep) { + stack.push(ARR); + stack.push(ARR_VAL); + return; + } + + // New array as obj value + if (curStep === OBJ_VAL) { + stack.push(ARR); + stack.push(ARR_VAL); + return; + } + + // New array as array element + if (curStep === ARR_VAL) { + stack.push(ARR); + stack.push(ARR_VAL); + } + + // New array as first array element + if (curStep === ARR) { + stack.push(ARR); + stack.push(ARR_VAL); + return; + } +} + +function _handleColon(stack, curStep) { + if (curStep === OBJ_KEY) { + stack.pop(); + stack.push(OBJ_VAL); + } +} + +function _handleComma(stack, curStep) { + // Comma after obj value + if (curStep === OBJ_VAL) { + stack.pop(); + return; + } + if (curStep === OBJ_VAL_COMPLETED) { + // Pop OBJ_VAL_COMPLETED & OBJ_VAL + stack.pop(); + stack.pop(); + return; + } + + // Comma after arr value + if (curStep === ARR_VAL) { + // do nothing - basically we'd pop ARR_VAL but add it right back + return; + } + + if (curStep === ARR_VAL_COMPLETED) { + // Pop ARR_VAL_COMPLETED + stack.pop(); + + // basically we'd pop ARR_VAL but add it right back + return; + } +} + +function _handleObjClose(stack, curStep) { + // Empty object {} + if (curStep === OBJ) { + stack.pop(); + } + + // Object with element + if (curStep === OBJ_VAL) { + // Pop OBJ_VAL, OBJ + stack.pop(); + stack.pop(); + } + + // Obj with element + if (curStep === OBJ_VAL_COMPLETED) { + // Pop OBJ_VAL_COMPLETED, OBJ_VAL, OBJ + stack.pop(); + stack.pop(); + stack.pop(); + } + + // if was obj value, complete it + if (stack[stack.length - 1] === OBJ_VAL) { + stack.push(OBJ_VAL_COMPLETED); + } + + // if was arr value, complete it + if (stack[stack.length - 1] === ARR_VAL) { + stack.push(ARR_VAL_COMPLETED); + } +} + +function _handleArrClose(stack, curStep) { + // Empty array [] + if (curStep === ARR) { + stack.pop(); + } + + // Array with element + if (curStep === ARR_VAL) { + // Pop ARR_VAL, ARR + stack.pop(); + stack.pop(); + } + + // Array with element + if (curStep === ARR_VAL_COMPLETED) { + // Pop ARR_VAL_COMPLETED, ARR_VAL, ARR + stack.pop(); + stack.pop(); + stack.pop(); + } + + // if was obj value, complete it + if (stack[stack.length - 1] === OBJ_VAL) { + stack.push(OBJ_VAL_COMPLETED); + } + + // if was arr value, complete it + if (stack[stack.length - 1] === ARR_VAL) { + stack.push(ARR_VAL_COMPLETED); + } +} + +function _isEscaped(str, pos) { + const previousChar = str[pos - 1]; + + return previousChar === '\\' && !_isEscaped(str, pos - 1); +} + +/* eslint-disable max-lines */ + +/** + * Takes an incomplete JSON string, and returns a hopefully valid JSON string. + * Note that this _can_ fail, so you should check the return value is valid JSON. + */ +function fixJson(incompleteJson) { + const stack = evaluateJson(incompleteJson); + + return completeJson(incompleteJson, stack); +} + +/** Get the size of a body. */ +function getBodySize( + body, + textEncoder, +) { + if (!body) { + return undefined; + } + + try { + if (typeof body === 'string') { + return textEncoder.encode(body).length; + } + + if (body instanceof URLSearchParams) { + return textEncoder.encode(body.toString()).length; + } + + if (body instanceof FormData) { + const formDataStr = _serializeFormData(body); + return textEncoder.encode(formDataStr).length; + } + + if (body instanceof Blob) { + return body.size; + } + + if (body instanceof ArrayBuffer) { + return body.byteLength; + } + + // Currently unhandled types: ArrayBufferView, ReadableStream + } catch (e) { + // just return undefined + } + + return undefined; +} + +/** Convert a Content-Length header to number/undefined. */ +function parseContentLengthHeader(header) { + if (!header) { + return undefined; + } + + const size = parseInt(header, 10); + return isNaN(size) ? undefined : size; +} + +/** Get the string representation of a body. */ +function getBodyString(body) { + if (typeof body === 'string') { + return body; + } + + if (body instanceof URLSearchParams) { + return body.toString(); + } + + if (body instanceof FormData) { + return _serializeFormData(body); + } + + return undefined; +} + +/** Convert ReplayNetworkRequestData to a PerformanceEntry. */ +function makeNetworkReplayBreadcrumb( + type, + data, +) { + if (!data) { + return null; + } + + const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data; + + const result = { + type, + start: startTimestamp / 1000, + end: endTimestamp / 1000, + name: url, + data: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.dropUndefinedKeys)({ + method, + statusCode, + request, + response, + }), + }; + + return result; +} + +/** Build the request or response part of a replay network breadcrumb that was skipped. */ +function buildSkippedNetworkRequestOrResponse(bodySize) { + return { + headers: {}, + size: bodySize, + _meta: { + warnings: ['URL_SKIPPED'], + }, + }; +} + +/** Build the request or response part of a replay network breadcrumb. */ +function buildNetworkRequestOrResponse( + headers, + bodySize, + body, +) { + if (!bodySize && Object.keys(headers).length === 0) { + return undefined; + } + + if (!bodySize) { + return { + headers, + }; + } + + if (!body) { + return { + headers, + size: bodySize, + }; + } + + const info = { + headers, + size: bodySize, + }; + + const { body: normalizedBody, warnings } = normalizeNetworkBody(body); + info.body = normalizedBody; + if (warnings.length > 0) { + info._meta = { + warnings, + }; + } + + return info; +} + +/** Filter a set of headers */ +function getAllowedHeaders(headers, allowedHeaders) { + return Object.keys(headers).reduce((filteredHeaders, key) => { + const normalizedKey = key.toLowerCase(); + // Avoid putting empty strings into the headers + if (allowedHeaders.includes(normalizedKey) && headers[key]) { + filteredHeaders[normalizedKey] = headers[key]; + } + return filteredHeaders; + }, {}); +} + +function _serializeFormData(formData) { + // This is a bit simplified, but gives us a decent estimate + // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13' + // @ts-expect-error passing FormData to URLSearchParams actually works + return new URLSearchParams(formData).toString(); +} + +function normalizeNetworkBody(body) + + { + if (!body || typeof body !== 'string') { + return { + body, + warnings: [], + }; + } + + const exceedsSizeLimit = body.length > NETWORK_BODY_MAX_SIZE; + + if (_strIsProbablyJson(body)) { + try { + const json = exceedsSizeLimit ? fixJson(body.slice(0, NETWORK_BODY_MAX_SIZE)) : body; + const normalizedBody = JSON.parse(json); + return { + body: normalizedBody, + warnings: exceedsSizeLimit ? ['JSON_TRUNCATED'] : [], + }; + } catch (e3) { + return { + body: exceedsSizeLimit ? `${body.slice(0, NETWORK_BODY_MAX_SIZE)}…` : body, + warnings: exceedsSizeLimit ? ['INVALID_JSON', 'TEXT_TRUNCATED'] : ['INVALID_JSON'], + }; + } + } + + return { + body: exceedsSizeLimit ? `${body.slice(0, NETWORK_BODY_MAX_SIZE)}…` : body, + warnings: exceedsSizeLimit ? ['TEXT_TRUNCATED'] : [], + }; +} + +function _strIsProbablyJson(str) { + const first = str[0]; + const last = str[str.length - 1]; + + // Simple check: If this does not start & end with {} or [], it's not JSON + return (first === '[' && last === ']') || (first === '{' && last === '}'); +} + +/** Match an URL against a list of strings/Regex. */ +function urlMatches(url, urls) { + const fullUrl = getFullUrl(url); + + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_9__.stringMatchesSomePattern)(fullUrl, urls); +} + +/** exported for tests */ +function getFullUrl(url, baseURI = WINDOW.document.baseURI) { + // Short circuit for common cases: + if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith(WINDOW.location.origin)) { + return url; + } + const fixedUrl = new URL(url, baseURI); + + // If these do not match, we are not dealing with a relative URL, so just return it + if (fixedUrl.origin !== new URL(baseURI).origin) { + return url; + } + + const fullUrl = fixedUrl.href; + + // Remove trailing slashes, if they don't match the original URL + if (!url.endsWith('/') && fullUrl.endsWith('/')) { + return fullUrl.slice(0, -1); + } + + return fullUrl; +} + +/** + * Capture a fetch breadcrumb to a replay. + * This adds additional data (where approriate). + */ +async function captureFetchBreadcrumbToReplay( + breadcrumb, + hint, + options + +, +) { + try { + const data = await _prepareFetchData(breadcrumb, hint, options); + + // Create a replay performance entry from this breadcrumb + const result = makeNetworkReplayBreadcrumb('resource.fetch', data); + addNetworkBreadcrumb(options.replay, result); + } catch (error) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('[Replay] Failed to capture fetch breadcrumb', error); + } +} + +/** + * Enrich a breadcrumb with additional data. + * This has to be sync & mutate the given breadcrumb, + * as the breadcrumb is afterwards consumed by other handlers. + */ +function enrichFetchBreadcrumb( + breadcrumb, + hint, + options, +) { + const { input, response } = hint; + + const body = _getFetchRequestArgBody(input); + const reqSize = getBodySize(body, options.textEncoder); + + const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined; + + if (reqSize !== undefined) { + breadcrumb.data.request_body_size = reqSize; + } + if (resSize !== undefined) { + breadcrumb.data.response_body_size = resSize; + } +} + +async function _prepareFetchData( + breadcrumb, + hint, + options + +, +) { + const { startTimestamp, endTimestamp } = hint; + + const { + url, + method, + status_code: statusCode = 0, + request_body_size: requestBodySize, + response_body_size: responseBodySize, + } = breadcrumb.data; + + const captureDetails = + urlMatches(url, options.networkDetailAllowUrls) && !urlMatches(url, options.networkDetailDenyUrls); + + const request = captureDetails + ? _getRequestInfo(options, hint.input, requestBodySize) + : buildSkippedNetworkRequestOrResponse(requestBodySize); + const response = await _getResponseInfo(captureDetails, options, hint.response, responseBodySize); + + return { + startTimestamp, + endTimestamp, + url, + method, + statusCode, + request, + response, + }; +} + +function _getRequestInfo( + { networkCaptureBodies, networkRequestHeaders }, + input, + requestBodySize, +) { + const headers = getRequestHeaders(input, networkRequestHeaders); + + if (!networkCaptureBodies) { + return buildNetworkRequestOrResponse(headers, requestBodySize, undefined); + } + + // We only want to transmit string or string-like bodies + const requestBody = _getFetchRequestArgBody(input); + const bodyStr = getBodyString(requestBody); + return buildNetworkRequestOrResponse(headers, requestBodySize, bodyStr); +} + +async function _getResponseInfo( + captureDetails, + { + networkCaptureBodies, + textEncoder, + networkResponseHeaders, + } + +, + response, + responseBodySize, +) { + if (!captureDetails && responseBodySize !== undefined) { + return buildSkippedNetworkRequestOrResponse(responseBodySize); + } + + const headers = getAllHeaders(response.headers, networkResponseHeaders); + + if (!networkCaptureBodies && responseBodySize !== undefined) { + return buildNetworkRequestOrResponse(headers, responseBodySize, undefined); + } + + // Only clone the response if we need to + try { + // We have to clone this, as the body can only be read once + const res = response.clone(); + const bodyText = await _parseFetchBody(res); + + const size = + bodyText && bodyText.length && responseBodySize === undefined + ? getBodySize(bodyText, textEncoder) + : responseBodySize; + + if (!captureDetails) { + return buildSkippedNetworkRequestOrResponse(size); + } + + if (networkCaptureBodies) { + return buildNetworkRequestOrResponse(headers, size, bodyText); + } + + return buildNetworkRequestOrResponse(headers, size, undefined); + } catch (e) { + // fallback + return buildNetworkRequestOrResponse(headers, responseBodySize, undefined); + } +} + +async function _parseFetchBody(response) { + try { + return await response.text(); + } catch (e2) { + return undefined; + } +} + +function _getFetchRequestArgBody(fetchArgs = []) { + // We only support getting the body from the fetch options + if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') { + return undefined; + } + + return (fetchArgs[1] ).body; +} + +function getAllHeaders(headers, allowedHeaders) { + const allHeaders = {}; + + allowedHeaders.forEach(header => { + if (headers.get(header)) { + allHeaders[header] = headers.get(header) ; + } + }); + + return allHeaders; +} + +function getRequestHeaders(fetchArgs, allowedHeaders) { + if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') { + return getHeadersFromOptions(fetchArgs[0] , allowedHeaders); + } + + if (fetchArgs.length === 2) { + return getHeadersFromOptions(fetchArgs[1] , allowedHeaders); + } + + return {}; +} + +function getHeadersFromOptions( + input, + allowedHeaders, +) { + if (!input) { + return {}; + } + + const headers = input.headers; + + if (!headers) { + return {}; + } + + if (headers instanceof Headers) { + return getAllHeaders(headers, allowedHeaders); + } + + // We do not support this, as it is not really documented (anymore?) + if (Array.isArray(headers)) { + return {}; + } + + return getAllowedHeaders(headers, allowedHeaders); +} + +/** + * Capture an XHR breadcrumb to a replay. + * This adds additional data (where approriate). + */ +async function captureXhrBreadcrumbToReplay( + breadcrumb, + hint, + options, +) { + try { + const data = _prepareXhrData(breadcrumb, hint, options); + + // Create a replay performance entry from this breadcrumb + const result = makeNetworkReplayBreadcrumb('resource.xhr', data); + addNetworkBreadcrumb(options.replay, result); + } catch (error) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('[Replay] Failed to capture fetch breadcrumb', error); + } +} + +/** + * Enrich a breadcrumb with additional data. + * This has to be sync & mutate the given breadcrumb, + * as the breadcrumb is afterwards consumed by other handlers. + */ +function enrichXhrBreadcrumb( + breadcrumb, + hint, + options, +) { + const { xhr, input } = hint; + + const reqSize = getBodySize(input, options.textEncoder); + const resSize = xhr.getResponseHeader('content-length') + ? parseContentLengthHeader(xhr.getResponseHeader('content-length')) + : getBodySize(xhr.response, options.textEncoder); + + if (reqSize !== undefined) { + breadcrumb.data.request_body_size = reqSize; + } + if (resSize !== undefined) { + breadcrumb.data.response_body_size = resSize; + } +} + +function _prepareXhrData( + breadcrumb, + hint, + options, +) { + const { startTimestamp, endTimestamp, input, xhr } = hint; + + const { + url, + method, + status_code: statusCode = 0, + request_body_size: requestBodySize, + response_body_size: responseBodySize, + } = breadcrumb.data; + + if (!url) { + return null; + } + + if (!urlMatches(url, options.networkDetailAllowUrls) || urlMatches(url, options.networkDetailDenyUrls)) { + const request = buildSkippedNetworkRequestOrResponse(requestBodySize); + const response = buildSkippedNetworkRequestOrResponse(responseBodySize); + return { + startTimestamp, + endTimestamp, + url, + method, + statusCode, + request, + response, + }; + } + + const xhrInfo = xhr[_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.SENTRY_XHR_DATA_KEY]; + const networkRequestHeaders = xhrInfo + ? getAllowedHeaders(xhrInfo.request_headers, options.networkRequestHeaders) + : {}; + const networkResponseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.networkResponseHeaders); + + const request = buildNetworkRequestOrResponse( + networkRequestHeaders, + requestBodySize, + options.networkCaptureBodies ? getBodyString(input) : undefined, + ); + const response = buildNetworkRequestOrResponse( + networkResponseHeaders, + responseBodySize, + options.networkCaptureBodies ? hint.xhr.responseText : undefined, + ); + + return { + startTimestamp, + endTimestamp, + url, + method, + statusCode, + request, + response, + }; +} + +function getResponseHeaders(xhr) { + const headers = xhr.getAllResponseHeaders(); + + if (!headers) { + return {}; + } + + return headers.split('\r\n').reduce((acc, line) => { + const [key, value] = line.split(': '); + acc[key.toLowerCase()] = value; + return acc; + }, {}); +} + +/** + * This method does two things: + * - It enriches the regular XHR/fetch breadcrumbs with request/response size data + * - It captures the XHR/fetch breadcrumbs to the replay + * (enriching it with further data that is _not_ added to the regular breadcrumbs) + */ +function handleNetworkBreadcrumbs(replay) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)().getClient(); + + try { + const textEncoder = new TextEncoder(); + + const { + networkDetailAllowUrls, + networkDetailDenyUrls, + networkCaptureBodies, + networkRequestHeaders, + networkResponseHeaders, + } = replay.getOptions(); + + const options = { + replay, + textEncoder, + networkDetailAllowUrls, + networkDetailDenyUrls, + networkCaptureBodies, + networkRequestHeaders, + networkResponseHeaders, + }; + + if (client && client.on) { + client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint)); + } else { + // Fallback behavior + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.addInstrumentationHandler)('fetch', handleFetchSpanListener(replay)); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.addInstrumentationHandler)('xhr', handleXhrSpanListener(replay)); + } + } catch (e2) { + // Do nothing + } +} + +/** just exported for tests */ +function beforeAddNetworkBreadcrumb( + options, + breadcrumb, + hint, +) { + if (!breadcrumb.data) { + return; + } + + try { + if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) { + // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick + // Because the hook runs synchronously, and the breadcrumb is afterwards passed on + // So any async mutations to it will not be reflected in the final breadcrumb + enrichXhrBreadcrumb(breadcrumb, hint, options); + + void captureXhrBreadcrumbToReplay(breadcrumb, hint, options); + } + + if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) { + // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick + // Because the hook runs synchronously, and the breadcrumb is afterwards passed on + // So any async mutations to it will not be reflected in the final breadcrumb + enrichFetchBreadcrumb(breadcrumb, hint, options); + + void captureFetchBreadcrumbToReplay(breadcrumb, hint, options); + } + } catch (e) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.warn('Error when enriching network breadcrumb'); + } +} + +function _isXhrBreadcrumb(breadcrumb) { + return breadcrumb.category === 'xhr'; +} + +function _isFetchBreadcrumb(breadcrumb) { + return breadcrumb.category === 'fetch'; +} + +function _isXhrHint(hint) { + return hint && hint.xhr; +} + +function _isFetchHint(hint) { + return hint && hint.response; +} + +let _LAST_BREADCRUMB = null; + +function isBreadcrumbWithCategory(breadcrumb) { + return !!breadcrumb.category; +} + +const handleScopeListener = + (replay) => + (scope) => { + if (!replay.isEnabled()) { + return; + } + + const result = handleScope(scope); + + if (!result) { + return; + } + + addBreadcrumbEvent(replay, result); + }; + +/** + * An event handler to handle scope changes. + */ +function handleScope(scope) { + // TODO (v8): Remove this guard. This was put in place because we introduced + // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs. + // For now, we'll just return null if the method doesn't exist but we should eventually + // get rid of this guard. + const newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb(); + + // Listener can be called when breadcrumbs have not changed, so we store the + // reference to the last crumb and only return a crumb if it has changed + if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) { + return null; + } + + _LAST_BREADCRUMB = newBreadcrumb; + + if ( + !isBreadcrumbWithCategory(newBreadcrumb) || + ['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) || + newBreadcrumb.category.startsWith('ui.') + ) { + return null; + } + + if (newBreadcrumb.category === 'console') { + return normalizeConsoleBreadcrumb(newBreadcrumb); + } + + return createBreadcrumb(newBreadcrumb); +} + +/** exported for tests only */ +function normalizeConsoleBreadcrumb( + breadcrumb, +) { + const args = breadcrumb.data && breadcrumb.data.arguments; + + if (!Array.isArray(args) || args.length === 0) { + return createBreadcrumb(breadcrumb); + } + + let isTruncated = false; + + // Avoid giant args captures + const normalizedArgs = args.map(arg => { + if (!arg) { + return arg; + } + if (typeof arg === 'string') { + if (arg.length > CONSOLE_ARG_MAX_SIZE) { + isTruncated = true; + return `${arg.slice(0, CONSOLE_ARG_MAX_SIZE)}…`; + } + + return arg; + } + if (typeof arg === 'object') { + try { + const normalizedArg = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.normalize)(arg, 7); + const stringified = JSON.stringify(normalizedArg); + if (stringified.length > CONSOLE_ARG_MAX_SIZE) { + const fixedJson = fixJson(stringified.slice(0, CONSOLE_ARG_MAX_SIZE)); + const json = JSON.parse(fixedJson); + // We only set this after JSON.parse() was successfull, so we know we didn't run into `catch` + isTruncated = true; + return json; + } + return normalizedArg; + } catch (e) { + // fall back to default + } + } + + return arg; + }); + + return createBreadcrumb({ + ...breadcrumb, + data: { + ...breadcrumb.data, + arguments: normalizedArgs, + ...(isTruncated ? { _meta: { warnings: ['CONSOLE_ARG_TRUNCATED'] } } : {}), + }, + }); +} + +/** + * Add global listeners that cannot be removed. + */ +function addGlobalListeners(replay) { + // Listeners from core SDK // + const scope = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)().getScope(); + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)().getClient(); + + scope.addScopeListener(handleScopeListener(replay)); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.addInstrumentationHandler)('dom', handleDomListener(replay)); + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_8__.addInstrumentationHandler)('history', handleHistorySpanListener(replay)); + handleNetworkBreadcrumbs(replay); + + // Tag all (non replay) events that get sent to Sentry with the current + // replay ID so that we can reference them later in the UI + const eventProcessor = handleGlobalEventListener(replay, !hasHooks(client)); + if (client && client.addEventProcessor) { + client.addEventProcessor(eventProcessor); + } else { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_10__.addGlobalEventProcessor)(eventProcessor); + } + + // If a custom client has no hooks yet, we continue to use the "old" implementation + if (hasHooks(client)) { + client.on('afterSendEvent', handleAfterSendEvent(replay)); + client.on('createDsc', (dsc) => { + const replayId = replay.getSessionId(); + // We do not want to set the DSC when in buffer mode, as that means the replay has not been sent (yet) + if (replayId && replay.isEnabled() && replay.recordingMode === 'session') { + dsc.replay_id = replayId; + } + }); + + client.on('startTransaction', transaction => { + replay.lastTransaction = transaction; + }); + + // We may be missing the initial startTransaction due to timing issues, + // so we capture it on finish again. + client.on('finishTransaction', transaction => { + replay.lastTransaction = transaction; + }); + } +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function hasHooks(client) { + return !!(client && client.on); +} + +/** + * Create a "span" for the total amount of memory being used by JS objects + * (including v8 internal objects). + */ +async function addMemoryEntry(replay) { + // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this + try { + return Promise.all( + createPerformanceSpans(replay, [ + // @ts-expect-error memory doesn't exist on type Performance as the API is non-standard (we check that it exists above) + createMemoryEntry(WINDOW.performance.memory), + ]), + ); + } catch (error) { + // Do nothing + return []; + } +} + +function createMemoryEntry(memoryEntry) { + const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry; + // we don't want to use `getAbsoluteTime` because it adds the event time to the + // time origin, so we get the current timestamp instead + const time = Date.now() / 1000; + return { + type: 'memory', + name: 'memory', + start: time, + end: time, + data: { + memory: { + jsHeapSizeLimit, + totalJSHeapSize, + usedJSHeapSize, + }, + }, + }; +} + +// Map entryType -> function to normalize data for event +const ENTRY_TYPES + + = { + // @ts-expect-error TODO: entry type does not fit the create* functions entry type + resource: createResourceEntry, + paint: createPaintEntry, + // @ts-expect-error TODO: entry type does not fit the create* functions entry type + navigation: createNavigationEntry, + // @ts-expect-error TODO: entry type does not fit the create* functions entry type + ['largest-contentful-paint']: createLargestContentfulPaint, +}; + +/** + * Create replay performance entries from the browser performance entries. + */ +function createPerformanceEntries( + entries, +) { + return entries.map(createPerformanceEntry).filter(Boolean) ; +} + +function createPerformanceEntry(entry) { + if (ENTRY_TYPES[entry.entryType] === undefined) { + return null; + } + + return ENTRY_TYPES[entry.entryType](entry); +} + +function getAbsoluteTime(time) { + // browserPerformanceTimeOrigin can be undefined if `performance` or + // `performance.now` doesn't exist, but this is already checked by this integration + return ((_sentry_utils__WEBPACK_IMPORTED_MODULE_11__.browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000; +} + +function createPaintEntry(entry) { + const { duration, entryType, name, startTime } = entry; + + const start = getAbsoluteTime(startTime); + return { + type: entryType, + name, + start, + end: start + duration, + data: undefined, + }; +} + +function createNavigationEntry(entry) { + const { + entryType, + name, + decodedBodySize, + duration, + domComplete, + encodedBodySize, + domContentLoadedEventStart, + domContentLoadedEventEnd, + domInteractive, + loadEventStart, + loadEventEnd, + redirectCount, + startTime, + transferSize, + type, + } = entry; + + // Ignore entries with no duration, they do not seem to be useful and cause dupes + if (duration === 0) { + return null; + } + + return { + type: `${entryType}.${type}`, + start: getAbsoluteTime(startTime), + end: getAbsoluteTime(domComplete), + name, + data: { + size: transferSize, + decodedBodySize, + encodedBodySize, + duration, + domInteractive, + domContentLoadedEventStart, + domContentLoadedEventEnd, + loadEventStart, + loadEventEnd, + domComplete, + redirectCount, + }, + }; +} + +function createResourceEntry( + entry, +) { + const { + entryType, + initiatorType, + name, + responseEnd, + startTime, + decodedBodySize, + encodedBodySize, + responseStatus, + transferSize, + } = entry; + + // Core SDK handles these + if (['fetch', 'xmlhttprequest'].includes(initiatorType)) { + return null; + } + + return { + type: `${entryType}.${initiatorType}`, + start: getAbsoluteTime(startTime), + end: getAbsoluteTime(responseEnd), + name, + data: { + size: transferSize, + statusCode: responseStatus, + decodedBodySize, + encodedBodySize, + }, + }; +} + +function createLargestContentfulPaint( + entry, +) { + const { entryType, startTime, size } = entry; + + let startTimeOrNavigationActivation = 0; + + if (WINDOW.performance) { + const navEntry = WINDOW.performance.getEntriesByType('navigation')[0] + +; + + // See https://github.com/GoogleChrome/web-vitals/blob/9f11c4c6578fb4c5ee6fa4e32b9d1d756475f135/src/lib/getActivationStart.ts#L21 + startTimeOrNavigationActivation = (navEntry && navEntry.activationStart) || 0; + } + + // value is in ms + const value = Math.max(startTime - startTimeOrNavigationActivation, 0); + // LCP doesn't have a "duration", it just happens at a single point in time. + // But the UI expects both, so use end (in seconds) for both timestamps. + const end = getAbsoluteTime(startTimeOrNavigationActivation) + value / 1000; + + return { + type: entryType, + name: entryType, + start: end, + end, + data: { + value, // LCP "duration" in ms + size, + nodeId: record.mirror.getId(entry.element), + }, + }; +} + +/** + * Heavily simplified debounce function based on lodash.debounce. + * + * This function takes a callback function (@param fun) and delays its invocation + * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options, + * which ensures that the callback is invoked at least once after the specified max. wait time. + * + * @param func the function whose invocation is to be debounced + * @param wait the minimum time until the function is invoked after it was called once + * @param options the options object, which can contain the `maxWait` property + * + * @returns the debounced version of the function, which needs to be called at least once to start the + * debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc + * was already invoked in the meantime, return @param func's return value. + * The debounced function has two additional properties: + * - `flush`: Invokes the debounced function immediately and returns its return value + * - `cancel`: Cancels the debouncing process and resets the debouncing timer + */ +function debounce(func, wait, options) { + let callbackReturnValue; + + let timerId; + let maxTimerId; + + const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0; + + function invokeFunc() { + cancelTimers(); + callbackReturnValue = func(); + return callbackReturnValue; + } + + function cancelTimers() { + timerId !== undefined && clearTimeout(timerId); + maxTimerId !== undefined && clearTimeout(maxTimerId); + timerId = maxTimerId = undefined; + } + + function flush() { + if (timerId !== undefined || maxTimerId !== undefined) { + return invokeFunc(); + } + return callbackReturnValue; + } + + function debounced() { + if (timerId) { + clearTimeout(timerId); + } + timerId = setTimeout(invokeFunc, wait); + + if (maxWait && maxTimerId === undefined) { + maxTimerId = setTimeout(invokeFunc, maxWait); + } + + return callbackReturnValue; + } + + debounced.cancel = cancelTimers; + debounced.flush = flush; + return debounced; +} + +/** + * Handler for recording events. + * + * Adds to event buffer, and has varying flushing behaviors if the event was a checkout. + */ +function getHandleRecordingEmit(replay) { + let hadFirstEvent = false; + + return (event, _isCheckout) => { + // If this is false, it means session is expired, create and a new session and wait for checkout + if (!replay.checkAndHandleExpiredSession()) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.warn('[Replay] Received replay event after session expired.'); + + return; + } + + // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms` + // We also want to treat the first event as a checkout, so we handle this specifically here + const isCheckout = _isCheckout || !hadFirstEvent; + hadFirstEvent = true; + + // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush. + replay.addUpdate(() => { + // The session is always started immediately on pageload/init, but for + // error-only replays, it should reflect the most recent checkout + // when an error occurs. Clear any state that happens before this current + // checkout. This needs to happen before `addEvent()` which updates state + // dependent on this reset. + if (replay.recordingMode === 'buffer' && isCheckout) { + replay.setInitialState(); + } + + // If the event is not added (e.g. due to being paused, disabled, or out of the max replay duration), + // Skip all further steps + if (!addEventSync(replay, event, isCheckout)) { + // Return true to skip scheduling a debounced flush + return true; + } + + // Different behavior for full snapshots (type=2), ignore other event types + // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16 + if (!isCheckout) { + return false; + } + + // Additionally, create a meta event that will capture certain SDK settings. + // In order to handle buffer mode, this needs to either be done when we + // receive checkout events or at flush time. + // + // `isCheckout` is always true, but want to be explicit that it should + // only be added for checkouts + addSettingsEvent(replay, isCheckout); + + // If there is a previousSessionId after a full snapshot occurs, then + // the replay session was started due to session expiration. The new session + // is started before triggering a new checkout and contains the id + // of the previous session. Do not immediately flush in this case + // to avoid capturing only the checkout and instead the replay will + // be captured if they perform any follow-up actions. + if (replay.session && replay.session.previousSessionId) { + return true; + } + + // When in buffer mode, make sure we adjust the session started date to the current earliest event of the buffer + // this should usually be the timestamp of the checkout event, but to be safe... + if (replay.recordingMode === 'buffer' && replay.session && replay.eventBuffer) { + const earliestEvent = replay.eventBuffer.getEarliestTimestamp(); + if (earliestEvent) { + logInfo( + `[Replay] Updating session start time to earliest event in buffer to ${new Date(earliestEvent)}`, + replay.getOptions()._experiments.traceInternals, + ); + + replay.session.started = earliestEvent; + + if (replay.getOptions().stickySession) { + saveSession(replay.session); + } + } + } + + if (replay.recordingMode === 'session') { + // If the full snapshot is due to an initial load, we will not have + // a previous session ID. In this case, we want to buffer events + // for a set amount of time before flushing. This can help avoid + // capturing replays of users that immediately close the window. + void replay.flush(); + } + + return true; + }); + }; +} + +/** + * Exported for tests + */ +function createOptionsEvent(replay) { + const options = replay.getOptions(); + return { + type: EventType.Custom, + timestamp: Date.now(), + data: { + tag: 'options', + payload: { + sessionSampleRate: options.sessionSampleRate, + errorSampleRate: options.errorSampleRate, + useCompressionOption: options.useCompression, + blockAllMedia: options.blockAllMedia, + maskAllText: options.maskAllText, + maskAllInputs: options.maskAllInputs, + useCompression: replay.eventBuffer ? replay.eventBuffer.type === 'worker' : false, + networkDetailHasUrls: options.networkDetailAllowUrls.length > 0, + networkCaptureBodies: options.networkCaptureBodies, + networkRequestHasHeaders: options.networkRequestHeaders.length > 0, + networkResponseHasHeaders: options.networkResponseHeaders.length > 0, + }, + }, + }; +} + +/** + * Add a "meta" event that contains a simplified view on current configuration + * options. This should only be included on the first segment of a recording. + */ +function addSettingsEvent(replay, isCheckout) { + // Only need to add this event when sending the first segment + if (!isCheckout || !replay.session || replay.session.segmentId !== 0) { + return; + } + + addEventSync(replay, createOptionsEvent(replay), false); +} + +/** + * Create a replay envelope ready to be sent. + * This includes both the replay event, as well as the recording data. + */ +function createReplayEnvelope( + replayEvent, + recordingData, + dsn, + tunnel, +) { + return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_12__.createEnvelope)( + (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_12__.createEventEnvelopeHeaders)(replayEvent, (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_12__.getSdkMetadataForEnvelopeHeader)(replayEvent), tunnel, dsn), + [ + [{ type: 'replay_event' }, replayEvent], + [ + { + type: 'replay_recording', + // If string then we need to encode to UTF8, otherwise will have + // wrong size. TextEncoder has similar browser support to + // MutationObserver, although it does not accept IE11. + length: + typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length, + }, + recordingData, + ], + ], + ); +} + +/** + * Prepare the recording data ready to be sent. + */ +function prepareRecordingData({ + recordingData, + headers, +} + +) { + let payloadWithSequence; + + // XXX: newline is needed to separate sequence id from events + const replayHeaders = `${JSON.stringify(headers)} +`; + + if (typeof recordingData === 'string') { + payloadWithSequence = `${replayHeaders}${recordingData}`; + } else { + const enc = new TextEncoder(); + // XXX: newline is needed to separate sequence id from events + const sequence = enc.encode(replayHeaders); + // Merge the two Uint8Arrays + payloadWithSequence = new Uint8Array(sequence.length + recordingData.length); + payloadWithSequence.set(sequence); + payloadWithSequence.set(recordingData, sequence.length); + } + + return payloadWithSequence; +} + +/** + * Prepare a replay event & enrich it with the SDK metadata. + */ +async function prepareReplayEvent({ + client, + scope, + replayId: event_id, + event, +} + +) { + const integrations = + typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations) + ? Object.keys(client._integrations) + : undefined; + + const eventHint = { event_id, integrations }; + + if (client.emit) { + client.emit('preprocessEvent', event, eventHint); + } + + const preparedEvent = (await (0,_sentry_core__WEBPACK_IMPORTED_MODULE_13__.prepareEvent)( + client.getOptions(), + event, + eventHint, + scope, + client, + )) ; + + // If e.g. a global event processor returned null + if (!preparedEvent) { + return null; + } + + // This normally happens in browser client "_prepareEvent" + // but since we do not use this private method from the client, but rather the plain import + // we need to do this manually. + preparedEvent.platform = preparedEvent.platform || 'javascript'; + + // extract the SDK name because `client._prepareEvent` doesn't add it to the event + const metadata = client.getSdkMetadata && client.getSdkMetadata(); + const { name, version } = (metadata && metadata.sdk) || {}; + + preparedEvent.sdk = { + ...preparedEvent.sdk, + name: name || 'sentry.javascript.unknown', + version: version || '0.0.0', + }; + + return preparedEvent; +} + +/** + * Send replay attachment using `fetch()` + */ +async function sendReplayRequest({ + recordingData, + replayId, + segmentId: segment_id, + eventContext, + timestamp, + session, +}) { + const preparedRecordingData = prepareRecordingData({ + recordingData, + headers: { + segment_id, + }, + }); + + const { urls, errorIds, traceIds, initialTimestamp } = eventContext; + + const hub = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)(); + const client = hub.getClient(); + const scope = hub.getScope(); + const transport = client && client.getTransport(); + const dsn = client && client.getDsn(); + + if (!client || !transport || !dsn || !session.sampled) { + return; + } + + const baseEvent = { + type: REPLAY_EVENT_NAME, + replay_start_timestamp: initialTimestamp / 1000, + timestamp: timestamp / 1000, + error_ids: errorIds, + trace_ids: traceIds, + urls, + replay_id: replayId, + segment_id, + replay_type: session.sampled, + }; + + const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent }); + + if (!replayEvent) { + // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions + client.recordDroppedEvent('event_processor', 'replay', baseEvent); + logInfo('An event processor returned `null`, will not send event.'); + return; + } + + /* + For reference, the fully built event looks something like this: + { + "type": "replay_event", + "timestamp": 1670837008.634, + "error_ids": [ + "errorId" + ], + "trace_ids": [ + "traceId" + ], + "urls": [ + "https://example.com" + ], + "replay_id": "eventId", + "segment_id": 3, + "replay_type": "error", + "platform": "javascript", + "event_id": "eventId", + "environment": "production", + "sdk": { + "integrations": [ + "BrowserTracing", + "Replay" + ], + "name": "sentry.javascript.browser", + "version": "7.25.0" + }, + "sdkProcessingMetadata": {}, + "contexts": { + }, + } + */ + + // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to + // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may + // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid + // of this `delete`, lest we miss putting it back in the next time the property is in use.) + delete replayEvent.sdkProcessingMetadata; + + const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel); + + let response; + + try { + response = await transport.send(envelope); + } catch (err) { + const error = new Error(UNABLE_TO_SEND_REPLAY); + + try { + // In case browsers don't allow this property to be writable + // @ts-expect-error This needs lib es2022 and newer + error.cause = err; + } catch (e) { + // nothing to do + } + throw error; + } + + // TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore + if (!response) { + return response; + } + + // If the status code is invalid, we want to immediately stop & not retry + if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) { + throw new TransportStatusCodeError(response.statusCode); + } + + return response; +} + +/** + * This error indicates that the transport returned an invalid status code. + */ +class TransportStatusCodeError extends Error { + constructor(statusCode) { + super(`Transport returned status code ${statusCode}`); + } +} + +/** + * Finalize and send the current replay event to Sentry + */ +async function sendReplay( + replayData, + retryConfig = { + count: 0, + interval: RETRY_BASE_INTERVAL, + }, +) { + const { recordingData, options } = replayData; + + // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check) + if (!recordingData.length) { + return; + } + + try { + await sendReplayRequest(replayData); + return true; + } catch (err) { + if (err instanceof TransportStatusCodeError) { + throw err; + } + + // Capture error for every failed replay + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.setContext)('Replays', { + _retryCount: retryConfig.count, + }); + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && options._experiments && options._experiments.captureExceptions) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.captureException)(err); + } + + // If an error happened here, it's likely that uploading the attachment + // failed, we'll can retry with the same events payload + if (retryConfig.count >= RETRY_MAX_COUNT) { + const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`); + + try { + // In case browsers don't allow this property to be writable + // @ts-expect-error This needs lib es2022 and newer + error.cause = err; + } catch (e) { + // nothing to do + } + + throw error; + } + + // will retry in intervals of 5, 10, 30 + retryConfig.interval *= ++retryConfig.count; + + return new Promise((resolve, reject) => { + setTimeout(async () => { + try { + await sendReplay(replayData, retryConfig); + resolve(true); + } catch (err) { + reject(err); + } + }, retryConfig.interval); + }); + } +} + +const THROTTLED = '__THROTTLED'; +const SKIPPED = '__SKIPPED'; + +/** + * Create a throttled function off a given function. + * When calling the throttled function, it will call the original function only + * if it hasn't been called more than `maxCount` times in the last `durationSeconds`. + * + * Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`, + * or else the return value of the original function. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function throttle( + fn, + maxCount, + durationSeconds, +) { + const counter = new Map(); + + const _cleanup = (now) => { + const threshold = now - durationSeconds; + counter.forEach((_value, key) => { + if (key < threshold) { + counter.delete(key); + } + }); + }; + + const _getTotalCount = () => { + return [...counter.values()].reduce((a, b) => a + b, 0); + }; + + let isThrottled = false; + + return (...rest) => { + // Date in second-precision, which we use as basis for the throttling + const now = Math.floor(Date.now() / 1000); + + // First, make sure to delete any old entries + _cleanup(now); + + // If already over limit, do nothing + if (_getTotalCount() >= maxCount) { + const wasThrottled = isThrottled; + isThrottled = true; + return wasThrottled ? SKIPPED : THROTTLED; + } + + isThrottled = false; + const count = counter.get(now) || 0; + counter.set(now, count + 1); + + return fn(...rest); + }; +} + +/* eslint-disable max-lines */ // TODO: We might want to split this file up + +/** + * The main replay container class, which holds all the state and methods for recording and sending replays. + */ +class ReplayContainer { + + /** + * List of PerformanceEntry from PerformanceObserver + */ + + /** + * Recording can happen in one of three modes: + * - session: Record the whole session, sending it continuously + * - buffer: Always keep the last 60s of recording, requires: + * - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs + * - or calling `flush()` to send the replay + */ + + /** + * The current or last active transcation. + * This is only available when performance is enabled. + */ + + /** + * These are here so we can overwrite them in tests etc. + * @hidden + */ + + /** + * Options to pass to `rrweb.record()` + */ + + /** + * Timestamp of the last user activity. This lives across sessions. + */ + + /** + * Is the integration currently active? + */ + + /** + * Paused is a state where: + * - DOM Recording is not listening at all + * - Nothing will be added to event buffer (e.g. core SDK events) + */ + + /** + * Have we attached listeners to the core SDK? + * Note we have to track this as there is no way to remove instrumentation handlers. + */ + + /** + * Function to stop recording + */ + + constructor({ + options, + recordingOptions, + } + +) {ReplayContainer.prototype.__init.call(this);ReplayContainer.prototype.__init2.call(this);ReplayContainer.prototype.__init3.call(this);ReplayContainer.prototype.__init4.call(this);ReplayContainer.prototype.__init5.call(this);ReplayContainer.prototype.__init6.call(this); + this.eventBuffer = null; + this.performanceEvents = []; + this.recordingMode = 'session'; + this.timeouts = { + sessionIdlePause: SESSION_IDLE_PAUSE_DURATION, + sessionIdleExpire: SESSION_IDLE_EXPIRE_DURATION, + } ; + this._lastActivity = Date.now(); + this._isEnabled = false; + this._isPaused = false; + this._hasInitializedCoreListeners = false; + this._context = { + errorIds: new Set(), + traceIds: new Set(), + urls: [], + initialTimestamp: Date.now(), + initialUrl: '', + }; + + this._recordingOptions = recordingOptions; + this._options = options; + + this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, { + maxWait: this._options.flushMaxDelay, + }); + + this._throttledAddEvent = throttle( + (event, isCheckout) => addEvent(this, event, isCheckout), + // Max 300 events... + 300, + // ... per 5s + 5, + ); + + const { slowClickTimeout, slowClickIgnoreSelectors } = this.getOptions(); + + const slowClickConfig = slowClickTimeout + ? { + threshold: Math.min(SLOW_CLICK_THRESHOLD, slowClickTimeout), + timeout: slowClickTimeout, + scrollTimeout: SLOW_CLICK_SCROLL_TIMEOUT, + ignoreSelector: slowClickIgnoreSelectors ? slowClickIgnoreSelectors.join(',') : '', + } + : undefined; + + if (slowClickConfig) { + this.clickDetector = new ClickDetector(this, slowClickConfig); + } + } + + /** Get the event context. */ + getContext() { + return this._context; + } + + /** If recording is currently enabled. */ + isEnabled() { + return this._isEnabled; + } + + /** If recording is currently paused. */ + isPaused() { + return this._isPaused; + } + + /** Get the replay integration options. */ + getOptions() { + return this._options; + } + + /** + * Initializes the plugin based on sampling configuration. Should not be + * called outside of constructor. + */ + initializeSampling(previousSessionId) { + const { errorSampleRate, sessionSampleRate } = this._options; + + // If neither sample rate is > 0, then do nothing - user will need to call one of + // `start()` or `startBuffering` themselves. + if (errorSampleRate <= 0 && sessionSampleRate <= 0) { + return; + } + + // Otherwise if there is _any_ sample rate set, try to load an existing + // session, or create a new one. + this._initializeSessionForSampling(previousSessionId); + + if (!this.session) { + // This should not happen, something wrong has occurred + this._handleException(new Error('Unable to initialize and create session')); + return; + } + + if (this.session.sampled === false) { + // This should only occur if `errorSampleRate` is 0 and was unsampled for + // session-based replay. In this case there is nothing to do. + return; + } + + // If segmentId > 0, it means we've previously already captured this session + // In this case, we still want to continue in `session` recording mode + this.recordingMode = this.session.sampled === 'buffer' && this.session.segmentId === 0 ? 'buffer' : 'session'; + + logInfoNextTick( + `[Replay] Starting replay in ${this.recordingMode} mode`, + this._options._experiments.traceInternals, + ); + + this._initializeRecording(); + } + + /** + * Start a replay regardless of sampling rate. Calling this will always + * create a new session. Will throw an error if replay is already in progress. + * + * Creates or loads a session, attaches listeners to varying events (DOM, + * _performanceObserver, Recording, Sentry SDK, etc) + */ + start() { + if (this._isEnabled && this.recordingMode === 'session') { + throw new Error('Replay recording is already in progress'); + } + + if (this._isEnabled && this.recordingMode === 'buffer') { + throw new Error('Replay buffering is in progress, call `flush()` to save the replay'); + } + + logInfoNextTick('[Replay] Starting replay in session mode', this._options._experiments.traceInternals); + + const session = loadOrCreateSession( + { + maxReplayDuration: this._options.maxReplayDuration, + sessionIdleExpire: this.timeouts.sessionIdleExpire, + traceInternals: this._options._experiments.traceInternals, + }, + { + stickySession: this._options.stickySession, + // This is intentional: create a new session-based replay when calling `start()` + sessionSampleRate: 1, + allowBuffering: false, + }, + ); + + this.session = session; + + this._initializeRecording(); + } + + /** + * Start replay buffering. Buffers until `flush()` is called or, if + * `replaysOnErrorSampleRate` > 0, an error occurs. + */ + startBuffering() { + if (this._isEnabled) { + throw new Error('Replay recording is already in progress'); + } + + logInfoNextTick('[Replay] Starting replay in buffer mode', this._options._experiments.traceInternals); + + const session = loadOrCreateSession( + { + sessionIdleExpire: this.timeouts.sessionIdleExpire, + maxReplayDuration: this._options.maxReplayDuration, + traceInternals: this._options._experiments.traceInternals, + }, + { + stickySession: this._options.stickySession, + sessionSampleRate: 0, + allowBuffering: true, + }, + ); + + this.session = session; + + this.recordingMode = 'buffer'; + this._initializeRecording(); + } + + /** + * Start recording. + * + * Note that this will cause a new DOM checkout + */ + startRecording() { + try { + this._stopRecording = record({ + ...this._recordingOptions, + // When running in error sampling mode, we need to overwrite `checkoutEveryNms` + // Without this, it would record forever, until an error happens, which we don't want + // instead, we'll always keep the last 60 seconds of replay before an error happened + ...(this.recordingMode === 'buffer' && { checkoutEveryNms: BUFFER_CHECKOUT_TIME }), + emit: getHandleRecordingEmit(this), + onMutation: this._onMutationHandler, + }); + } catch (err) { + this._handleException(err); + } + } + + /** + * Stops the recording, if it was running. + * + * Returns true if it was previously stopped, or is now stopped, + * otherwise false. + */ + stopRecording() { + try { + if (this._stopRecording) { + this._stopRecording(); + this._stopRecording = undefined; + } + + return true; + } catch (err) { + this._handleException(err); + return false; + } + } + + /** + * Currently, this needs to be manually called (e.g. for tests). Sentry SDK + * does not support a teardown + */ + async stop({ forceFlush = false, reason } = {}) { + if (!this._isEnabled) { + return; + } + + // We can't move `_isEnabled` after awaiting a flush, otherwise we can + // enter into an infinite loop when `stop()` is called while flushing. + this._isEnabled = false; + + try { + logInfo( + `[Replay] Stopping Replay${reason ? ` triggered by ${reason}` : ''}`, + this._options._experiments.traceInternals, + ); + + this._removeListeners(); + this.stopRecording(); + + this._debouncedFlush.cancel(); + // See comment above re: `_isEnabled`, we "force" a flush, ignoring the + // `_isEnabled` state of the plugin since it was disabled above. + if (forceFlush) { + await this._flush({ force: true }); + } + + // After flush, destroy event buffer + this.eventBuffer && this.eventBuffer.destroy(); + this.eventBuffer = null; + + // Clear session from session storage, note this means if a new session + // is started after, it will not have `previousSessionId` + clearSession(this); + } catch (err) { + this._handleException(err); + } + } + + /** + * Pause some replay functionality. See comments for `_isPaused`. + * This differs from stop as this only stops DOM recording, it is + * not as thorough of a shutdown as `stop()`. + */ + pause() { + if (this._isPaused) { + return; + } + + this._isPaused = true; + this.stopRecording(); + + logInfo('[Replay] Pausing replay', this._options._experiments.traceInternals); + } + + /** + * Resumes recording, see notes for `pause(). + * + * Note that calling `startRecording()` here will cause a + * new DOM checkout.` + */ + resume() { + if (!this._isPaused || !this._checkSession()) { + return; + } + + this._isPaused = false; + this.startRecording(); + + logInfo('[Replay] Resuming replay', this._options._experiments.traceInternals); + } + + /** + * If not in "session" recording mode, flush event buffer which will create a new replay. + * Unless `continueRecording` is false, the replay will continue to record and + * behave as a "session"-based replay. + * + * Otherwise, queue up a flush. + */ + async sendBufferedReplayOrFlush({ continueRecording = true } = {}) { + if (this.recordingMode === 'session') { + return this.flushImmediate(); + } + + const activityTime = Date.now(); + + logInfo('[Replay] Converting buffer to session', this._options._experiments.traceInternals); + + // Allow flush to complete before resuming as a session recording, otherwise + // the checkout from `startRecording` may be included in the payload. + // Prefer to keep the error replay as a separate (and smaller) segment + // than the session replay. + await this.flushImmediate(); + + const hasStoppedRecording = this.stopRecording(); + + if (!continueRecording || !hasStoppedRecording) { + return; + } + + // To avoid race conditions where this is called multiple times, we check here again that we are still buffering + if ((this.recordingMode ) === 'session') { + return; + } + + // Re-start recording in session-mode + this.recordingMode = 'session'; + + // Once this session ends, we do not want to refresh it + if (this.session) { + this._updateUserActivity(activityTime); + this._updateSessionActivity(activityTime); + this._maybeSaveSession(); + } + + this.startRecording(); + } + + /** + * We want to batch uploads of replay events. Save events only if + * `` milliseconds have elapsed since the last event + * *OR* if `` milliseconds have elapsed. + * + * Accepts a callback to perform side-effects and returns true to stop batch + * processing and hand back control to caller. + */ + addUpdate(cb) { + // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'buffer'`) + const cbResult = cb(); + + // If this option is turned on then we will only want to call `flush` + // explicitly + if (this.recordingMode === 'buffer') { + return; + } + + // If callback is true, we do not want to continue with flushing -- the + // caller will need to handle it. + if (cbResult === true) { + return; + } + + // addUpdate is called quite frequently - use _debouncedFlush so that it + // respects the flush delays and does not flush immediately + this._debouncedFlush(); + } + + /** + * Updates the user activity timestamp and resumes recording. This should be + * called in an event handler for a user action that we consider as the user + * being "active" (e.g. a mouse click). + */ + triggerUserActivity() { + this._updateUserActivity(); + + // This case means that recording was once stopped due to inactivity. + // Ensure that recording is resumed. + if (!this._stopRecording) { + // Create a new session, otherwise when the user action is flushed, it + // will get rejected due to an expired session. + if (!this._checkSession()) { + return; + } + + // Note: This will cause a new DOM checkout + this.resume(); + return; + } + + // Otherwise... recording was never suspended, continue as normalish + this.checkAndHandleExpiredSession(); + + this._updateSessionActivity(); + } + + /** + * Updates the user activity timestamp *without* resuming + * recording. Some user events (e.g. keydown) can be create + * low-value replays that only contain the keypress as a + * breadcrumb. Instead this would require other events to + * create a new replay after a session has expired. + */ + updateUserActivity() { + this._updateUserActivity(); + this._updateSessionActivity(); + } + + /** + * Only flush if `this.recordingMode === 'session'` + */ + conditionalFlush() { + if (this.recordingMode === 'buffer') { + return Promise.resolve(); + } + + return this.flushImmediate(); + } + + /** + * Flush using debounce flush + */ + flush() { + return this._debouncedFlush() ; + } + + /** + * Always flush via `_debouncedFlush` so that we do not have flushes triggered + * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be + * cases of mulitple flushes happening closely together. + */ + flushImmediate() { + this._debouncedFlush(); + // `.flush` is provided by the debounced function, analogously to lodash.debounce + return this._debouncedFlush.flush() ; + } + + /** + * Cancels queued up flushes. + */ + cancelFlush() { + this._debouncedFlush.cancel(); + } + + /** Get the current sesion (=replay) ID */ + getSessionId() { + return this.session && this.session.id; + } + + /** + * Checks if recording should be stopped due to user inactivity. Otherwise + * check if session is expired and create a new session if so. Triggers a new + * full snapshot on new session. + * + * Returns true if session is not expired, false otherwise. + * @hidden + */ + checkAndHandleExpiredSession() { + // Prevent starting a new session if the last user activity is older than + // SESSION_IDLE_PAUSE_DURATION. Otherwise non-user activity can trigger a new + // session+recording. This creates noisy replays that do not have much + // content in them. + if ( + this._lastActivity && + isExpired(this._lastActivity, this.timeouts.sessionIdlePause) && + this.session && + this.session.sampled === 'session' + ) { + // Pause recording only for session-based replays. Otherwise, resuming + // will create a new replay and will conflict with users who only choose + // to record error-based replays only. (e.g. the resumed replay will not + // contain a reference to an error) + this.pause(); + return; + } + + // --- There is recent user activity --- // + // This will create a new session if expired, based on expiry length + if (!this._checkSession()) { + // Check session handles the refreshing itself + return false; + } + + return true; + } + + /** + * Capture some initial state that can change throughout the lifespan of the + * replay. This is required because otherwise they would be captured at the + * first flush. + */ + setInitialState() { + const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`; + const url = `${WINDOW.location.origin}${urlPath}`; + + this.performanceEvents = []; + + // Reset _context as well + this._clearContext(); + + this._context.initialUrl = url; + this._context.initialTimestamp = Date.now(); + this._context.urls.push(url); + } + + /** + * Add a breadcrumb event, that may be throttled. + * If it was throttled, we add a custom breadcrumb to indicate that. + */ + throttledAddEvent( + event, + isCheckout, + ) { + const res = this._throttledAddEvent(event, isCheckout); + + // If this is THROTTLED, it means we have throttled the event for the first time + // In this case, we want to add a breadcrumb indicating that something was skipped + if (res === THROTTLED) { + const breadcrumb = createBreadcrumb({ + category: 'replay.throttled', + }); + + this.addUpdate(() => { + // Return `false` if the event _was_ added, as that means we schedule a flush + return !addEventSync(this, { + type: ReplayEventTypeCustom, + timestamp: breadcrumb.timestamp || 0, + data: { + tag: 'breadcrumb', + payload: breadcrumb, + metric: true, + }, + }); + }); + } + + return res; + } + + /** + * This will get the parametrized route name of the current page. + * This is only available if performance is enabled, and if an instrumented router is used. + */ + getCurrentRoute() { + const lastTransaction = this.lastTransaction || (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)().getScope().getTransaction(); + if (!lastTransaction || !['route', 'custom'].includes(lastTransaction.metadata.source)) { + return undefined; + } + + return lastTransaction.name; + } + + /** + * Initialize and start all listeners to varying events (DOM, + * Performance Observer, Recording, Sentry SDK, etc) + */ + _initializeRecording() { + this.setInitialState(); + + // this method is generally called on page load or manually - in both cases + // we should treat it as an activity + this._updateSessionActivity(); + + this.eventBuffer = createEventBuffer({ + useCompression: this._options.useCompression, + }); + + this._removeListeners(); + this._addListeners(); + + // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout + this._isEnabled = true; + this._isPaused = false; + + this.startRecording(); + } + + /** A wrapper to conditionally capture exceptions. */ + _handleException(error) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('[Replay]', error); + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && this._options._experiments && this._options._experiments.captureExceptions) { + (0,_sentry_core__WEBPACK_IMPORTED_MODULE_14__.captureException)(error); + } + } + + /** + * Loads (or refreshes) the current session. + */ + _initializeSessionForSampling(previousSessionId) { + // Whenever there is _any_ error sample rate, we always allow buffering + // Because we decide on sampling when an error occurs, we need to buffer at all times if sampling for errors + const allowBuffering = this._options.errorSampleRate > 0; + + const session = loadOrCreateSession( + { + sessionIdleExpire: this.timeouts.sessionIdleExpire, + maxReplayDuration: this._options.maxReplayDuration, + traceInternals: this._options._experiments.traceInternals, + previousSessionId, + }, + { + stickySession: this._options.stickySession, + sessionSampleRate: this._options.sessionSampleRate, + allowBuffering, + }, + ); + + this.session = session; + } + + /** + * Checks and potentially refreshes the current session. + * Returns false if session is not recorded. + */ + _checkSession() { + // If there is no session yet, we do not want to refresh anything + // This should generally not happen, but to be safe.... + if (!this.session) { + return false; + } + + const currentSession = this.session; + + if ( + shouldRefreshSession(currentSession, { + sessionIdleExpire: this.timeouts.sessionIdleExpire, + maxReplayDuration: this._options.maxReplayDuration, + }) + ) { + void this._refreshSession(currentSession); + return false; + } + + return true; + } + + /** + * Refresh a session with a new one. + * This stops the current session (without forcing a flush, as that would never work since we are expired), + * and then does a new sampling based on the refreshed session. + */ + async _refreshSession(session) { + if (!this._isEnabled) { + return; + } + await this.stop({ reason: 'refresh session' }); + this.initializeSampling(session.id); + } + + /** + * Adds listeners to record events for the replay + */ + _addListeners() { + try { + WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange); + WINDOW.addEventListener('blur', this._handleWindowBlur); + WINDOW.addEventListener('focus', this._handleWindowFocus); + WINDOW.addEventListener('keydown', this._handleKeyboardEvent); + + if (this.clickDetector) { + this.clickDetector.addListeners(); + } + + // There is no way to remove these listeners, so ensure they are only added once + if (!this._hasInitializedCoreListeners) { + addGlobalListeners(this); + + this._hasInitializedCoreListeners = true; + } + } catch (err) { + this._handleException(err); + } + + // PerformanceObserver // + if (!('PerformanceObserver' in WINDOW)) { + return; + } + + this._performanceObserver = setupPerformanceObserver(this); + } + + /** + * Cleans up listeners that were created in `_addListeners` + */ + _removeListeners() { + try { + WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange); + + WINDOW.removeEventListener('blur', this._handleWindowBlur); + WINDOW.removeEventListener('focus', this._handleWindowFocus); + WINDOW.removeEventListener('keydown', this._handleKeyboardEvent); + + if (this.clickDetector) { + this.clickDetector.removeListeners(); + } + + if (this._performanceObserver) { + this._performanceObserver.disconnect(); + this._performanceObserver = undefined; + } + } catch (err) { + this._handleException(err); + } + } + + /** + * Handle when visibility of the page content changes. Opening a new tab will + * cause the state to change to hidden because of content of current page will + * be hidden. Likewise, moving a different window to cover the contents of the + * page will also trigger a change to a hidden state. + */ + __init() {this._handleVisibilityChange = () => { + if (WINDOW.document.visibilityState === 'visible') { + this._doChangeToForegroundTasks(); + } else { + this._doChangeToBackgroundTasks(); + } + };} + + /** + * Handle when page is blurred + */ + __init2() {this._handleWindowBlur = () => { + const breadcrumb = createBreadcrumb({ + category: 'ui.blur', + }); + + // Do not count blur as a user action -- it's part of the process of them + // leaving the page + this._doChangeToBackgroundTasks(breadcrumb); + };} + + /** + * Handle when page is focused + */ + __init3() {this._handleWindowFocus = () => { + const breadcrumb = createBreadcrumb({ + category: 'ui.focus', + }); + + // Do not count focus as a user action -- instead wait until they focus and + // interactive with page + this._doChangeToForegroundTasks(breadcrumb); + };} + + /** Ensure page remains active when a key is pressed. */ + __init4() {this._handleKeyboardEvent = (event) => { + handleKeyboardEvent(this, event); + };} + + /** + * Tasks to run when we consider a page to be hidden (via blurring and/or visibility) + */ + _doChangeToBackgroundTasks(breadcrumb) { + if (!this.session) { + return; + } + + const expired = isSessionExpired(this.session, { + maxReplayDuration: this._options.maxReplayDuration, + sessionIdleExpire: this.timeouts.sessionIdleExpire, + }); + + if (expired) { + return; + } + + if (breadcrumb) { + this._createCustomBreadcrumb(breadcrumb); + } + + // Send replay when the page/tab becomes hidden. There is no reason to send + // replay if it becomes visible, since no actions we care about were done + // while it was hidden + void this.conditionalFlush(); + } + + /** + * Tasks to run when we consider a page to be visible (via focus and/or visibility) + */ + _doChangeToForegroundTasks(breadcrumb) { + if (!this.session) { + return; + } + + const isSessionActive = this.checkAndHandleExpiredSession(); + + if (!isSessionActive) { + // If the user has come back to the page within SESSION_IDLE_PAUSE_DURATION + // ms, we will re-use the existing session, otherwise create a new + // session + logInfo('[Replay] Document has become active, but session has expired'); + return; + } + + if (breadcrumb) { + this._createCustomBreadcrumb(breadcrumb); + } + } + + /** + * Trigger rrweb to take a full snapshot which will cause this plugin to + * create a new Replay event. + */ + _triggerFullSnapshot(checkout = true) { + try { + logInfo('[Replay] Taking full rrweb snapshot'); + record.takeFullSnapshot(checkout); + } catch (err) { + this._handleException(err); + } + } + + /** + * Update user activity (across session lifespans) + */ + _updateUserActivity(_lastActivity = Date.now()) { + this._lastActivity = _lastActivity; + } + + /** + * Updates the session's last activity timestamp + */ + _updateSessionActivity(_lastActivity = Date.now()) { + if (this.session) { + this.session.lastActivity = _lastActivity; + this._maybeSaveSession(); + } + } + + /** + * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb + */ + _createCustomBreadcrumb(breadcrumb) { + this.addUpdate(() => { + void this.throttledAddEvent({ + type: EventType.Custom, + timestamp: breadcrumb.timestamp || 0, + data: { + tag: 'breadcrumb', + payload: breadcrumb, + }, + }); + }); + } + + /** + * Observed performance events are added to `this.performanceEvents`. These + * are included in the replay event before it is finished and sent to Sentry. + */ + _addPerformanceEntries() { + // Copy and reset entries before processing + const entries = [...this.performanceEvents]; + this.performanceEvents = []; + + return Promise.all(createPerformanceSpans(this, createPerformanceEntries(entries))); + } + + /** + * Clear _context + */ + _clearContext() { + // XXX: `initialTimestamp` and `initialUrl` do not get cleared + this._context.errorIds.clear(); + this._context.traceIds.clear(); + this._context.urls = []; + } + + /** Update the initial timestamp based on the buffer content. */ + _updateInitialTimestampFromEventBuffer() { + const { session, eventBuffer } = this; + if (!session || !eventBuffer) { + return; + } + + // we only ever update this on the initial segment + if (session.segmentId) { + return; + } + + const earliestEvent = eventBuffer.getEarliestTimestamp(); + if (earliestEvent && earliestEvent < this._context.initialTimestamp) { + this._context.initialTimestamp = earliestEvent; + } + } + + /** + * Return and clear _context + */ + _popEventContext() { + const _context = { + initialTimestamp: this._context.initialTimestamp, + initialUrl: this._context.initialUrl, + errorIds: Array.from(this._context.errorIds), + traceIds: Array.from(this._context.traceIds), + urls: this._context.urls, + }; + + this._clearContext(); + + return _context; + } + + /** + * Flushes replay event buffer to Sentry. + * + * Performance events are only added right before flushing - this is + * due to the buffered performance observer events. + * + * Should never be called directly, only by `flush` + */ + async _runFlush() { + const replayId = this.getSessionId(); + + if (!this.session || !this.eventBuffer || !replayId) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('[Replay] No session or eventBuffer found to flush.'); + return; + } + + await this._addPerformanceEntries(); + + // Check eventBuffer again, as it could have been stopped in the meanwhile + if (!this.eventBuffer || !this.eventBuffer.hasEvents) { + return; + } + + // Only attach memory event if eventBuffer is not empty + await addMemoryEntry(this); + + // Check eventBuffer again, as it could have been stopped in the meanwhile + if (!this.eventBuffer) { + return; + } + + // if this changed in the meanwhile, e.g. because the session was refreshed or similar, we abort here + if (replayId !== this.getSessionId()) { + return; + } + + try { + // This uses the data from the eventBuffer, so we need to call this before `finish() + this._updateInitialTimestampFromEventBuffer(); + + const timestamp = Date.now(); + + // Check total duration again, to avoid sending outdated stuff + // We leave 30s wiggle room to accomodate late flushing etc. + // This _could_ happen when the browser is suspended during flushing, in which case we just want to stop + if (timestamp - this._context.initialTimestamp > this._options.maxReplayDuration + 30000) { + throw new Error('Session is too long, not sending replay'); + } + + const eventContext = this._popEventContext(); + // Always increment segmentId regardless of outcome of sending replay + const segmentId = this.session.segmentId++; + this._maybeSaveSession(); + + // Note this empties the event buffer regardless of outcome of sending replay + const recordingData = await this.eventBuffer.finish(); + + await sendReplay({ + replayId, + recordingData, + segmentId, + eventContext, + session: this.session, + options: this.getOptions(), + timestamp, + }); + } catch (err) { + this._handleException(err); + + // This means we retried 3 times and all of them failed, + // or we ran into a problem we don't want to retry, like rate limiting. + // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments + void this.stop({ reason: 'sendReplay' }); + + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)().getClient(); + + if (client) { + client.recordDroppedEvent('send_error', 'replay'); + } + } + } + + /** + * Flush recording data to Sentry. Creates a lock so that only a single flush + * can be active at a time. Do not call this directly. + */ + __init5() {this._flush = async ({ + force = false, + } + + = {}) => { + if (!this._isEnabled && !force) { + // This can happen if e.g. the replay was stopped because of exceeding the retry limit + return; + } + + if (!this.checkAndHandleExpiredSession()) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('[Replay] Attempting to finish replay event after session expired.'); + return; + } + + if (!this.session) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('[Replay] No session found to flush.'); + return; + } + + const start = this.session.started; + const now = Date.now(); + const duration = now - start; + + // A flush is about to happen, cancel any queued flushes + this._debouncedFlush.cancel(); + + // If session is too short, or too long (allow some wiggle room over maxReplayDuration), do not send it + // This _should_ not happen, but it may happen if flush is triggered due to a page activity change or similar + const tooShort = duration < this._options.minReplayDuration; + const tooLong = duration > this._options.maxReplayDuration + 5000; + if (tooShort || tooLong) { + logInfo( + `[Replay] Session duration (${Math.floor(duration / 1000)}s) is too ${ + tooShort ? 'short' : 'long' + }, not sending replay.`, + this._options._experiments.traceInternals, + ); + + if (tooShort) { + this._debouncedFlush(); + } + return; + } + + const eventBuffer = this.eventBuffer; + if (eventBuffer && this.session.segmentId === 0 && !eventBuffer.hasCheckout) { + logInfo('[Replay] Flushing initial segment without checkout.', this._options._experiments.traceInternals); + // TODO FN: Evaluate if we want to stop here, or remove this again? + } + + // this._flushLock acts as a lock so that future calls to `_flush()` + // will be blocked until this promise resolves + if (!this._flushLock) { + this._flushLock = this._runFlush(); + await this._flushLock; + this._flushLock = undefined; + return; + } + + // Wait for previous flush to finish, then call the debounced `_flush()`. + // It's possible there are other flush requests queued and waiting for it + // to resolve. We want to reduce all outstanding requests (as well as any + // new flush requests that occur within a second of the locked flush + // completing) into a single flush. + + try { + await this._flushLock; + } catch (err) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error(err); + } finally { + this._debouncedFlush(); + } + };} + + /** Save the session, if it is sticky */ + _maybeSaveSession() { + if (this.session && this._options.stickySession) { + saveSession(this.session); + } + } + + /** Handler for rrweb.record.onMutation */ + __init6() {this._onMutationHandler = (mutations) => { + const count = mutations.length; + + const mutationLimit = this._options.mutationLimit; + const mutationBreadcrumbLimit = this._options.mutationBreadcrumbLimit; + const overMutationLimit = mutationLimit && count > mutationLimit; + + // Create a breadcrumb if a lot of mutations happen at the same time + // We can show this in the UI as an information with potential performance improvements + if (count > mutationBreadcrumbLimit || overMutationLimit) { + const breadcrumb = createBreadcrumb({ + category: 'replay.mutations', + data: { + count, + limit: overMutationLimit, + }, + }); + this._createCustomBreadcrumb(breadcrumb); + } + + // Stop replay if over the mutation limit + if (overMutationLimit) { + void this.stop({ reason: 'mutationLimit', forceFlush: this.recordingMode === 'session' }); + return false; + } + + // `true` means we use the regular mutation handling by rrweb + return true; + };} +} + +function getOption( + selectors, + defaultSelectors, + deprecatedClassOption, + deprecatedSelectorOption, +) { + const deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : []; + + const allSelectors = [ + ...selectors, + // @deprecated + ...deprecatedSelectors, + + // sentry defaults + ...defaultSelectors, + ]; + + // @deprecated + if (typeof deprecatedClassOption !== 'undefined') { + // NOTE: No support for RegExp + if (typeof deprecatedClassOption === 'string') { + allSelectors.push(`.${deprecatedClassOption}`); + } + + // eslint-disable-next-line no-console + console.warn( + '[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.', + ); + } + + return allSelectors.join(','); +} + +/** + * Returns privacy related configuration for use in rrweb + */ +function getPrivacyOptions({ + mask, + unmask, + block, + unblock, + ignore, + + // eslint-disable-next-line deprecation/deprecation + blockClass, + // eslint-disable-next-line deprecation/deprecation + blockSelector, + // eslint-disable-next-line deprecation/deprecation + maskTextClass, + // eslint-disable-next-line deprecation/deprecation + maskTextSelector, + // eslint-disable-next-line deprecation/deprecation + ignoreClass, +}) { + const defaultBlockedElements = ['base[href="/"]']; + + const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector); + const unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']); + + const options = { + // We are making the decision to make text and input selectors the same + maskTextSelector: maskSelector, + unmaskTextSelector: unmaskSelector, + + blockSelector: getOption( + block, + ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements], + blockClass, + blockSelector, + ), + unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']), + ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type="file"]'], ignoreClass), + }; + + if (blockClass instanceof RegExp) { + options.blockClass = blockClass; + } + + if (maskTextClass instanceof RegExp) { + options.maskTextClass = maskTextClass; + } + + return options; +} + +/** + * Returns true if we are in the browser. + */ +function isBrowser() { + // eslint-disable-next-line no-restricted-globals + return typeof window !== 'undefined' && (!(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_15__.isNodeEnv)() || isElectronNodeRenderer()); +} + +// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them +function isElectronNodeRenderer() { + return typeof ({"env":{"ENVIRONMENT":"development"}}) !== 'undefined' && (({"env":{"ENVIRONMENT":"development"}}) ).type === 'renderer'; +} + +/** + * Masks an attribute if necessary, otherwise return attribute value as-is. + */ +function maskAttribute({ + el, + key, + maskAttributes, + maskAllText, + privacyOptions, + value, +}) { + // We only mask attributes if `maskAllText` is true + if (!maskAllText) { + return value; + } + + // unmaskTextSelector takes precendence + if (privacyOptions.unmaskTextSelector && el.matches(privacyOptions.unmaskTextSelector)) { + return value; + } + + if ( + maskAttributes.includes(key) || + // Need to mask `value` attribute for `` if it's a button-like + // type + (key === 'value' && el.tagName === 'INPUT' && ['submit', 'button'].includes(el.getAttribute('type') || '')) + ) { + return value.replace(/[\S]/g, '*'); + } + + return value; +} + +const MEDIA_SELECTORS = + 'img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]'; + +const DEFAULT_NETWORK_HEADERS = ['content-length', 'content-type', 'accept']; + +let _initialized = false; + +/** + * The main replay integration class, to be passed to `init({ integrations: [] })`. + */ +class Replay { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Replay';} + + /** + * @inheritDoc + */ + + /** + * Options to pass to `rrweb.record()` + */ + + /** + * Initial options passed to the replay integration, merged with default values. + * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they + * can only be finally set when setupOnce() is called. + * + * @private + */ + + constructor({ + flushMinDelay = DEFAULT_FLUSH_MIN_DELAY, + flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY, + minReplayDuration = MIN_REPLAY_DURATION, + maxReplayDuration = MAX_REPLAY_DURATION, + stickySession = true, + useCompression = true, + _experiments = {}, + sessionSampleRate, + errorSampleRate, + maskAllText = true, + maskAllInputs = true, + blockAllMedia = true, + + mutationBreadcrumbLimit = 750, + mutationLimit = 10000, + + slowClickTimeout = 7000, + slowClickIgnoreSelectors = [], + + networkDetailAllowUrls = [], + networkDetailDenyUrls = [], + networkCaptureBodies = true, + networkRequestHeaders = [], + networkResponseHeaders = [], + + mask = [], + maskAttributes = ['title', 'placeholder'], + unmask = [], + block = [], + unblock = [], + ignore = [], + maskFn, + + beforeAddRecordingEvent, + + // eslint-disable-next-line deprecation/deprecation + blockClass, + // eslint-disable-next-line deprecation/deprecation + blockSelector, + // eslint-disable-next-line deprecation/deprecation + maskInputOptions, + // eslint-disable-next-line deprecation/deprecation + maskTextClass, + // eslint-disable-next-line deprecation/deprecation + maskTextSelector, + // eslint-disable-next-line deprecation/deprecation + ignoreClass, + } = {}) { + this.name = Replay.id; + + const privacyOptions = getPrivacyOptions({ + mask, + unmask, + block, + unblock, + ignore, + blockClass, + blockSelector, + maskTextClass, + maskTextSelector, + ignoreClass, + }); + + this._recordingOptions = { + maskAllInputs, + maskAllText, + maskInputOptions: { ...(maskInputOptions || {}), password: true }, + maskTextFn: maskFn, + maskInputFn: maskFn, + maskAttributeFn: (key, value, el) => + maskAttribute({ + maskAttributes, + maskAllText, + privacyOptions, + key, + value, + el, + }), + + ...privacyOptions, + + // Our defaults + slimDOMOptions: 'all', + inlineStylesheet: true, + // Disable inline images as it will increase segment/replay size + inlineImages: false, + // collect fonts, but be aware that `sentry.io` needs to be an allowed + // origin for playback + collectFonts: true, + errorHandler: (err) => { + try { + // @ts-expect-error Set this so that replay SDK can ignore errors originating from rrweb + err.__rrweb__ = true; + } catch (e) { + // avoid any potential hazards here + } + // return true to suppress throwing the error inside of rrweb + return true; + }, + }; + + this._initialOptions = { + flushMinDelay, + flushMaxDelay, + minReplayDuration: Math.min(minReplayDuration, MIN_REPLAY_DURATION_LIMIT), + maxReplayDuration: Math.min(maxReplayDuration, MAX_REPLAY_DURATION), + stickySession, + sessionSampleRate, + errorSampleRate, + useCompression, + blockAllMedia, + maskAllInputs, + maskAllText, + mutationBreadcrumbLimit, + mutationLimit, + slowClickTimeout, + slowClickIgnoreSelectors, + networkDetailAllowUrls, + networkDetailDenyUrls, + networkCaptureBodies, + networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders), + networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders), + beforeAddRecordingEvent, + + _experiments, + }; + + if (typeof sessionSampleRate === 'number') { + // eslint-disable-next-line + console.warn( + `[Replay] You are passing \`sessionSampleRate\` to the Replay integration. +This option is deprecated and will be removed soon. +Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.: +Sentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`, + ); + + this._initialOptions.sessionSampleRate = sessionSampleRate; + } + + if (typeof errorSampleRate === 'number') { + // eslint-disable-next-line + console.warn( + `[Replay] You are passing \`errorSampleRate\` to the Replay integration. +This option is deprecated and will be removed soon. +Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.: +Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`, + ); + + this._initialOptions.errorSampleRate = errorSampleRate; + } + + if (this._initialOptions.blockAllMedia) { + // `blockAllMedia` is a more user friendly option to configure blocking + // embedded media elements + this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector + ? MEDIA_SELECTORS + : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`; + } + + if (this._isInitialized && isBrowser()) { + throw new Error('Multiple Sentry Session Replay instances are not supported'); + } + + this._isInitialized = true; + } + + /** If replay has already been initialized */ + get _isInitialized() { + return _initialized; + } + + /** Update _isInitialized */ + set _isInitialized(value) { + _initialized = value; + } + + /** + * Setup and initialize replay container + */ + setupOnce() { + if (!isBrowser()) { + return; + } + + this._setup(); + + // Once upon a time, we tried to create a transaction in `setupOnce` and it would + // potentially create a transaction before some native SDK integrations have run + // and applied their own global event processor. An example is: + // https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts + // + // So we call `this._initialize()` in next event loop as a workaround to wait for other + // global event processors to finish. This is no longer needed, but keeping it + // here to avoid any future issues. + setTimeout(() => this._initialize()); + } + + /** + * Start a replay regardless of sampling rate. Calling this will always + * create a new session. Will throw an error if replay is already in progress. + * + * Creates or loads a session, attaches listeners to varying events (DOM, + * PerformanceObserver, Recording, Sentry SDK, etc) + */ + start() { + if (!this._replay) { + return; + } + + this._replay.start(); + } + + /** + * Start replay buffering. Buffers until `flush()` is called or, if + * `replaysOnErrorSampleRate` > 0, until an error occurs. + */ + startBuffering() { + if (!this._replay) { + return; + } + + this._replay.startBuffering(); + } + + /** + * Currently, this needs to be manually called (e.g. for tests). Sentry SDK + * does not support a teardown + */ + stop() { + if (!this._replay) { + return Promise.resolve(); + } + + return this._replay.stop({ forceFlush: this._replay.recordingMode === 'session' }); + } + + /** + * If not in "session" recording mode, flush event buffer which will create a new replay. + * Unless `continueRecording` is false, the replay will continue to record and + * behave as a "session"-based replay. + * + * Otherwise, queue up a flush. + */ + flush(options) { + if (!this._replay || !this._replay.isEnabled()) { + return Promise.resolve(); + } + + return this._replay.sendBufferedReplayOrFlush(options); + } + + /** + * Get the current session ID. + */ + getReplayId() { + if (!this._replay || !this._replay.isEnabled()) { + return; + } + + return this._replay.getSessionId(); + } + /** + * Initializes replay. + */ + _initialize() { + if (!this._replay) { + return; + } + + this._replay.initializeSampling(); + } + + /** Setup the integration. */ + _setup() { + // Client is not available in constructor, so we need to wait until setupOnce + const finalOptions = loadReplayOptionsFromClient(this._initialOptions); + + this._replay = new ReplayContainer({ + options: finalOptions, + recordingOptions: this._recordingOptions, + }); + } +} Replay.__initStatic(); + +/** Parse Replay-related options from SDK options */ +function loadReplayOptionsFromClient(initialOptions) { + const client = (0,_sentry_core__WEBPACK_IMPORTED_MODULE_5__.getCurrentHub)().getClient(); + const opt = client && (client.getOptions() ); + + const finalOptions = { sessionSampleRate: 0, errorSampleRate: 0, ...(0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.dropUndefinedKeys)(initialOptions) }; + + if (!opt) { + // eslint-disable-next-line no-console + console.warn('SDK client is not available.'); + return finalOptions; + } + + if ( + initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed + initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed + opt.replaysSessionSampleRate == null && + opt.replaysOnErrorSampleRate == null + ) { + // eslint-disable-next-line no-console + console.warn( + 'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.', + ); + } + + if (typeof opt.replaysSessionSampleRate === 'number') { + finalOptions.sessionSampleRate = opt.replaysSessionSampleRate; + } + + if (typeof opt.replaysOnErrorSampleRate === 'number') { + finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate; + } + + return finalOptions; +} + +function _getMergedNetworkHeaders(headers) { + return [...DEFAULT_NETWORK_HEADERS, ...headers.map(header => header.toLowerCase())]; +} + + +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/aggregate-errors.js": +/*!************************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/aggregate-errors.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ applyAggregateErrorsToEvent: () => (/* binding */ applyAggregateErrorsToEvent) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is.js */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string.js */ "./node_modules/@sentry/utils/esm/string.js"); + + + +/** + * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter. + */ +function applyAggregateErrorsToEvent( + exceptionFromErrorImplementation, + parser, + maxValueLimit = 250, + key, + limit, + event, + hint, +) { + if (!event.exception || !event.exception.values || !hint || !(0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isInstanceOf)(hint.originalException, Error)) { + return; + } + + // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error + const originalException = + event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined; + + // We only create exception grouping if there is an exception in the event. + if (originalException) { + event.exception.values = truncateAggregateExceptions( + aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + hint.originalException , + key, + event.exception.values, + originalException, + 0, + ), + maxValueLimit, + ); + } +} + +function aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + error, + key, + prevExceptions, + exception, + exceptionId, +) { + if (prevExceptions.length >= limit + 1) { + return prevExceptions; + } + + let newExceptions = [...prevExceptions]; + + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isInstanceOf)(error[key], Error)) { + applyExceptionGroupFieldsForParentException(exception, exceptionId); + const newException = exceptionFromErrorImplementation(parser, error[key]); + const newExceptionId = newExceptions.length; + applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); + newExceptions = aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + error[key], + key, + [newException, ...newExceptions], + newException, + newExceptionId, + ); + } + + // This will create exception grouping for AggregateErrors + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError + if (Array.isArray(error.errors)) { + error.errors.forEach((childError, i) => { + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isInstanceOf)(childError, Error)) { + applyExceptionGroupFieldsForParentException(exception, exceptionId); + const newException = exceptionFromErrorImplementation(parser, childError); + const newExceptionId = newExceptions.length; + applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId); + newExceptions = aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + childError, + key, + [newException, ...newExceptions], + newException, + newExceptionId, + ); + } + }); + } + + return newExceptions; +} + +function applyExceptionGroupFieldsForParentException(exception, exceptionId) { + // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default. + exception.mechanism = exception.mechanism || { type: 'generic', handled: true }; + + exception.mechanism = { + ...exception.mechanism, + is_exception_group: true, + exception_id: exceptionId, + }; +} + +function applyExceptionGroupFieldsForChildException( + exception, + source, + exceptionId, + parentId, +) { + // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default. + exception.mechanism = exception.mechanism || { type: 'generic', handled: true }; + + exception.mechanism = { + ...exception.mechanism, + type: 'chained', + source, + exception_id: exceptionId, + parent_id: parentId, + }; +} + +/** + * Truncate the message (exception.value) of all exceptions in the event. + * Because this event processor is ran after `applyClientOptions`, + * we need to truncate the message of the added exceptions here. + */ +function truncateAggregateExceptions(exceptions, maxValueLength) { + return exceptions.map(exception => { + if (exception.value) { + exception.value = (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.truncate)(exception.value, maxValueLength); + } + return exception; + }); +} + + +//# sourceMappingURL=aggregate-errors.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/baggage.js": +/*!***************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/baggage.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BAGGAGE_HEADER_NAME: () => (/* binding */ BAGGAGE_HEADER_NAME), +/* harmony export */ MAX_BAGGAGE_STRING_LENGTH: () => (/* binding */ MAX_BAGGAGE_STRING_LENGTH), +/* harmony export */ SENTRY_BAGGAGE_KEY_PREFIX: () => (/* binding */ SENTRY_BAGGAGE_KEY_PREFIX), +/* harmony export */ SENTRY_BAGGAGE_KEY_PREFIX_REGEX: () => (/* binding */ SENTRY_BAGGAGE_KEY_PREFIX_REGEX), +/* harmony export */ baggageHeaderToDynamicSamplingContext: () => (/* binding */ baggageHeaderToDynamicSamplingContext), +/* harmony export */ dynamicSamplingContextToSentryBaggageHeader: () => (/* binding */ dynamicSamplingContextToSentryBaggageHeader) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is.js */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger.js */ "./node_modules/@sentry/utils/esm/logger.js"); + + + +const BAGGAGE_HEADER_NAME = 'baggage'; + +const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-'; + +const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; + +/** + * Max length of a serialized baggage string + * + * https://www.w3.org/TR/baggage/#limits + */ +const MAX_BAGGAGE_STRING_LENGTH = 8192; + +/** + * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values + * from it. + * + * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks. + * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise. + */ +function baggageHeaderToDynamicSamplingContext( + // Very liberal definition of what any incoming header might look like + baggageHeader, +) { + if (!(0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isString)(baggageHeader) && !Array.isArray(baggageHeader)) { + return undefined; + } + + // Intermediary object to store baggage key value pairs of incoming baggage headers on. + // It is later used to read Sentry-DSC-values from. + let baggageObject = {}; + + if (Array.isArray(baggageHeader)) { + // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it + baggageObject = baggageHeader.reduce((acc, curr) => { + const currBaggageObject = baggageHeaderToObject(curr); + return { + ...acc, + ...currBaggageObject, + }; + }, {}); + } else { + // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but + // this is how we choose to handle it) + if (!baggageHeader) { + return undefined; + } + + baggageObject = baggageHeaderToObject(baggageHeader); + } + + // Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object. + const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { + if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { + const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); + acc[nonPrefixedKey] = value; + } + return acc; + }, {}); + + // Only return a dynamic sampling context object if there are keys in it. + // A keyless object means there were no sentry values on the header, which means that there is no DSC. + if (Object.keys(dynamicSamplingContext).length > 0) { + return dynamicSamplingContext ; + } else { + return undefined; + } +} + +/** + * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-". + * + * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility + * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is + * `undefined` the function will return `undefined`. + * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext` + * was `undefined`, or if `dynamicSamplingContext` didn't contain any values. + */ +function dynamicSamplingContextToSentryBaggageHeader( + // this also takes undefined for convenience and bundle size in other places + dynamicSamplingContext, +) { + if (!dynamicSamplingContext) { + return undefined; + } + + // Prefix all DSC keys with "sentry-" and put them into a new object + const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( + (acc, [dscKey, dscValue]) => { + if (dscValue) { + acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; + } + return acc; + }, + {}, + ); + + return objectToBaggageHeader(sentryPrefixedDSC); +} + +/** + * Will parse a baggage header, which is a simple key-value map, into a flat object. + * + * @param baggageHeader The baggage header to parse. + * @returns a flat object containing all the key-value pairs from `baggageHeader`. + */ +function baggageHeaderToObject(baggageHeader) { + return baggageHeader + .split(',') + .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim()))) + .reduce((acc, [key, value]) => { + acc[key] = value; + return acc; + }, {}); +} + +/** + * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs. + * + * @param object The object to turn into a baggage header. + * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header + * is not spec compliant. + */ +function objectToBaggageHeader(object) { + if (Object.keys(object).length === 0) { + // An empty baggage header is not spec compliant: We return undefined. + return undefined; + } + + return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { + const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; + const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; + if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.warn( + `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`, + ); + return baggageHeader; + } else { + return newBaggageHeader; + } + }, ''); +} + + +//# sourceMappingURL=baggage.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/browser.js": +/*!***************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/browser.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getDomElement: () => (/* binding */ getDomElement), +/* harmony export */ getLocationHref: () => (/* binding */ getLocationHref), +/* harmony export */ htmlTreeAsString: () => (/* binding */ htmlTreeAsString) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is.js */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "./node_modules/@sentry/utils/esm/worldwide.js"); + + + +// eslint-disable-next-line deprecation/deprecation +const WINDOW = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalObject)(); + +const DEFAULT_MAX_STRING_LENGTH = 80; + +/** + * Given a child DOM element, returns a query-selector statement describing that + * and its ancestors + * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz] + * @returns generated DOM path + */ +function htmlTreeAsString( + elem, + options = {}, +) { + + // try/catch both: + // - accessing event.target (see getsentry/raven-js#838, #768) + // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly + // - can throw an exception in some circumstances. + try { + let currentElem = elem ; + const MAX_TRAVERSE_HEIGHT = 5; + const out = []; + let height = 0; + let len = 0; + const separator = ' > '; + const sepLength = separator.length; + let nextStr; + const keyAttrs = Array.isArray(options) ? options : options.keyAttrs; + const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH; + + while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { + nextStr = _htmlElementAsString(currentElem, keyAttrs); + // bail out if + // - nextStr is the 'html' element + // - the length of the string that would be created exceeds maxStringLength + // (ignore this limit if we are on the first iteration) + if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) { + break; + } + + out.push(nextStr); + + len += nextStr.length; + currentElem = currentElem.parentNode; + } + + return out.reverse().join(separator); + } catch (_oO) { + return ''; + } +} + +/** + * Returns a simple, query-selector representation of a DOM element + * e.g. [HTMLElement] => input#foo.btn[name=baz] + * @returns generated DOM path + */ +function _htmlElementAsString(el, keyAttrs) { + const elem = el + +; + + const out = []; + let className; + let classes; + let key; + let attr; + let i; + + if (!elem || !elem.tagName) { + return ''; + } + + out.push(elem.tagName.toLowerCase()); + + // Pairs of attribute keys defined in `serializeAttribute` and their values on element. + const keyAttrPairs = + keyAttrs && keyAttrs.length + ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)]) + : null; + + if (keyAttrPairs && keyAttrPairs.length) { + keyAttrPairs.forEach(keyAttrPair => { + out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); + }); + } else { + if (elem.id) { + out.push(`#${elem.id}`); + } + + // eslint-disable-next-line prefer-const + className = elem.className; + if (className && (0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isString)(className)) { + classes = className.split(/\s+/); + for (i = 0; i < classes.length; i++) { + out.push(`.${classes[i]}`); + } + } + } + const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt']; + for (i = 0; i < allowedAttrs.length; i++) { + key = allowedAttrs[i]; + attr = elem.getAttribute(key); + if (attr) { + out.push(`[${key}="${attr}"]`); + } + } + return out.join(''); +} + +/** + * A safe form of location.href + */ +function getLocationHref() { + try { + return WINDOW.document.location.href; + } catch (oO) { + return ''; + } +} + +/** + * Gets a DOM element by using document.querySelector. + * + * This wrapper will first check for the existance of the function before + * actually calling it so that we don't have to take care of this check, + * every time we want to access the DOM. + * + * Reason: DOM/querySelector is not available in all environments. + * + * We have to cast to any because utils can be consumed by a variety of environments, + * and we don't want to break TS users. If you know what element will be selected by + * `document.querySelector`, specify it as part of the generic call. For example, + * `const element = getDomElement('selector');` + * + * @param selector the selector string passed on to document.querySelector + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function getDomElement(selector) { + if (WINDOW.document && WINDOW.document.querySelector) { + return WINDOW.document.querySelector(selector) ; + } + return null; +} + + +//# sourceMappingURL=browser.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/clientreport.js": +/*!********************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/clientreport.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createClientReportEnvelope: () => (/* binding */ createClientReportEnvelope) +/* harmony export */ }); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./envelope.js */ "./node_modules/@sentry/utils/esm/envelope.js"); +/* harmony import */ var _time_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./time.js */ "./node_modules/@sentry/utils/esm/time.js"); + + + +/** + * Creates client report envelope + * @param discarded_events An array of discard events + * @param dsn A DSN that can be set on the header. Optional. + */ +function createClientReportEnvelope( + discarded_events, + dsn, + timestamp, +) { + const clientReportItem = [ + { type: 'client_report' }, + { + timestamp: timestamp || (0,_time_js__WEBPACK_IMPORTED_MODULE_0__.dateTimestampInSeconds)(), + discarded_events, + }, + ]; + return (0,_envelope_js__WEBPACK_IMPORTED_MODULE_1__.createEnvelope)(dsn ? { dsn } : {}, [clientReportItem]); +} + + +//# sourceMappingURL=clientreport.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/dsn.js": +/*!***********************************************!*\ + !*** ./node_modules/@sentry/utils/esm/dsn.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ dsnFromString: () => (/* binding */ dsnFromString), +/* harmony export */ dsnToString: () => (/* binding */ dsnToString), +/* harmony export */ makeDsn: () => (/* binding */ makeDsn) +/* harmony export */ }); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./logger.js */ "./node_modules/@sentry/utils/esm/logger.js"); + + +/** Regular expression used to parse a Dsn. */ +const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; + +function isValidProtocol(protocol) { + return protocol === 'http' || protocol === 'https'; +} + +/** + * Renders the string representation of this Dsn. + * + * By default, this will render the public representation without the password + * component. To get the deprecated private representation, set `withPassword` + * to true. + * + * @param withPassword When set to true, the password will be included. + */ +function dsnToString(dsn, withPassword = false) { + const { host, path, pass, port, projectId, protocol, publicKey } = dsn; + return ( + `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` + + `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}` + ); +} + +/** + * Parses a Dsn from a given string. + * + * @param str A Dsn as string + * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string + */ +function dsnFromString(str) { + const match = DSN_REGEX.exec(str); + + if (!match) { + // This should be logged to the console + // eslint-disable-next-line no-console + console.error(`Invalid Sentry Dsn: ${str}`); + return undefined; + } + + const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1); + let path = ''; + let projectId = lastPath; + + const split = projectId.split('/'); + if (split.length > 1) { + path = split.slice(0, -1).join('/'); + projectId = split.pop() ; + } + + if (projectId) { + const projectMatch = projectId.match(/^\d+/); + if (projectMatch) { + projectId = projectMatch[0]; + } + } + + return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey }); +} + +function dsnFromComponents(components) { + return { + protocol: components.protocol, + publicKey: components.publicKey || '', + pass: components.pass || '', + host: components.host, + port: components.port || '', + path: components.path || '', + projectId: components.projectId, + }; +} + +function validateDsn(dsn) { + if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + return true; + } + + const { port, projectId, protocol } = dsn; + + const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; + const hasMissingRequiredComponent = requiredComponents.find(component => { + if (!dsn[component]) { + _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Invalid Sentry Dsn: ${component} missing`); + return true; + } + return false; + }); + + if (hasMissingRequiredComponent) { + return false; + } + + if (!projectId.match(/^\d+$/)) { + _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); + return false; + } + + if (!isValidProtocol(protocol)) { + _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); + return false; + } + + if (port && isNaN(parseInt(port, 10))) { + _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.error(`Invalid Sentry Dsn: Invalid port ${port}`); + return false; + } + + return true; +} + +/** + * Creates a valid Sentry Dsn object, identifying a Sentry instance and project. + * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source + */ +function makeDsn(from) { + const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); + if (!components || !validateDsn(components)) { + return undefined; + } + return components; +} + + +//# sourceMappingURL=dsn.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/env.js": +/*!***********************************************!*\ + !*** ./node_modules/@sentry/utils/esm/env.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getSDKSource: () => (/* binding */ getSDKSource), +/* harmony export */ isBrowserBundle: () => (/* binding */ isBrowserBundle) +/* harmony export */ }); +/* + * This module exists for optimizations in the build process through rollup and terser. We define some global + * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these + * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will + * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to + * `logger` and preventing node-related code from appearing in browser bundles. + * + * Attention: + * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by + * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack) + * having issues tree-shaking these constants across package boundaries. + * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want + * users to be able to shake away expressions that it guards. + */ + +/** + * Figures out if we're building a browser bundle. + * + * @returns true if this is a browser bundle build. + */ +function isBrowserBundle() { + return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; +} + +/** + * Get source of SDK. + */ +function getSDKSource() { + // @ts-expect-error "npm" is injected by rollup during build process + return "npm"; +} + + +//# sourceMappingURL=env.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/envelope.js": +/*!****************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/envelope.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addItemToEnvelope: () => (/* binding */ addItemToEnvelope), +/* harmony export */ createAttachmentEnvelopeItem: () => (/* binding */ createAttachmentEnvelopeItem), +/* harmony export */ createEnvelope: () => (/* binding */ createEnvelope), +/* harmony export */ createEventEnvelopeHeaders: () => (/* binding */ createEventEnvelopeHeaders), +/* harmony export */ envelopeContainsItemType: () => (/* binding */ envelopeContainsItemType), +/* harmony export */ envelopeItemTypeToDataCategory: () => (/* binding */ envelopeItemTypeToDataCategory), +/* harmony export */ forEachEnvelopeItem: () => (/* binding */ forEachEnvelopeItem), +/* harmony export */ getSdkMetadataForEnvelopeHeader: () => (/* binding */ getSdkMetadataForEnvelopeHeader), +/* harmony export */ parseEnvelope: () => (/* binding */ parseEnvelope), +/* harmony export */ serializeEnvelope: () => (/* binding */ serializeEnvelope) +/* harmony export */ }); +/* harmony import */ var _dsn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dsn.js */ "./node_modules/@sentry/utils/esm/dsn.js"); +/* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./normalize.js */ "./node_modules/@sentry/utils/esm/normalize.js"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./object.js */ "./node_modules/@sentry/utils/esm/object.js"); + + + + +/** + * Creates an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function createEnvelope(headers, items = []) { + return [headers, items] ; +} + +/** + * Add an item to an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function addItemToEnvelope(envelope, newItem) { + const [headers, items] = envelope; + return [headers, [...items, newItem]] ; +} + +/** + * Convenience function to loop through the items and item types of an envelope. + * (This function was mostly created because working with envelope types is painful at the moment) + * + * If the callback returns true, the rest of the items will be skipped. + */ +function forEachEnvelopeItem( + envelope, + callback, +) { + const envelopeItems = envelope[1]; + + for (const envelopeItem of envelopeItems) { + const envelopeItemType = envelopeItem[0].type; + const result = callback(envelopeItem, envelopeItemType); + + if (result) { + return true; + } + } + + return false; +} + +/** + * Returns true if the envelope contains any of the given envelope item types + */ +function envelopeContainsItemType(envelope, types) { + return forEachEnvelopeItem(envelope, (_, type) => types.includes(type)); +} + +/** + * Encode a string to UTF8. + */ +function encodeUTF8(input, textEncoder) { + const utf8 = textEncoder || new TextEncoder(); + return utf8.encode(input); +} + +/** + * Serializes an envelope. + */ +function serializeEnvelope(envelope, textEncoder) { + const [envHeaders, items] = envelope; + + // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data + let parts = JSON.stringify(envHeaders); + + function append(next) { + if (typeof parts === 'string') { + parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next]; + } else { + parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next); + } + } + + for (const item of items) { + const [itemHeaders, payload] = item; + + append(`\n${JSON.stringify(itemHeaders)}\n`); + + if (typeof payload === 'string' || payload instanceof Uint8Array) { + append(payload); + } else { + let stringifiedPayload; + try { + stringifiedPayload = JSON.stringify(payload); + } catch (e) { + // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still + // fails, we try again after normalizing it again with infinite normalization depth. This of course has a + // performance impact but in this case a performance hit is better than throwing. + stringifiedPayload = JSON.stringify((0,_normalize_js__WEBPACK_IMPORTED_MODULE_0__.normalize)(payload)); + } + append(stringifiedPayload); + } + } + + return typeof parts === 'string' ? parts : concatBuffers(parts); +} + +function concatBuffers(buffers) { + const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); + + const merged = new Uint8Array(totalLength); + let offset = 0; + for (const buffer of buffers) { + merged.set(buffer, offset); + offset += buffer.length; + } + + return merged; +} + +/** + * Parses an envelope + */ +function parseEnvelope( + env, + textEncoder, + textDecoder, +) { + let buffer = typeof env === 'string' ? textEncoder.encode(env) : env; + + function readBinary(length) { + const bin = buffer.subarray(0, length); + // Replace the buffer with the remaining data excluding trailing newline + buffer = buffer.subarray(length + 1); + return bin; + } + + function readJson() { + let i = buffer.indexOf(0xa); + // If we couldn't find a newline, we must have found the end of the buffer + if (i < 0) { + i = buffer.length; + } + + return JSON.parse(textDecoder.decode(readBinary(i))) ; + } + + const envelopeHeader = readJson(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const items = []; + + while (buffer.length) { + const itemHeader = readJson(); + const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined; + + items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]); + } + + return [envelopeHeader, items]; +} + +/** + * Creates attachment envelope items + */ +function createAttachmentEnvelopeItem( + attachment, + textEncoder, +) { + const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data; + + return [ + (0,_object_js__WEBPACK_IMPORTED_MODULE_1__.dropUndefinedKeys)({ + type: 'attachment', + length: buffer.length, + filename: attachment.filename, + content_type: attachment.contentType, + attachment_type: attachment.attachmentType, + }), + buffer, + ]; +} + +const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { + session: 'session', + sessions: 'session', + attachment: 'attachment', + transaction: 'transaction', + event: 'error', + client_report: 'internal', + user_report: 'default', + profile: 'profile', + replay_event: 'replay', + replay_recording: 'replay', + check_in: 'monitor', +}; + +/** + * Maps the type of an envelope item to a data category. + */ +function envelopeItemTypeToDataCategory(type) { + return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; +} + +/** Extracts the minimal SDK info from from the metadata or an events */ +function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { + if (!metadataOrEvent || !metadataOrEvent.sdk) { + return; + } + const { name, version } = metadataOrEvent.sdk; + return { name, version }; +} + +/** + * Creates event envelope headers, based on event, sdk info and tunnel + * Note: This function was extracted from the core package to make it available in Replay + */ +function createEventEnvelopeHeaders( + event, + sdkInfo, + tunnel, + dsn, +) { + const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; + return { + event_id: event.event_id , + sent_at: new Date().toISOString(), + ...(sdkInfo && { sdk: sdkInfo }), + ...(!!tunnel && dsn && { dsn: (0,_dsn_js__WEBPACK_IMPORTED_MODULE_2__.dsnToString)(dsn) }), + ...(dynamicSamplingContext && { + trace: (0,_object_js__WEBPACK_IMPORTED_MODULE_1__.dropUndefinedKeys)({ ...dynamicSamplingContext }), + }), + }; +} + + +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/error.js": +/*!*************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/error.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SentryError: () => (/* binding */ SentryError) +/* harmony export */ }); +/** An error emitted by Sentry SDKs and related utilities. */ +class SentryError extends Error { + /** Display name of this error instance. */ + + constructor( message, logLevel = 'warn') { + super(message);this.message = message; + this.name = new.target.prototype.constructor.name; + // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line + // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes + // instances of `SentryError` fail `obj instanceof SentryError` checks. + Object.setPrototypeOf(this, new.target.prototype); + this.logLevel = logLevel; + } +} + + +//# sourceMappingURL=error.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/instrument.js": +/*!******************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/instrument.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SENTRY_XHR_DATA_KEY: () => (/* binding */ SENTRY_XHR_DATA_KEY), +/* harmony export */ addInstrumentationHandler: () => (/* binding */ addInstrumentationHandler), +/* harmony export */ instrumentDOM: () => (/* binding */ instrumentDOM), +/* harmony export */ instrumentXHR: () => (/* binding */ instrumentXHR), +/* harmony export */ parseFetchArgs: () => (/* binding */ parseFetchArgs), +/* harmony export */ resetInstrumentationHandlers: () => (/* binding */ resetInstrumentationHandlers) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./is.js */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger.js */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./object.js */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _stacktrace_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stacktrace.js */ "./node_modules/@sentry/utils/esm/stacktrace.js"); +/* harmony import */ var _supports_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./supports.js */ "./node_modules/@sentry/utils/esm/supports.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "./node_modules/@sentry/utils/esm/worldwide.js"); +/* harmony import */ var _vendor_supportsHistory_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vendor/supportsHistory.js */ "./node_modules/@sentry/utils/esm/vendor/supportsHistory.js"); + + + + + + + + +// eslint-disable-next-line deprecation/deprecation +const WINDOW = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalObject)(); + +const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v2__'; + +/** + * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc. + * - Console API + * - Fetch API + * - XHR API + * - History API + * - DOM API (click/typing) + * - Error API + * - UnhandledRejection API + */ + +const handlers = {}; +const instrumented = {}; + +/** Instruments given API */ +function instrument(type) { + if (instrumented[type]) { + return; + } + + instrumented[type] = true; + + switch (type) { + case 'console': + instrumentConsole(); + break; + case 'dom': + instrumentDOM(); + break; + case 'xhr': + instrumentXHR(); + break; + case 'fetch': + instrumentFetch(); + break; + case 'history': + instrumentHistory(); + break; + case 'error': + instrumentError(); + break; + case 'unhandledrejection': + instrumentUnhandledRejection(); + break; + default: + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.warn('unknown instrumentation type:', type); + return; + } +} + +/** + * Add handler that will be called when given type of instrumentation triggers. + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addInstrumentationHandler(type, callback) { + handlers[type] = handlers[type] || []; + (handlers[type] ).push(callback); + instrument(type); +} + +/** + * Reset all instrumentation handlers. + * This can be used by tests to ensure we have a clean slate of instrumentation handlers. + */ +function resetInstrumentationHandlers() { + Object.keys(handlers).forEach(key => { + handlers[key ] = undefined; + }); +} + +/** JSDoc */ +function triggerHandlers(type, data) { + if (!type || !handlers[type]) { + return; + } + + for (const handler of handlers[type] || []) { + try { + handler(data); + } catch (e) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.error( + `Error while triggering instrumentation handler.\nType: ${type}\nName: ${(0,_stacktrace_js__WEBPACK_IMPORTED_MODULE_2__.getFunctionName)(handler)}\nError:`, + e, + ); + } + } +} + +/** JSDoc */ +function instrumentConsole() { + if (!("console" in _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ)) { + return; + } + + _logger_js__WEBPACK_IMPORTED_MODULE_1__.CONSOLE_LEVELS.forEach(function (level) { + if (!(level in _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console)) { + return; + } + + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console, level, function (originalConsoleMethod) { + _logger_js__WEBPACK_IMPORTED_MODULE_1__.originalConsoleMethods[level] = originalConsoleMethod; + + return function (...args) { + triggerHandlers('console', { args, level }); + + const log = _logger_js__WEBPACK_IMPORTED_MODULE_1__.originalConsoleMethods[level]; + log && log.apply(_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console, args); + }; + }); + }); +} + +/** JSDoc */ +function instrumentFetch() { + if (!(0,_supports_js__WEBPACK_IMPORTED_MODULE_4__.supportsNativeFetch)()) { + return; + } + + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ, 'fetch', function (originalFetch) { + return function (...args) { + const { method, url } = parseFetchArgs(args); + + const handlerData = { + args, + fetchData: { + method, + url, + }, + startTimestamp: Date.now(), + }; + + triggerHandlers('fetch', { + ...handlerData, + }); + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return originalFetch.apply(_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ, args).then( + (response) => { + triggerHandlers('fetch', { + ...handlerData, + endTimestamp: Date.now(), + response, + }); + return response; + }, + (error) => { + triggerHandlers('fetch', { + ...handlerData, + endTimestamp: Date.now(), + error, + }); + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the sentry.javascript SDK caught an error invoking your application code. + // This is expected behavior and NOT indicative of a bug with sentry.javascript. + throw error; + }, + ); + }; + }); +} + +function hasProp(obj, prop) { + return !!obj && typeof obj === 'object' && !!(obj )[prop]; +} + +function getUrlFromResource(resource) { + if (typeof resource === 'string') { + return resource; + } + + if (!resource) { + return ''; + } + + if (hasProp(resource, 'url')) { + return resource.url; + } + + if (resource.toString) { + return resource.toString(); + } + + return ''; +} + +/** + * Parses the fetch arguments to find the used Http method and the url of the request + */ +function parseFetchArgs(fetchArgs) { + if (fetchArgs.length === 0) { + return { method: 'GET', url: '' }; + } + + if (fetchArgs.length === 2) { + const [url, options] = fetchArgs ; + + return { + url: getUrlFromResource(url), + method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET', + }; + } + + const arg = fetchArgs[0]; + return { + url: getUrlFromResource(arg ), + method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET', + }; +} + +/** JSDoc */ +function instrumentXHR() { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (!(WINDOW ).XMLHttpRequest) { + return; + } + + const xhrproto = XMLHttpRequest.prototype; + + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(xhrproto, 'open', function (originalOpen) { + return function ( ...args) { + const url = args[1]; + const xhrInfo = (this[SENTRY_XHR_DATA_KEY] = { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + method: (0,_is_js__WEBPACK_IMPORTED_MODULE_5__.isString)(args[0]) ? args[0].toUpperCase() : args[0], + url: args[1], + request_headers: {}, + }); + + // if Sentry key appears in URL, don't capture it as a request + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_5__.isString)(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) { + this.__sentry_own_request__ = true; + } + + const onreadystatechangeHandler = () => { + // For whatever reason, this is not the same instance here as from the outer method + const xhrInfo = this[SENTRY_XHR_DATA_KEY]; + + if (!xhrInfo) { + return; + } + + if (this.readyState === 4) { + try { + // touching statusCode in some platforms throws + // an exception + xhrInfo.status_code = this.status; + } catch (e) { + /* do nothing */ + } + + triggerHandlers('xhr', { + args: args , + endTimestamp: Date.now(), + startTimestamp: Date.now(), + xhr: this, + } ); + } + }; + + if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') { + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(this, 'onreadystatechange', function (original) { + return function ( ...readyStateArgs) { + onreadystatechangeHandler(); + return original.apply(this, readyStateArgs); + }; + }); + } else { + this.addEventListener('readystatechange', onreadystatechangeHandler); + } + + // Intercepting `setRequestHeader` to access the request headers of XHR instance. + // This will only work for user/library defined headers, not for the default/browser-assigned headers. + // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`. + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(this, 'setRequestHeader', function (original) { + return function ( ...setRequestHeaderArgs) { + const [header, value] = setRequestHeaderArgs ; + + const xhrInfo = this[SENTRY_XHR_DATA_KEY]; + + if (xhrInfo) { + xhrInfo.request_headers[header.toLowerCase()] = value; + } + + return original.apply(this, setRequestHeaderArgs); + }; + }); + + return originalOpen.apply(this, args); + }; + }); + + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(xhrproto, 'send', function (originalSend) { + return function ( ...args) { + const sentryXhrData = this[SENTRY_XHR_DATA_KEY]; + if (sentryXhrData && args[0] !== undefined) { + sentryXhrData.body = args[0]; + } + + triggerHandlers('xhr', { + args, + startTimestamp: Date.now(), + xhr: this, + }); + + return originalSend.apply(this, args); + }; + }); +} + +let lastHref; + +/** JSDoc */ +function instrumentHistory() { + if (!(0,_vendor_supportsHistory_js__WEBPACK_IMPORTED_MODULE_6__.supportsHistory)()) { + return; + } + + const oldOnPopState = WINDOW.onpopstate; + WINDOW.onpopstate = function ( ...args) { + const to = WINDOW.location.href; + // keep track of the current URL state, as we always receive only the updated state + const from = lastHref; + lastHref = to; + triggerHandlers('history', { + from, + to, + }); + if (oldOnPopState) { + // Apparently this can throw in Firefox when incorrectly implemented plugin is installed. + // https://github.com/getsentry/sentry-javascript/issues/3344 + // https://github.com/bugsnag/bugsnag-js/issues/469 + try { + return oldOnPopState.apply(this, args); + } catch (_oO) { + // no-empty + } + } + }; + + /** @hidden */ + function historyReplacementFunction(originalHistoryFunction) { + return function ( ...args) { + const url = args.length > 2 ? args[2] : undefined; + if (url) { + // coerce to string (this is what pushState does) + const from = lastHref; + const to = String(url); + // keep track of the current URL state, as we always receive only the updated state + lastHref = to; + triggerHandlers('history', { + from, + to, + }); + } + return originalHistoryFunction.apply(this, args); + }; + } + + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(WINDOW.history, 'pushState', historyReplacementFunction); + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(WINDOW.history, 'replaceState', historyReplacementFunction); +} + +const debounceDuration = 1000; +let debounceTimerID; +let lastCapturedEvent; + +/** + * Decide whether the current event should finish the debounce of previously captured one. + * @param previous previously captured event + * @param current event to be captured + */ +function shouldShortcircuitPreviousDebounce(previous, current) { + // If there was no previous event, it should always be swapped for the new one. + if (!previous) { + return true; + } + + // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress. + if (previous.type !== current.type) { + return true; + } + + try { + // If both events have the same type, it's still possible that actions were performed on different targets. + // e.g. 2 clicks on different buttons. + if (previous.target !== current.target) { + return true; + } + } catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + + // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_ + // to which an event listener was attached), we treat them as the same action, as we want to capture + // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box. + return false; +} + +/** + * Decide whether an event should be captured. + * @param event event to be captured + */ +function shouldSkipDOMEvent(event) { + // We are only interested in filtering `keypress` events for now. + if (event.type !== 'keypress') { + return false; + } + + try { + const target = event.target ; + + if (!target || !target.tagName) { + return true; + } + + // Only consider keypress events on actual input elements. This will disregard keypresses targeting body + // e.g.tabbing through elements, hotkeys, etc. + if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) { + return false; + } + } catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + + return true; +} + +/** + * Wraps addEventListener to capture UI breadcrumbs + * @param handler function that will be triggered + * @param globalListener indicates whether event was captured by the global event listener + * @returns wrapped breadcrumb events handler + * @hidden + */ +function makeDOMEventHandler(handler, globalListener = false) { + return (event) => { + // It's possible this handler might trigger multiple times for the same + // event (e.g. event propagation through node ancestors). + // Ignore if we've already captured that event. + if (!event || lastCapturedEvent === event) { + return; + } + + // We always want to skip _some_ events. + if (shouldSkipDOMEvent(event)) { + return; + } + + const name = event.type === 'keypress' ? 'input' : event.type; + + // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons. + if (debounceTimerID === undefined) { + handler({ + event: event, + name, + global: globalListener, + }); + lastCapturedEvent = event; + } + // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one. + // If that's the case, emit the previous event and store locally the newly-captured DOM event. + else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) { + handler({ + event: event, + name, + global: globalListener, + }); + lastCapturedEvent = event; + } + + // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together. + clearTimeout(debounceTimerID); + debounceTimerID = WINDOW.setTimeout(() => { + debounceTimerID = undefined; + }, debounceDuration); + }; +} + +/** JSDoc */ +function instrumentDOM() { + if (!WINDOW.document) { + return; + } + + // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom + // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before + // we instrument `addEventListener` so that we don't end up attaching this handler twice. + const triggerDOMHandler = triggerHandlers.bind(null, 'dom'); + const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); + WINDOW.document.addEventListener('click', globalDOMEventHandler, false); + WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false); + + // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled + // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That + // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler + // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still + // guaranteed to fire at least once.) + ['EventTarget', 'Node'].forEach((target) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const proto = (WINDOW )[target] && (WINDOW )[target].prototype; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; + } + + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)(proto, 'addEventListener', function (originalAddEventListener) { + return function ( + + type, + listener, + options, + ) { + if (type === 'click' || type == 'keypress') { + try { + const el = this ; + const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {}); + const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 }); + + if (!handlerForType.handler) { + const handler = makeDOMEventHandler(triggerDOMHandler); + handlerForType.handler = handler; + originalAddEventListener.call(this, type, handler, options); + } + + handlerForType.refCount++; + } catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListenrs` calls with no proper `this` context. + } + } + + return originalAddEventListener.call(this, type, listener, options); + }; + }); + + (0,_object_js__WEBPACK_IMPORTED_MODULE_3__.fill)( + proto, + 'removeEventListener', + function (originalRemoveEventListener) { + return function ( + + type, + listener, + options, + ) { + if (type === 'click' || type == 'keypress') { + try { + const el = this ; + const handlers = el.__sentry_instrumentation_handlers__ || {}; + const handlerForType = handlers[type]; + + if (handlerForType) { + handlerForType.refCount--; + // If there are no longer any custom handlers of the current type on this element, we can remove ours, too. + if (handlerForType.refCount <= 0) { + originalRemoveEventListener.call(this, type, handlerForType.handler, options); + handlerForType.handler = undefined; + delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete + } + + // If there are no longer any custom handlers of any type on this element, cleanup everything. + if (Object.keys(handlers).length === 0) { + delete el.__sentry_instrumentation_handlers__; + } + } + } catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListenrs` calls with no proper `this` context. + } + } + + return originalRemoveEventListener.call(this, type, listener, options); + }; + }, + ); + }); +} + +let _oldOnErrorHandler = null; +/** JSDoc */ +function instrumentError() { + _oldOnErrorHandler = WINDOW.onerror; + + WINDOW.onerror = function (msg, url, line, column, error) { + triggerHandlers('error', { + column, + error, + line, + msg, + url, + }); + + if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) { + // eslint-disable-next-line prefer-rest-params + return _oldOnErrorHandler.apply(this, arguments); + } + + return false; + }; + + WINDOW.onerror.__SENTRY_INSTRUMENTED__ = true; +} + +let _oldOnUnhandledRejectionHandler = null; +/** JSDoc */ +function instrumentUnhandledRejection() { + _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection; + + WINDOW.onunhandledrejection = function (e) { + triggerHandlers('unhandledrejection', e); + + if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) { + // eslint-disable-next-line prefer-rest-params + return _oldOnUnhandledRejectionHandler.apply(this, arguments); + } + + return true; + }; + + WINDOW.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; +} + + +//# sourceMappingURL=instrument.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/is.js": +/*!**********************************************!*\ + !*** ./node_modules/@sentry/utils/esm/is.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isDOMError: () => (/* binding */ isDOMError), +/* harmony export */ isDOMException: () => (/* binding */ isDOMException), +/* harmony export */ isElement: () => (/* binding */ isElement), +/* harmony export */ isError: () => (/* binding */ isError), +/* harmony export */ isErrorEvent: () => (/* binding */ isErrorEvent), +/* harmony export */ isEvent: () => (/* binding */ isEvent), +/* harmony export */ isInstanceOf: () => (/* binding */ isInstanceOf), +/* harmony export */ isNaN: () => (/* binding */ isNaN), +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject), +/* harmony export */ isPrimitive: () => (/* binding */ isPrimitive), +/* harmony export */ isRegExp: () => (/* binding */ isRegExp), +/* harmony export */ isString: () => (/* binding */ isString), +/* harmony export */ isSyntheticEvent: () => (/* binding */ isSyntheticEvent), +/* harmony export */ isThenable: () => (/* binding */ isThenable), +/* harmony export */ isVueViewModel: () => (/* binding */ isVueViewModel) +/* harmony export */ }); +// eslint-disable-next-line @typescript-eslint/unbound-method +const objectToString = Object.prototype.toString; + +/** + * Checks whether given value's type is one of a few Error or Error-like + * {@link isError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isError(wat) { + switch (objectToString.call(wat)) { + case '[object Error]': + case '[object Exception]': + case '[object DOMException]': + return true; + default: + return isInstanceOf(wat, Error); + } +} +/** + * Checks whether given value is an instance of the given built-in class. + * + * @param wat The value to be checked + * @param className + * @returns A boolean representing the result. + */ +function isBuiltin(wat, className) { + return objectToString.call(wat) === `[object ${className}]`; +} + +/** + * Checks whether given value's type is ErrorEvent + * {@link isErrorEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isErrorEvent(wat) { + return isBuiltin(wat, 'ErrorEvent'); +} + +/** + * Checks whether given value's type is DOMError + * {@link isDOMError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMError(wat) { + return isBuiltin(wat, 'DOMError'); +} + +/** + * Checks whether given value's type is DOMException + * {@link isDOMException}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMException(wat) { + return isBuiltin(wat, 'DOMException'); +} + +/** + * Checks whether given value's type is a string + * {@link isString}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isString(wat) { + return isBuiltin(wat, 'String'); +} + +/** + * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol) + * {@link isPrimitive}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPrimitive(wat) { + return wat === null || (typeof wat !== 'object' && typeof wat !== 'function'); +} + +/** + * Checks whether given value's type is an object literal + * {@link isPlainObject}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPlainObject(wat) { + return isBuiltin(wat, 'Object'); +} + +/** + * Checks whether given value's type is an Event instance + * {@link isEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isEvent(wat) { + return typeof Event !== 'undefined' && isInstanceOf(wat, Event); +} + +/** + * Checks whether given value's type is an Element instance + * {@link isElement}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isElement(wat) { + return typeof Element !== 'undefined' && isInstanceOf(wat, Element); +} + +/** + * Checks whether given value's type is an regexp + * {@link isRegExp}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isRegExp(wat) { + return isBuiltin(wat, 'RegExp'); +} + +/** + * Checks whether given value has a then function. + * @param wat A value to be checked. + */ +function isThenable(wat) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return Boolean(wat && wat.then && typeof wat.then === 'function'); +} + +/** + * Checks whether given value's type is a SyntheticEvent + * {@link isSyntheticEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isSyntheticEvent(wat) { + return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; +} + +/** + * Checks whether given value is NaN + * {@link isNaN}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isNaN(wat) { + return typeof wat === 'number' && wat !== wat; +} + +/** + * Checks whether given value's type is an instance of provided constructor. + * {@link isInstanceOf}. + * + * @param wat A value to be checked. + * @param base A constructor to be used in a check. + * @returns A boolean representing the result. + */ +function isInstanceOf(wat, base) { + try { + return wat instanceof base; + } catch (_e) { + return false; + } +} + +/** + * Checks whether given value's type is a Vue ViewModel. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isVueViewModel(wat) { + // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property. + return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue)); +} + + +//# sourceMappingURL=is.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/logger.js": +/*!**************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/logger.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CONSOLE_LEVELS: () => (/* binding */ CONSOLE_LEVELS), +/* harmony export */ consoleSandbox: () => (/* binding */ consoleSandbox), +/* harmony export */ logger: () => (/* binding */ logger), +/* harmony export */ originalConsoleMethods: () => (/* binding */ originalConsoleMethods) +/* harmony export */ }); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "./node_modules/@sentry/utils/esm/worldwide.js"); + + +/** Prefix for logging strings */ +const PREFIX = 'Sentry Logger '; + +const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ; + +/** This may be mutated by the console instrumentation. */ +const originalConsoleMethods + + = {}; + +/** JSDoc */ + +/** + * Temporarily disable sentry console instrumentations. + * + * @param callback The function to run against the original `console` messages + * @returns The results of the callback + */ +function consoleSandbox(callback) { + if (!("console" in _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ)) { + return callback(); + } + + const console = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console ; + const wrappedFuncs = {}; + + const wrappedLevels = Object.keys(originalConsoleMethods) ; + + // Restore all wrapped console methods + wrappedLevels.forEach(level => { + const originalConsoleMethod = originalConsoleMethods[level] ; + wrappedFuncs[level] = console[level] ; + console[level] = originalConsoleMethod; + }); + + try { + return callback(); + } finally { + // Revert restoration to wrapped state + wrappedLevels.forEach(level => { + console[level] = wrappedFuncs[level] ; + }); + } +} + +function makeLogger() { + let enabled = false; + const logger = { + enable: () => { + enabled = true; + }, + disable: () => { + enabled = false; + }, + }; + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + CONSOLE_LEVELS.forEach(name => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + logger[name] = (...args) => { + if (enabled) { + consoleSandbox(() => { + _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args); + }); + } + }; + }); + } else { + CONSOLE_LEVELS.forEach(name => { + logger[name] = () => undefined; + }); + } + + return logger ; +} + +const logger = makeLogger(); + + +//# sourceMappingURL=logger.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/memo.js": +/*!************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/memo.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ memoBuilder: () => (/* binding */ memoBuilder) +/* harmony export */ }); +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** + * Helper to decycle json objects + */ +function memoBuilder() { + const hasWeakSet = typeof WeakSet === 'function'; + const inner = hasWeakSet ? new WeakSet() : []; + function memoize(obj) { + if (hasWeakSet) { + if (inner.has(obj)) { + return true; + } + inner.add(obj); + return false; + } + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < inner.length; i++) { + const value = inner[i]; + if (value === obj) { + return true; + } + } + inner.push(obj); + return false; + } + + function unmemoize(obj) { + if (hasWeakSet) { + inner.delete(obj); + } else { + for (let i = 0; i < inner.length; i++) { + if (inner[i] === obj) { + inner.splice(i, 1); + break; + } + } + } + } + return [memoize, unmemoize]; +} + + +//# sourceMappingURL=memo.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/misc.js": +/*!************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/misc.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addContextToFrame: () => (/* binding */ addContextToFrame), +/* harmony export */ addExceptionMechanism: () => (/* binding */ addExceptionMechanism), +/* harmony export */ addExceptionTypeValue: () => (/* binding */ addExceptionTypeValue), +/* harmony export */ arrayify: () => (/* binding */ arrayify), +/* harmony export */ checkOrSetAlreadyCaught: () => (/* binding */ checkOrSetAlreadyCaught), +/* harmony export */ getEventDescription: () => (/* binding */ getEventDescription), +/* harmony export */ parseSemver: () => (/* binding */ parseSemver), +/* harmony export */ uuid4: () => (/* binding */ uuid4) +/* harmony export */ }); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./object.js */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string.js */ "./node_modules/@sentry/utils/esm/string.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "./node_modules/@sentry/utils/esm/worldwide.js"); + + + + +/** + * UUID4 generator + * + * @returns string Generated UUID4. + */ +function uuid4() { + const gbl = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ ; + const crypto = gbl.crypto || gbl.msCrypto; + + let getRandomByte = () => Math.random() * 16; + try { + if (crypto && crypto.randomUUID) { + return crypto.randomUUID().replace(/-/g, ''); + } + if (crypto && crypto.getRandomValues) { + getRandomByte = () => crypto.getRandomValues(new Uint8Array(1))[0]; + } + } catch (_) { + // some runtimes can crash invoking crypto + // https://github.com/getsentry/sentry-javascript/issues/8935 + } + + // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 + // Concatenating the following numbers as strings results in '10000000100040008000100000000000' + return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c => + // eslint-disable-next-line no-bitwise + ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16), + ); +} + +function getFirstException(event) { + return event.exception && event.exception.values ? event.exception.values[0] : undefined; +} + +/** + * Extracts either message or type+value from an event that can be used for user-facing logs + * @returns event's description + */ +function getEventDescription(event) { + const { message, event_id: eventId } = event; + if (message) { + return message; + } + + const firstException = getFirstException(event); + if (firstException) { + if (firstException.type && firstException.value) { + return `${firstException.type}: ${firstException.value}`; + } + return firstException.type || firstException.value || eventId || ''; + } + return eventId || ''; +} + +/** + * Adds exception values, type and value to an synthetic Exception. + * @param event The event to modify. + * @param value Value of the exception. + * @param type Type of the exception. + * @hidden + */ +function addExceptionTypeValue(event, value, type) { + const exception = (event.exception = event.exception || {}); + const values = (exception.values = exception.values || []); + const firstException = (values[0] = values[0] || {}); + if (!firstException.value) { + firstException.value = value || ''; + } + if (!firstException.type) { + firstException.type = type || 'Error'; + } +} + +/** + * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed. + * + * @param event The event to modify. + * @param newMechanism Mechanism data to add to the event. + * @hidden + */ +function addExceptionMechanism(event, newMechanism) { + const firstException = getFirstException(event); + if (!firstException) { + return; + } + + const defaultMechanism = { type: 'generic', handled: true }; + const currentMechanism = firstException.mechanism; + firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism }; + + if (newMechanism && 'data' in newMechanism) { + const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data }; + firstException.mechanism.data = mergedData; + } +} + +// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string +const SEMVER_REGEXP = + /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; + +/** + * Represents Semantic Versioning object + */ + +/** + * Parses input into a SemVer interface + * @param input string representation of a semver version + */ +function parseSemver(input) { + const match = input.match(SEMVER_REGEXP) || []; + const major = parseInt(match[1], 10); + const minor = parseInt(match[2], 10); + const patch = parseInt(match[3], 10); + return { + buildmetadata: match[5], + major: isNaN(major) ? undefined : major, + minor: isNaN(minor) ? undefined : minor, + patch: isNaN(patch) ? undefined : patch, + prerelease: match[4], + }; +} + +/** + * This function adds context (pre/post/line) lines to the provided frame + * + * @param lines string[] containing all lines + * @param frame StackFrame that will be mutated + * @param linesOfContext number of context lines we want to add pre/post + */ +function addContextToFrame(lines, frame, linesOfContext = 5) { + // When there is no line number in the frame, attaching context is nonsensical and will even break grouping + if (frame.lineno === undefined) { + return; + } + + const maxLines = lines.length; + const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0); + + frame.pre_context = lines + .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) + .map((line) => (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.snipLine)(line, 0)); + + frame.context_line = (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.snipLine)(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0); + + frame.post_context = lines + .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext) + .map((line) => (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.snipLine)(line, 0)); +} + +/** + * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object + * in question), and marks it captured if not. + * + * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and + * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so + * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because + * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not + * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This + * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we + * see it. + * + * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on + * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent + * object wrapper forms so that this check will always work. However, because we need to flag the exact object which + * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification + * must be done before the exception captured. + * + * @param A thrown exception to check or flag as having been seen + * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) + */ +function checkOrSetAlreadyCaught(exception) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (exception && (exception ).__sentry_captured__) { + return true; + } + + try { + // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the + // `ExtraErrorData` integration + (0,_object_js__WEBPACK_IMPORTED_MODULE_2__.addNonEnumerableProperty)(exception , '__sentry_captured__', true); + } catch (err) { + // `exception` is a primitive, so we can't mark it seen + } + + return false; +} + +/** + * Checks whether the given input is already an array, and if it isn't, wraps it in one. + * + * @param maybeArray Input to turn into an array, if necessary + * @returns The input, if already an array, or an array with the input as the only element, if not + */ +function arrayify(maybeArray) { + return Array.isArray(maybeArray) ? maybeArray : [maybeArray]; +} + + +//# sourceMappingURL=misc.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/node-stack-trace.js": +/*!************************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/node-stack-trace.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ filenameIsInApp: () => (/* binding */ filenameIsInApp), +/* harmony export */ node: () => (/* binding */ node) +/* harmony export */ }); +/** + * Does this filename look like it's part of the app code? + */ +function filenameIsInApp(filename, isNative = false) { + const isInternal = + isNative || + (filename && + // It's not internal if it's an absolute linux path + !filename.startsWith('/') && + // It's not internal if it's an absolute windows path + !filename.includes(':\\') && + // It's not internal if the path is starting with a dot + !filename.startsWith('.') && + // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack + !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)); // Schema from: https://stackoverflow.com/a/3641782 + + // in_app is all that's not an internal Node function or a module within node_modules + // note that isNative appears to return true even for node core libraries + // see https://github.com/getsentry/raven-node/issues/176 + + return !isInternal && filename !== undefined && !filename.includes('node_modules/'); +} + +/** Node Stack line parser */ +// eslint-disable-next-line complexity +function node(getModule) { + const FILENAME_MATCH = /^\s*[-]{4,}$/; + const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/; + + // eslint-disable-next-line complexity + return (line) => { + const lineMatch = line.match(FULL_MATCH); + + if (lineMatch) { + let object; + let method; + let functionName; + let typeName; + let methodName; + + if (lineMatch[1]) { + functionName = lineMatch[1]; + + let methodStart = functionName.lastIndexOf('.'); + if (functionName[methodStart - 1] === '.') { + methodStart--; + } + + if (methodStart > 0) { + object = functionName.slice(0, methodStart); + method = functionName.slice(methodStart + 1); + const objectEnd = object.indexOf('.Module'); + if (objectEnd > 0) { + functionName = functionName.slice(objectEnd + 1); + object = object.slice(0, objectEnd); + } + } + typeName = undefined; + } + + if (method) { + typeName = object; + methodName = method; + } + + if (method === '') { + methodName = undefined; + functionName = undefined; + } + + if (functionName === undefined) { + methodName = methodName || ''; + functionName = typeName ? `${typeName}.${methodName}` : methodName; + } + + let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2]; + const isNative = lineMatch[5] === 'native'; + + if (!filename && lineMatch[5] && !isNative) { + filename = lineMatch[5]; + } + + return { + filename, + module: getModule ? getModule(filename) : undefined, + function: functionName, + lineno: parseInt(lineMatch[3], 10) || undefined, + colno: parseInt(lineMatch[4], 10) || undefined, + in_app: filenameIsInApp(filename, isNative), + }; + } + + if (line.match(FILENAME_MATCH)) { + return { + filename: line, + }; + } + + return undefined; + }; +} + + +//# sourceMappingURL=node-stack-trace.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/node.js": +/*!************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/node.js ***! + \************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ dynamicRequire: () => (/* binding */ dynamicRequire), +/* harmony export */ isNodeEnv: () => (/* binding */ isNodeEnv), +/* harmony export */ loadModule: () => (/* binding */ loadModule) +/* harmony export */ }); +/* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env.js */ "./node_modules/@sentry/utils/esm/env.js"); +/* module decorator */ module = __webpack_require__.hmd(module); + + +/** + * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, + * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. + */ + +/** + * Checks whether we're in the Node.js or Browser environment + * + * @returns Answer to given question + */ +function isNodeEnv() { + // explicitly check for browser bundles as those can be optimized statically + // by terser/rollup. + return ( + !(0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isBrowserBundle)() && + Object.prototype.toString.call(typeof ({"env":{"ENVIRONMENT":"development"}}) !== 'undefined' ? ({"env":{"ENVIRONMENT":"development"}}) : 0) === '[object process]' + ); +} + +/** + * Requires a module which is protected against bundler minification. + * + * @param request The module path to resolve + */ +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any +function dynamicRequire(mod, request) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return mod.require(request); +} + +/** + * Helper for dynamically loading module that should work with linked dependencies. + * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))` + * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during + * build time. `require.resolve` is also not available in any other way, so we cannot create, + * a fake helper like we do with `dynamicRequire`. + * + * We always prefer to use local package, thus the value is not returned early from each `try/catch` block. + * That is to mimic the behavior of `require.resolve` exactly. + * + * @param moduleName module name to require + * @returns possibly required module + */ +function loadModule(moduleName) { + let mod; + + try { + mod = dynamicRequire(module, moduleName); + } catch (e) { + // no-empty + } + + try { + const { cwd } = dynamicRequire(module, 'process'); + mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) ; + } catch (e) { + // no-empty + } + + return mod; +} + + +//# sourceMappingURL=node.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/normalize.js": +/*!*****************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/normalize.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ normalize: () => (/* binding */ normalize), +/* harmony export */ normalizeToSize: () => (/* binding */ normalizeToSize), +/* harmony export */ walk: () => (/* binding */ visit) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is.js */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _memo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./memo.js */ "./node_modules/@sentry/utils/esm/memo.js"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./object.js */ "./node_modules/@sentry/utils/esm/object.js"); +/* harmony import */ var _stacktrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stacktrace.js */ "./node_modules/@sentry/utils/esm/stacktrace.js"); + + + + + +/** + * Recursively normalizes the given object. + * + * - Creates a copy to prevent original input mutation + * - Skips non-enumerable properties + * - When stringifying, calls `toJSON` if implemented + * - Removes circular references + * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format + * - Translates known global objects/classes to a string representations + * - Takes care of `Error` object serialization + * - Optionally limits depth of final output + * - Optionally limits number of properties/elements included in any single object/array + * + * @param input The object to be normalized. + * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) + * @param maxProperties The max number of elements or properties to be included in any single array or + * object in the normallized output. + * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function normalize(input, depth = 100, maxProperties = +Infinity) { + try { + // since we're at the outermost level, we don't provide a key + return visit('', input, depth, maxProperties); + } catch (err) { + return { ERROR: `**non-serializable** (${err})` }; + } +} + +/** JSDoc */ +function normalizeToSize( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + object, + // Default Node.js REPL depth + depth = 3, + // 100kB, as 200kB is max payload size, so half sounds reasonable + maxSize = 100 * 1024, +) { + const normalized = normalize(object, depth); + + if (jsonSize(normalized) > maxSize) { + return normalizeToSize(object, depth - 1, maxSize); + } + + return normalized ; +} + +/** + * Visits a node to perform normalization on it + * + * @param key The key corresponding to the given node + * @param value The node to be visited + * @param depth Optional number indicating the maximum recursion depth + * @param maxProperties Optional maximum number of properties/elements included in any single object/array + * @param memo Optional Memo class handling decycling + */ +function visit( + key, + value, + depth = +Infinity, + maxProperties = +Infinity, + memo = (0,_memo_js__WEBPACK_IMPORTED_MODULE_0__.memoBuilder)(), +) { + const [memoize, unmemoize] = memo; + + // Get the simple cases out of the way first + if ( + value == null || // this matches null and undefined -> eqeq not eqeqeq + (['number', 'boolean', 'string'].includes(typeof value) && !(0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isNaN)(value)) + ) { + return value ; + } + + const stringified = stringifyValue(key, value); + + // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. + // Everything else will have already been serialized, so if we don't see that pattern, we're done. + if (!stringified.startsWith('[object ')) { + return stringified; + } + + // From here on, we can assert that `value` is either an object or an array. + + // Do not normalize objects that we know have already been normalized. As a general rule, the + // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that + // have already been normalized. + if ((value )['__sentry_skip_normalization__']) { + return value ; + } + + // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there + // We keep a certain amount of depth. + // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state. + const remainingDepth = + typeof (value )['__sentry_override_normalization_depth__'] === 'number' + ? ((value )['__sentry_override_normalization_depth__'] ) + : depth; + + // We're also done if we've reached the max depth + if (remainingDepth === 0) { + // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. + return stringified.replace('object ', ''); + } + + // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. + if (memoize(value)) { + return '[Circular ~]'; + } + + // If the value has a `toJSON` method, we call it to extract more information + const valueWithToJSON = value ; + if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { + try { + const jsonValue = valueWithToJSON.toJSON(); + // We need to normalize the return value of `.toJSON()` in case it has circular references + return visit('', jsonValue, remainingDepth - 1, maxProperties, memo); + } catch (err) { + // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) + } + } + + // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse + // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each + // property/entry, and keep track of the number of items we add to it. + const normalized = (Array.isArray(value) ? [] : {}) ; + let numAdded = 0; + + // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant + // properties are non-enumerable and otherwise would get missed. + const visitable = (0,_object_js__WEBPACK_IMPORTED_MODULE_2__.convertToPlainObject)(value ); + + for (const visitKey in visitable) { + // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. + if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { + continue; + } + + if (numAdded >= maxProperties) { + normalized[visitKey] = '[MaxProperties ~]'; + break; + } + + // Recursively visit all the child nodes + const visitValue = visitable[visitKey]; + normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo); + + numAdded++; + } + + // Once we've visited all the branches, remove the parent from memo storage + unmemoize(value); + + // Return accumulated values + return normalized; +} + +/* eslint-disable complexity */ +/** + * Stringify the given value. Handles various known special values and types. + * + * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn + * the number 1231 into "[Object Number]", nor on `null`, as it will throw. + * + * @param value The value to stringify + * @returns A stringified representation of the given value + */ +function stringifyValue( + key, + // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for + // our internal use, it'll do + value, +) { + try { + if (key === 'domain' && value && typeof value === 'object' && (value )._events) { + return '[Domain]'; + } + + if (key === 'domainEmitter') { + return '[DomainEmitter]'; + } + + // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first + // which won't throw if they are not present. + + if ( true && value === ({})) { + return '[Global]'; + } + + // eslint-disable-next-line no-restricted-globals + if (typeof window !== 'undefined' && value === window) { + return '[Window]'; + } + + // eslint-disable-next-line no-restricted-globals + if (typeof document !== 'undefined' && value === document) { + return '[Document]'; + } + + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isVueViewModel)(value)) { + return '[VueViewModel]'; + } + + // React's SyntheticEvent thingy + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isSyntheticEvent)(value)) { + return '[SyntheticEvent]'; + } + + if (typeof value === 'number' && value !== value) { + return '[NaN]'; + } + + if (typeof value === 'function') { + return `[Function: ${(0,_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__.getFunctionName)(value)}]`; + } + + if (typeof value === 'symbol') { + return `[${String(value)}]`; + } + + // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion + if (typeof value === 'bigint') { + return `[BigInt: ${String(value)}]`; + } + + // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting + // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as + // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), + // we can make sure that only plain objects come out that way. + const objName = getConstructorName(value); + + // Handle HTML Elements + if (/^HTML(\w*)Element$/.test(objName)) { + return `[HTMLElement: ${objName}]`; + } + + return `[object ${objName}]`; + } catch (err) { + return `**non-serializable** (${err})`; + } +} +/* eslint-enable complexity */ + +function getConstructorName(value) { + const prototype = Object.getPrototypeOf(value); + + return prototype ? prototype.constructor.name : 'null prototype'; +} + +/** Calculates bytes size of input string */ +function utf8Length(value) { + // eslint-disable-next-line no-bitwise + return ~-encodeURI(value).split(/%..|./).length; +} + +/** Calculates bytes size of input object */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function jsonSize(value) { + return utf8Length(JSON.stringify(value)); +} + + +//# sourceMappingURL=normalize.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/object.js": +/*!**************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/object.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addNonEnumerableProperty: () => (/* binding */ addNonEnumerableProperty), +/* harmony export */ convertToPlainObject: () => (/* binding */ convertToPlainObject), +/* harmony export */ dropUndefinedKeys: () => (/* binding */ dropUndefinedKeys), +/* harmony export */ extractExceptionKeysForMessage: () => (/* binding */ extractExceptionKeysForMessage), +/* harmony export */ fill: () => (/* binding */ fill), +/* harmony export */ getOriginalFunction: () => (/* binding */ getOriginalFunction), +/* harmony export */ markFunctionWrapped: () => (/* binding */ markFunctionWrapped), +/* harmony export */ objectify: () => (/* binding */ objectify), +/* harmony export */ urlEncode: () => (/* binding */ urlEncode) +/* harmony export */ }); +/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./browser.js */ "./node_modules/@sentry/utils/esm/browser.js"); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is.js */ "./node_modules/@sentry/utils/esm/is.js"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./logger.js */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./string.js */ "./node_modules/@sentry/utils/esm/string.js"); + + + + + +/** + * Replace a method in an object with a wrapped version of itself. + * + * @param source An object that contains a method to be wrapped. + * @param name The name of the method to be wrapped. + * @param replacementFactory A higher-order function that takes the original version of the given method and returns a + * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to + * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`. + * @returns void + */ +function fill(source, name, replacementFactory) { + if (!(name in source)) { + return; + } + + const original = source[name] ; + const wrapped = replacementFactory(original) ; + + // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work + // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" + if (typeof wrapped === 'function') { + markFunctionWrapped(wrapped, original); + } + + source[name] = wrapped; +} + +/** + * Defines a non-enumerable property on the given object. + * + * @param obj The object on which to set the property + * @param name The name of the property to be set + * @param value The value to which to set the property + */ +function addNonEnumerableProperty(obj, name, value) { + try { + Object.defineProperty(obj, name, { + // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it + value: value, + writable: true, + configurable: true, + }); + } catch (o_O) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _logger_js__WEBPACK_IMPORTED_MODULE_0__.logger.log(`Failed to add non-enumerable property "${name}" to object`, obj); + } +} + +/** + * Remembers the original function on the wrapped function and + * patches up the prototype. + * + * @param wrapped the wrapper function + * @param original the original function that gets wrapped + */ +function markFunctionWrapped(wrapped, original) { + try { + const proto = original.prototype || {}; + wrapped.prototype = original.prototype = proto; + addNonEnumerableProperty(wrapped, '__sentry_original__', original); + } catch (o_O) {} // eslint-disable-line no-empty +} + +/** + * This extracts the original function if available. See + * `markFunctionWrapped` for more information. + * + * @param func the function to unwrap + * @returns the unwrapped version of the function if available. + */ +function getOriginalFunction(func) { + return func.__sentry_original__; +} + +/** + * Encodes given object into url-friendly format + * + * @param object An object that contains serializable values + * @returns string Encoded + */ +function urlEncode(object) { + return Object.keys(object) + .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`) + .join('&'); +} + +/** + * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their + * non-enumerable properties attached. + * + * @param value Initial source that we have to transform in order for it to be usable by the serializer + * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor + * an Error. + */ +function convertToPlainObject(value) + + { + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isError)(value)) { + return { + message: value.message, + name: value.name, + stack: value.stack, + ...getOwnProperties(value), + }; + } else if ((0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isEvent)(value)) { + const newObj + + = { + type: value.type, + target: serializeEventTarget(value.target), + currentTarget: serializeEventTarget(value.currentTarget), + ...getOwnProperties(value), + }; + + if (typeof CustomEvent !== 'undefined' && (0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isInstanceOf)(value, CustomEvent)) { + newObj.detail = value.detail; + } + + return newObj; + } else { + return value; + } +} + +/** Creates a string representation of the target of an `Event` object */ +function serializeEventTarget(target) { + try { + return (0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isElement)(target) ? (0,_browser_js__WEBPACK_IMPORTED_MODULE_2__.htmlTreeAsString)(target) : Object.prototype.toString.call(target); + } catch (_oO) { + return ''; + } +} + +/** Filters out all but an object's own properties */ +function getOwnProperties(obj) { + if (typeof obj === 'object' && obj !== null) { + const extractedProps = {}; + for (const property in obj) { + if (Object.prototype.hasOwnProperty.call(obj, property)) { + extractedProps[property] = (obj )[property]; + } + } + return extractedProps; + } else { + return {}; + } +} + +/** + * Given any captured exception, extract its keys and create a sorted + * and truncated list that will be used inside the event message. + * eg. `Non-error exception captured with keys: foo, bar, baz` + */ +function extractExceptionKeysForMessage(exception, maxLength = 40) { + const keys = Object.keys(convertToPlainObject(exception)); + keys.sort(); + + if (!keys.length) { + return '[object has no keys]'; + } + + if (keys[0].length >= maxLength) { + return (0,_string_js__WEBPACK_IMPORTED_MODULE_3__.truncate)(keys[0], maxLength); + } + + for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) { + const serialized = keys.slice(0, includedKeys).join(', '); + if (serialized.length > maxLength) { + continue; + } + if (includedKeys === keys.length) { + return serialized; + } + return (0,_string_js__WEBPACK_IMPORTED_MODULE_3__.truncate)(serialized, maxLength); + } + + return ''; +} + +/** + * Given any object, return a new object having removed all fields whose value was `undefined`. + * Works recursively on objects and arrays. + * + * Attention: This function keeps circular references in the returned object. + */ +function dropUndefinedKeys(inputValue) { + // This map keeps track of what already visited nodes map to. + // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular + // references as the input object. + const memoizationMap = new Map(); + + // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API + return _dropUndefinedKeys(inputValue, memoizationMap); +} + +function _dropUndefinedKeys(inputValue, memoizationMap) { + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(inputValue)) { + // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== undefined) { + return memoVal ; + } + + const returnValue = {}; + // Store the mapping of this value in case we visit it again, in case of circular data + memoizationMap.set(inputValue, returnValue); + + for (const key of Object.keys(inputValue)) { + if (typeof inputValue[key] !== 'undefined') { + returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); + } + } + + return returnValue ; + } + + if (Array.isArray(inputValue)) { + // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== undefined) { + return memoVal ; + } + + const returnValue = []; + // Store the mapping of this value in case we visit it again, in case of circular data + memoizationMap.set(inputValue, returnValue); + + inputValue.forEach((item) => { + returnValue.push(_dropUndefinedKeys(item, memoizationMap)); + }); + + return returnValue ; + } + + return inputValue; +} + +/** + * Ensure that something is an object. + * + * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper + * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives. + * + * @param wat The subject of the objectification + * @returns A version of `wat` which can safely be used with `Object` class methods + */ +function objectify(wat) { + let objectified; + switch (true) { + case wat === undefined || wat === null: + objectified = new String(wat); + break; + + // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason + // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as + // an object in order to wrap it. + case typeof wat === 'symbol' || typeof wat === 'bigint': + objectified = Object(wat); + break; + + // this will catch the remaining primitives: `String`, `Number`, and `Boolean` + case (0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isPrimitive)(wat): + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + objectified = new (wat ).constructor(wat); + break; + + // by process of elimination, at this point we know that `wat` must already be an object + default: + objectified = wat; + break; + } + return objectified; +} + + +//# sourceMappingURL=object.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/promisebuffer.js": +/*!*********************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/promisebuffer.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ makePromiseBuffer: () => (/* binding */ makePromiseBuffer) +/* harmony export */ }); +/* harmony import */ var _error_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./error.js */ "./node_modules/@sentry/utils/esm/error.js"); +/* harmony import */ var _syncpromise_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./syncpromise.js */ "./node_modules/@sentry/utils/esm/syncpromise.js"); + + + +/** + * Creates an new PromiseBuffer object with the specified limit + * @param limit max number of promises that can be stored in the buffer + */ +function makePromiseBuffer(limit) { + const buffer = []; + + function isReady() { + return limit === undefined || buffer.length < limit; + } + + /** + * Remove a promise from the queue. + * + * @param task Can be any PromiseLike + * @returns Removed promise. + */ + function remove(task) { + return buffer.splice(buffer.indexOf(task), 1)[0]; + } + + /** + * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. + * + * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task: + * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor + * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By + * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer + * limit check. + * @returns The original promise. + */ + function add(taskProducer) { + if (!isReady()) { + return (0,_syncpromise_js__WEBPACK_IMPORTED_MODULE_0__.rejectedSyncPromise)(new _error_js__WEBPACK_IMPORTED_MODULE_1__.SentryError('Not adding Promise because buffer limit was reached.')); + } + + // start the task and add its promise to the queue + const task = taskProducer(); + if (buffer.indexOf(task) === -1) { + buffer.push(task); + } + void task + .then(() => remove(task)) + // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` + // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't + // have promises, so TS has to polyfill when down-compiling.) + .then(null, () => + remove(task).then(null, () => { + // We have to add another catch here because `remove()` starts a new promise chain. + }), + ); + return task; + } + + /** + * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or + * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to + * `true`. + * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and + * `false` otherwise + */ + function drain(timeout) { + return new _syncpromise_js__WEBPACK_IMPORTED_MODULE_0__.SyncPromise((resolve, reject) => { + let counter = buffer.length; + + if (!counter) { + return resolve(true); + } + + // wait for `timeout` ms and then resolve to `false` (if not cancelled first) + const capturedSetTimeout = setTimeout(() => { + if (timeout && timeout > 0) { + resolve(false); + } + }, timeout); + + // if all promises resolve in time, cancel the timer and resolve to `true` + buffer.forEach(item => { + void (0,_syncpromise_js__WEBPACK_IMPORTED_MODULE_0__.resolvedSyncPromise)(item).then(() => { + if (!--counter) { + clearTimeout(capturedSetTimeout); + resolve(true); + } + }, reject); + }); + }); + } + + return { + $: buffer, + add, + drain, + }; +} + + +//# sourceMappingURL=promisebuffer.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/ratelimit.js": +/*!*****************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/ratelimit.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DEFAULT_RETRY_AFTER: () => (/* binding */ DEFAULT_RETRY_AFTER), +/* harmony export */ disabledUntil: () => (/* binding */ disabledUntil), +/* harmony export */ isRateLimited: () => (/* binding */ isRateLimited), +/* harmony export */ parseRetryAfterHeader: () => (/* binding */ parseRetryAfterHeader), +/* harmony export */ updateRateLimits: () => (/* binding */ updateRateLimits) +/* harmony export */ }); +// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend + +const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds + +/** + * Extracts Retry-After value from the request header or returns default value + * @param header string representation of 'Retry-After' header + * @param now current unix timestamp + * + */ +function parseRetryAfterHeader(header, now = Date.now()) { + const headerDelay = parseInt(`${header}`, 10); + if (!isNaN(headerDelay)) { + return headerDelay * 1000; + } + + const headerDate = Date.parse(`${header}`); + if (!isNaN(headerDate)) { + return headerDate - now; + } + + return DEFAULT_RETRY_AFTER; +} + +/** + * Gets the time that the given category is disabled until for rate limiting. + * In case no category-specific limit is set but a general rate limit across all categories is active, + * that time is returned. + * + * @return the time in ms that the category is disabled until or 0 if there's no active rate limit. + */ +function disabledUntil(limits, category) { + return limits[category] || limits.all || 0; +} + +/** + * Checks if a category is rate limited + */ +function isRateLimited(limits, category, now = Date.now()) { + return disabledUntil(limits, category) > now; +} + +/** + * Update ratelimits from incoming headers. + * + * @return the updated RateLimits object. + */ +function updateRateLimits( + limits, + { statusCode, headers }, + now = Date.now(), +) { + const updatedRateLimits = { + ...limits, + }; + + // "The name is case-insensitive." + // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get + const rateLimitHeader = headers && headers['x-sentry-rate-limits']; + const retryAfterHeader = headers && headers['retry-after']; + + if (rateLimitHeader) { + /** + * rate limit headers are of the form + *
,
,.. + * where each
is of the form + * : : : + * where + * is a delay in seconds + * is the event type(s) (error, transaction, etc) being rate limited and is of the form + * ;;... + * is what's being limited (org, project, or key) - ignored by SDK + * is an arbitrary string like "org_quota" - ignored by SDK + */ + for (const limit of rateLimitHeader.trim().split(',')) { + const [retryAfter, categories] = limit.split(':', 2); + const headerDelay = parseInt(retryAfter, 10); + const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default + if (!categories) { + updatedRateLimits.all = now + delay; + } else { + for (const category of categories.split(';')) { + updatedRateLimits[category] = now + delay; + } + } + } + } else if (retryAfterHeader) { + updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); + } else if (statusCode === 429) { + updatedRateLimits.all = now + 60 * 1000; + } + + return updatedRateLimits; +} + + +//# sourceMappingURL=ratelimit.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/severity.js": +/*!****************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/severity.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ severityFromString: () => (/* binding */ severityFromString), +/* harmony export */ severityLevelFromString: () => (/* binding */ severityLevelFromString), +/* harmony export */ validSeverityLevels: () => (/* binding */ validSeverityLevels) +/* harmony export */ }); +// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either +// +// a) moving `validSeverityLevels` to `@sentry/types`, +// b) moving the`SeverityLevel` type here, or +// c) importing `validSeverityLevels` from here into `@sentry/types`. +// +// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would +// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the +// type, reminding anyone who changes it to change this list also, will have to do. + +const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug']; + +/** + * Converts a string-based level into a member of the deprecated {@link Severity} enum. + * + * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead. + * + * @param level String representation of Severity + * @returns Severity + */ +function severityFromString(level) { + return severityLevelFromString(level) ; +} + +/** + * Converts a string-based level into a `SeverityLevel`, normalizing it along the way. + * + * @param level String representation of desired `SeverityLevel`. + * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level. + */ +function severityLevelFromString(level) { + return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ; +} + + +//# sourceMappingURL=severity.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/stacktrace.js": +/*!******************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/stacktrace.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createStackParser: () => (/* binding */ createStackParser), +/* harmony export */ filenameIsInApp: () => (/* reexport safe */ _node_stack_trace_js__WEBPACK_IMPORTED_MODULE_0__.filenameIsInApp), +/* harmony export */ getFunctionName: () => (/* binding */ getFunctionName), +/* harmony export */ nodeStackLineParser: () => (/* binding */ nodeStackLineParser), +/* harmony export */ stackParserFromStackParserOptions: () => (/* binding */ stackParserFromStackParserOptions), +/* harmony export */ stripSentryFramesAndReverse: () => (/* binding */ stripSentryFramesAndReverse) +/* harmony export */ }); +/* harmony import */ var _node_stack_trace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node-stack-trace.js */ "./node_modules/@sentry/utils/esm/node-stack-trace.js"); + + + +const STACKTRACE_FRAME_LIMIT = 50; +// Used to sanitize webpack (error: *) wrapped stack errors +const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; +const STRIP_FRAME_REGEXP = /captureMessage|captureException/; + +/** + * Creates a stack parser with the supplied line parsers + * + * StackFrames are returned in the correct order for Sentry Exception + * frames and with Sentry SDK internal frames removed from the top and bottom + * + */ +function createStackParser(...parsers) { + const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]); + + return (stack, skipFirst = 0) => { + const frames = []; + const lines = stack.split('\n'); + + for (let i = skipFirst; i < lines.length; i++) { + const line = lines[i]; + // Ignore lines over 1kb as they are unlikely to be stack frames. + // Many of the regular expressions use backtracking which results in run time that increases exponentially with + // input size. Huge strings can result in hangs/Denial of Service: + // https://github.com/getsentry/sentry-javascript/issues/2286 + if (line.length > 1024) { + continue; + } + + // https://github.com/getsentry/sentry-javascript/issues/5459 + // Remove webpack (error: *) wrappers + const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line; + + // https://github.com/getsentry/sentry-javascript/issues/7813 + // Skip Error: lines + if (cleanedLine.match(/\S*Error: /)) { + continue; + } + + for (const parser of sortedParsers) { + const frame = parser(cleanedLine); + + if (frame) { + frames.push(frame); + break; + } + } + + if (frames.length >= STACKTRACE_FRAME_LIMIT) { + break; + } + } + + return stripSentryFramesAndReverse(frames); + }; +} + +/** + * Gets a stack parser implementation from Options.stackParser + * @see Options + * + * If options contains an array of line parsers, it is converted into a parser + */ +function stackParserFromStackParserOptions(stackParser) { + if (Array.isArray(stackParser)) { + return createStackParser(...stackParser); + } + return stackParser; +} + +/** + * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames. + * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the + * function that caused the crash is the last frame in the array. + * @hidden + */ +function stripSentryFramesAndReverse(stack) { + if (!stack.length) { + return []; + } + + const localStack = Array.from(stack); + + // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) + if (/sentryWrapped/.test(localStack[localStack.length - 1].function || '')) { + localStack.pop(); + } + + // Reversing in the middle of the procedure allows us to just pop the values off the stack + localStack.reverse(); + + // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call) + if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) { + localStack.pop(); + + // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')` + // is produced within the hub itself, making it: + // + // Sentry.captureException() + // getCurrentHub().captureException() + // + // instead of just the top `Sentry` call itself. + // This forces us to possibly strip an additional frame in the exact same was as above. + if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) { + localStack.pop(); + } + } + + return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({ + ...frame, + filename: frame.filename || localStack[localStack.length - 1].filename, + function: frame.function || '?', + })); +} + +const defaultFunctionName = ''; + +/** + * Safely extract function name from itself + */ +function getFunctionName(fn) { + try { + if (!fn || typeof fn !== 'function') { + return defaultFunctionName; + } + return fn.name || defaultFunctionName; + } catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + return defaultFunctionName; + } +} + +/** + * Node.js stack line parser + * + * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. + * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain + */ +function nodeStackLineParser(getModule) { + return [90, (0,_node_stack_trace_js__WEBPACK_IMPORTED_MODULE_0__.node)(getModule)]; +} + + +//# sourceMappingURL=stacktrace.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/string.js": +/*!**************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/string.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isMatchingPattern: () => (/* binding */ isMatchingPattern), +/* harmony export */ safeJoin: () => (/* binding */ safeJoin), +/* harmony export */ snipLine: () => (/* binding */ snipLine), +/* harmony export */ stringMatchesSomePattern: () => (/* binding */ stringMatchesSomePattern), +/* harmony export */ truncate: () => (/* binding */ truncate) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is.js */ "./node_modules/@sentry/utils/esm/is.js"); + + +/** + * Truncates given string to the maximum characters count + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string (0 = unlimited) + * @returns string Encoded + */ +function truncate(str, max = 0) { + if (typeof str !== 'string' || max === 0) { + return str; + } + return str.length <= max ? str : `${str.slice(0, max)}...`; +} + +/** + * This is basically just `trim_line` from + * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string + * @returns string Encoded + */ +function snipLine(line, colno) { + let newLine = line; + const lineLength = newLine.length; + if (lineLength <= 150) { + return newLine; + } + if (colno > lineLength) { + // eslint-disable-next-line no-param-reassign + colno = lineLength; + } + + let start = Math.max(colno - 60, 0); + if (start < 5) { + start = 0; + } + + let end = Math.min(start + 140, lineLength); + if (end > lineLength - 5) { + end = lineLength; + } + if (end === lineLength) { + start = Math.max(end - 140, 0); + } + + newLine = newLine.slice(start, end); + if (start > 0) { + newLine = `'{snip} ${newLine}`; + } + if (end < lineLength) { + newLine += ' {snip}'; + } + + return newLine; +} + +/** + * Join values in array + * @param input array of values to be joined together + * @param delimiter string to be placed in-between values + * @returns Joined values + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function safeJoin(input, delimiter) { + if (!Array.isArray(input)) { + return ''; + } + + const output = []; + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < input.length; i++) { + const value = input[i]; + try { + // This is a hack to fix a Vue3-specific bug that causes an infinite loop of + // console warnings. This happens when a Vue template is rendered with + // an undeclared variable, which we try to stringify, ultimately causing + // Vue to issue another warning which repeats indefinitely. + // see: https://github.com/getsentry/sentry-javascript/pull/8981 + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isVueViewModel)(value)) { + output.push('[VueViewModel]'); + } else { + output.push(String(value)); + } + } catch (e) { + output.push('[value cannot be serialized]'); + } + } + + return output.join(delimiter); +} + +/** + * Checks if the given value matches a regex or string + * + * @param value The string to test + * @param pattern Either a regex or a string against which `value` will be matched + * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match + * `pattern` if it contains `pattern`. Only applies to string-type patterns. + */ +function isMatchingPattern( + value, + pattern, + requireExactStringMatch = false, +) { + if (!(0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value)) { + return false; + } + + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isRegExp)(pattern)) { + return pattern.test(value); + } + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isString)(pattern)) { + return requireExactStringMatch ? value === pattern : value.includes(pattern); + } + + return false; +} + +/** + * Test the given string against an array of strings and regexes. By default, string matching is done on a + * substring-inclusion basis rather than a strict equality basis + * + * @param testString The string to test + * @param patterns The patterns against which to test the string + * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to + * count. If false, `testString` will match a string pattern if it contains that pattern. + * @returns + */ +function stringMatchesSomePattern( + testString, + patterns = [], + requireExactStringMatch = false, +) { + return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch)); +} + + +//# sourceMappingURL=string.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/supports.js": +/*!****************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/supports.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ isNativeFetch: () => (/* binding */ isNativeFetch), +/* harmony export */ supportsDOMError: () => (/* binding */ supportsDOMError), +/* harmony export */ supportsDOMException: () => (/* binding */ supportsDOMException), +/* harmony export */ supportsErrorEvent: () => (/* binding */ supportsErrorEvent), +/* harmony export */ supportsFetch: () => (/* binding */ supportsFetch), +/* harmony export */ supportsNativeFetch: () => (/* binding */ supportsNativeFetch), +/* harmony export */ supportsReferrerPolicy: () => (/* binding */ supportsReferrerPolicy), +/* harmony export */ supportsReportingObserver: () => (/* binding */ supportsReportingObserver) +/* harmony export */ }); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger.js */ "./node_modules/@sentry/utils/esm/logger.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "./node_modules/@sentry/utils/esm/worldwide.js"); + + + +// eslint-disable-next-line deprecation/deprecation +const WINDOW = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalObject)(); + +/** + * Tells whether current environment supports ErrorEvent objects + * {@link supportsErrorEvent}. + * + * @returns Answer to the given question. + */ +function supportsErrorEvent() { + try { + new ErrorEvent(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports DOMError objects + * {@link supportsDOMError}. + * + * @returns Answer to the given question. + */ +function supportsDOMError() { + try { + // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError': + // 1 argument required, but only 0 present. + // @ts-expect-error It really needs 1 argument, not 0. + new DOMError(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports DOMException objects + * {@link supportsDOMException}. + * + * @returns Answer to the given question. + */ +function supportsDOMException() { + try { + new DOMException(''); + return true; + } catch (e) { + return false; + } +} + +/** + * Tells whether current environment supports Fetch API + * {@link supportsFetch}. + * + * @returns Answer to the given question. + */ +function supportsFetch() { + if (!('fetch' in WINDOW)) { + return false; + } + + try { + new Headers(); + new Request('http://www.example.com'); + new Response(); + return true; + } catch (e) { + return false; + } +} +/** + * isNativeFetch checks if the given function is a native implementation of fetch() + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function isNativeFetch(func) { + return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); +} + +/** + * Tells whether current environment supports Fetch API natively + * {@link supportsNativeFetch}. + * + * @returns true if `window.fetch` is natively implemented, false otherwise + */ +function supportsNativeFetch() { + if (!supportsFetch()) { + return false; + } + + // Fast path to avoid DOM I/O + // eslint-disable-next-line @typescript-eslint/unbound-method + if (isNativeFetch(WINDOW.fetch)) { + return true; + } + + // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension) + // so create a "pure" iframe to see if that has native fetch + let result = false; + const doc = WINDOW.document; + // eslint-disable-next-line deprecation/deprecation + if (doc && typeof (doc.createElement ) === 'function') { + try { + const sandbox = doc.createElement('iframe'); + sandbox.hidden = true; + doc.head.appendChild(sandbox); + if (sandbox.contentWindow && sandbox.contentWindow.fetch) { + // eslint-disable-next-line @typescript-eslint/unbound-method + result = isNativeFetch(sandbox.contentWindow.fetch); + } + doc.head.removeChild(sandbox); + } catch (err) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err); + } + } + + return result; +} + +/** + * Tells whether current environment supports ReportingObserver API + * {@link supportsReportingObserver}. + * + * @returns Answer to the given question. + */ +function supportsReportingObserver() { + return 'ReportingObserver' in WINDOW; +} + +/** + * Tells whether current environment supports Referrer Policy API + * {@link supportsReferrerPolicy}. + * + * @returns Answer to the given question. + */ +function supportsReferrerPolicy() { + // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' + // (see https://caniuse.com/#feat=referrer-policy), + // it doesn't. And it throws an exception instead of ignoring this parameter... + // REF: https://github.com/getsentry/raven-js/issues/1233 + + if (!supportsFetch()) { + return false; + } + + try { + new Request('_', { + referrerPolicy: 'origin' , + }); + return true; + } catch (e) { + return false; + } +} + + +//# sourceMappingURL=supports.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/syncpromise.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/syncpromise.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SyncPromise: () => (/* binding */ SyncPromise), +/* harmony export */ rejectedSyncPromise: () => (/* binding */ rejectedSyncPromise), +/* harmony export */ resolvedSyncPromise: () => (/* binding */ resolvedSyncPromise) +/* harmony export */ }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is.js */ "./node_modules/@sentry/utils/esm/is.js"); + + +/* eslint-disable @typescript-eslint/explicit-function-return-type */ + +/** SyncPromise internal states */ +var States; (function (States) { + /** Pending */ + const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING"; + /** Resolved / OK */ + const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED"; + /** Rejected / Error */ + const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED"; +})(States || (States = {})); + +// Overloads so we can call resolvedSyncPromise without arguments and generic argument + +/** + * Creates a resolved sync promise. + * + * @param value the value to resolve the promise with + * @returns the resolved sync promise + */ +function resolvedSyncPromise(value) { + return new SyncPromise(resolve => { + resolve(value); + }); +} + +/** + * Creates a rejected sync promise. + * + * @param value the value to reject the promise with + * @returns the rejected sync promise + */ +function rejectedSyncPromise(reason) { + return new SyncPromise((_, reject) => { + reject(reason); + }); +} + +/** + * Thenable class that behaves like a Promise and follows it's interface + * but is not async internally + */ +class SyncPromise { + + constructor( + executor, + ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this); + this._state = States.PENDING; + this._handlers = []; + + try { + executor(this._resolve, this._reject); + } catch (e) { + this._reject(e); + } + } + + /** JSDoc */ + then( + onfulfilled, + onrejected, + ) { + return new SyncPromise((resolve, reject) => { + this._handlers.push([ + false, + result => { + if (!onfulfilled) { + // TODO: ¯\_(ツ)_/¯ + // TODO: FIXME + resolve(result ); + } else { + try { + resolve(onfulfilled(result)); + } catch (e) { + reject(e); + } + } + }, + reason => { + if (!onrejected) { + reject(reason); + } else { + try { + resolve(onrejected(reason)); + } catch (e) { + reject(e); + } + } + }, + ]); + this._executeHandlers(); + }); + } + + /** JSDoc */ + catch( + onrejected, + ) { + return this.then(val => val, onrejected); + } + + /** JSDoc */ + finally(onfinally) { + return new SyncPromise((resolve, reject) => { + let val; + let isRejected; + + return this.then( + value => { + isRejected = false; + val = value; + if (onfinally) { + onfinally(); + } + }, + reason => { + isRejected = true; + val = reason; + if (onfinally) { + onfinally(); + } + }, + ).then(() => { + if (isRejected) { + reject(val); + return; + } + + resolve(val ); + }); + }); + } + + /** JSDoc */ + __init() {this._resolve = (value) => { + this._setResult(States.RESOLVED, value); + };} + + /** JSDoc */ + __init2() {this._reject = (reason) => { + this._setResult(States.REJECTED, reason); + };} + + /** JSDoc */ + __init3() {this._setResult = (state, value) => { + if (this._state !== States.PENDING) { + return; + } + + if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isThenable)(value)) { + void (value ).then(this._resolve, this._reject); + return; + } + + this._state = state; + this._value = value; + + this._executeHandlers(); + };} + + /** JSDoc */ + __init4() {this._executeHandlers = () => { + if (this._state === States.PENDING) { + return; + } + + const cachedHandlers = this._handlers.slice(); + this._handlers = []; + + cachedHandlers.forEach(handler => { + if (handler[0]) { + return; + } + + if (this._state === States.RESOLVED) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + handler[1](this._value ); + } + + if (this._state === States.REJECTED) { + handler[2](this._value); + } + + handler[0] = true; + }); + };} +} + + +//# sourceMappingURL=syncpromise.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/time.js": +/*!************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/time.js ***! + \************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _browserPerformanceTimeOriginMode: () => (/* binding */ _browserPerformanceTimeOriginMode), +/* harmony export */ browserPerformanceTimeOrigin: () => (/* binding */ browserPerformanceTimeOrigin), +/* harmony export */ dateTimestampInSeconds: () => (/* binding */ dateTimestampInSeconds), +/* harmony export */ timestampInSeconds: () => (/* binding */ timestampInSeconds), +/* harmony export */ timestampWithMs: () => (/* binding */ timestampWithMs), +/* harmony export */ usingPerformanceAPI: () => (/* binding */ usingPerformanceAPI) +/* harmony export */ }); +/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node.js */ "./node_modules/@sentry/utils/esm/node.js"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worldwide.js */ "./node_modules/@sentry/utils/esm/worldwide.js"); +/* module decorator */ module = __webpack_require__.hmd(module); + + + +// eslint-disable-next-line deprecation/deprecation +const WINDOW = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalObject)(); + +/** + * An object that can return the current timestamp in seconds since the UNIX epoch. + */ + +/** + * A TimestampSource implementation for environments that do not support the Performance Web API natively. + * + * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier + * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It + * is more obvious to explain "why does my span have negative duration" than "why my spans have zero duration". + */ +const dateTimestampSource = { + nowSeconds: () => Date.now() / 1000, +}; + +/** + * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance} + * for accessing a high-resolution monotonic clock. + */ + +/** + * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not + * support the API. + * + * Wrapping the native API works around differences in behavior from different browsers. + */ +function getBrowserPerformance() { + const { performance } = WINDOW; + if (!performance || !performance.now) { + return undefined; + } + + // Replace performance.timeOrigin with our own timeOrigin based on Date.now(). + // + // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin + + // performance.now() gives a date arbitrarily in the past. + // + // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is + // undefined. + // + // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to + // interact with data coming out of performance entries. + // + // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that + // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes + // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have + // observed skews that can be as long as days, weeks or months. + // + // See https://github.com/getsentry/sentry-javascript/issues/2590. + // + // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload + // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation + // transactions of long-lived web pages. + const timeOrigin = Date.now() - performance.now(); + + return { + now: () => performance.now(), + timeOrigin, + }; +} + +/** + * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't + * implement the API. + */ +function getNodePerformance() { + try { + const perfHooks = (0,_node_js__WEBPACK_IMPORTED_MODULE_1__.dynamicRequire)(module, 'perf_hooks') ; + return perfHooks.performance; + } catch (_) { + return undefined; + } +} + +/** + * The Performance API implementation for the current platform, if available. + */ +const platformPerformance = (0,_node_js__WEBPACK_IMPORTED_MODULE_1__.isNodeEnv)() ? getNodePerformance() : getBrowserPerformance(); + +const timestampSource = + platformPerformance === undefined + ? dateTimestampSource + : { + nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000, + }; + +/** + * Returns a timestamp in seconds since the UNIX epoch using the Date API. + */ +const dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource); + +/** + * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the + * availability of the Performance API. + * + * See `usingPerformanceAPI` to test whether the Performance API is used. + * + * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is + * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The + * skew can grow to arbitrary amounts like days, weeks or months. + * See https://github.com/getsentry/sentry-javascript/issues/2590. + */ +const timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); + +/** + * Re-exported with an old name for backwards-compatibility. + * TODO (v8): Remove this + * + * @deprecated Use `timestampInSeconds` instead. + */ +const timestampWithMs = timestampInSeconds; + +/** + * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps. + */ +const usingPerformanceAPI = platformPerformance !== undefined; + +/** + * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only. + */ +let _browserPerformanceTimeOriginMode; + +/** + * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the + * performance API is available. + */ +const browserPerformanceTimeOrigin = (() => { + // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or + // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin + // data as reliable if they are within a reasonable threshold of the current time. + + const { performance } = WINDOW; + if (!performance || !performance.now) { + _browserPerformanceTimeOriginMode = 'none'; + return undefined; + } + + const threshold = 3600 * 1000; + const performanceNow = performance.now(); + const dateNow = Date.now(); + + // if timeOrigin isn't available set delta to threshold so it isn't used + const timeOriginDelta = performance.timeOrigin + ? Math.abs(performance.timeOrigin + performanceNow - dateNow) + : threshold; + const timeOriginIsReliable = timeOriginDelta < threshold; + + // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin + // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. + // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always + // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the + // Date API. + // eslint-disable-next-line deprecation/deprecation + const navigationStart = performance.timing && performance.timing.navigationStart; + const hasNavigationStart = typeof navigationStart === 'number'; + // if navigationStart isn't available set delta to threshold so it isn't used + const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; + const navigationStartIsReliable = navigationStartDelta < threshold; + + if (timeOriginIsReliable || navigationStartIsReliable) { + // Use the more reliable time origin + if (timeOriginDelta <= navigationStartDelta) { + _browserPerformanceTimeOriginMode = 'timeOrigin'; + return performance.timeOrigin; + } else { + _browserPerformanceTimeOriginMode = 'navigationStart'; + return navigationStart; + } + } + + // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. + _browserPerformanceTimeOriginMode = 'dateNow'; + return dateNow; +})(); + + +//# sourceMappingURL=time.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/tracing.js": +/*!***************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/tracing.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ TRACEPARENT_REGEXP: () => (/* binding */ TRACEPARENT_REGEXP), +/* harmony export */ extractTraceparentData: () => (/* binding */ extractTraceparentData), +/* harmony export */ generateSentryTraceHeader: () => (/* binding */ generateSentryTraceHeader), +/* harmony export */ tracingContextFromHeaders: () => (/* binding */ tracingContextFromHeaders) +/* harmony export */ }); +/* harmony import */ var _baggage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baggage.js */ "./node_modules/@sentry/utils/esm/baggage.js"); +/* harmony import */ var _misc_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./misc.js */ "./node_modules/@sentry/utils/esm/misc.js"); + + + +const TRACEPARENT_REGEXP = new RegExp( + '^[ \\t]*' + // whitespace + '([0-9a-f]{32})?' + // trace_id + '-?([0-9a-f]{16})?' + // span_id + '-?([01])?' + // sampled + '[ \\t]*$', // whitespace +); + +/** + * Extract transaction context data from a `sentry-trace` header. + * + * @param traceparent Traceparent string + * + * @returns Object containing data from the header, or undefined if traceparent string is malformed + */ +function extractTraceparentData(traceparent) { + if (!traceparent) { + return undefined; + } + + const matches = traceparent.match(TRACEPARENT_REGEXP); + if (!matches) { + return undefined; + } + + let parentSampled; + if (matches[3] === '1') { + parentSampled = true; + } else if (matches[3] === '0') { + parentSampled = false; + } + + return { + traceId: matches[1], + parentSampled, + parentSpanId: matches[2], + }; +} + +/** + * Create tracing context from incoming headers. + */ +function tracingContextFromHeaders( + sentryTrace, + baggage, +) + + { + const traceparentData = extractTraceparentData(sentryTrace); + const dynamicSamplingContext = (0,_baggage_js__WEBPACK_IMPORTED_MODULE_0__.baggageHeaderToDynamicSamplingContext)(baggage); + + const { traceId, parentSpanId, parentSampled } = traceparentData || {}; + + const propagationContext = { + traceId: traceId || (0,_misc_js__WEBPACK_IMPORTED_MODULE_1__.uuid4)(), + spanId: (0,_misc_js__WEBPACK_IMPORTED_MODULE_1__.uuid4)().substring(16), + sampled: parentSampled, + }; + + if (parentSpanId) { + propagationContext.parentSpanId = parentSpanId; + } + + if (dynamicSamplingContext) { + propagationContext.dsc = dynamicSamplingContext ; + } + + return { + traceparentData, + dynamicSamplingContext, + propagationContext, + }; +} + +/** + * Create sentry-trace header from span context values. + */ +function generateSentryTraceHeader( + traceId = (0,_misc_js__WEBPACK_IMPORTED_MODULE_1__.uuid4)(), + spanId = (0,_misc_js__WEBPACK_IMPORTED_MODULE_1__.uuid4)().substring(16), + sampled, +) { + let sampledString = ''; + if (sampled !== undefined) { + sampledString = sampled ? '-1' : '-0'; + } + return `${traceId}-${spanId}${sampledString}`; +} + + +//# sourceMappingURL=tracing.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/url.js": +/*!***********************************************!*\ + !*** ./node_modules/@sentry/utils/esm/url.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getNumberOfUrlSegments: () => (/* binding */ getNumberOfUrlSegments), +/* harmony export */ getSanitizedUrlString: () => (/* binding */ getSanitizedUrlString), +/* harmony export */ parseUrl: () => (/* binding */ parseUrl), +/* harmony export */ stripUrlQueryAndFragment: () => (/* binding */ stripUrlQueryAndFragment) +/* harmony export */ }); +/** + * Parses string form of URL into an object + * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B + * // intentionally using regex and not href parsing trick because React Native and other + * // environments where DOM might not be available + * @returns parsed URL object + */ +function parseUrl(url) { + if (!url) { + return {}; + } + + const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); + + if (!match) { + return {}; + } + + // coerce to undefined values to empty string so we don't get 'undefined' + const query = match[6] || ''; + const fragment = match[8] || ''; + return { + host: match[4], + path: match[5], + protocol: match[2], + search: query, + hash: fragment, + relative: match[5] + query + fragment, // everything minus origin + }; +} + +/** + * Strip the query string and fragment off of a given URL or path (if present) + * + * @param urlPath Full URL or path, including possible query string and/or fragment + * @returns URL or path without query string or fragment + */ +function stripUrlQueryAndFragment(urlPath) { + // eslint-disable-next-line no-useless-escape + return urlPath.split(/[\?#]/, 1)[0]; +} + +/** + * Returns number of URL segments of a passed string URL. + */ +function getNumberOfUrlSegments(url) { + // split at '/' or at '\/' to split regex urls correctly + return url.split(/\\?\//).filter(s => s.length > 0 && s !== ',').length; +} + +/** + * Takes a URL object and returns a sanitized string which is safe to use as span description + * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data + */ +function getSanitizedUrlString(url) { + const { protocol, host, path } = url; + + const filteredHost = + (host && + host + // Always filter out authority + .replace(/^.*@/, '[filtered]:[filtered]@') + // Don't show standard :80 (http) and :443 (https) ports to reduce the noise + .replace(':80', '') + .replace(':443', '')) || + ''; + + return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`; +} + + +//# sourceMappingURL=url.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/vendor/supportsHistory.js": +/*!******************************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/vendor/supportsHistory.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ supportsHistory: () => (/* binding */ supportsHistory) +/* harmony export */ }); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../worldwide.js */ "./node_modules/@sentry/utils/esm/worldwide.js"); + + +// Based on https://github.com/angular/angular.js/pull/13945/files + +// eslint-disable-next-line deprecation/deprecation +const WINDOW = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalObject)(); + +/** + * Tells whether current environment supports History API + * {@link supportsHistory}. + * + * @returns Answer to the given question. + */ +function supportsHistory() { + // NOTE: in Chrome App environment, touching history.pushState, *even inside + // a try/catch block*, will cause Chrome to output an error to console.error + // borrowed from: https://github.com/angular/angular.js/pull/13945/files + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const chrome = (WINDOW ).chrome; + const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime; + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState; + + return !isChromePackagedApp && hasHistoryApi; +} + + +//# sourceMappingURL=supportsHistory.js.map + + +/***/ }), + +/***/ "./node_modules/@sentry/utils/esm/worldwide.js": +/*!*****************************************************!*\ + !*** ./node_modules/@sentry/utils/esm/worldwide.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ GLOBAL_OBJ: () => (/* binding */ GLOBAL_OBJ), +/* harmony export */ getGlobalObject: () => (/* binding */ getGlobalObject), +/* harmony export */ getGlobalSingleton: () => (/* binding */ getGlobalSingleton) +/* harmony export */ }); +/** Internal global with common properties and Sentry extensions */ + +// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification +// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js +// core-js has the following licence: +// +// Copyright (c) 2014-2022 Denis Pushkarev +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +/** Returns 'obj' if it's the global object, otherwise returns undefined */ +function isGlobalObj(obj) { + return obj && obj.Math == Math ? obj : undefined; +} + +/** Get's the global object for the current JavaScript runtime */ +const GLOBAL_OBJ = + (typeof globalThis == 'object' && isGlobalObj(globalThis)) || + // eslint-disable-next-line no-restricted-globals + (typeof window == 'object' && isGlobalObj(window)) || + (typeof self == 'object' && isGlobalObj(self)) || + ( true && isGlobalObj(({}))) || + (function () { + return this; + })() || + {}; + +/** + * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8 + */ +function getGlobalObject() { + return GLOBAL_OBJ ; +} + +/** + * Returns a global singleton contained in the global `__SENTRY__` object. + * + * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory + * function and added to the `__SENTRY__` object. + * + * @param name name of the global singleton on __SENTRY__ + * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` + * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value + * @returns the singleton + */ +function getGlobalSingleton(name, creator, obj) { + const gbl = (obj || GLOBAL_OBJ) ; + const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {}); + const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator()); + return singleton; +} + + +//# sourceMappingURL=worldwide.js.map + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/compiler/compiler.js": +/*!*************************************************************!*\ + !*** ./node_modules/@sinclair/typebox/compiler/compiler.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/compiler + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeCompiler = exports.Policy = exports.TypeCompilerTypeGuardError = exports.TypeCompilerUnknownTypeError = exports.TypeCheck = void 0; +const transform_1 = __webpack_require__(/*! ../value/transform */ "./node_modules/@sinclair/typebox/value/transform.js"); +const guard_1 = __webpack_require__(/*! ../value/guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const errors_1 = __webpack_require__(/*! ../errors/errors */ "./node_modules/@sinclair/typebox/errors/errors.js"); +const index_1 = __webpack_require__(/*! ../system/index */ "./node_modules/@sinclair/typebox/system/index.js"); +const deref_1 = __webpack_require__(/*! ../value/deref */ "./node_modules/@sinclair/typebox/value/deref.js"); +const hash_1 = __webpack_require__(/*! ../value/hash */ "./node_modules/@sinclair/typebox/value/hash.js"); +const Types = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +// ------------------------------------------------------------------- +// TypeCheck +// ------------------------------------------------------------------- +class TypeCheck { + constructor(schema, references, checkFunc, code) { + this.schema = schema; + this.references = references; + this.checkFunc = checkFunc; + this.code = code; + this.hasTransform = transform_1.HasTransform.Has(schema, references); + } + /** Returns the generated assertion code used to validate this type. */ + Code() { + return this.code; + } + /** Returns an iterator for each error in this value. */ + Errors(value) { + return (0, errors_1.Errors)(this.schema, this.references, value); + } + /** Returns true if the value matches the compiled type. */ + Check(value) { + return this.checkFunc(value); + } + /** Decodes a value or throws if error */ + Decode(value) { + if (!this.checkFunc(value)) + throw new transform_1.TransformDecodeCheckError(this.schema, value, this.Errors(value).First()); + return this.hasTransform ? transform_1.DecodeTransform.Decode(this.schema, this.references, value, (_, __, value) => this.Check(value)) : value; + } + /** Encodes a value or throws if error */ + Encode(value) { + const encoded = this.hasTransform ? transform_1.EncodeTransform.Encode(this.schema, this.references, value, (_, __, value) => this.Check(value)) : value; + if (!this.checkFunc(encoded)) + throw new transform_1.TransformEncodeCheckError(this.schema, value, this.Errors(value).First()); + return encoded; + } +} +exports.TypeCheck = TypeCheck; +// ------------------------------------------------------------------- +// Character +// ------------------------------------------------------------------- +var Character; +(function (Character) { + function DollarSign(code) { + return code === 36; + } + Character.DollarSign = DollarSign; + function IsUnderscore(code) { + return code === 95; + } + Character.IsUnderscore = IsUnderscore; + function IsAlpha(code) { + return (code >= 65 && code <= 90) || (code >= 97 && code <= 122); + } + Character.IsAlpha = IsAlpha; + function IsNumeric(code) { + return code >= 48 && code <= 57; + } + Character.IsNumeric = IsNumeric; +})(Character || (Character = {})); +// ------------------------------------------------------------------- +// MemberExpression +// ------------------------------------------------------------------- +var MemberExpression; +(function (MemberExpression) { + function IsFirstCharacterNumeric(value) { + if (value.length === 0) + return false; + return Character.IsNumeric(value.charCodeAt(0)); + } + function IsAccessor(value) { + if (IsFirstCharacterNumeric(value)) + return false; + for (let i = 0; i < value.length; i++) { + const code = value.charCodeAt(i); + const check = Character.IsAlpha(code) || Character.IsNumeric(code) || Character.DollarSign(code) || Character.IsUnderscore(code); + if (!check) + return false; + } + return true; + } + function EscapeHyphen(key) { + return key.replace(/'/g, "\\'"); + } + function Encode(object, key) { + return IsAccessor(key) ? `${object}.${key}` : `${object}['${EscapeHyphen(key)}']`; + } + MemberExpression.Encode = Encode; +})(MemberExpression || (MemberExpression = {})); +// ------------------------------------------------------------------- +// Identifier +// ------------------------------------------------------------------- +var Identifier; +(function (Identifier) { + function Encode($id) { + const buffer = []; + for (let i = 0; i < $id.length; i++) { + const code = $id.charCodeAt(i); + if (Character.IsNumeric(code) || Character.IsAlpha(code)) { + buffer.push($id.charAt(i)); + } + else { + buffer.push(`_${code}_`); + } + } + return buffer.join('').replace(/__/g, '_'); + } + Identifier.Encode = Encode; +})(Identifier || (Identifier = {})); +// ------------------------------------------------------------------- +// LiteralString +// ------------------------------------------------------------------- +var LiteralString; +(function (LiteralString) { + function Escape(content) { + return content.replace(/'/g, "\\'"); + } + LiteralString.Escape = Escape; +})(LiteralString || (LiteralString = {})); +// ------------------------------------------------------------------- +// Errors +// ------------------------------------------------------------------- +class TypeCompilerUnknownTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +exports.TypeCompilerUnknownTypeError = TypeCompilerUnknownTypeError; +class TypeCompilerTypeGuardError extends Types.TypeBoxError { + constructor(schema) { + super('Preflight validation check failed to guard for the given schema'); + this.schema = schema; + } +} +exports.TypeCompilerTypeGuardError = TypeCompilerTypeGuardError; +// ------------------------------------------------------------------- +// Policy +// ------------------------------------------------------------------- +var Policy; +(function (Policy) { + function IsExactOptionalProperty(value, key, expression) { + return index_1.TypeSystemPolicy.ExactOptionalPropertyTypes ? `('${key}' in ${value} ? ${expression} : true)` : `(${MemberExpression.Encode(value, key)} !== undefined ? ${expression} : true)`; + } + Policy.IsExactOptionalProperty = IsExactOptionalProperty; + function IsObjectLike(value) { + return !index_1.TypeSystemPolicy.AllowArrayObject ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}))` : `(typeof ${value} === 'object' && ${value} !== null)`; + } + Policy.IsObjectLike = IsObjectLike; + function IsRecordLike(value) { + return !index_1.TypeSystemPolicy.AllowArrayObject + ? `(typeof ${value} === 'object' && ${value} !== null && !Array.isArray(${value}) && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))` + : `(typeof ${value} === 'object' && ${value} !== null && !(${value} instanceof Date) && !(${value} instanceof Uint8Array))`; + } + Policy.IsRecordLike = IsRecordLike; + function IsNumberLike(value) { + return !index_1.TypeSystemPolicy.AllowNaN ? `(typeof ${value} === 'number' && Number.isFinite(${value}))` : `typeof ${value} === 'number'`; + } + Policy.IsNumberLike = IsNumberLike; + function IsVoidLike(value) { + return index_1.TypeSystemPolicy.AllowNullVoid ? `(${value} === undefined || ${value} === null)` : `${value} === undefined`; + } + Policy.IsVoidLike = IsVoidLike; +})(Policy || (exports.Policy = Policy = {})); +/** Compiles Types for Runtime Type Checking */ +var TypeCompiler; +(function (TypeCompiler) { + // ---------------------------------------------------------------------- + // Guards + // ---------------------------------------------------------------------- + function IsAnyOrUnknown(schema) { + return schema[Types.Kind] === 'Any' || schema[Types.Kind] === 'Unknown'; + } + // ------------------------------------------------------------------- + // Types + // ------------------------------------------------------------------- + function* TAny(schema, references, value) { + yield 'true'; + } + function* TArray(schema, references, value) { + yield `Array.isArray(${value})`; + const [parameter, accumulator] = [CreateParameter('value', 'any'), CreateParameter('acc', 'number')]; + if ((0, guard_1.IsNumber)(schema.maxItems)) + yield `${value}.length <= ${schema.maxItems}`; + if ((0, guard_1.IsNumber)(schema.minItems)) + yield `${value}.length >= ${schema.minItems}`; + const elementExpression = CreateExpression(schema.items, references, 'value'); + yield `${value}.every((${parameter}) => ${elementExpression})`; + if (Types.TypeGuard.TSchema(schema.contains) || (0, guard_1.IsNumber)(schema.minContains) || (0, guard_1.IsNumber)(schema.maxContains)) { + const containsSchema = Types.TypeGuard.TSchema(schema.contains) ? schema.contains : Types.Type.Never(); + const checkExpression = CreateExpression(containsSchema, references, 'value'); + const checkMinContains = (0, guard_1.IsNumber)(schema.minContains) ? [`(count >= ${schema.minContains})`] : []; + const checkMaxContains = (0, guard_1.IsNumber)(schema.maxContains) ? [`(count <= ${schema.maxContains})`] : []; + const checkCount = `const count = value.reduce((${accumulator}, ${parameter}) => ${checkExpression} ? acc + 1 : acc, 0)`; + const check = [`(count > 0)`, ...checkMinContains, ...checkMaxContains].join(' && '); + yield `((${parameter}) => { ${checkCount}; return ${check}})(${value})`; + } + if (schema.uniqueItems === true) { + const check = `const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true`; + const block = `const set = new Set(); for(const element of value) { ${check} }`; + yield `((${parameter}) => { ${block} )(${value})`; + } + } + function* TAsyncIterator(schema, references, value) { + yield `(typeof value === 'object' && Symbol.asyncIterator in ${value})`; + } + function* TBigInt(schema, references, value) { + yield `(typeof ${value} === 'bigint')`; + if ((0, guard_1.IsBigInt)(schema.exclusiveMaximum)) + yield `${value} < BigInt(${schema.exclusiveMaximum})`; + if ((0, guard_1.IsBigInt)(schema.exclusiveMinimum)) + yield `${value} > BigInt(${schema.exclusiveMinimum})`; + if ((0, guard_1.IsBigInt)(schema.maximum)) + yield `${value} <= BigInt(${schema.maximum})`; + if ((0, guard_1.IsBigInt)(schema.minimum)) + yield `${value} >= BigInt(${schema.minimum})`; + if ((0, guard_1.IsBigInt)(schema.multipleOf)) + yield `(${value} % BigInt(${schema.multipleOf})) === 0`; + } + function* TBoolean(schema, references, value) { + yield `(typeof ${value} === 'boolean')`; + } + function* TConstructor(schema, references, value) { + yield* Visit(schema.returns, references, `${value}.prototype`); + } + function* TDate(schema, references, value) { + yield `(${value} instanceof Date) && Number.isFinite(${value}.getTime())`; + if ((0, guard_1.IsNumber)(schema.exclusiveMaximumTimestamp)) + yield `${value}.getTime() < ${schema.exclusiveMaximumTimestamp}`; + if ((0, guard_1.IsNumber)(schema.exclusiveMinimumTimestamp)) + yield `${value}.getTime() > ${schema.exclusiveMinimumTimestamp}`; + if ((0, guard_1.IsNumber)(schema.maximumTimestamp)) + yield `${value}.getTime() <= ${schema.maximumTimestamp}`; + if ((0, guard_1.IsNumber)(schema.minimumTimestamp)) + yield `${value}.getTime() >= ${schema.minimumTimestamp}`; + if ((0, guard_1.IsNumber)(schema.multipleOfTimestamp)) + yield `(${value}.getTime() % ${schema.multipleOfTimestamp}) === 0`; + } + function* TFunction(schema, references, value) { + yield `(typeof ${value} === 'function')`; + } + function* TInteger(schema, references, value) { + yield `(typeof ${value} === 'number' && Number.isInteger(${value}))`; + if ((0, guard_1.IsNumber)(schema.exclusiveMaximum)) + yield `${value} < ${schema.exclusiveMaximum}`; + if ((0, guard_1.IsNumber)(schema.exclusiveMinimum)) + yield `${value} > ${schema.exclusiveMinimum}`; + if ((0, guard_1.IsNumber)(schema.maximum)) + yield `${value} <= ${schema.maximum}`; + if ((0, guard_1.IsNumber)(schema.minimum)) + yield `${value} >= ${schema.minimum}`; + if ((0, guard_1.IsNumber)(schema.multipleOf)) + yield `(${value} % ${schema.multipleOf}) === 0`; + } + function* TIntersect(schema, references, value) { + const check1 = schema.allOf.map((schema) => CreateExpression(schema, references, value)).join(' && '); + if (schema.unevaluatedProperties === false) { + const keyCheck = CreateVariable(`${new RegExp(Types.KeyResolver.ResolvePattern(schema))};`); + const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key))`; + yield `(${check1} && ${check2})`; + } + else if (Types.TypeGuard.TSchema(schema.unevaluatedProperties)) { + const keyCheck = CreateVariable(`${new RegExp(Types.KeyResolver.ResolvePattern(schema))};`); + const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key) || ${CreateExpression(schema.unevaluatedProperties, references, `${value}[key]`)})`; + yield `(${check1} && ${check2})`; + } + else { + yield `(${check1})`; + } + } + function* TIterator(schema, references, value) { + yield `(typeof value === 'object' && Symbol.iterator in ${value})`; + } + function* TLiteral(schema, references, value) { + if (typeof schema.const === 'number' || typeof schema.const === 'boolean') { + yield `(${value} === ${schema.const})`; + } + else { + yield `(${value} === '${LiteralString.Escape(schema.const)}')`; + } + } + function* TNever(schema, references, value) { + yield `false`; + } + function* TNot(schema, references, value) { + const expression = CreateExpression(schema.not, references, value); + yield `(!${expression})`; + } + function* TNull(schema, references, value) { + yield `(${value} === null)`; + } + function* TNumber(schema, references, value) { + yield Policy.IsNumberLike(value); + if ((0, guard_1.IsNumber)(schema.exclusiveMaximum)) + yield `${value} < ${schema.exclusiveMaximum}`; + if ((0, guard_1.IsNumber)(schema.exclusiveMinimum)) + yield `${value} > ${schema.exclusiveMinimum}`; + if ((0, guard_1.IsNumber)(schema.maximum)) + yield `${value} <= ${schema.maximum}`; + if ((0, guard_1.IsNumber)(schema.minimum)) + yield `${value} >= ${schema.minimum}`; + if ((0, guard_1.IsNumber)(schema.multipleOf)) + yield `(${value} % ${schema.multipleOf}) === 0`; + } + function* TObject(schema, references, value) { + yield Policy.IsObjectLike(value); + if ((0, guard_1.IsNumber)(schema.minProperties)) + yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`; + if ((0, guard_1.IsNumber)(schema.maxProperties)) + yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`; + const knownKeys = Object.getOwnPropertyNames(schema.properties); + for (const knownKey of knownKeys) { + const memberExpression = MemberExpression.Encode(value, knownKey); + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + yield* Visit(property, references, memberExpression); + if (Types.ExtendsUndefined.Check(property) || IsAnyOrUnknown(property)) + yield `('${knownKey}' in ${value})`; + } + else { + const expression = CreateExpression(property, references, memberExpression); + yield Policy.IsExactOptionalProperty(value, knownKey, expression); + } + } + if (schema.additionalProperties === false) { + if (schema.required && schema.required.length === knownKeys.length) { + yield `Object.getOwnPropertyNames(${value}).length === ${knownKeys.length}`; + } + else { + const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`; + yield `Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key))`; + } + } + if (typeof schema.additionalProperties === 'object') { + const expression = CreateExpression(schema.additionalProperties, references, `${value}[key]`); + const keys = `[${knownKeys.map((key) => `'${key}'`).join(', ')}]`; + yield `(Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key) || ${expression}))`; + } + } + function* TPromise(schema, references, value) { + yield `(typeof value === 'object' && typeof ${value}.then === 'function')`; + } + function* TRecord(schema, references, value) { + yield Policy.IsRecordLike(value); + if ((0, guard_1.IsNumber)(schema.minProperties)) + yield `Object.getOwnPropertyNames(${value}).length >= ${schema.minProperties}`; + if ((0, guard_1.IsNumber)(schema.maxProperties)) + yield `Object.getOwnPropertyNames(${value}).length <= ${schema.maxProperties}`; + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const variable = CreateVariable(`${new RegExp(patternKey)}`); + const check1 = CreateExpression(patternSchema, references, 'value'); + const check2 = Types.TypeGuard.TSchema(schema.additionalProperties) ? CreateExpression(schema.additionalProperties, references, value) : schema.additionalProperties === false ? 'false' : 'true'; + const expression = `(${variable}.test(key) ? ${check1} : ${check2})`; + yield `(Object.entries(${value}).every(([key, value]) => ${expression}))`; + } + function* TRef(schema, references, value) { + const target = (0, deref_1.Deref)(schema, references); + // Reference: If we have seen this reference before we can just yield and return the function call. + // If this isn't the case we defer to visit to generate and set the function for subsequent passes. + if (state.functions.has(schema.$ref)) + return yield `${CreateFunctionName(schema.$ref)}(${value})`; + yield* Visit(target, references, value); + } + function* TString(schema, references, value) { + yield `(typeof ${value} === 'string')`; + if ((0, guard_1.IsNumber)(schema.maxLength)) + yield `${value}.length <= ${schema.maxLength}`; + if ((0, guard_1.IsNumber)(schema.minLength)) + yield `${value}.length >= ${schema.minLength}`; + if (schema.pattern !== undefined) { + const variable = CreateVariable(`${new RegExp(schema.pattern)};`); + yield `${variable}.test(${value})`; + } + if (schema.format !== undefined) { + yield `format('${schema.format}', ${value})`; + } + } + function* TSymbol(schema, references, value) { + yield `(typeof ${value} === 'symbol')`; + } + function* TTemplateLiteral(schema, references, value) { + yield `(typeof ${value} === 'string')`; + const variable = CreateVariable(`${new RegExp(schema.pattern)};`); + yield `${variable}.test(${value})`; + } + function* TThis(schema, references, value) { + // Note: This types are assured to be hoisted prior to this call. Just yield the function. + yield `${CreateFunctionName(schema.$ref)}(${value})`; + } + function* TTuple(schema, references, value) { + yield `Array.isArray(${value})`; + if (schema.items === undefined) + return yield `${value}.length === 0`; + yield `(${value}.length === ${schema.maxItems})`; + for (let i = 0; i < schema.items.length; i++) { + const expression = CreateExpression(schema.items[i], references, `${value}[${i}]`); + yield `${expression}`; + } + } + function* TUndefined(schema, references, value) { + yield `${value} === undefined`; + } + function* TUnion(schema, references, value) { + const expressions = schema.anyOf.map((schema) => CreateExpression(schema, references, value)); + yield `(${expressions.join(' || ')})`; + } + function* TUint8Array(schema, references, value) { + yield `${value} instanceof Uint8Array`; + if ((0, guard_1.IsNumber)(schema.maxByteLength)) + yield `(${value}.length <= ${schema.maxByteLength})`; + if ((0, guard_1.IsNumber)(schema.minByteLength)) + yield `(${value}.length >= ${schema.minByteLength})`; + } + function* TUnknown(schema, references, value) { + yield 'true'; + } + function* TVoid(schema, references, value) { + yield Policy.IsVoidLike(value); + } + function* TKind(schema, references, value) { + const instance = state.instances.size; + state.instances.set(instance, schema); + yield `kind('${schema[Types.Kind]}', ${instance}, ${value})`; + } + function* Visit(schema, references, value, useHoisting = true) { + const references_ = (0, guard_1.IsString)(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + // ---------------------------------------------------------------------------------- + // Hoisting + // ---------------------------------------------------------------------------------- + if (useHoisting && (0, guard_1.IsString)(schema.$id)) { + const functionName = CreateFunctionName(schema.$id); + if (state.functions.has(functionName)) { + return yield `${functionName}(${value})`; + } + else { + const functionCode = CreateFunction(functionName, schema, references, 'value', false); + state.functions.set(functionName, functionCode); + return yield `${functionName}(${value})`; + } + } + switch (schema_[Types.Kind]) { + case 'Any': + return yield* TAny(schema_, references_, value); + case 'Array': + return yield* TArray(schema_, references_, value); + case 'AsyncIterator': + return yield* TAsyncIterator(schema_, references_, value); + case 'BigInt': + return yield* TBigInt(schema_, references_, value); + case 'Boolean': + return yield* TBoolean(schema_, references_, value); + case 'Constructor': + return yield* TConstructor(schema_, references_, value); + case 'Date': + return yield* TDate(schema_, references_, value); + case 'Function': + return yield* TFunction(schema_, references_, value); + case 'Integer': + return yield* TInteger(schema_, references_, value); + case 'Intersect': + return yield* TIntersect(schema_, references_, value); + case 'Iterator': + return yield* TIterator(schema_, references_, value); + case 'Literal': + return yield* TLiteral(schema_, references_, value); + case 'Never': + return yield* TNever(schema_, references_, value); + case 'Not': + return yield* TNot(schema_, references_, value); + case 'Null': + return yield* TNull(schema_, references_, value); + case 'Number': + return yield* TNumber(schema_, references_, value); + case 'Object': + return yield* TObject(schema_, references_, value); + case 'Promise': + return yield* TPromise(schema_, references_, value); + case 'Record': + return yield* TRecord(schema_, references_, value); + case 'Ref': + return yield* TRef(schema_, references_, value); + case 'String': + return yield* TString(schema_, references_, value); + case 'Symbol': + return yield* TSymbol(schema_, references_, value); + case 'TemplateLiteral': + return yield* TTemplateLiteral(schema_, references_, value); + case 'This': + return yield* TThis(schema_, references_, value); + case 'Tuple': + return yield* TTuple(schema_, references_, value); + case 'Undefined': + return yield* TUndefined(schema_, references_, value); + case 'Union': + return yield* TUnion(schema_, references_, value); + case 'Uint8Array': + return yield* TUint8Array(schema_, references_, value); + case 'Unknown': + return yield* TUnknown(schema_, references_, value); + case 'Void': + return yield* TVoid(schema_, references_, value); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new TypeCompilerUnknownTypeError(schema); + return yield* TKind(schema_, references_, value); + } + } + // ------------------------------------------------------------------- + // Compiler State + // ------------------------------------------------------------------- + // prettier-ignore + const state = { + language: 'javascript', + functions: new Map(), + variables: new Map(), + instances: new Map() // exterior kind instances + }; + // ------------------------------------------------------------------- + // Compiler Factory + // ------------------------------------------------------------------- + function CreateExpression(schema, references, value, useHoisting = true) { + return `(${[...Visit(schema, references, value, useHoisting)].join(' && ')})`; + } + function CreateFunctionName($id) { + return `check_${Identifier.Encode($id)}`; + } + function CreateVariable(expression) { + const variableName = `local_${state.variables.size}`; + state.variables.set(variableName, `const ${variableName} = ${expression}`); + return variableName; + } + function CreateFunction(name, schema, references, value, useHoisting = true) { + const [newline, pad] = ['\n', (length) => ''.padStart(length, ' ')]; + const parameter = CreateParameter('value', 'any'); + const returns = CreateReturns('boolean'); + const expression = [...Visit(schema, references, value, useHoisting)].map((expression) => `${pad(4)}${expression}`).join(` &&${newline}`); + return `function ${name}(${parameter})${returns} {${newline}${pad(2)}return (${newline}${expression}${newline}${pad(2)})\n}`; + } + function CreateParameter(name, type) { + const annotation = state.language === 'typescript' ? `: ${type}` : ''; + return `${name}${annotation}`; + } + function CreateReturns(type) { + return state.language === 'typescript' ? `: ${type}` : ''; + } + // ------------------------------------------------------------------- + // Compile + // ------------------------------------------------------------------- + function Build(schema, references, options) { + const functionCode = CreateFunction('check', schema, references, 'value'); // will populate functions and variables + const parameter = CreateParameter('value', 'any'); + const returns = CreateReturns('boolean'); + const functions = [...state.functions.values()]; + const variables = [...state.variables.values()]; + // prettier-ignore + const checkFunction = (0, guard_1.IsString)(schema.$id) // ensure top level schemas with $id's are hoisted + ? `return function check(${parameter})${returns} {\n return ${CreateFunctionName(schema.$id)}(value)\n}` + : `return ${functionCode}`; + return [...variables, ...functions, checkFunction].join('\n'); + } + /** Generates the code used to assert this type and returns it as a string */ + function Code(...args) { + const defaults = { language: 'javascript' }; + // prettier-ignore + const [schema, references, options] = (args.length === 2 && (0, guard_1.IsArray)(args[1]) ? [args[0], args[1], defaults] : + args.length === 2 && !(0, guard_1.IsArray)(args[1]) ? [args[0], [], args[1]] : + args.length === 3 ? [args[0], args[1], args[2]] : + args.length === 1 ? [args[0], [], defaults] : + [null, [], defaults]); + // compiler-reset + state.language = options.language; + state.variables.clear(); + state.functions.clear(); + state.instances.clear(); + if (!Types.TypeGuard.TSchema(schema)) + throw new TypeCompilerTypeGuardError(schema); + for (const schema of references) + if (!Types.TypeGuard.TSchema(schema)) + throw new TypeCompilerTypeGuardError(schema); + return Build(schema, references, options); + } + TypeCompiler.Code = Code; + /** Compiles a TypeBox type for optimal runtime type checking. Types must be valid TypeBox types of TSchema */ + function Compile(schema, references = []) { + const generatedCode = Code(schema, references, { language: 'javascript' }); + const compiledFunction = globalThis.Function('kind', 'format', 'hash', generatedCode); + const instances = new Map(state.instances); + function typeRegistryFunction(kind, instance, value) { + if (!Types.TypeRegistry.Has(kind) || !instances.has(instance)) + return false; + const checkFunc = Types.TypeRegistry.Get(kind); + const schema = instances.get(instance); + return checkFunc(schema, value); + } + function formatRegistryFunction(format, value) { + if (!Types.FormatRegistry.Has(format)) + return false; + const checkFunc = Types.FormatRegistry.Get(format); + return checkFunc(value); + } + function hashFunction(value) { + return (0, hash_1.Hash)(value); + } + const checkFunction = compiledFunction(typeRegistryFunction, formatRegistryFunction, hashFunction); + return new TypeCheck(schema, references, checkFunction, generatedCode); + } + TypeCompiler.Compile = Compile; +})(TypeCompiler || (exports.TypeCompiler = TypeCompiler = {})); + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/compiler/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/compiler/index.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/compiler + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ValueErrorIterator = exports.ValueErrorType = void 0; +var index_1 = __webpack_require__(/*! ../errors/index */ "./node_modules/@sinclair/typebox/errors/index.js"); +Object.defineProperty(exports, "ValueErrorType", ({ enumerable: true, get: function () { return index_1.ValueErrorType; } })); +Object.defineProperty(exports, "ValueErrorIterator", ({ enumerable: true, get: function () { return index_1.ValueErrorIterator; } })); +__exportStar(__webpack_require__(/*! ./compiler */ "./node_modules/@sinclair/typebox/compiler/compiler.js"), exports); + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/errors/errors.js": +/*!*********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/errors/errors.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/errors + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Errors = exports.ValueErrorIterator = exports.ValueErrorsUnknownTypeError = exports.ValueErrorType = void 0; +const guard_1 = __webpack_require__(/*! ../value/guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const system_1 = __webpack_require__(/*! ../system/system */ "./node_modules/@sinclair/typebox/system/system.js"); +const deref_1 = __webpack_require__(/*! ../value/deref */ "./node_modules/@sinclair/typebox/value/deref.js"); +const hash_1 = __webpack_require__(/*! ../value/hash */ "./node_modules/@sinclair/typebox/value/hash.js"); +const Types = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +// -------------------------------------------------------------------------- +// ValueErrorType +// -------------------------------------------------------------------------- +var ValueErrorType; +(function (ValueErrorType) { + ValueErrorType[ValueErrorType["ArrayContains"] = 0] = "ArrayContains"; + ValueErrorType[ValueErrorType["ArrayMaxContains"] = 1] = "ArrayMaxContains"; + ValueErrorType[ValueErrorType["ArrayMaxItems"] = 2] = "ArrayMaxItems"; + ValueErrorType[ValueErrorType["ArrayMinContains"] = 3] = "ArrayMinContains"; + ValueErrorType[ValueErrorType["ArrayMinItems"] = 4] = "ArrayMinItems"; + ValueErrorType[ValueErrorType["ArrayUniqueItems"] = 5] = "ArrayUniqueItems"; + ValueErrorType[ValueErrorType["Array"] = 6] = "Array"; + ValueErrorType[ValueErrorType["AsyncIterator"] = 7] = "AsyncIterator"; + ValueErrorType[ValueErrorType["BigIntExclusiveMaximum"] = 8] = "BigIntExclusiveMaximum"; + ValueErrorType[ValueErrorType["BigIntExclusiveMinimum"] = 9] = "BigIntExclusiveMinimum"; + ValueErrorType[ValueErrorType["BigIntMaximum"] = 10] = "BigIntMaximum"; + ValueErrorType[ValueErrorType["BigIntMinimum"] = 11] = "BigIntMinimum"; + ValueErrorType[ValueErrorType["BigIntMultipleOf"] = 12] = "BigIntMultipleOf"; + ValueErrorType[ValueErrorType["BigInt"] = 13] = "BigInt"; + ValueErrorType[ValueErrorType["Boolean"] = 14] = "Boolean"; + ValueErrorType[ValueErrorType["DateExclusiveMaximumTimestamp"] = 15] = "DateExclusiveMaximumTimestamp"; + ValueErrorType[ValueErrorType["DateExclusiveMinimumTimestamp"] = 16] = "DateExclusiveMinimumTimestamp"; + ValueErrorType[ValueErrorType["DateMaximumTimestamp"] = 17] = "DateMaximumTimestamp"; + ValueErrorType[ValueErrorType["DateMinimumTimestamp"] = 18] = "DateMinimumTimestamp"; + ValueErrorType[ValueErrorType["DateMultipleOfTimestamp"] = 19] = "DateMultipleOfTimestamp"; + ValueErrorType[ValueErrorType["Date"] = 20] = "Date"; + ValueErrorType[ValueErrorType["Function"] = 21] = "Function"; + ValueErrorType[ValueErrorType["IntegerExclusiveMaximum"] = 22] = "IntegerExclusiveMaximum"; + ValueErrorType[ValueErrorType["IntegerExclusiveMinimum"] = 23] = "IntegerExclusiveMinimum"; + ValueErrorType[ValueErrorType["IntegerMaximum"] = 24] = "IntegerMaximum"; + ValueErrorType[ValueErrorType["IntegerMinimum"] = 25] = "IntegerMinimum"; + ValueErrorType[ValueErrorType["IntegerMultipleOf"] = 26] = "IntegerMultipleOf"; + ValueErrorType[ValueErrorType["Integer"] = 27] = "Integer"; + ValueErrorType[ValueErrorType["IntersectUnevaluatedProperties"] = 28] = "IntersectUnevaluatedProperties"; + ValueErrorType[ValueErrorType["Intersect"] = 29] = "Intersect"; + ValueErrorType[ValueErrorType["Iterator"] = 30] = "Iterator"; + ValueErrorType[ValueErrorType["Kind"] = 31] = "Kind"; + ValueErrorType[ValueErrorType["Literal"] = 32] = "Literal"; + ValueErrorType[ValueErrorType["Never"] = 33] = "Never"; + ValueErrorType[ValueErrorType["Not"] = 34] = "Not"; + ValueErrorType[ValueErrorType["Null"] = 35] = "Null"; + ValueErrorType[ValueErrorType["NumberExclusiveMaximum"] = 36] = "NumberExclusiveMaximum"; + ValueErrorType[ValueErrorType["NumberExclusiveMinimum"] = 37] = "NumberExclusiveMinimum"; + ValueErrorType[ValueErrorType["NumberMaximum"] = 38] = "NumberMaximum"; + ValueErrorType[ValueErrorType["NumberMinimum"] = 39] = "NumberMinimum"; + ValueErrorType[ValueErrorType["NumberMultipleOf"] = 40] = "NumberMultipleOf"; + ValueErrorType[ValueErrorType["Number"] = 41] = "Number"; + ValueErrorType[ValueErrorType["ObjectAdditionalProperties"] = 42] = "ObjectAdditionalProperties"; + ValueErrorType[ValueErrorType["ObjectMaxProperties"] = 43] = "ObjectMaxProperties"; + ValueErrorType[ValueErrorType["ObjectMinProperties"] = 44] = "ObjectMinProperties"; + ValueErrorType[ValueErrorType["ObjectRequiredProperty"] = 45] = "ObjectRequiredProperty"; + ValueErrorType[ValueErrorType["Object"] = 46] = "Object"; + ValueErrorType[ValueErrorType["Promise"] = 47] = "Promise"; + ValueErrorType[ValueErrorType["StringFormatUnknown"] = 48] = "StringFormatUnknown"; + ValueErrorType[ValueErrorType["StringFormat"] = 49] = "StringFormat"; + ValueErrorType[ValueErrorType["StringMaxLength"] = 50] = "StringMaxLength"; + ValueErrorType[ValueErrorType["StringMinLength"] = 51] = "StringMinLength"; + ValueErrorType[ValueErrorType["StringPattern"] = 52] = "StringPattern"; + ValueErrorType[ValueErrorType["String"] = 53] = "String"; + ValueErrorType[ValueErrorType["Symbol"] = 54] = "Symbol"; + ValueErrorType[ValueErrorType["TupleLength"] = 55] = "TupleLength"; + ValueErrorType[ValueErrorType["Tuple"] = 56] = "Tuple"; + ValueErrorType[ValueErrorType["Uint8ArrayMaxByteLength"] = 57] = "Uint8ArrayMaxByteLength"; + ValueErrorType[ValueErrorType["Uint8ArrayMinByteLength"] = 58] = "Uint8ArrayMinByteLength"; + ValueErrorType[ValueErrorType["Uint8Array"] = 59] = "Uint8Array"; + ValueErrorType[ValueErrorType["Undefined"] = 60] = "Undefined"; + ValueErrorType[ValueErrorType["Union"] = 61] = "Union"; + ValueErrorType[ValueErrorType["Void"] = 62] = "Void"; +})(ValueErrorType || (exports.ValueErrorType = ValueErrorType = {})); +// -------------------------------------------------------------------------- +// ValueErrors +// -------------------------------------------------------------------------- +class ValueErrorsUnknownTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +exports.ValueErrorsUnknownTypeError = ValueErrorsUnknownTypeError; +// -------------------------------------------------------------------------- +// Guards +// -------------------------------------------------------------------------- +function IsDefined(value) { + return value !== undefined; +} +// -------------------------------------------------------------------------- +// ValueErrorIterator +// -------------------------------------------------------------------------- +class ValueErrorIterator { + constructor(iterator) { + this.iterator = iterator; + } + [Symbol.iterator]() { + return this.iterator; + } + /** Returns the first value error or undefined if no errors */ + First() { + const next = this.iterator.next(); + return next.done ? undefined : next.value; + } +} +exports.ValueErrorIterator = ValueErrorIterator; +// -------------------------------------------------------------------------- +// Create +// -------------------------------------------------------------------------- +function Create(type, schema, path, value) { + return { type, schema, path, value, message: system_1.TypeSystemErrorFunction.Get()(schema, type) }; +} +// -------------------------------------------------------------------------- +// Types +// -------------------------------------------------------------------------- +function* TAny(schema, references, path, value) { } +function* TArray(schema, references, path, value) { + if (!(0, guard_1.IsArray)(value)) { + return yield Create(ValueErrorType.Array, schema, path, value); + } + if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) { + yield Create(ValueErrorType.ArrayMinItems, schema, path, value); + } + if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) { + yield Create(ValueErrorType.ArrayMaxItems, schema, path, value); + } + for (let i = 0; i < value.length; i++) { + yield* Visit(schema.items, references, `${path}/${i}`, value[i]); + } + // prettier-ignore + if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) { + const hashed = (0, hash_1.Hash)(element); + if (set.has(hashed)) { + return false; + } + else { + set.add(hashed); + } + } return true; })())) { + yield Create(ValueErrorType.ArrayUniqueItems, schema, path, value); + } + // contains + if (!(IsDefined(schema.contains) || IsDefined(schema.minContains) || IsDefined(schema.maxContains))) { + return; + } + const containsSchema = IsDefined(schema.contains) ? schema.contains : Types.Type.Never(); + const containsCount = value.reduce((acc, value, index) => (Visit(containsSchema, references, `${path}${index}`, value).next().done === true ? acc + 1 : acc), 0); + if (containsCount === 0) { + yield Create(ValueErrorType.ArrayContains, schema, path, value); + } + if ((0, guard_1.IsNumber)(schema.minContains) && containsCount < schema.minContains) { + yield Create(ValueErrorType.ArrayMinContains, schema, path, value); + } + if ((0, guard_1.IsNumber)(schema.maxContains) && containsCount > schema.maxContains) { + yield Create(ValueErrorType.ArrayMaxContains, schema, path, value); + } +} +function* TAsyncIterator(schema, references, path, value) { + if (!(0, guard_1.IsAsyncIterator)(value)) + yield Create(ValueErrorType.AsyncIterator, schema, path, value); +} +function* TBigInt(schema, references, path, value) { + if (!(0, guard_1.IsBigInt)(value)) + return yield Create(ValueErrorType.BigInt, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.BigIntExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.BigIntExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.BigIntMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.BigIntMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) { + yield Create(ValueErrorType.BigIntMultipleOf, schema, path, value); + } +} +function* TBoolean(schema, references, path, value) { + if (!(0, guard_1.IsBoolean)(value)) + yield Create(ValueErrorType.Boolean, schema, path, value); +} +function* TConstructor(schema, references, path, value) { + yield* Visit(schema.returns, references, path, value.prototype); +} +function* TDate(schema, references, path, value) { + if (!(0, guard_1.IsDate)(value)) + return yield Create(ValueErrorType.Date, schema, path, value); + if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) { + yield Create(ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) { + yield Create(ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value); + } + if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) { + yield Create(ValueErrorType.DateMaximumTimestamp, schema, path, value); + } + if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) { + yield Create(ValueErrorType.DateMinimumTimestamp, schema, path, value); + } + if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) { + yield Create(ValueErrorType.DateMultipleOfTimestamp, schema, path, value); + } +} +function* TFunction(schema, references, path, value) { + if (!(0, guard_1.IsFunction)(value)) + yield Create(ValueErrorType.Function, schema, path, value); +} +function* TInteger(schema, references, path, value) { + if (!(0, guard_1.IsInteger)(value)) + return yield Create(ValueErrorType.Integer, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.IntegerExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.IntegerExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.IntegerMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.IntegerMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + yield Create(ValueErrorType.IntegerMultipleOf, schema, path, value); + } +} +function* TIntersect(schema, references, path, value) { + for (const inner of schema.allOf) { + const next = Visit(inner, references, path, value).next(); + if (!next.done) { + yield Create(ValueErrorType.Intersect, schema, path, value); + yield next.value; + } + } + if (schema.unevaluatedProperties === false) { + const keyCheck = new RegExp(Types.KeyResolver.ResolvePattern(schema)); + for (const valueKey of Object.getOwnPropertyNames(value)) { + if (!keyCheck.test(valueKey)) { + yield Create(ValueErrorType.IntersectUnevaluatedProperties, schema, `${path}/${valueKey}`, value); + } + } + } + if (typeof schema.unevaluatedProperties === 'object') { + const keyCheck = new RegExp(Types.KeyResolver.ResolvePattern(schema)); + for (const valueKey of Object.getOwnPropertyNames(value)) { + if (!keyCheck.test(valueKey)) { + const next = Visit(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next(); + if (!next.done) + yield next.value; // yield interior + } + } + } +} +function* TIterator(schema, references, path, value) { + if (!(0, guard_1.IsIterator)(value)) + yield Create(ValueErrorType.Iterator, schema, path, value); +} +function* TLiteral(schema, references, path, value) { + if (!(value === schema.const)) + yield Create(ValueErrorType.Literal, schema, path, value); +} +function* TNever(schema, references, path, value) { + yield Create(ValueErrorType.Never, schema, path, value); +} +function* TNot(schema, references, path, value) { + if (Visit(schema.not, references, path, value).next().done === true) + yield Create(ValueErrorType.Not, schema, path, value); +} +function* TNull(schema, references, path, value) { + if (!(0, guard_1.IsNull)(value)) + yield Create(ValueErrorType.Null, schema, path, value); +} +function* TNumber(schema, references, path, value) { + if (!system_1.TypeSystemPolicy.IsNumberLike(value)) + return yield Create(ValueErrorType.Number, schema, path, value); + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + yield Create(ValueErrorType.NumberExclusiveMaximum, schema, path, value); + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + yield Create(ValueErrorType.NumberExclusiveMinimum, schema, path, value); + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + yield Create(ValueErrorType.NumberMaximum, schema, path, value); + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + yield Create(ValueErrorType.NumberMinimum, schema, path, value); + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + yield Create(ValueErrorType.NumberMultipleOf, schema, path, value); + } +} +function* TObject(schema, references, path, value) { + if (!system_1.TypeSystemPolicy.IsObjectLike(value)) + return yield Create(ValueErrorType.Object, schema, path, value); + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + yield Create(ValueErrorType.ObjectMinProperties, schema, path, value); + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value); + } + const requiredKeys = Array.isArray(schema.required) ? schema.required : []; + const knownKeys = Object.getOwnPropertyNames(schema.properties); + const unknownKeys = Object.getOwnPropertyNames(value); + for (const requiredKey of requiredKeys) { + if (unknownKeys.includes(requiredKey)) + continue; + yield Create(ValueErrorType.ObjectRequiredProperty, schema.properties[requiredKey], `${path}/${requiredKey}`, undefined); + } + if (schema.additionalProperties === false) { + for (const valueKey of unknownKeys) { + if (!knownKeys.includes(valueKey)) { + yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${valueKey}`, value[valueKey]); + } + } + } + if (typeof schema.additionalProperties === 'object') { + for (const valueKey of unknownKeys) { + if (knownKeys.includes(valueKey)) + continue; + yield* Visit(schema.additionalProperties, references, `${path}/${valueKey}`, value[valueKey]); + } + } + for (const knownKey of knownKeys) { + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + yield* Visit(property, references, `${path}/${knownKey}`, value[knownKey]); + if (Types.ExtendsUndefined.Check(schema) && !(knownKey in value)) { + yield Create(ValueErrorType.ObjectRequiredProperty, property, `${path}/${knownKey}`, undefined); + } + } + else { + if (system_1.TypeSystemPolicy.IsExactOptionalProperty(value, knownKey)) { + yield* Visit(property, references, `${path}/${knownKey}`, value[knownKey]); + } + } + } +} +function* TPromise(schema, references, path, value) { + if (!(0, guard_1.IsPromise)(value)) + yield Create(ValueErrorType.Promise, schema, path, value); +} +function* TRecord(schema, references, path, value) { + if (!system_1.TypeSystemPolicy.IsRecordLike(value)) + return yield Create(ValueErrorType.Object, schema, path, value); + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + yield Create(ValueErrorType.ObjectMinProperties, schema, path, value); + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + yield Create(ValueErrorType.ObjectMaxProperties, schema, path, value); + } + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const regex = new RegExp(patternKey); + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (regex.test(propertyKey)) + yield* Visit(patternSchema, references, `${path}/${propertyKey}`, propertyValue); + } + if (typeof schema.additionalProperties === 'object') { + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (!regex.test(propertyKey)) + yield* Visit(schema.additionalProperties, references, `${path}/${propertyKey}`, propertyValue); + } + } + if (schema.additionalProperties === false) { + for (const [propertyKey, propertyValue] of Object.entries(value)) { + if (regex.test(propertyKey)) + continue; + return yield Create(ValueErrorType.ObjectAdditionalProperties, schema, `${path}/${propertyKey}`, propertyValue); + } + } +} +function* TRef(schema, references, path, value) { + yield* Visit((0, deref_1.Deref)(schema, references), references, path, value); +} +function* TString(schema, references, path, value) { + if (!(0, guard_1.IsString)(value)) + return yield Create(ValueErrorType.String, schema, path, value); + if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) { + yield Create(ValueErrorType.StringMinLength, schema, path, value); + } + if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) { + yield Create(ValueErrorType.StringMaxLength, schema, path, value); + } + if ((0, guard_1.IsString)(schema.pattern)) { + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) { + yield Create(ValueErrorType.StringPattern, schema, path, value); + } + } + if ((0, guard_1.IsString)(schema.format)) { + if (!Types.FormatRegistry.Has(schema.format)) { + yield Create(ValueErrorType.StringFormatUnknown, schema, path, value); + } + else { + const format = Types.FormatRegistry.Get(schema.format); + if (!format(value)) { + yield Create(ValueErrorType.StringFormat, schema, path, value); + } + } + } +} +function* TSymbol(schema, references, path, value) { + if (!(0, guard_1.IsSymbol)(value)) + yield Create(ValueErrorType.Symbol, schema, path, value); +} +function* TTemplateLiteral(schema, references, path, value) { + if (!(0, guard_1.IsString)(value)) + return yield Create(ValueErrorType.String, schema, path, value); + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) { + yield Create(ValueErrorType.StringPattern, schema, path, value); + } +} +function* TThis(schema, references, path, value) { + yield* Visit((0, deref_1.Deref)(schema, references), references, path, value); +} +function* TTuple(schema, references, path, value) { + if (!(0, guard_1.IsArray)(value)) + return yield Create(ValueErrorType.Tuple, schema, path, value); + if (schema.items === undefined && !(value.length === 0)) { + return yield Create(ValueErrorType.TupleLength, schema, path, value); + } + if (!(value.length === schema.maxItems)) { + return yield Create(ValueErrorType.TupleLength, schema, path, value); + } + if (!schema.items) { + return; + } + for (let i = 0; i < schema.items.length; i++) { + yield* Visit(schema.items[i], references, `${path}/${i}`, value[i]); + } +} +function* TUndefined(schema, references, path, value) { + if (!(0, guard_1.IsUndefined)(value)) + yield Create(ValueErrorType.Undefined, schema, path, value); +} +function* TUnion(schema, references, path, value) { + let count = 0; + for (const subschema of schema.anyOf) { + const errors = [...Visit(subschema, references, path, value)]; + if (errors.length === 0) + return; // matched + count += errors.length; + } + if (count > 0) { + yield Create(ValueErrorType.Union, schema, path, value); + } +} +function* TUint8Array(schema, references, path, value) { + if (!(0, guard_1.IsUint8Array)(value)) + return yield Create(ValueErrorType.Uint8Array, schema, path, value); + if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) { + yield Create(ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value); + } + if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) { + yield Create(ValueErrorType.Uint8ArrayMinByteLength, schema, path, value); + } +} +function* TUnknown(schema, references, path, value) { } +function* TVoid(schema, references, path, value) { + if (!system_1.TypeSystemPolicy.IsVoidLike(value)) + yield Create(ValueErrorType.Void, schema, path, value); +} +function* TKind(schema, references, path, value) { + const check = Types.TypeRegistry.Get(schema[Types.Kind]); + if (!check(schema, value)) + yield Create(ValueErrorType.Kind, schema, path, value); +} +function* Visit(schema, references, path, value) { + const references_ = IsDefined(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + switch (schema_[Types.Kind]) { + case 'Any': + return yield* TAny(schema_, references_, path, value); + case 'Array': + return yield* TArray(schema_, references_, path, value); + case 'AsyncIterator': + return yield* TAsyncIterator(schema_, references_, path, value); + case 'BigInt': + return yield* TBigInt(schema_, references_, path, value); + case 'Boolean': + return yield* TBoolean(schema_, references_, path, value); + case 'Constructor': + return yield* TConstructor(schema_, references_, path, value); + case 'Date': + return yield* TDate(schema_, references_, path, value); + case 'Function': + return yield* TFunction(schema_, references_, path, value); + case 'Integer': + return yield* TInteger(schema_, references_, path, value); + case 'Intersect': + return yield* TIntersect(schema_, references_, path, value); + case 'Iterator': + return yield* TIterator(schema_, references_, path, value); + case 'Literal': + return yield* TLiteral(schema_, references_, path, value); + case 'Never': + return yield* TNever(schema_, references_, path, value); + case 'Not': + return yield* TNot(schema_, references_, path, value); + case 'Null': + return yield* TNull(schema_, references_, path, value); + case 'Number': + return yield* TNumber(schema_, references_, path, value); + case 'Object': + return yield* TObject(schema_, references_, path, value); + case 'Promise': + return yield* TPromise(schema_, references_, path, value); + case 'Record': + return yield* TRecord(schema_, references_, path, value); + case 'Ref': + return yield* TRef(schema_, references_, path, value); + case 'String': + return yield* TString(schema_, references_, path, value); + case 'Symbol': + return yield* TSymbol(schema_, references_, path, value); + case 'TemplateLiteral': + return yield* TTemplateLiteral(schema_, references_, path, value); + case 'This': + return yield* TThis(schema_, references_, path, value); + case 'Tuple': + return yield* TTuple(schema_, references_, path, value); + case 'Undefined': + return yield* TUndefined(schema_, references_, path, value); + case 'Union': + return yield* TUnion(schema_, references_, path, value); + case 'Uint8Array': + return yield* TUint8Array(schema_, references_, path, value); + case 'Unknown': + return yield* TUnknown(schema_, references_, path, value); + case 'Void': + return yield* TVoid(schema_, references_, path, value); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new ValueErrorsUnknownTypeError(schema); + return yield* TKind(schema_, references_, path, value); + } +} +/** Returns an iterator for each error in this value. */ +function Errors(...args) { + const iterator = args.length === 3 ? Visit(args[0], args[1], '', args[2]) : Visit(args[0], [], '', args[1]); + return new ValueErrorIterator(iterator); +} +exports.Errors = Errors; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/errors/index.js": +/*!********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/errors/index.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/errors + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__webpack_require__(/*! ./errors */ "./node_modules/@sinclair/typebox/errors/errors.js"), exports); + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/system/index.js": +/*!********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/system/index.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/system + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ValueErrorType = void 0; +var errors_1 = __webpack_require__(/*! ../errors/errors */ "./node_modules/@sinclair/typebox/errors/errors.js"); +Object.defineProperty(exports, "ValueErrorType", ({ enumerable: true, get: function () { return errors_1.ValueErrorType; } })); +__exportStar(__webpack_require__(/*! ./system */ "./node_modules/@sinclair/typebox/system/system.js"), exports); + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/system/system.js": +/*!*********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/system/system.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/system + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DefaultErrorFunction = exports.TypeSystemPolicy = exports.TypeSystemErrorFunction = exports.TypeSystem = exports.TypeSystemDuplicateFormat = exports.TypeSystemDuplicateTypeKind = void 0; +const guard_1 = __webpack_require__(/*! ../value/guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const errors_1 = __webpack_require__(/*! ../errors/errors */ "./node_modules/@sinclair/typebox/errors/errors.js"); +const Types = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class TypeSystemDuplicateTypeKind extends Types.TypeBoxError { + constructor(kind) { + super(`Duplicate type kind '${kind}' detected`); + } +} +exports.TypeSystemDuplicateTypeKind = TypeSystemDuplicateTypeKind; +class TypeSystemDuplicateFormat extends Types.TypeBoxError { + constructor(kind) { + super(`Duplicate string format '${kind}' detected`); + } +} +exports.TypeSystemDuplicateFormat = TypeSystemDuplicateFormat; +// ------------------------------------------------------------------------------------------- +// TypeSystem +// ------------------------------------------------------------------------------------------- +/** Creates user defined types and formats and provides overrides for value checking behaviours */ +var TypeSystem; +(function (TypeSystem) { + /** Creates a new type */ + function Type(kind, check) { + if (Types.TypeRegistry.Has(kind)) + throw new TypeSystemDuplicateTypeKind(kind); + Types.TypeRegistry.Set(kind, check); + return (options = {}) => Types.Type.Unsafe({ ...options, [Types.Kind]: kind }); + } + TypeSystem.Type = Type; + /** Creates a new string format */ + function Format(format, check) { + if (Types.FormatRegistry.Has(format)) + throw new TypeSystemDuplicateFormat(format); + Types.FormatRegistry.Set(format, check); + return format; + } + TypeSystem.Format = Format; +})(TypeSystem || (exports.TypeSystem = TypeSystem = {})); +// -------------------------------------------------------------------------- +// TypeSystemErrorFunction +// -------------------------------------------------------------------------- +/** Manages error message providers */ +var TypeSystemErrorFunction; +(function (TypeSystemErrorFunction) { + let errorMessageFunction = DefaultErrorFunction; + /** Resets the error message function to en-us */ + function Reset() { + errorMessageFunction = DefaultErrorFunction; + } + TypeSystemErrorFunction.Reset = Reset; + /** Sets the error message function used to generate error messages */ + function Set(callback) { + errorMessageFunction = callback; + } + TypeSystemErrorFunction.Set = Set; + /** Gets the error message function */ + function Get() { + return errorMessageFunction; + } + TypeSystemErrorFunction.Get = Get; +})(TypeSystemErrorFunction || (exports.TypeSystemErrorFunction = TypeSystemErrorFunction = {})); +// -------------------------------------------------------------------------- +// TypeSystemPolicy +// -------------------------------------------------------------------------- +/** Shared assertion routines used by the value and errors modules */ +var TypeSystemPolicy; +(function (TypeSystemPolicy) { + /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */ + TypeSystemPolicy.ExactOptionalPropertyTypes = false; + /** Sets whether arrays should be treated as a kind of objects. The default is `false` */ + TypeSystemPolicy.AllowArrayObject = false; + /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */ + TypeSystemPolicy.AllowNaN = false; + /** Sets whether `null` should validate for void types. The default is `false` */ + TypeSystemPolicy.AllowNullVoid = false; + /** Asserts this value using the ExactOptionalPropertyTypes policy */ + function IsExactOptionalProperty(value, key) { + return TypeSystemPolicy.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined; + } + TypeSystemPolicy.IsExactOptionalProperty = IsExactOptionalProperty; + /** Asserts this value using the AllowArrayObjects policy */ + function IsObjectLike(value) { + const isObject = (0, guard_1.IsObject)(value); + return TypeSystemPolicy.AllowArrayObject ? isObject : isObject && !(0, guard_1.IsArray)(value); + } + TypeSystemPolicy.IsObjectLike = IsObjectLike; + /** Asserts this value as a record using the AllowArrayObjects policy */ + function IsRecordLike(value) { + return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array); + } + TypeSystemPolicy.IsRecordLike = IsRecordLike; + /** Asserts this value using the AllowNaN policy */ + function IsNumberLike(value) { + const isNumber = (0, guard_1.IsNumber)(value); + return TypeSystemPolicy.AllowNaN ? isNumber : isNumber && Number.isFinite(value); + } + TypeSystemPolicy.IsNumberLike = IsNumberLike; + /** Asserts this value using the AllowVoidNull policy */ + function IsVoidLike(value) { + const isUndefined = (0, guard_1.IsUndefined)(value); + return TypeSystemPolicy.AllowNullVoid ? isUndefined || value === null : isUndefined; + } + TypeSystemPolicy.IsVoidLike = IsVoidLike; +})(TypeSystemPolicy || (exports.TypeSystemPolicy = TypeSystemPolicy = {})); +// -------------------------------------------------------------------------- +// DefaultErrorFunction +// -------------------------------------------------------------------------- +/** Creates an error message using en-US as the default locale */ +function DefaultErrorFunction(schema, errorType) { + switch (errorType) { + case errors_1.ValueErrorType.ArrayContains: + return 'Expected array to contain at least one matching value'; + case errors_1.ValueErrorType.ArrayMaxContains: + return `Expected array to contain no more than ${schema.maxContains} matching values`; + case errors_1.ValueErrorType.ArrayMinContains: + return `Expected array to contain at least ${schema.minContains} matching values`; + case errors_1.ValueErrorType.ArrayMaxItems: + return `Expected array length to be less or equal to ${schema.maxItems}`; + case errors_1.ValueErrorType.ArrayMinItems: + return `Expected array length to be greater or equal to ${schema.minItems}`; + case errors_1.ValueErrorType.ArrayUniqueItems: + return 'Expected array elements to be unique'; + case errors_1.ValueErrorType.Array: + return 'Expected array'; + case errors_1.ValueErrorType.AsyncIterator: + return 'Expected AsyncIterator'; + case errors_1.ValueErrorType.BigIntExclusiveMaximum: + return `Expected bigint to be less than ${schema.exclusiveMaximum}`; + case errors_1.ValueErrorType.BigIntExclusiveMinimum: + return `Expected bigint to be greater than ${schema.exclusiveMinimum}`; + case errors_1.ValueErrorType.BigIntMaximum: + return `Expected bigint to be less or equal to ${schema.maximum}`; + case errors_1.ValueErrorType.BigIntMinimum: + return `Expected bigint to be greater or equal to ${schema.minimum}`; + case errors_1.ValueErrorType.BigIntMultipleOf: + return `Expected bigint to be a multiple of ${schema.multipleOf}`; + case errors_1.ValueErrorType.BigInt: + return 'Expected bigint'; + case errors_1.ValueErrorType.Boolean: + return 'Expected boolean'; + case errors_1.ValueErrorType.DateExclusiveMinimumTimestamp: + return `Expected Date timestamp to be greater than ${schema.exclusiveMinimumTimestamp}`; + case errors_1.ValueErrorType.DateExclusiveMaximumTimestamp: + return `Expected Date timestamp to be less than ${schema.exclusiveMaximumTimestamp}`; + case errors_1.ValueErrorType.DateMinimumTimestamp: + return `Expected Date timestamp to be greater or equal to ${schema.minimumTimestamp}`; + case errors_1.ValueErrorType.DateMaximumTimestamp: + return `Expected Date timestamp to be less or equal to ${schema.maximumTimestamp}`; + case errors_1.ValueErrorType.DateMultipleOfTimestamp: + return `Expected Date timestamp to be a multiple of ${schema.multipleOfTimestamp}`; + case errors_1.ValueErrorType.Date: + return 'Expected Date'; + case errors_1.ValueErrorType.Function: + return 'Expected function'; + case errors_1.ValueErrorType.IntegerExclusiveMaximum: + return `Expected integer to be less than ${schema.exclusiveMaximum}`; + case errors_1.ValueErrorType.IntegerExclusiveMinimum: + return `Expected integer to be greater than ${schema.exclusiveMinimum}`; + case errors_1.ValueErrorType.IntegerMaximum: + return `Expected integer to be less or equal to ${schema.maximum}`; + case errors_1.ValueErrorType.IntegerMinimum: + return `Expected integer to be greater or equal to ${schema.minimum}`; + case errors_1.ValueErrorType.IntegerMultipleOf: + return `Expected integer to be a multiple of ${schema.multipleOf}`; + case errors_1.ValueErrorType.Integer: + return 'Expected integer'; + case errors_1.ValueErrorType.IntersectUnevaluatedProperties: + return 'Unexpected property'; + case errors_1.ValueErrorType.Intersect: + return 'Expected all values to match'; + case errors_1.ValueErrorType.Iterator: + return 'Expected Iterator'; + case errors_1.ValueErrorType.Literal: + return `Expected ${typeof schema.const === 'string' ? `'${schema.const}'` : schema.const}`; + case errors_1.ValueErrorType.Never: + return 'Never'; + case errors_1.ValueErrorType.Not: + return 'Value should not match'; + case errors_1.ValueErrorType.Null: + return 'Expected null'; + case errors_1.ValueErrorType.NumberExclusiveMaximum: + return `Expected number to be less than ${schema.exclusiveMaximum}`; + case errors_1.ValueErrorType.NumberExclusiveMinimum: + return `Expected number to be greater than ${schema.exclusiveMinimum}`; + case errors_1.ValueErrorType.NumberMaximum: + return `Expected number to be less or equal to ${schema.maximum}`; + case errors_1.ValueErrorType.NumberMinimum: + return `Expected number to be greater or equal to ${schema.minimum}`; + case errors_1.ValueErrorType.NumberMultipleOf: + return `Expected number to be a multiple of ${schema.multipleOf}`; + case errors_1.ValueErrorType.Number: + return 'Expected number'; + case errors_1.ValueErrorType.Object: + return 'Expected object'; + case errors_1.ValueErrorType.ObjectAdditionalProperties: + return 'Unexpected property'; + case errors_1.ValueErrorType.ObjectMaxProperties: + return `Expected object to have no more than ${schema.maxProperties} properties`; + case errors_1.ValueErrorType.ObjectMinProperties: + return `Expected object to have at least ${schema.minProperties} properties`; + case errors_1.ValueErrorType.ObjectRequiredProperty: + return 'Required property'; + case errors_1.ValueErrorType.Promise: + return 'Expected Promise'; + case errors_1.ValueErrorType.StringFormatUnknown: + return `Unknown format '${schema.format}'`; + case errors_1.ValueErrorType.StringFormat: + return `Expected string to match '${schema.format}' format`; + case errors_1.ValueErrorType.StringMaxLength: + return `Expected string length less or equal to ${schema.maxLength}`; + case errors_1.ValueErrorType.StringMinLength: + return `Expected string length greater or equal to ${schema.minLength}`; + case errors_1.ValueErrorType.StringPattern: + return `Expected string to match '${schema.pattern}'`; + case errors_1.ValueErrorType.String: + return 'Expected string'; + case errors_1.ValueErrorType.Symbol: + return 'Expected symbol'; + case errors_1.ValueErrorType.TupleLength: + return `Expected tuple to have ${schema.maxItems || 0} elements`; + case errors_1.ValueErrorType.Tuple: + return 'Expected tuple'; + case errors_1.ValueErrorType.Uint8ArrayMaxByteLength: + return `Expected byte length less or equal to ${schema.maxByteLength}`; + case errors_1.ValueErrorType.Uint8ArrayMinByteLength: + return `Expected byte length greater or equal to ${schema.minByteLength}`; + case errors_1.ValueErrorType.Uint8Array: + return 'Expected Uint8Array'; + case errors_1.ValueErrorType.Undefined: + return 'Expected undefined'; + case errors_1.ValueErrorType.Union: + return 'Expected union value'; + case errors_1.ValueErrorType.Void: + return 'Expected void'; + case errors_1.ValueErrorType.Kind: + return `Expected kind '${schema[Types.Kind]}'`; + default: + return 'Unknown error type'; + } +} +exports.DefaultErrorFunction = DefaultErrorFunction; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/typebox.js": +/*!***************************************************!*\ + !*** ./node_modules/@sinclair/typebox/typebox.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Type = exports.JsonType = exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = exports.TypeBuilder = exports.TypeBuilderError = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = exports.TemplateLiteralDslParser = exports.TemplateLiteralGenerator = exports.TemplateLiteralGeneratorError = exports.TemplateLiteralFinite = exports.TemplateLiteralFiniteError = exports.TemplateLiteralParser = exports.TemplateLiteralParserError = exports.TemplateLiteralResolver = exports.TemplateLiteralPattern = exports.TemplateLiteralPatternError = exports.UnionResolver = exports.KeyArrayResolver = exports.KeyArrayResolverError = exports.KeyResolver = exports.ObjectMap = exports.Intrinsic = exports.IndexedAccessor = exports.TypeClone = exports.TypeExtends = exports.TypeExtendsResult = exports.TypeExtendsError = exports.ExtendsUndefined = exports.TypeGuard = exports.TypeGuardUnknownTypeError = exports.ValueGuard = exports.FormatRegistry = exports.TypeBoxError = exports.TypeRegistry = exports.PatternStringExact = exports.PatternNumberExact = exports.PatternBooleanExact = exports.PatternString = exports.PatternNumber = exports.PatternBoolean = exports.Kind = exports.Hint = exports.Optional = exports.Readonly = exports.Transform = void 0; +// -------------------------------------------------------------------------- +// Symbols +// -------------------------------------------------------------------------- +exports.Transform = Symbol.for('TypeBox.Transform'); +exports.Readonly = Symbol.for('TypeBox.Readonly'); +exports.Optional = Symbol.for('TypeBox.Optional'); +exports.Hint = Symbol.for('TypeBox.Hint'); +exports.Kind = Symbol.for('TypeBox.Kind'); +// -------------------------------------------------------------------------- +// Patterns +// -------------------------------------------------------------------------- +exports.PatternBoolean = '(true|false)'; +exports.PatternNumber = '(0|[1-9][0-9]*)'; +exports.PatternString = '(.*)'; +exports.PatternBooleanExact = `^${exports.PatternBoolean}$`; +exports.PatternNumberExact = `^${exports.PatternNumber}$`; +exports.PatternStringExact = `^${exports.PatternString}$`; +/** A registry for user defined types */ +var TypeRegistry; +(function (TypeRegistry) { + const map = new Map(); + /** Returns the entries in this registry */ + function Entries() { + return new Map(map); + } + TypeRegistry.Entries = Entries; + /** Clears all user defined types */ + function Clear() { + return map.clear(); + } + TypeRegistry.Clear = Clear; + /** Deletes a registered type */ + function Delete(kind) { + return map.delete(kind); + } + TypeRegistry.Delete = Delete; + /** Returns true if this registry contains this kind */ + function Has(kind) { + return map.has(kind); + } + TypeRegistry.Has = Has; + /** Sets a validation function for a user defined type */ + function Set(kind, func) { + map.set(kind, func); + } + TypeRegistry.Set = Set; + /** Gets a custom validation function for a user defined type */ + function Get(kind) { + return map.get(kind); + } + TypeRegistry.Get = Get; +})(TypeRegistry || (exports.TypeRegistry = TypeRegistry = {})); +// -------------------------------------------------------------------------- +// TypeBoxError +// -------------------------------------------------------------------------- +class TypeBoxError extends Error { + constructor(message) { + super(message); + } +} +exports.TypeBoxError = TypeBoxError; +/** A registry for user defined string formats */ +var FormatRegistry; +(function (FormatRegistry) { + const map = new Map(); + /** Returns the entries in this registry */ + function Entries() { + return new Map(map); + } + FormatRegistry.Entries = Entries; + /** Clears all user defined string formats */ + function Clear() { + return map.clear(); + } + FormatRegistry.Clear = Clear; + /** Deletes a registered format */ + function Delete(format) { + return map.delete(format); + } + FormatRegistry.Delete = Delete; + /** Returns true if the user defined string format exists */ + function Has(format) { + return map.has(format); + } + FormatRegistry.Has = Has; + /** Sets a validation function for a user defined string format */ + function Set(format, func) { + map.set(format, func); + } + FormatRegistry.Set = Set; + /** Gets a validation function for a user defined string format */ + function Get(format) { + return map.get(format); + } + FormatRegistry.Get = Get; +})(FormatRegistry || (exports.FormatRegistry = FormatRegistry = {})); +// -------------------------------------------------------------------------- +// ValueGuard +// -------------------------------------------------------------------------- +/** Provides functions to type guard raw JavaScript values */ +var ValueGuard; +(function (ValueGuard) { + /** Returns true if this value is an array */ + function IsArray(value) { + return Array.isArray(value); + } + ValueGuard.IsArray = IsArray; + /** Returns true if this value is bigint */ + function IsBigInt(value) { + return typeof value === 'bigint'; + } + ValueGuard.IsBigInt = IsBigInt; + /** Returns true if this value is a boolean */ + function IsBoolean(value) { + return typeof value === 'boolean'; + } + ValueGuard.IsBoolean = IsBoolean; + /** Returns true if this value is null */ + function IsNull(value) { + return value === null; + } + ValueGuard.IsNull = IsNull; + /** Returns true if this value is number */ + function IsNumber(value) { + return typeof value === 'number'; + } + ValueGuard.IsNumber = IsNumber; + /** Returns true if this value is an object */ + function IsObject(value) { + return typeof value === 'object' && value !== null; + } + ValueGuard.IsObject = IsObject; + /** Returns true if this value is string */ + function IsString(value) { + return typeof value === 'string'; + } + ValueGuard.IsString = IsString; + /** Returns true if this value is undefined */ + function IsUndefined(value) { + return value === undefined; + } + ValueGuard.IsUndefined = IsUndefined; +})(ValueGuard || (exports.ValueGuard = ValueGuard = {})); +// -------------------------------------------------------------------------- +// TypeGuard +// -------------------------------------------------------------------------- +class TypeGuardUnknownTypeError extends TypeBoxError { +} +exports.TypeGuardUnknownTypeError = TypeGuardUnknownTypeError; +/** Provides functions to test if JavaScript values are TypeBox types */ +var TypeGuard; +(function (TypeGuard) { + function IsPattern(value) { + try { + new RegExp(value); + return true; + } + catch { + return false; + } + } + function IsControlCharacterFree(value) { + if (!ValueGuard.IsString(value)) + return false; + for (let i = 0; i < value.length; i++) { + const code = value.charCodeAt(i); + if ((code >= 7 && code <= 13) || code === 27 || code === 127) { + return false; + } + } + return true; + } + function IsAdditionalProperties(value) { + return IsOptionalBoolean(value) || TSchema(value); + } + function IsOptionalBigInt(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsBigInt(value); + } + function IsOptionalNumber(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsNumber(value); + } + function IsOptionalBoolean(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsBoolean(value); + } + function IsOptionalString(value) { + return ValueGuard.IsUndefined(value) || ValueGuard.IsString(value); + } + function IsOptionalPattern(value) { + return ValueGuard.IsUndefined(value) || (ValueGuard.IsString(value) && IsControlCharacterFree(value) && IsPattern(value)); + } + function IsOptionalFormat(value) { + return ValueGuard.IsUndefined(value) || (ValueGuard.IsString(value) && IsControlCharacterFree(value)); + } + function IsOptionalSchema(value) { + return ValueGuard.IsUndefined(value) || TSchema(value); + } + /** Returns true if the given value is TAny */ + function TAny(schema) { + // prettier-ignore + return (TKindOf(schema, 'Any') && + IsOptionalString(schema.$id)); + } + TypeGuard.TAny = TAny; + /** Returns true if the given value is TArray */ + function TArray(schema) { + return (TKindOf(schema, 'Array') && + schema.type === 'array' && + IsOptionalString(schema.$id) && + TSchema(schema.items) && + IsOptionalNumber(schema.minItems) && + IsOptionalNumber(schema.maxItems) && + IsOptionalBoolean(schema.uniqueItems) && + IsOptionalSchema(schema.contains) && + IsOptionalNumber(schema.minContains) && + IsOptionalNumber(schema.maxContains)); + } + TypeGuard.TArray = TArray; + /** Returns true if the given value is TAsyncIterator */ + function TAsyncIterator(schema) { + // prettier-ignore + return (TKindOf(schema, 'AsyncIterator') && + schema.type === 'AsyncIterator' && + IsOptionalString(schema.$id) && + TSchema(schema.items)); + } + TypeGuard.TAsyncIterator = TAsyncIterator; + /** Returns true if the given value is TBigInt */ + function TBigInt(schema) { + // prettier-ignore + return (TKindOf(schema, 'BigInt') && + schema.type === 'bigint' && + IsOptionalString(schema.$id) && + IsOptionalBigInt(schema.exclusiveMaximum) && + IsOptionalBigInt(schema.exclusiveMinimum) && + IsOptionalBigInt(schema.maximum) && + IsOptionalBigInt(schema.minimum) && + IsOptionalBigInt(schema.multipleOf)); + } + TypeGuard.TBigInt = TBigInt; + /** Returns true if the given value is TBoolean */ + function TBoolean(schema) { + // prettier-ignore + return (TKindOf(schema, 'Boolean') && + schema.type === 'boolean' && + IsOptionalString(schema.$id)); + } + TypeGuard.TBoolean = TBoolean; + /** Returns true if the given value is TConstructor */ + function TConstructor(schema) { + // prettier-ignore + return (TKindOf(schema, 'Constructor') && + schema.type === 'Constructor' && + IsOptionalString(schema.$id) && + ValueGuard.IsArray(schema.parameters) && + schema.parameters.every(schema => TSchema(schema)) && + TSchema(schema.returns)); + } + TypeGuard.TConstructor = TConstructor; + /** Returns true if the given value is TDate */ + function TDate(schema) { + return (TKindOf(schema, 'Date') && + schema.type === 'Date' && + IsOptionalString(schema.$id) && + IsOptionalNumber(schema.exclusiveMaximumTimestamp) && + IsOptionalNumber(schema.exclusiveMinimumTimestamp) && + IsOptionalNumber(schema.maximumTimestamp) && + IsOptionalNumber(schema.minimumTimestamp) && + IsOptionalNumber(schema.multipleOfTimestamp)); + } + TypeGuard.TDate = TDate; + /** Returns true if the given value is TFunction */ + function TFunction(schema) { + // prettier-ignore + return (TKindOf(schema, 'Function') && + schema.type === 'Function' && + IsOptionalString(schema.$id) && + ValueGuard.IsArray(schema.parameters) && + schema.parameters.every(schema => TSchema(schema)) && + TSchema(schema.returns)); + } + TypeGuard.TFunction = TFunction; + /** Returns true if the given value is TInteger */ + function TInteger(schema) { + return (TKindOf(schema, 'Integer') && + schema.type === 'integer' && + IsOptionalString(schema.$id) && + IsOptionalNumber(schema.exclusiveMaximum) && + IsOptionalNumber(schema.exclusiveMinimum) && + IsOptionalNumber(schema.maximum) && + IsOptionalNumber(schema.minimum) && + IsOptionalNumber(schema.multipleOf)); + } + TypeGuard.TInteger = TInteger; + /** Returns true if the given value is TIntersect */ + function TIntersect(schema) { + // prettier-ignore + return (TKindOf(schema, 'Intersect') && + (ValueGuard.IsString(schema.type) && schema.type !== 'object' ? false : true) && + ValueGuard.IsArray(schema.allOf) && + schema.allOf.every(schema => TSchema(schema) && !TTransform(schema)) && + IsOptionalString(schema.type) && + (IsOptionalBoolean(schema.unevaluatedProperties) || IsOptionalSchema(schema.unevaluatedProperties)) && + IsOptionalString(schema.$id)); + } + TypeGuard.TIntersect = TIntersect; + /** Returns true if the given value is TIterator */ + function TIterator(schema) { + // prettier-ignore + return (TKindOf(schema, 'Iterator') && + schema.type === 'Iterator' && + IsOptionalString(schema.$id) && + TSchema(schema.items)); + } + TypeGuard.TIterator = TIterator; + /** Returns true if the given value is a TKind with the given name. */ + function TKindOf(schema, kind) { + return TKind(schema) && schema[exports.Kind] === kind; + } + TypeGuard.TKindOf = TKindOf; + /** Returns true if the given value is TKind */ + function TKind(schema) { + return ValueGuard.IsObject(schema) && exports.Kind in schema && ValueGuard.IsString(schema[exports.Kind]); + } + TypeGuard.TKind = TKind; + /** Returns true if the given value is TLiteral */ + function TLiteralString(schema) { + return TLiteral(schema) && ValueGuard.IsString(schema.const); + } + TypeGuard.TLiteralString = TLiteralString; + /** Returns true if the given value is TLiteral */ + function TLiteralNumber(schema) { + return TLiteral(schema) && ValueGuard.IsNumber(schema.const); + } + TypeGuard.TLiteralNumber = TLiteralNumber; + /** Returns true if the given value is TLiteral */ + function TLiteralBoolean(schema) { + return TLiteral(schema) && ValueGuard.IsBoolean(schema.const); + } + TypeGuard.TLiteralBoolean = TLiteralBoolean; + /** Returns true if the given value is TLiteral */ + function TLiteral(schema) { + // prettier-ignore + return (TKindOf(schema, 'Literal') && + IsOptionalString(schema.$id) && (ValueGuard.IsBoolean(schema.const) || + ValueGuard.IsNumber(schema.const) || + ValueGuard.IsString(schema.const))); + } + TypeGuard.TLiteral = TLiteral; + /** Returns true if the given value is TNever */ + function TNever(schema) { + // prettier-ignore + return (TKindOf(schema, 'Never') && + ValueGuard.IsObject(schema.not) && + Object.getOwnPropertyNames(schema.not).length === 0); + } + TypeGuard.TNever = TNever; + /** Returns true if the given value is TNot */ + function TNot(schema) { + // prettier-ignore + return (TKindOf(schema, 'Not') && + TSchema(schema.not)); + } + TypeGuard.TNot = TNot; + /** Returns true if the given value is TNull */ + function TNull(schema) { + // prettier-ignore + return (TKindOf(schema, 'Null') && + schema.type === 'null' && + IsOptionalString(schema.$id)); + } + TypeGuard.TNull = TNull; + /** Returns true if the given value is TNumber */ + function TNumber(schema) { + return (TKindOf(schema, 'Number') && + schema.type === 'number' && + IsOptionalString(schema.$id) && + IsOptionalNumber(schema.exclusiveMaximum) && + IsOptionalNumber(schema.exclusiveMinimum) && + IsOptionalNumber(schema.maximum) && + IsOptionalNumber(schema.minimum) && + IsOptionalNumber(schema.multipleOf)); + } + TypeGuard.TNumber = TNumber; + /** Returns true if the given value is TObject */ + function TObject(schema) { + // prettier-ignore + return (TKindOf(schema, 'Object') && + schema.type === 'object' && + IsOptionalString(schema.$id) && + ValueGuard.IsObject(schema.properties) && + IsAdditionalProperties(schema.additionalProperties) && + IsOptionalNumber(schema.minProperties) && + IsOptionalNumber(schema.maxProperties) && + Object.entries(schema.properties).every(([key, schema]) => IsControlCharacterFree(key) && TSchema(schema))); + } + TypeGuard.TObject = TObject; + /** Returns true if the given value is TPromise */ + function TPromise(schema) { + // prettier-ignore + return (TKindOf(schema, 'Promise') && + schema.type === 'Promise' && + IsOptionalString(schema.$id) && + TSchema(schema.item)); + } + TypeGuard.TPromise = TPromise; + /** Returns true if the given value is TRecord */ + function TRecord(schema) { + // prettier-ignore + return (TKindOf(schema, 'Record') && + schema.type === 'object' && + IsOptionalString(schema.$id) && + IsAdditionalProperties(schema.additionalProperties) && + ValueGuard.IsObject(schema.patternProperties) && + ((schema) => { + const keys = Object.getOwnPropertyNames(schema.patternProperties); + return (keys.length === 1 && + IsPattern(keys[0]) && + ValueGuard.IsObject(schema.patternProperties) && + TSchema(schema.patternProperties[keys[0]])); + })(schema)); + } + TypeGuard.TRecord = TRecord; + /** Returns true if this value is TRecursive */ + function TRecursive(schema) { + return ValueGuard.IsObject(schema) && exports.Hint in schema && schema[exports.Hint] === 'Recursive'; + } + TypeGuard.TRecursive = TRecursive; + /** Returns true if the given value is TRef */ + function TRef(schema) { + // prettier-ignore + return (TKindOf(schema, 'Ref') && + IsOptionalString(schema.$id) && + ValueGuard.IsString(schema.$ref)); + } + TypeGuard.TRef = TRef; + /** Returns true if the given value is TString */ + function TString(schema) { + // prettier-ignore + return (TKindOf(schema, 'String') && + schema.type === 'string' && + IsOptionalString(schema.$id) && + IsOptionalNumber(schema.minLength) && + IsOptionalNumber(schema.maxLength) && + IsOptionalPattern(schema.pattern) && + IsOptionalFormat(schema.format)); + } + TypeGuard.TString = TString; + /** Returns true if the given value is TSymbol */ + function TSymbol(schema) { + // prettier-ignore + return (TKindOf(schema, 'Symbol') && + schema.type === 'symbol' && + IsOptionalString(schema.$id)); + } + TypeGuard.TSymbol = TSymbol; + /** Returns true if the given value is TTemplateLiteral */ + function TTemplateLiteral(schema) { + // prettier-ignore + return (TKindOf(schema, 'TemplateLiteral') && + schema.type === 'string' && + ValueGuard.IsString(schema.pattern) && + schema.pattern[0] === '^' && + schema.pattern[schema.pattern.length - 1] === '$'); + } + TypeGuard.TTemplateLiteral = TTemplateLiteral; + /** Returns true if the given value is TThis */ + function TThis(schema) { + // prettier-ignore + return (TKindOf(schema, 'This') && + IsOptionalString(schema.$id) && + ValueGuard.IsString(schema.$ref)); + } + TypeGuard.TThis = TThis; + /** Returns true of this value is TTransform */ + function TTransform(schema) { + return ValueGuard.IsObject(schema) && exports.Transform in schema; + } + TypeGuard.TTransform = TTransform; + /** Returns true if the given value is TTuple */ + function TTuple(schema) { + // prettier-ignore + return (TKindOf(schema, 'Tuple') && + schema.type === 'array' && + IsOptionalString(schema.$id) && + ValueGuard.IsNumber(schema.minItems) && + ValueGuard.IsNumber(schema.maxItems) && + schema.minItems === schema.maxItems && + (( // empty + ValueGuard.IsUndefined(schema.items) && + ValueGuard.IsUndefined(schema.additionalItems) && + schema.minItems === 0) || (ValueGuard.IsArray(schema.items) && + schema.items.every(schema => TSchema(schema))))); + } + TypeGuard.TTuple = TTuple; + /** Returns true if the given value is TUndefined */ + function TUndefined(schema) { + // prettier-ignore + return (TKindOf(schema, 'Undefined') && + schema.type === 'undefined' && + IsOptionalString(schema.$id)); + } + TypeGuard.TUndefined = TUndefined; + /** Returns true if the given value is TUnion[]> */ + function TUnionLiteral(schema) { + return TUnion(schema) && schema.anyOf.every((schema) => TLiteralString(schema) || TLiteralNumber(schema)); + } + TypeGuard.TUnionLiteral = TUnionLiteral; + /** Returns true if the given value is TUnion */ + function TUnion(schema) { + // prettier-ignore + return (TKindOf(schema, 'Union') && + IsOptionalString(schema.$id) && + ValueGuard.IsObject(schema) && + ValueGuard.IsArray(schema.anyOf) && + schema.anyOf.every(schema => TSchema(schema))); + } + TypeGuard.TUnion = TUnion; + /** Returns true if the given value is TUint8Array */ + function TUint8Array(schema) { + // prettier-ignore + return (TKindOf(schema, 'Uint8Array') && + schema.type === 'Uint8Array' && + IsOptionalString(schema.$id) && + IsOptionalNumber(schema.minByteLength) && + IsOptionalNumber(schema.maxByteLength)); + } + TypeGuard.TUint8Array = TUint8Array; + /** Returns true if the given value is TUnknown */ + function TUnknown(schema) { + // prettier-ignore + return (TKindOf(schema, 'Unknown') && + IsOptionalString(schema.$id)); + } + TypeGuard.TUnknown = TUnknown; + /** Returns true if the given value is a raw TUnsafe */ + function TUnsafe(schema) { + return TKindOf(schema, 'Unsafe'); + } + TypeGuard.TUnsafe = TUnsafe; + /** Returns true if the given value is TVoid */ + function TVoid(schema) { + // prettier-ignore + return (TKindOf(schema, 'Void') && + schema.type === 'void' && + IsOptionalString(schema.$id)); + } + TypeGuard.TVoid = TVoid; + /** Returns true if this value has a Readonly symbol */ + function TReadonly(schema) { + return ValueGuard.IsObject(schema) && schema[exports.Readonly] === 'Readonly'; + } + TypeGuard.TReadonly = TReadonly; + /** Returns true if this value has a Optional symbol */ + function TOptional(schema) { + return ValueGuard.IsObject(schema) && schema[exports.Optional] === 'Optional'; + } + TypeGuard.TOptional = TOptional; + /** Returns true if the given value is TSchema */ + function TSchema(schema) { + return (ValueGuard.IsObject(schema) && + (TAny(schema) || + TArray(schema) || + TBoolean(schema) || + TBigInt(schema) || + TAsyncIterator(schema) || + TConstructor(schema) || + TDate(schema) || + TFunction(schema) || + TInteger(schema) || + TIntersect(schema) || + TIterator(schema) || + TLiteral(schema) || + TNever(schema) || + TNot(schema) || + TNull(schema) || + TNumber(schema) || + TObject(schema) || + TPromise(schema) || + TRecord(schema) || + TRef(schema) || + TString(schema) || + TSymbol(schema) || + TTemplateLiteral(schema) || + TThis(schema) || + TTuple(schema) || + TUndefined(schema) || + TUnion(schema) || + TUint8Array(schema) || + TUnknown(schema) || + TUnsafe(schema) || + TVoid(schema) || + (TKind(schema) && TypeRegistry.Has(schema[exports.Kind])))); + } + TypeGuard.TSchema = TSchema; +})(TypeGuard || (exports.TypeGuard = TypeGuard = {})); +// -------------------------------------------------------------------------- +// ExtendsUndefined +// -------------------------------------------------------------------------- +/** Fast undefined check used for properties of type undefined */ +var ExtendsUndefined; +(function (ExtendsUndefined) { + function Check(schema) { + return schema[exports.Kind] === 'Intersect' + ? schema.allOf.every((schema) => Check(schema)) + : schema[exports.Kind] === 'Union' + ? schema.anyOf.some((schema) => Check(schema)) + : schema[exports.Kind] === 'Undefined' + ? true + : schema[exports.Kind] === 'Not' + ? !Check(schema.not) + : false; + } + ExtendsUndefined.Check = Check; +})(ExtendsUndefined || (exports.ExtendsUndefined = ExtendsUndefined = {})); +// -------------------------------------------------------------------------- +// TypeExtends +// -------------------------------------------------------------------------- +class TypeExtendsError extends TypeBoxError { +} +exports.TypeExtendsError = TypeExtendsError; +var TypeExtendsResult; +(function (TypeExtendsResult) { + TypeExtendsResult[TypeExtendsResult["Union"] = 0] = "Union"; + TypeExtendsResult[TypeExtendsResult["True"] = 1] = "True"; + TypeExtendsResult[TypeExtendsResult["False"] = 2] = "False"; +})(TypeExtendsResult || (exports.TypeExtendsResult = TypeExtendsResult = {})); +var TypeExtends; +(function (TypeExtends) { + // -------------------------------------------------------------------------- + // IntoBooleanResult + // -------------------------------------------------------------------------- + function IntoBooleanResult(result) { + return result === TypeExtendsResult.False ? result : TypeExtendsResult.True; + } + // -------------------------------------------------------------------------- + // Throw + // -------------------------------------------------------------------------- + function Throw(message) { + throw new TypeExtendsError(message); + } + // -------------------------------------------------------------------------- + // StructuralRight + // -------------------------------------------------------------------------- + function IsStructuralRight(right) { + // prettier-ignore + return (TypeGuard.TNever(right) || + TypeGuard.TIntersect(right) || + TypeGuard.TUnion(right) || + TypeGuard.TUnknown(right) || + TypeGuard.TAny(right)); + } + function StructuralRight(left, right) { + // prettier-ignore + return (TypeGuard.TNever(right) ? TNeverRight(left, right) : + TypeGuard.TIntersect(right) ? TIntersectRight(left, right) : + TypeGuard.TUnion(right) ? TUnionRight(left, right) : + TypeGuard.TUnknown(right) ? TUnknownRight(left, right) : + TypeGuard.TAny(right) ? TAnyRight(left, right) : + Throw('StructuralRight')); + } + // -------------------------------------------------------------------------- + // Any + // -------------------------------------------------------------------------- + function TAnyRight(left, right) { + return TypeExtendsResult.True; + } + function TAny(left, right) { + // prettier-ignore + return (TypeGuard.TIntersect(right) ? TIntersectRight(left, right) : + (TypeGuard.TUnion(right) && right.anyOf.some((schema) => TypeGuard.TAny(schema) || TypeGuard.TUnknown(schema))) ? TypeExtendsResult.True : + TypeGuard.TUnion(right) ? TypeExtendsResult.Union : + TypeGuard.TUnknown(right) ? TypeExtendsResult.True : + TypeGuard.TAny(right) ? TypeExtendsResult.True : + TypeExtendsResult.Union); + } + // -------------------------------------------------------------------------- + // Array + // -------------------------------------------------------------------------- + function TArrayRight(left, right) { + // prettier-ignore + return (TypeGuard.TUnknown(left) ? TypeExtendsResult.False : + TypeGuard.TAny(left) ? TypeExtendsResult.Union : + TypeGuard.TNever(left) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + function TArray(left, right) { + // prettier-ignore + return (TypeGuard.TObject(right) && IsObjectArrayLike(right) ? TypeExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + !TypeGuard.TArray(right) ? TypeExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); + } + // -------------------------------------------------------------------------- + // AsyncIterator + // -------------------------------------------------------------------------- + function TAsyncIterator(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + !TypeGuard.TAsyncIterator(right) ? TypeExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); + } + // -------------------------------------------------------------------------- + // BigInt + // -------------------------------------------------------------------------- + function TBigInt(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TBigInt(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Boolean + // -------------------------------------------------------------------------- + function TBooleanRight(left, right) { + return TypeGuard.TLiteral(left) && ValueGuard.IsBoolean(left.const) ? TypeExtendsResult.True : TypeGuard.TBoolean(left) ? TypeExtendsResult.True : TypeExtendsResult.False; + } + function TBoolean(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TBoolean(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Constructor + // -------------------------------------------------------------------------- + function TConstructor(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + !TypeGuard.TConstructor(right) ? TypeExtendsResult.False : + left.parameters.length > right.parameters.length ? TypeExtendsResult.False : + (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === TypeExtendsResult.True)) ? TypeExtendsResult.False : + IntoBooleanResult(Visit(left.returns, right.returns))); + } + // -------------------------------------------------------------------------- + // Date + // -------------------------------------------------------------------------- + function TDate(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TDate(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Function + // -------------------------------------------------------------------------- + function TFunction(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + !TypeGuard.TFunction(right) ? TypeExtendsResult.False : + left.parameters.length > right.parameters.length ? TypeExtendsResult.False : + (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === TypeExtendsResult.True)) ? TypeExtendsResult.False : + IntoBooleanResult(Visit(left.returns, right.returns))); + } + // -------------------------------------------------------------------------- + // Integer + // -------------------------------------------------------------------------- + function TIntegerRight(left, right) { + // prettier-ignore + return (TypeGuard.TLiteral(left) && ValueGuard.IsNumber(left.const) ? TypeExtendsResult.True : + TypeGuard.TNumber(left) || TypeGuard.TInteger(left) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + function TInteger(left, right) { + // prettier-ignore + return (TypeGuard.TInteger(right) || TypeGuard.TNumber(right) ? TypeExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Intersect + // -------------------------------------------------------------------------- + function TIntersectRight(left, right) { + // prettier-ignore + return right.allOf.every((schema) => Visit(left, schema) === TypeExtendsResult.True) + ? TypeExtendsResult.True + : TypeExtendsResult.False; + } + function TIntersect(left, right) { + // prettier-ignore + return left.allOf.some((schema) => Visit(schema, right) === TypeExtendsResult.True) + ? TypeExtendsResult.True + : TypeExtendsResult.False; + } + // -------------------------------------------------------------------------- + // Iterator + // -------------------------------------------------------------------------- + function TIterator(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + !TypeGuard.TIterator(right) ? TypeExtendsResult.False : + IntoBooleanResult(Visit(left.items, right.items))); + } + // -------------------------------------------------------------------------- + // Literal + // -------------------------------------------------------------------------- + function TLiteral(left, right) { + // prettier-ignore + return (TypeGuard.TLiteral(right) && right.const === left.const ? TypeExtendsResult.True : + IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TString(right) ? TStringRight(left, right) : + TypeGuard.TNumber(right) ? TNumberRight(left, right) : + TypeGuard.TInteger(right) ? TIntegerRight(left, right) : + TypeGuard.TBoolean(right) ? TBooleanRight(left, right) : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Never + // -------------------------------------------------------------------------- + function TNeverRight(left, right) { + return TypeExtendsResult.False; + } + function TNever(left, right) { + return TypeExtendsResult.True; + } + // -------------------------------------------------------------------------- + // Not + // -------------------------------------------------------------------------- + function UnwrapTNot(schema) { + let [current, depth] = [schema, 0]; + while (true) { + if (!TypeGuard.TNot(current)) + break; + current = current.not; + depth += 1; + } + return depth % 2 === 0 ? current : exports.Type.Unknown(); + } + function TNot(left, right) { + // TypeScript has no concept of negated types, and attempts to correctly check the negated + // type at runtime would put TypeBox at odds with TypeScripts ability to statically infer + // the type. Instead we unwrap to either unknown or T and continue evaluating. + // prettier-ignore + return (TypeGuard.TNot(left) ? Visit(UnwrapTNot(left), right) : + TypeGuard.TNot(right) ? Visit(left, UnwrapTNot(right)) : + Throw('Invalid fallthrough for Not')); + } + // -------------------------------------------------------------------------- + // Null + // -------------------------------------------------------------------------- + function TNull(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TNull(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Number + // -------------------------------------------------------------------------- + function TNumberRight(left, right) { + // prettier-ignore + return (TypeGuard.TLiteralNumber(left) ? TypeExtendsResult.True : + TypeGuard.TNumber(left) || TypeGuard.TInteger(left) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + function TNumber(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TInteger(right) || TypeGuard.TNumber(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Object + // -------------------------------------------------------------------------- + function IsObjectPropertyCount(schema, count) { + return Object.getOwnPropertyNames(schema.properties).length === count; + } + function IsObjectStringLike(schema) { + return IsObjectArrayLike(schema); + } + function IsObjectSymbolLike(schema) { + // prettier-ignore + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'description' in schema.properties && TypeGuard.TUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && ((TypeGuard.TString(schema.properties.description.anyOf[0]) && + TypeGuard.TUndefined(schema.properties.description.anyOf[1])) || (TypeGuard.TString(schema.properties.description.anyOf[1]) && + TypeGuard.TUndefined(schema.properties.description.anyOf[0])))); + } + function IsObjectNumberLike(schema) { + return IsObjectPropertyCount(schema, 0); + } + function IsObjectBooleanLike(schema) { + return IsObjectPropertyCount(schema, 0); + } + function IsObjectBigIntLike(schema) { + return IsObjectPropertyCount(schema, 0); + } + function IsObjectDateLike(schema) { + return IsObjectPropertyCount(schema, 0); + } + function IsObjectUint8ArrayLike(schema) { + return IsObjectArrayLike(schema); + } + function IsObjectFunctionLike(schema) { + const length = exports.Type.Number(); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === TypeExtendsResult.True); + } + function IsObjectConstructorLike(schema) { + return IsObjectPropertyCount(schema, 0); + } + function IsObjectArrayLike(schema) { + const length = exports.Type.Number(); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === TypeExtendsResult.True); + } + function IsObjectPromiseLike(schema) { + const then = exports.Type.Function([exports.Type.Any()], exports.Type.Any()); + return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'then' in schema.properties && IntoBooleanResult(Visit(schema.properties['then'], then)) === TypeExtendsResult.True); + } + // -------------------------------------------------------------------------- + // Property + // -------------------------------------------------------------------------- + function Property(left, right) { + // prettier-ignore + return (Visit(left, right) === TypeExtendsResult.False ? TypeExtendsResult.False : + TypeGuard.TOptional(left) && !TypeGuard.TOptional(right) ? TypeExtendsResult.False : + TypeExtendsResult.True); + } + function TObjectRight(left, right) { + // prettier-ignore + return (TypeGuard.TUnknown(left) ? TypeExtendsResult.False : + TypeGuard.TAny(left) ? TypeExtendsResult.Union : (TypeGuard.TNever(left) || + (TypeGuard.TLiteralString(left) && IsObjectStringLike(right)) || + (TypeGuard.TLiteralNumber(left) && IsObjectNumberLike(right)) || + (TypeGuard.TLiteralBoolean(left) && IsObjectBooleanLike(right)) || + (TypeGuard.TSymbol(left) && IsObjectSymbolLike(right)) || + (TypeGuard.TBigInt(left) && IsObjectBigIntLike(right)) || + (TypeGuard.TString(left) && IsObjectStringLike(right)) || + (TypeGuard.TSymbol(left) && IsObjectSymbolLike(right)) || + (TypeGuard.TNumber(left) && IsObjectNumberLike(right)) || + (TypeGuard.TInteger(left) && IsObjectNumberLike(right)) || + (TypeGuard.TBoolean(left) && IsObjectBooleanLike(right)) || + (TypeGuard.TUint8Array(left) && IsObjectUint8ArrayLike(right)) || + (TypeGuard.TDate(left) && IsObjectDateLike(right)) || + (TypeGuard.TConstructor(left) && IsObjectConstructorLike(right)) || + (TypeGuard.TFunction(left) && IsObjectFunctionLike(right))) ? TypeExtendsResult.True : + (TypeGuard.TRecord(left) && TypeGuard.TString(RecordKey(left))) ? (() => { + // When expressing a Record with literal key values, the Record is converted into a Object with + // the Hint assigned as `Record`. This is used to invert the extends logic. + return right[exports.Hint] === 'Record' ? TypeExtendsResult.True : TypeExtendsResult.False; + })() : + (TypeGuard.TRecord(left) && TypeGuard.TNumber(RecordKey(left))) ? (() => { + return IsObjectPropertyCount(right, 0) + ? TypeExtendsResult.True + : TypeExtendsResult.False; + })() : + TypeExtendsResult.False); + } + function TObject(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + !TypeGuard.TObject(right) ? TypeExtendsResult.False : + (() => { + for (const key of Object.getOwnPropertyNames(right.properties)) { + if (!(key in left.properties)) + return TypeExtendsResult.False; + if (Property(left.properties[key], right.properties[key]) === TypeExtendsResult.False) { + return TypeExtendsResult.False; + } + } + return TypeExtendsResult.True; + })()); + } + // -------------------------------------------------------------------------- + // Promise + // -------------------------------------------------------------------------- + function TPromise(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) && IsObjectPromiseLike(right) ? TypeExtendsResult.True : + !TypeGuard.TPromise(right) ? TypeExtendsResult.False : + IntoBooleanResult(Visit(left.item, right.item))); + } + // -------------------------------------------------------------------------- + // Record + // -------------------------------------------------------------------------- + function RecordKey(schema) { + // prettier-ignore + return (exports.PatternNumberExact in schema.patternProperties ? exports.Type.Number() : + exports.PatternStringExact in schema.patternProperties ? exports.Type.String() : + Throw('Unknown record key pattern')); + } + function RecordValue(schema) { + // prettier-ignore + return (exports.PatternNumberExact in schema.patternProperties ? schema.patternProperties[exports.PatternNumberExact] : + exports.PatternStringExact in schema.patternProperties ? schema.patternProperties[exports.PatternStringExact] : + Throw('Unable to get record value schema')); + } + function TRecordRight(left, right) { + const [Key, Value] = [RecordKey(right), RecordValue(right)]; + // prettier-ignore + return ((TypeGuard.TLiteralString(left) && TypeGuard.TNumber(Key) && IntoBooleanResult(Visit(left, Value)) === TypeExtendsResult.True) ? TypeExtendsResult.True : + TypeGuard.TUint8Array(left) && TypeGuard.TNumber(Key) ? Visit(left, Value) : + TypeGuard.TString(left) && TypeGuard.TNumber(Key) ? Visit(left, Value) : + TypeGuard.TArray(left) && TypeGuard.TNumber(Key) ? Visit(left, Value) : + TypeGuard.TObject(left) ? (() => { + for (const key of Object.getOwnPropertyNames(left.properties)) { + if (Property(Value, left.properties[key]) === TypeExtendsResult.False) { + return TypeExtendsResult.False; + } + } + return TypeExtendsResult.True; + })() : + TypeExtendsResult.False); + } + function TRecord(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + !TypeGuard.TRecord(right) ? TypeExtendsResult.False : + Visit(RecordValue(left), RecordValue(right))); + } + // -------------------------------------------------------------------------- + // String + // -------------------------------------------------------------------------- + function TStringRight(left, right) { + // prettier-ignore + return (TypeGuard.TLiteral(left) && ValueGuard.IsString(left.const) ? TypeExtendsResult.True : + TypeGuard.TString(left) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + function TString(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TString(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Symbol + // -------------------------------------------------------------------------- + function TSymbol(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TSymbol(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // TemplateLiteral + // -------------------------------------------------------------------------- + function TTemplateLiteral(left, right) { + // TemplateLiteral types are resolved to either unions for finite expressions or string + // for infinite expressions. Here we call to TemplateLiteralResolver to resolve for + // either type and continue evaluating. + // prettier-ignore + return (TypeGuard.TTemplateLiteral(left) ? Visit(TemplateLiteralResolver.Resolve(left), right) : + TypeGuard.TTemplateLiteral(right) ? Visit(left, TemplateLiteralResolver.Resolve(right)) : + Throw('Invalid fallthrough for TemplateLiteral')); + } + // -------------------------------------------------------------------------- + // Tuple + // -------------------------------------------------------------------------- + function IsArrayOfTuple(left, right) { + // prettier-ignore + return (TypeGuard.TArray(right) && + left.items !== undefined && + left.items.every((schema) => Visit(schema, right.items) === TypeExtendsResult.True)); + } + function TTupleRight(left, right) { + // prettier-ignore + return (TypeGuard.TNever(left) ? TypeExtendsResult.True : + TypeGuard.TUnknown(left) ? TypeExtendsResult.False : + TypeGuard.TAny(left) ? TypeExtendsResult.Union : + TypeExtendsResult.False); + } + function TTuple(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) && IsObjectArrayLike(right) ? TypeExtendsResult.True : + TypeGuard.TArray(right) && IsArrayOfTuple(left, right) ? TypeExtendsResult.True : + !TypeGuard.TTuple(right) ? TypeExtendsResult.False : + (ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) || (!ValueGuard.IsUndefined(left.items) && ValueGuard.IsUndefined(right.items)) ? TypeExtendsResult.False : + (ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) ? TypeExtendsResult.True : + left.items.every((schema, index) => Visit(schema, right.items[index]) === TypeExtendsResult.True) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Uint8Array + // -------------------------------------------------------------------------- + function TUint8Array(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TUint8Array(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Undefined + // -------------------------------------------------------------------------- + function TUndefined(left, right) { + // prettier-ignore + return (IsStructuralRight(right) ? StructuralRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TRecord(right) ? TRecordRight(left, right) : + TypeGuard.TVoid(right) ? VoidRight(left, right) : + TypeGuard.TUndefined(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Union + // -------------------------------------------------------------------------- + function TUnionRight(left, right) { + // prettier-ignore + return right.anyOf.some((schema) => Visit(left, schema) === TypeExtendsResult.True) + ? TypeExtendsResult.True + : TypeExtendsResult.False; + } + function TUnion(left, right) { + // prettier-ignore + return left.anyOf.every((schema) => Visit(schema, right) === TypeExtendsResult.True) + ? TypeExtendsResult.True + : TypeExtendsResult.False; + } + // -------------------------------------------------------------------------- + // Unknown + // -------------------------------------------------------------------------- + function TUnknownRight(left, right) { + return TypeExtendsResult.True; + } + function TUnknown(left, right) { + // prettier-ignore + return (TypeGuard.TNever(right) ? TNeverRight(left, right) : + TypeGuard.TIntersect(right) ? TIntersectRight(left, right) : + TypeGuard.TUnion(right) ? TUnionRight(left, right) : + TypeGuard.TAny(right) ? TAnyRight(left, right) : + TypeGuard.TString(right) ? TStringRight(left, right) : + TypeGuard.TNumber(right) ? TNumberRight(left, right) : + TypeGuard.TInteger(right) ? TIntegerRight(left, right) : + TypeGuard.TBoolean(right) ? TBooleanRight(left, right) : + TypeGuard.TArray(right) ? TArrayRight(left, right) : + TypeGuard.TTuple(right) ? TTupleRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TUnknown(right) ? TypeExtendsResult.True : + TypeExtendsResult.False); + } + // -------------------------------------------------------------------------- + // Void + // -------------------------------------------------------------------------- + function VoidRight(left, right) { + // prettier-ignore + return TypeGuard.TUndefined(left) ? TypeExtendsResult.True : + TypeGuard.TUndefined(left) ? TypeExtendsResult.True : + TypeExtendsResult.False; + } + function TVoid(left, right) { + // prettier-ignore + return TypeGuard.TIntersect(right) ? TIntersectRight(left, right) : + TypeGuard.TUnion(right) ? TUnionRight(left, right) : + TypeGuard.TUnknown(right) ? TUnknownRight(left, right) : + TypeGuard.TAny(right) ? TAnyRight(left, right) : + TypeGuard.TObject(right) ? TObjectRight(left, right) : + TypeGuard.TVoid(right) ? TypeExtendsResult.True : + TypeExtendsResult.False; + } + function Visit(left, right) { + // prettier-ignore + return ( + // resolvable + (TypeGuard.TTemplateLiteral(left) || TypeGuard.TTemplateLiteral(right)) ? TTemplateLiteral(left, right) : + (TypeGuard.TNot(left) || TypeGuard.TNot(right)) ? TNot(left, right) : + // standard + TypeGuard.TAny(left) ? TAny(left, right) : + TypeGuard.TArray(left) ? TArray(left, right) : + TypeGuard.TBigInt(left) ? TBigInt(left, right) : + TypeGuard.TBoolean(left) ? TBoolean(left, right) : + TypeGuard.TAsyncIterator(left) ? TAsyncIterator(left, right) : + TypeGuard.TConstructor(left) ? TConstructor(left, right) : + TypeGuard.TDate(left) ? TDate(left, right) : + TypeGuard.TFunction(left) ? TFunction(left, right) : + TypeGuard.TInteger(left) ? TInteger(left, right) : + TypeGuard.TIntersect(left) ? TIntersect(left, right) : + TypeGuard.TIterator(left) ? TIterator(left, right) : + TypeGuard.TLiteral(left) ? TLiteral(left, right) : + TypeGuard.TNever(left) ? TNever(left, right) : + TypeGuard.TNull(left) ? TNull(left, right) : + TypeGuard.TNumber(left) ? TNumber(left, right) : + TypeGuard.TObject(left) ? TObject(left, right) : + TypeGuard.TRecord(left) ? TRecord(left, right) : + TypeGuard.TString(left) ? TString(left, right) : + TypeGuard.TSymbol(left) ? TSymbol(left, right) : + TypeGuard.TTuple(left) ? TTuple(left, right) : + TypeGuard.TPromise(left) ? TPromise(left, right) : + TypeGuard.TUint8Array(left) ? TUint8Array(left, right) : + TypeGuard.TUndefined(left) ? TUndefined(left, right) : + TypeGuard.TUnion(left) ? TUnion(left, right) : + TypeGuard.TUnknown(left) ? TUnknown(left, right) : + TypeGuard.TVoid(left) ? TVoid(left, right) : + Throw(`Unknown left type operand '${left[exports.Kind]}'`)); + } + function Extends(left, right) { + return Visit(left, right); + } + TypeExtends.Extends = Extends; +})(TypeExtends || (exports.TypeExtends = TypeExtends = {})); +// -------------------------------------------------------------------------- +// TypeClone +// -------------------------------------------------------------------------- +/** Specialized Clone for Types */ +var TypeClone; +(function (TypeClone) { + function ObjectType(value) { + const clonedProperties = Object.getOwnPropertyNames(value).reduce((acc, key) => ({ ...acc, [key]: Visit(value[key]) }), {}); + const clonedSymbols = Object.getOwnPropertySymbols(value).reduce((acc, key) => ({ ...acc, [key]: Visit(value[key]) }), {}); + return { ...clonedProperties, ...clonedSymbols }; + } + function ArrayType(value) { + return value.map((value) => Visit(value)); + } + function Visit(value) { + // prettier-ignore + return ValueGuard.IsArray(value) ? ArrayType(value) : + ValueGuard.IsObject(value) ? ObjectType(value) : + value; + } + /** Clones a Rest */ + function Rest(schemas) { + return schemas.map((schema) => Type(schema)); + } + TypeClone.Rest = Rest; + /** Clones a Type */ + function Type(schema, options = {}) { + return { ...Visit(schema), ...options }; + } + TypeClone.Type = Type; +})(TypeClone || (exports.TypeClone = TypeClone = {})); +// -------------------------------------------------------------------------- +// IndexedAccessor +// -------------------------------------------------------------------------- +var IndexedAccessor; +(function (IndexedAccessor) { + function OptionalUnwrap(schema) { + return schema.map((schema) => { + const { [exports.Optional]: _, ...clone } = TypeClone.Type(schema); + return clone; + }); + } + function IsIntersectOptional(schema) { + return schema.every((schema) => TypeGuard.TOptional(schema)); + } + function IsUnionOptional(schema) { + return schema.some((schema) => TypeGuard.TOptional(schema)); + } + function ResolveIntersect(schema) { + return IsIntersectOptional(schema.allOf) ? exports.Type.Optional(exports.Type.Intersect(OptionalUnwrap(schema.allOf))) : schema; + } + function ResolveUnion(schema) { + return IsUnionOptional(schema.anyOf) ? exports.Type.Optional(exports.Type.Union(OptionalUnwrap(schema.anyOf))) : schema; + } + function ResolveOptional(schema) { + // prettier-ignore + return schema[exports.Kind] === 'Intersect' ? ResolveIntersect(schema) : + schema[exports.Kind] === 'Union' ? ResolveUnion(schema) : + schema; + } + function TIntersect(schema, key) { + const resolved = schema.allOf.reduce((acc, schema) => { + const indexed = Visit(schema, key); + return indexed[exports.Kind] === 'Never' ? acc : [...acc, indexed]; + }, []); + return ResolveOptional(exports.Type.Intersect(resolved)); + } + function TUnion(schema, key) { + const resolved = schema.anyOf.map((schema) => Visit(schema, key)); + return ResolveOptional(exports.Type.Union(resolved)); + } + function TObject(schema, key) { + const property = schema.properties[key]; + return ValueGuard.IsUndefined(property) ? exports.Type.Never() : exports.Type.Union([property]); + } + function TTuple(schema, key) { + const items = schema.items; + if (ValueGuard.IsUndefined(items)) + return exports.Type.Never(); + const element = items[key]; // + if (ValueGuard.IsUndefined(element)) + return exports.Type.Never(); + return element; + } + function Visit(schema, key) { + // prettier-ignore + return schema[exports.Kind] === 'Intersect' ? TIntersect(schema, key) : + schema[exports.Kind] === 'Union' ? TUnion(schema, key) : + schema[exports.Kind] === 'Object' ? TObject(schema, key) : + schema[exports.Kind] === 'Tuple' ? TTuple(schema, key) : + exports.Type.Never(); + } + function Resolve(schema, keys, options = {}) { + const resolved = keys.map((key) => Visit(schema, key.toString())); + return ResolveOptional(exports.Type.Union(resolved, options)); + } + IndexedAccessor.Resolve = Resolve; +})(IndexedAccessor || (exports.IndexedAccessor = IndexedAccessor = {})); +// -------------------------------------------------------------------------- +// Intrinsic +// -------------------------------------------------------------------------- +var Intrinsic; +(function (Intrinsic) { + function Uncapitalize(value) { + const [first, rest] = [value.slice(0, 1), value.slice(1)]; + return `${first.toLowerCase()}${rest}`; + } + function Capitalize(value) { + const [first, rest] = [value.slice(0, 1), value.slice(1)]; + return `${first.toUpperCase()}${rest}`; + } + function Uppercase(value) { + return value.toUpperCase(); + } + function Lowercase(value) { + return value.toLowerCase(); + } + function IntrinsicTemplateLiteral(schema, mode) { + // note: template literals require special runtime handling as they are encoded in string patterns. + // This diverges from the mapped type which would otherwise map on the template literal kind. + const expression = TemplateLiteralParser.ParseExact(schema.pattern); + const finite = TemplateLiteralFinite.Check(expression); + if (!finite) + return { ...schema, pattern: IntrinsicLiteral(schema.pattern, mode) }; + const strings = [...TemplateLiteralGenerator.Generate(expression)]; + const literals = strings.map((value) => exports.Type.Literal(value)); + const mapped = IntrinsicRest(literals, mode); + const union = exports.Type.Union(mapped); + return exports.Type.TemplateLiteral([union]); + } + function IntrinsicLiteral(value, mode) { + // prettier-ignore + return typeof value === 'string' ? (mode === 'Uncapitalize' ? Uncapitalize(value) : + mode === 'Capitalize' ? Capitalize(value) : + mode === 'Uppercase' ? Uppercase(value) : + mode === 'Lowercase' ? Lowercase(value) : + value) : value.toString(); + } + function IntrinsicRest(schema, mode) { + if (schema.length === 0) + return []; + const [L, ...R] = schema; + return [Map(L, mode), ...IntrinsicRest(R, mode)]; + } + function Visit(schema, mode) { + // prettier-ignore + return TypeGuard.TTemplateLiteral(schema) ? IntrinsicTemplateLiteral(schema, mode) : + TypeGuard.TUnion(schema) ? exports.Type.Union(IntrinsicRest(schema.anyOf, mode)) : + TypeGuard.TLiteral(schema) ? exports.Type.Literal(IntrinsicLiteral(schema.const, mode)) : + schema; + } + /** Applies an intrinsic string manipulation to the given type. */ + function Map(schema, mode) { + return Visit(schema, mode); + } + Intrinsic.Map = Map; +})(Intrinsic || (exports.Intrinsic = Intrinsic = {})); +// -------------------------------------------------------------------------- +// ObjectMap +// -------------------------------------------------------------------------- +var ObjectMap; +(function (ObjectMap) { + function TIntersect(schema, callback) { + // prettier-ignore + return exports.Type.Intersect(schema.allOf.map((inner) => Visit(inner, callback)), { ...schema }); + } + function TUnion(schema, callback) { + // prettier-ignore + return exports.Type.Union(schema.anyOf.map((inner) => Visit(inner, callback)), { ...schema }); + } + function TObject(schema, callback) { + return callback(schema); + } + function Visit(schema, callback) { + // There are cases where users need to map objects with unregistered kinds. Using a TypeGuard here would + // prevent sub schema mapping as unregistered kinds will not pass TSchema checks. This is notable in the + // case of TObject where unregistered property kinds cause the TObject check to fail. As mapping is only + // used for composition, we use explicit checks instead. + // prettier-ignore + return (schema[exports.Kind] === 'Intersect' ? TIntersect(schema, callback) : + schema[exports.Kind] === 'Union' ? TUnion(schema, callback) : + schema[exports.Kind] === 'Object' ? TObject(schema, callback) : + schema); + } + function Map(schema, callback, options) { + return { ...Visit(TypeClone.Type(schema), callback), ...options }; + } + ObjectMap.Map = Map; +})(ObjectMap || (exports.ObjectMap = ObjectMap = {})); +var KeyResolver; +(function (KeyResolver) { + function UnwrapPattern(key) { + return key[0] === '^' && key[key.length - 1] === '$' ? key.slice(1, key.length - 1) : key; + } + function TIntersect(schema, options) { + return schema.allOf.reduce((acc, schema) => [...acc, ...Visit(schema, options)], []); + } + function TUnion(schema, options) { + const sets = schema.anyOf.map((inner) => Visit(inner, options)); + return [...sets.reduce((set, outer) => outer.map((key) => (sets.every((inner) => inner.includes(key)) ? set.add(key) : set))[0], new Set())]; + } + function TObject(schema, options) { + return Object.getOwnPropertyNames(schema.properties); + } + function TRecord(schema, options) { + return options.includePatterns ? Object.getOwnPropertyNames(schema.patternProperties) : []; + } + function Visit(schema, options) { + // prettier-ignore + return (TypeGuard.TIntersect(schema) ? TIntersect(schema, options) : + TypeGuard.TUnion(schema) ? TUnion(schema, options) : + TypeGuard.TObject(schema) ? TObject(schema, options) : + TypeGuard.TRecord(schema) ? TRecord(schema, options) : + []); + } + /** Resolves an array of keys in this schema */ + function ResolveKeys(schema, options) { + return [...new Set(Visit(schema, options))]; + } + KeyResolver.ResolveKeys = ResolveKeys; + /** Resolves a regular expression pattern matching all keys in this schema */ + function ResolvePattern(schema) { + const keys = ResolveKeys(schema, { includePatterns: true }); + const pattern = keys.map((key) => `(${UnwrapPattern(key)})`); + return `^(${pattern.join('|')})$`; + } + KeyResolver.ResolvePattern = ResolvePattern; +})(KeyResolver || (exports.KeyResolver = KeyResolver = {})); +// -------------------------------------------------------------------------- +// KeyArrayResolver +// -------------------------------------------------------------------------- +class KeyArrayResolverError extends TypeBoxError { +} +exports.KeyArrayResolverError = KeyArrayResolverError; +var KeyArrayResolver; +(function (KeyArrayResolver) { + /** Resolves an array of string[] keys from the given schema or array type. */ + function Resolve(schema) { + // prettier-ignore + return Array.isArray(schema) ? schema : + TypeGuard.TUnionLiteral(schema) ? schema.anyOf.map((schema) => schema.const.toString()) : + TypeGuard.TLiteral(schema) ? [schema.const] : + TypeGuard.TTemplateLiteral(schema) ? (() => { + const expression = TemplateLiteralParser.ParseExact(schema.pattern); + if (!TemplateLiteralFinite.Check(expression)) + throw new KeyArrayResolverError('Cannot resolve keys from infinite template expression'); + return [...TemplateLiteralGenerator.Generate(expression)]; + })() : []; + } + KeyArrayResolver.Resolve = Resolve; +})(KeyArrayResolver || (exports.KeyArrayResolver = KeyArrayResolver = {})); +// -------------------------------------------------------------------------- +// UnionResolver +// -------------------------------------------------------------------------- +var UnionResolver; +(function (UnionResolver) { + function* TUnion(union) { + for (const schema of union.anyOf) { + if (schema[exports.Kind] === 'Union') { + yield* TUnion(schema); + } + else { + yield schema; + } + } + } + /** Returns a resolved union with interior unions flattened */ + function Resolve(union) { + return exports.Type.Union([...TUnion(union)], { ...union }); + } + UnionResolver.Resolve = Resolve; +})(UnionResolver || (exports.UnionResolver = UnionResolver = {})); +// -------------------------------------------------------------------------- +// TemplateLiteralPattern +// -------------------------------------------------------------------------- +class TemplateLiteralPatternError extends TypeBoxError { +} +exports.TemplateLiteralPatternError = TemplateLiteralPatternError; +var TemplateLiteralPattern; +(function (TemplateLiteralPattern) { + function Throw(message) { + throw new TemplateLiteralPatternError(message); + } + function Escape(value) { + return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + } + function Visit(schema, acc) { + // prettier-ignore + return (TypeGuard.TTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : + TypeGuard.TUnion(schema) ? `(${schema.anyOf.map((schema) => Visit(schema, acc)).join('|')})` : + TypeGuard.TNumber(schema) ? `${acc}${exports.PatternNumber}` : + TypeGuard.TInteger(schema) ? `${acc}${exports.PatternNumber}` : + TypeGuard.TBigInt(schema) ? `${acc}${exports.PatternNumber}` : + TypeGuard.TString(schema) ? `${acc}${exports.PatternString}` : + TypeGuard.TLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : + TypeGuard.TBoolean(schema) ? `${acc}${exports.PatternBoolean}` : + Throw(`Unexpected Kind '${schema[exports.Kind]}'`)); + } + function Create(kinds) { + return `^${kinds.map((schema) => Visit(schema, '')).join('')}\$`; + } + TemplateLiteralPattern.Create = Create; +})(TemplateLiteralPattern || (exports.TemplateLiteralPattern = TemplateLiteralPattern = {})); +// -------------------------------------------------------------------------------------- +// TemplateLiteralResolver +// -------------------------------------------------------------------------------------- +var TemplateLiteralResolver; +(function (TemplateLiteralResolver) { + /** Resolves a template literal as a TUnion */ + function Resolve(template) { + const expression = TemplateLiteralParser.ParseExact(template.pattern); + if (!TemplateLiteralFinite.Check(expression)) + return exports.Type.String(); + const literals = [...TemplateLiteralGenerator.Generate(expression)].map((value) => exports.Type.Literal(value)); + return exports.Type.Union(literals); + } + TemplateLiteralResolver.Resolve = Resolve; +})(TemplateLiteralResolver || (exports.TemplateLiteralResolver = TemplateLiteralResolver = {})); +// -------------------------------------------------------------------------------------- +// TemplateLiteralParser +// -------------------------------------------------------------------------------------- +class TemplateLiteralParserError extends TypeBoxError { +} +exports.TemplateLiteralParserError = TemplateLiteralParserError; +var TemplateLiteralParser; +(function (TemplateLiteralParser) { + function IsNonEscaped(pattern, index, char) { + return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92; + } + function IsOpenParen(pattern, index) { + return IsNonEscaped(pattern, index, '('); + } + function IsCloseParen(pattern, index) { + return IsNonEscaped(pattern, index, ')'); + } + function IsSeparator(pattern, index) { + return IsNonEscaped(pattern, index, '|'); + } + function IsGroup(pattern) { + if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1))) + return false; + let count = 0; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (count === 0 && index !== pattern.length - 1) + return false; + } + return true; + } + function InGroup(pattern) { + return pattern.slice(1, pattern.length - 1); + } + function IsPrecedenceOr(pattern) { + let count = 0; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (IsSeparator(pattern, index) && count === 0) + return true; + } + return false; + } + function IsPrecedenceAnd(pattern) { + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + return true; + } + return false; + } + function Or(pattern) { + let [count, start] = [0, 0]; + const expressions = []; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) + count += 1; + if (IsCloseParen(pattern, index)) + count -= 1; + if (IsSeparator(pattern, index) && count === 0) { + const range = pattern.slice(start, index); + if (range.length > 0) + expressions.push(Parse(range)); + start = index + 1; + } + } + const range = pattern.slice(start); + if (range.length > 0) + expressions.push(Parse(range)); + if (expressions.length === 0) + return { type: 'const', const: '' }; + if (expressions.length === 1) + return expressions[0]; + return { type: 'or', expr: expressions }; + } + function And(pattern) { + function Group(value, index) { + if (!IsOpenParen(value, index)) + throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`); + let count = 0; + for (let scan = index; scan < value.length; scan++) { + if (IsOpenParen(value, scan)) + count += 1; + if (IsCloseParen(value, scan)) + count -= 1; + if (count === 0) + return [index, scan]; + } + throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`); + } + function Range(pattern, index) { + for (let scan = index; scan < pattern.length; scan++) { + if (IsOpenParen(pattern, scan)) + return [index, scan]; + } + return [index, pattern.length]; + } + const expressions = []; + for (let index = 0; index < pattern.length; index++) { + if (IsOpenParen(pattern, index)) { + const [start, end] = Group(pattern, index); + const range = pattern.slice(start, end + 1); + expressions.push(Parse(range)); + index = end; + } + else { + const [start, end] = Range(pattern, index); + const range = pattern.slice(start, end); + if (range.length > 0) + expressions.push(Parse(range)); + index = end - 1; + } + } + // prettier-ignore + return (expressions.length === 0) ? { type: 'const', const: '' } : + (expressions.length === 1) ? expressions[0] : + { type: 'and', expr: expressions }; + } + /** Parses a pattern and returns an expression tree */ + function Parse(pattern) { + // prettier-ignore + return IsGroup(pattern) ? Parse(InGroup(pattern)) : + IsPrecedenceOr(pattern) ? Or(pattern) : + IsPrecedenceAnd(pattern) ? And(pattern) : + { type: 'const', const: pattern }; + } + TemplateLiteralParser.Parse = Parse; + /** Parses a pattern and strips forward and trailing ^ and $ */ + function ParseExact(pattern) { + return Parse(pattern.slice(1, pattern.length - 1)); + } + TemplateLiteralParser.ParseExact = ParseExact; +})(TemplateLiteralParser || (exports.TemplateLiteralParser = TemplateLiteralParser = {})); +// -------------------------------------------------------------------------------------- +// TemplateLiteralFinite +// -------------------------------------------------------------------------------------- +class TemplateLiteralFiniteError extends TypeBoxError { +} +exports.TemplateLiteralFiniteError = TemplateLiteralFiniteError; +var TemplateLiteralFinite; +(function (TemplateLiteralFinite) { + function Throw(message) { + throw new TemplateLiteralFiniteError(message); + } + function IsNumber(expression) { + // prettier-ignore + return (expression.type === 'or' && + expression.expr.length === 2 && + expression.expr[0].type === 'const' && + expression.expr[0].const === '0' && + expression.expr[1].type === 'const' && + expression.expr[1].const === '[1-9][0-9]*'); + } + function IsBoolean(expression) { + // prettier-ignore + return (expression.type === 'or' && + expression.expr.length === 2 && + expression.expr[0].type === 'const' && + expression.expr[0].const === 'true' && + expression.expr[1].type === 'const' && + expression.expr[1].const === 'false'); + } + function IsString(expression) { + return expression.type === 'const' && expression.const === '.*'; + } + function Check(expression) { + // prettier-ignore + return IsBoolean(expression) ? true : + IsNumber(expression) || IsString(expression) ? false : + (expression.type === 'and') ? expression.expr.every((expr) => Check(expr)) : + (expression.type === 'or') ? expression.expr.every((expr) => Check(expr)) : + (expression.type === 'const') ? true : + Throw(`Unknown expression type`); + } + TemplateLiteralFinite.Check = Check; +})(TemplateLiteralFinite || (exports.TemplateLiteralFinite = TemplateLiteralFinite = {})); +// -------------------------------------------------------------------------------------- +// TemplateLiteralGenerator +// -------------------------------------------------------------------------------------- +class TemplateLiteralGeneratorError extends TypeBoxError { +} +exports.TemplateLiteralGeneratorError = TemplateLiteralGeneratorError; +var TemplateLiteralGenerator; +(function (TemplateLiteralGenerator) { + function* Reduce(buffer) { + if (buffer.length === 1) + return yield* buffer[0]; + for (const left of buffer[0]) { + for (const right of Reduce(buffer.slice(1))) { + yield `${left}${right}`; + } + } + } + function* And(expression) { + return yield* Reduce(expression.expr.map((expr) => [...Generate(expr)])); + } + function* Or(expression) { + for (const expr of expression.expr) + yield* Generate(expr); + } + function* Const(expression) { + return yield expression.const; + } + function* Generate(expression) { + // prettier-ignore + return (expression.type === 'and' ? yield* And(expression) : + expression.type === 'or' ? yield* Or(expression) : + expression.type === 'const' ? yield* Const(expression) : + (() => { throw new TemplateLiteralGeneratorError('Unknown expression'); })()); + } + TemplateLiteralGenerator.Generate = Generate; +})(TemplateLiteralGenerator || (exports.TemplateLiteralGenerator = TemplateLiteralGenerator = {})); +// --------------------------------------------------------------------- +// TemplateLiteralDslParser +// --------------------------------------------------------------------- +var TemplateLiteralDslParser; +(function (TemplateLiteralDslParser) { + function* ParseUnion(template) { + const trim = template.trim().replace(/"|'/g, ''); + // prettier-ignore + return (trim === 'boolean' ? yield exports.Type.Boolean() : + trim === 'number' ? yield exports.Type.Number() : + trim === 'bigint' ? yield exports.Type.BigInt() : + trim === 'string' ? yield exports.Type.String() : + yield (() => { + const literals = trim.split('|').map((literal) => exports.Type.Literal(literal.trim())); + return (literals.length === 0 ? exports.Type.Never() : + literals.length === 1 ? literals[0] : + exports.Type.Union(literals)); + })()); + } + function* ParseTerminal(template) { + if (template[1] !== '{') { + const L = exports.Type.Literal('$'); + const R = ParseLiteral(template.slice(1)); + return yield* [L, ...R]; + } + for (let i = 2; i < template.length; i++) { + if (template[i] === '}') { + const L = ParseUnion(template.slice(2, i)); + const R = ParseLiteral(template.slice(i + 1)); + return yield* [...L, ...R]; + } + } + yield exports.Type.Literal(template); + } + function* ParseLiteral(template) { + for (let i = 0; i < template.length; i++) { + if (template[i] === '$') { + const L = exports.Type.Literal(template.slice(0, i)); + const R = ParseTerminal(template.slice(i)); + return yield* [L, ...R]; + } + } + yield exports.Type.Literal(template); + } + function Parse(template_dsl) { + return [...ParseLiteral(template_dsl)]; + } + TemplateLiteralDslParser.Parse = Parse; +})(TemplateLiteralDslParser || (exports.TemplateLiteralDslParser = TemplateLiteralDslParser = {})); +// --------------------------------------------------------------------- +// TransformBuilder +// --------------------------------------------------------------------- +class TransformDecodeBuilder { + constructor(schema) { + this.schema = schema; + } + Decode(decode) { + return new TransformEncodeBuilder(this.schema, decode); + } +} +exports.TransformDecodeBuilder = TransformDecodeBuilder; +class TransformEncodeBuilder { + constructor(schema, decode) { + this.schema = schema; + this.decode = decode; + } + Encode(encode) { + const schema = TypeClone.Type(this.schema); + // prettier-ignore + return (TypeGuard.TTransform(schema) ? (() => { + const Encode = (value) => schema[exports.Transform].Encode(encode(value)); + const Decode = (value) => this.decode(schema[exports.Transform].Decode(value)); + const Codec = { Encode: Encode, Decode: Decode }; + return { ...schema, [exports.Transform]: Codec }; + })() : (() => { + const Codec = { Decode: this.decode, Encode: encode }; + return { ...schema, [exports.Transform]: Codec }; + })()); + } +} +exports.TransformEncodeBuilder = TransformEncodeBuilder; +// -------------------------------------------------------------------------- +// TypeOrdinal: Used for auto $id generation +// -------------------------------------------------------------------------- +let TypeOrdinal = 0; +// -------------------------------------------------------------------------- +// TypeBuilder +// -------------------------------------------------------------------------- +class TypeBuilderError extends TypeBoxError { +} +exports.TypeBuilderError = TypeBuilderError; +class TypeBuilder { + /** `[Internal]` Creates a schema without `static` and `params` types */ + Create(schema) { + return schema; + } + /** `[Internal]` Throws a TypeBuilder error with the given message */ + Throw(message) { + throw new TypeBuilderError(message); + } + /** `[Internal]` Discards property keys from the given record type */ + Discard(record, keys) { + return keys.reduce((acc, key) => { + const { [key]: _, ...rest } = acc; + return rest; + }, record); + } + /** `[Json]` Omits compositing symbols from this schema */ + Strict(schema) { + return JSON.parse(JSON.stringify(schema)); + } +} +exports.TypeBuilder = TypeBuilder; +// -------------------------------------------------------------------------- +// JsonTypeBuilder +// -------------------------------------------------------------------------- +class JsonTypeBuilder extends TypeBuilder { + // ------------------------------------------------------------------------ + // Modifiers + // ------------------------------------------------------------------------ + /** `[Json]` Creates a Readonly and Optional property */ + ReadonlyOptional(schema) { + return this.Readonly(this.Optional(schema)); + } + /** `[Json]` Creates a Readonly property */ + Readonly(schema) { + return { ...TypeClone.Type(schema), [exports.Readonly]: 'Readonly' }; + } + /** `[Json]` Creates an Optional property */ + Optional(schema) { + return { ...TypeClone.Type(schema), [exports.Optional]: 'Optional' }; + } + // ------------------------------------------------------------------------ + // Types + // ------------------------------------------------------------------------ + /** `[Json]` Creates an Any type */ + Any(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Any' }); + } + /** `[Json]` Creates an Array type */ + Array(schema, options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Array', type: 'array', items: TypeClone.Type(schema) }); + } + /** `[Json]` Creates a Boolean type */ + Boolean(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Boolean', type: 'boolean' }); + } + /** `[Json]` Intrinsic function to Capitalize LiteralString types */ + Capitalize(schema, options = {}) { + return { ...Intrinsic.Map(TypeClone.Type(schema), 'Capitalize'), ...options }; + } + /** `[Json]` Creates a Composite object type */ + Composite(objects, options) { + const intersect = exports.Type.Intersect(objects, {}); + const keys = KeyResolver.ResolveKeys(intersect, { includePatterns: false }); + const properties = keys.reduce((acc, key) => ({ ...acc, [key]: exports.Type.Index(intersect, [key]) }), {}); + return exports.Type.Object(properties, options); + } + /** `[Json]` Creates a Enum type */ + Enum(item, options = {}) { + // prettier-ignore + const values1 = Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]); + const values2 = [...new Set(values1)]; + const anyOf = values2.map((value) => exports.Type.Literal(value)); + return this.Union(anyOf, { ...options, [exports.Hint]: 'Enum' }); + } + /** `[Json]` Creates a Conditional type */ + Extends(left, right, trueType, falseType, options = {}) { + switch (TypeExtends.Extends(left, right)) { + case TypeExtendsResult.Union: + return this.Union([TypeClone.Type(trueType, options), TypeClone.Type(falseType, options)]); + case TypeExtendsResult.True: + return TypeClone.Type(trueType, options); + case TypeExtendsResult.False: + return TypeClone.Type(falseType, options); + } + } + /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */ + Exclude(unionType, excludedMembers, options = {}) { + // prettier-ignore + return (TypeGuard.TTemplateLiteral(unionType) ? this.Exclude(TemplateLiteralResolver.Resolve(unionType), excludedMembers, options) : + TypeGuard.TTemplateLiteral(excludedMembers) ? this.Exclude(unionType, TemplateLiteralResolver.Resolve(excludedMembers), options) : + TypeGuard.TUnion(unionType) ? (() => { + const narrowed = unionType.anyOf.filter((inner) => TypeExtends.Extends(inner, excludedMembers) === TypeExtendsResult.False); + return (narrowed.length === 1 ? TypeClone.Type(narrowed[0], options) : this.Union(narrowed, options)); + })() : + TypeExtends.Extends(unionType, excludedMembers) !== TypeExtendsResult.False ? this.Never(options) : + TypeClone.Type(unionType, options)); + } + /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */ + Extract(type, union, options = {}) { + // prettier-ignore + return (TypeGuard.TTemplateLiteral(type) ? this.Extract(TemplateLiteralResolver.Resolve(type), union, options) : + TypeGuard.TTemplateLiteral(union) ? this.Extract(type, TemplateLiteralResolver.Resolve(union), options) : + TypeGuard.TUnion(type) ? (() => { + const narrowed = type.anyOf.filter((inner) => TypeExtends.Extends(inner, union) !== TypeExtendsResult.False); + return (narrowed.length === 1 ? TypeClone.Type(narrowed[0], options) : this.Union(narrowed, options)); + })() : + TypeExtends.Extends(type, union) !== TypeExtendsResult.False ? TypeClone.Type(type, options) : + this.Never(options)); + } + /** `[Json]` Returns an Indexed property type for the given keys */ + Index(schema, unresolved, options = {}) { + // prettier-ignore + return (TypeGuard.TArray(schema) && TypeGuard.TNumber(unresolved) ? (() => { + return TypeClone.Type(schema.items, options); + })() : + TypeGuard.TTuple(schema) && TypeGuard.TNumber(unresolved) ? (() => { + const items = ValueGuard.IsUndefined(schema.items) ? [] : schema.items; + const cloned = items.map((schema) => TypeClone.Type(schema)); + return this.Union(cloned, options); + })() : (() => { + const keys = KeyArrayResolver.Resolve(unresolved); + const clone = TypeClone.Type(schema); + return IndexedAccessor.Resolve(clone, keys, options); + })()); + } + /** `[Json]` Creates an Integer type */ + Integer(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Integer', type: 'integer' }); + } + /** `[Json]` Creates an Intersect type */ + Intersect(allOf, options = {}) { + if (allOf.length === 0) + return exports.Type.Never(); + if (allOf.length === 1) + return TypeClone.Type(allOf[0], options); + if (allOf.some((schema) => TypeGuard.TTransform(schema))) + this.Throw('Cannot intersect transform types'); + const objects = allOf.every((schema) => TypeGuard.TObject(schema)); + const cloned = TypeClone.Rest(allOf); + // prettier-ignore + const clonedUnevaluatedProperties = TypeGuard.TSchema(options.unevaluatedProperties) + ? { unevaluatedProperties: TypeClone.Type(options.unevaluatedProperties) } + : {}; + return options.unevaluatedProperties === false || TypeGuard.TSchema(options.unevaluatedProperties) || objects + ? this.Create({ ...options, ...clonedUnevaluatedProperties, [exports.Kind]: 'Intersect', type: 'object', allOf: cloned }) + : this.Create({ ...options, ...clonedUnevaluatedProperties, [exports.Kind]: 'Intersect', allOf: cloned }); + } + /** `[Json]` Creates a KeyOf type */ + KeyOf(schema, options = {}) { + // prettier-ignore + return (TypeGuard.TRecord(schema) ? (() => { + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + return (pattern === exports.PatternNumberExact ? this.Number(options) : + pattern === exports.PatternStringExact ? this.String(options) : + this.Throw('Unable to resolve key type from Record key pattern')); + })() : + TypeGuard.TTuple(schema) ? (() => { + const items = ValueGuard.IsUndefined(schema.items) ? [] : schema.items; + const literals = items.map((_, index) => exports.Type.Literal(index.toString())); + return this.Union(literals, options); + })() : + TypeGuard.TArray(schema) ? (() => { + return this.Number(options); + })() : (() => { + const keys = KeyResolver.ResolveKeys(schema, { includePatterns: false }); + if (keys.length === 0) + return this.Never(options); + const literals = keys.map((key) => this.Literal(key)); + return this.Union(literals, options); + })()); + } + /** `[Json]` Creates a Literal type */ + Literal(value, options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Literal', const: value, type: typeof value }); + } + /** `[Json]` Intrinsic function to Lowercase LiteralString types */ + Lowercase(schema, options = {}) { + return { ...Intrinsic.Map(TypeClone.Type(schema), 'Lowercase'), ...options }; + } + /** `[Json]` Creates a Never type */ + Never(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Never', not: {} }); + } + /** `[Json]` Creates a Not type */ + Not(schema, options) { + return this.Create({ ...options, [exports.Kind]: 'Not', not: TypeClone.Type(schema) }); + } + /** `[Json]` Creates a Null type */ + Null(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Null', type: 'null' }); + } + /** `[Json]` Creates a Number type */ + Number(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Number', type: 'number' }); + } + /** `[Json]` Creates an Object type */ + Object(properties, options = {}) { + const propertyKeys = Object.getOwnPropertyNames(properties); + const optionalKeys = propertyKeys.filter((key) => TypeGuard.TOptional(properties[key])); + const requiredKeys = propertyKeys.filter((name) => !optionalKeys.includes(name)); + const clonedAdditionalProperties = TypeGuard.TSchema(options.additionalProperties) ? { additionalProperties: TypeClone.Type(options.additionalProperties) } : {}; + const clonedProperties = propertyKeys.reduce((acc, key) => ({ ...acc, [key]: TypeClone.Type(properties[key]) }), {}); + return requiredKeys.length > 0 + ? this.Create({ ...options, ...clonedAdditionalProperties, [exports.Kind]: 'Object', type: 'object', properties: clonedProperties, required: requiredKeys }) + : this.Create({ ...options, ...clonedAdditionalProperties, [exports.Kind]: 'Object', type: 'object', properties: clonedProperties }); + } + /** `[Json]` Constructs a type whose keys are omitted from the given type */ + Omit(schema, unresolved, options = {}) { + const keys = KeyArrayResolver.Resolve(unresolved); + // prettier-ignore + return ObjectMap.Map(this.Discard(TypeClone.Type(schema), ['$id', exports.Transform]), (object) => { + if (ValueGuard.IsArray(object.required)) { + object.required = object.required.filter((key) => !keys.includes(key)); + if (object.required.length === 0) + delete object.required; + } + for (const key of Object.getOwnPropertyNames(object.properties)) { + if (keys.includes(key)) + delete object.properties[key]; + } + return this.Create(object); + }, options); + } + /** `[Json]` Constructs a type where all properties are optional */ + Partial(schema, options = {}) { + // prettier-ignore + return ObjectMap.Map(this.Discard(TypeClone.Type(schema), ['$id', exports.Transform]), (object) => { + const properties = Object.getOwnPropertyNames(object.properties).reduce((acc, key) => { + return { ...acc, [key]: this.Optional(object.properties[key]) }; + }, {}); + return this.Object(properties, this.Discard(object, ['required']) /* object used as options to retain other constraints */); + }, options); + } + /** `[Json]` Constructs a type whose keys are picked from the given type */ + Pick(schema, unresolved, options = {}) { + const keys = KeyArrayResolver.Resolve(unresolved); + // prettier-ignore + return ObjectMap.Map(this.Discard(TypeClone.Type(schema), ['$id', exports.Transform]), (object) => { + if (ValueGuard.IsArray(object.required)) { + object.required = object.required.filter((key) => keys.includes(key)); + if (object.required.length === 0) + delete object.required; + } + for (const key of Object.getOwnPropertyNames(object.properties)) { + if (!keys.includes(key)) + delete object.properties[key]; + } + return this.Create(object); + }, options); + } + /** `[Json]` Creates a Record type */ + Record(key, schema, options = {}) { + // prettier-ignore + return (TypeGuard.TTemplateLiteral(key) ? (() => { + const expression = TemplateLiteralParser.ParseExact(key.pattern); + // prettier-ignore + return TemplateLiteralFinite.Check(expression) + ? (this.Object([...TemplateLiteralGenerator.Generate(expression)].reduce((acc, key) => ({ ...acc, [key]: TypeClone.Type(schema) }), {}), options)) + : this.Create({ ...options, [exports.Kind]: 'Record', type: 'object', patternProperties: { [key.pattern]: TypeClone.Type(schema) } }); + })() : + TypeGuard.TUnion(key) ? (() => { + const union = UnionResolver.Resolve(key); + if (TypeGuard.TUnionLiteral(union)) { + const properties = union.anyOf.reduce((acc, literal) => ({ ...acc, [literal.const]: TypeClone.Type(schema) }), {}); + return this.Object(properties, { ...options, [exports.Hint]: 'Record' }); + } + else + this.Throw('Record key of type union contains non-literal types'); + })() : + TypeGuard.TLiteral(key) ? (() => { + // prettier-ignore + return (ValueGuard.IsString(key.const) || ValueGuard.IsNumber(key.const)) + ? this.Object({ [key.const]: TypeClone.Type(schema) }, options) + : this.Throw('Record key of type literal is not of type string or number'); + })() : + TypeGuard.TInteger(key) || TypeGuard.TNumber(key) ? (() => { + return this.Create({ ...options, [exports.Kind]: 'Record', type: 'object', patternProperties: { [exports.PatternNumberExact]: TypeClone.Type(schema) } }); + })() : + TypeGuard.TString(key) ? (() => { + const pattern = ValueGuard.IsUndefined(key.pattern) ? exports.PatternStringExact : key.pattern; + return this.Create({ ...options, [exports.Kind]: 'Record', type: 'object', patternProperties: { [pattern]: TypeClone.Type(schema) } }); + })() : + this.Never()); + } + /** `[Json]` Creates a Recursive type */ + Recursive(callback, options = {}) { + if (ValueGuard.IsUndefined(options.$id)) + options.$id = `T${TypeOrdinal++}`; + const thisType = callback({ [exports.Kind]: 'This', $ref: `${options.$id}` }); + thisType.$id = options.$id; + return this.Create({ ...options, [exports.Hint]: 'Recursive', ...thisType }); + } + /** `[Json]` Creates a Ref type. */ + Ref(unresolved, options = {}) { + if (ValueGuard.IsString(unresolved)) + return this.Create({ ...options, [exports.Kind]: 'Ref', $ref: unresolved }); + if (ValueGuard.IsUndefined(unresolved.$id)) + this.Throw('Reference target type must specify an $id'); + return this.Create({ ...options, [exports.Kind]: 'Ref', $ref: unresolved.$id }); + } + /** `[Json]` Constructs a type where all properties are required */ + Required(schema, options = {}) { + // prettier-ignore + return ObjectMap.Map(this.Discard(TypeClone.Type(schema), ['$id', exports.Transform]), (object) => { + const properties = Object.getOwnPropertyNames(object.properties).reduce((acc, key) => { + return { ...acc, [key]: this.Discard(object.properties[key], [exports.Optional]) }; + }, {}); + return this.Object(properties, object /* object used as options to retain other constraints */); + }, options); + } + /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */ + Rest(schema) { + return (TypeGuard.TTuple(schema) && !ValueGuard.IsUndefined(schema.items) ? TypeClone.Rest(schema.items) : TypeGuard.TIntersect(schema) ? TypeClone.Rest(schema.allOf) : TypeGuard.TUnion(schema) ? TypeClone.Rest(schema.anyOf) : []); + } + /** `[Json]` Creates a String type */ + String(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'String', type: 'string' }); + } + /** `[Json]` Creates a TemplateLiteral type */ + TemplateLiteral(unresolved, options = {}) { + // prettier-ignore + const pattern = ValueGuard.IsString(unresolved) + ? TemplateLiteralPattern.Create(TemplateLiteralDslParser.Parse(unresolved)) + : TemplateLiteralPattern.Create(unresolved); + return this.Create({ ...options, [exports.Kind]: 'TemplateLiteral', type: 'string', pattern }); + } + /** `[Json]` Creates a Transform type */ + Transform(schema) { + return new TransformDecodeBuilder(schema); + } + /** `[Json]` Creates a Tuple type */ + Tuple(items, options = {}) { + const [additionalItems, minItems, maxItems] = [false, items.length, items.length]; + const clonedItems = TypeClone.Rest(items); + // prettier-ignore + const schema = (items.length > 0 ? + { ...options, [exports.Kind]: 'Tuple', type: 'array', items: clonedItems, additionalItems, minItems, maxItems } : + { ...options, [exports.Kind]: 'Tuple', type: 'array', minItems, maxItems }); + return this.Create(schema); + } + /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */ + Uncapitalize(schema, options = {}) { + return { ...Intrinsic.Map(TypeClone.Type(schema), 'Uncapitalize'), ...options }; + } + /** `[Json]` Creates a Union type */ + Union(union, options = {}) { + // prettier-ignore + return TypeGuard.TTemplateLiteral(union) + ? TemplateLiteralResolver.Resolve(union) + : (() => { + const anyOf = union; + if (anyOf.length === 0) + return this.Never(options); + if (anyOf.length === 1) + return this.Create(TypeClone.Type(anyOf[0], options)); + const clonedAnyOf = TypeClone.Rest(anyOf); + return this.Create({ ...options, [exports.Kind]: 'Union', anyOf: clonedAnyOf }); + })(); + } + /** `[Json]` Creates an Unknown type */ + Unknown(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Unknown' }); + } + /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */ + Unsafe(options = {}) { + return this.Create({ ...options, [exports.Kind]: options[exports.Kind] || 'Unsafe' }); + } + /** `[Json]` Intrinsic function to Uppercase LiteralString types */ + Uppercase(schema, options = {}) { + return { ...Intrinsic.Map(TypeClone.Type(schema), 'Uppercase'), ...options }; + } +} +exports.JsonTypeBuilder = JsonTypeBuilder; +// -------------------------------------------------------------------------- +// JavaScriptTypeBuilder +// -------------------------------------------------------------------------- +class JavaScriptTypeBuilder extends JsonTypeBuilder { + /** `[JavaScript]` Creates a AsyncIterator type */ + AsyncIterator(items, options = {}) { + return this.Create({ ...options, [exports.Kind]: 'AsyncIterator', type: 'AsyncIterator', items: TypeClone.Type(items) }); + } + /** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */ + Awaited(schema, options = {}) { + // prettier-ignore + const Unwrap = (rest) => rest.length > 0 ? (() => { + const [L, ...R] = rest; + return [this.Awaited(L), ...Unwrap(R)]; + })() : rest; + // prettier-ignore + return (TypeGuard.TIntersect(schema) ? exports.Type.Intersect(Unwrap(schema.allOf)) : + TypeGuard.TUnion(schema) ? exports.Type.Union(Unwrap(schema.anyOf)) : + TypeGuard.TPromise(schema) ? this.Awaited(schema.item) : + TypeClone.Type(schema, options)); + } + /** `[JavaScript]` Creates a BigInt type */ + BigInt(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'BigInt', type: 'bigint' }); + } + /** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */ + ConstructorParameters(schema, options = {}) { + return this.Tuple([...schema.parameters], { ...options }); + } + /** `[JavaScript]` Creates a Constructor type */ + Constructor(parameters, returns, options) { + const [clonedParameters, clonedReturns] = [TypeClone.Rest(parameters), TypeClone.Type(returns)]; + return this.Create({ ...options, [exports.Kind]: 'Constructor', type: 'Constructor', parameters: clonedParameters, returns: clonedReturns }); + } + /** `[JavaScript]` Creates a Date type */ + Date(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Date', type: 'Date' }); + } + /** `[JavaScript]` Creates a Function type */ + Function(parameters, returns, options) { + const [clonedParameters, clonedReturns] = [TypeClone.Rest(parameters), TypeClone.Type(returns)]; + return this.Create({ ...options, [exports.Kind]: 'Function', type: 'Function', parameters: clonedParameters, returns: clonedReturns }); + } + /** `[JavaScript]` Extracts the InstanceType from the given Constructor type */ + InstanceType(schema, options = {}) { + return TypeClone.Type(schema.returns, options); + } + /** `[JavaScript]` Creates an Iterator type */ + Iterator(items, options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Iterator', type: 'Iterator', items: TypeClone.Type(items) }); + } + /** `[JavaScript]` Extracts the Parameters from the given Function type */ + Parameters(schema, options = {}) { + return this.Tuple(schema.parameters, { ...options }); + } + /** `[JavaScript]` Creates a Promise type */ + Promise(item, options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Promise', type: 'Promise', item: TypeClone.Type(item) }); + } + /** `[Extended]` Creates a String type */ + RegExp(unresolved, options = {}) { + const pattern = ValueGuard.IsString(unresolved) ? unresolved : unresolved.source; + return this.Create({ ...options, [exports.Kind]: 'String', type: 'string', pattern }); + } + /** + * @deprecated Use `Type.RegExp` + */ + RegEx(regex, options = {}) { + return this.RegExp(regex, options); + } + /** `[JavaScript]` Extracts the ReturnType from the given Function type */ + ReturnType(schema, options = {}) { + return TypeClone.Type(schema.returns, options); + } + /** `[JavaScript]` Creates a Symbol type */ + Symbol(options) { + return this.Create({ ...options, [exports.Kind]: 'Symbol', type: 'symbol' }); + } + /** `[JavaScript]` Creates a Undefined type */ + Undefined(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Undefined', type: 'undefined' }); + } + /** `[JavaScript]` Creates a Uint8Array type */ + Uint8Array(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Uint8Array', type: 'Uint8Array' }); + } + /** `[JavaScript]` Creates a Void type */ + Void(options = {}) { + return this.Create({ ...options, [exports.Kind]: 'Void', type: 'void' }); + } +} +exports.JavaScriptTypeBuilder = JavaScriptTypeBuilder; +/** Json Type Builder with Static Resolution for TypeScript */ +exports.JsonType = new JsonTypeBuilder(); +/** JavaScript Type Builder with Static Resolution for TypeScript */ +exports.Type = new JavaScriptTypeBuilder(); + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/cast.js": +/*!******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/cast.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Cast = exports.Default = exports.DefaultClone = exports.ValueCastUnknownTypeError = exports.ValueCastRecursiveTypeError = exports.ValueCastNeverTypeError = exports.ValueCastArrayUniqueItemsTypeError = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const create_1 = __webpack_require__(/*! ./create */ "./node_modules/@sinclair/typebox/value/create.js"); +const check_1 = __webpack_require__(/*! ./check */ "./node_modules/@sinclair/typebox/value/check.js"); +const clone_1 = __webpack_require__(/*! ./clone */ "./node_modules/@sinclair/typebox/value/clone.js"); +const deref_1 = __webpack_require__(/*! ./deref */ "./node_modules/@sinclair/typebox/value/deref.js"); +const Types = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class ValueCastArrayUniqueItemsTypeError extends Types.TypeBoxError { + constructor(schema, value) { + super('Array cast produced invalid data due to uniqueItems constraint'); + this.schema = schema; + this.value = value; + } +} +exports.ValueCastArrayUniqueItemsTypeError = ValueCastArrayUniqueItemsTypeError; +class ValueCastNeverTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Never types cannot be cast'); + this.schema = schema; + } +} +exports.ValueCastNeverTypeError = ValueCastNeverTypeError; +class ValueCastRecursiveTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Cannot cast recursive schemas'); + this.schema = schema; + } +} +exports.ValueCastRecursiveTypeError = ValueCastRecursiveTypeError; +class ValueCastUnknownTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +exports.ValueCastUnknownTypeError = ValueCastUnknownTypeError; +// -------------------------------------------------------------------------- +// The following will score a schema against a value. For objects, the score +// is the tally of points awarded for each property of the value. Property +// points are (1.0 / propertyCount) to prevent large property counts biasing +// results. Properties that match literal values are maximally awarded as +// literals are typically used as union discriminator fields. +// -------------------------------------------------------------------------- +var UnionCastCreate; +(function (UnionCastCreate) { + function Score(schema, references, value) { + if (schema[Types.Kind] === 'Object' && typeof value === 'object' && !(0, guard_1.IsNull)(value)) { + const object = schema; + const keys = Object.getOwnPropertyNames(value); + const entries = Object.entries(object.properties); + const [point, max] = [1 / entries.length, entries.length]; + return entries.reduce((acc, [key, schema]) => { + const literal = schema[Types.Kind] === 'Literal' && schema.const === value[key] ? max : 0; + const checks = (0, check_1.Check)(schema, references, value[key]) ? point : 0; + const exists = keys.includes(key) ? point : 0; + return acc + (literal + checks + exists); + }, 0); + } + else { + return (0, check_1.Check)(schema, references, value) ? 1 : 0; + } + } + function Select(union, references, value) { + let [select, best] = [union.anyOf[0], 0]; + for (const schema of union.anyOf) { + const score = Score(schema, references, value); + if (score > best) { + select = schema; + best = score; + } + } + return select; + } + function Create(union, references, value) { + if ('default' in union) { + return union.default; + } + else { + const schema = Select(union, references, value); + return Cast(schema, references, value); + } + } + UnionCastCreate.Create = Create; +})(UnionCastCreate || (UnionCastCreate = {})); +// -------------------------------------------------------------------------- +// Default +// -------------------------------------------------------------------------- +function DefaultClone(schema, references, value) { + return (0, check_1.Check)(schema, references, value) ? (0, clone_1.Clone)(value) : (0, create_1.Create)(schema, references); +} +exports.DefaultClone = DefaultClone; +function Default(schema, references, value) { + return (0, check_1.Check)(schema, references, value) ? value : (0, create_1.Create)(schema, references); +} +exports.Default = Default; +// -------------------------------------------------------------------------- +// Cast +// -------------------------------------------------------------------------- +function TArray(schema, references, value) { + if ((0, check_1.Check)(schema, references, value)) + return (0, clone_1.Clone)(value); + const created = (0, guard_1.IsArray)(value) ? (0, clone_1.Clone)(value) : (0, create_1.Create)(schema, references); + const minimum = (0, guard_1.IsNumber)(schema.minItems) && created.length < schema.minItems ? [...created, ...Array.from({ length: schema.minItems - created.length }, () => null)] : created; + const maximum = (0, guard_1.IsNumber)(schema.maxItems) && minimum.length > schema.maxItems ? minimum.slice(0, schema.maxItems) : minimum; + const casted = maximum.map((value) => Visit(schema.items, references, value)); + if (schema.uniqueItems !== true) + return casted; + const unique = [...new Set(casted)]; + if (!(0, check_1.Check)(schema, references, unique)) + throw new ValueCastArrayUniqueItemsTypeError(schema, unique); + return unique; +} +function TConstructor(schema, references, value) { + if ((0, check_1.Check)(schema, references, value)) + return (0, create_1.Create)(schema, references); + const required = new Set(schema.returns.required || []); + const result = function () { }; + for (const [key, property] of Object.entries(schema.returns.properties)) { + if (!required.has(key) && value.prototype[key] === undefined) + continue; + result.prototype[key] = Visit(property, references, value.prototype[key]); + } + return result; +} +function TIntersect(schema, references, value) { + const created = (0, create_1.Create)(schema, references); + const mapped = (0, guard_1.IsPlainObject)(created) && (0, guard_1.IsPlainObject)(value) ? { ...created, ...value } : value; + return (0, check_1.Check)(schema, references, mapped) ? mapped : (0, create_1.Create)(schema, references); +} +function TNever(schema, references, value) { + throw new ValueCastNeverTypeError(schema); +} +function TObject(schema, references, value) { + if ((0, check_1.Check)(schema, references, value)) + return value; + if (value === null || typeof value !== 'object') + return (0, create_1.Create)(schema, references); + const required = new Set(schema.required || []); + const result = {}; + for (const [key, property] of Object.entries(schema.properties)) { + if (!required.has(key) && value[key] === undefined) + continue; + result[key] = Visit(property, references, value[key]); + } + // additional schema properties + if (typeof schema.additionalProperties === 'object') { + const propertyNames = Object.getOwnPropertyNames(schema.properties); + for (const propertyName of Object.getOwnPropertyNames(value)) { + if (propertyNames.includes(propertyName)) + continue; + result[propertyName] = Visit(schema.additionalProperties, references, value[propertyName]); + } + } + return result; +} +function TRecord(schema, references, value) { + if ((0, check_1.Check)(schema, references, value)) + return (0, clone_1.Clone)(value); + if (value === null || typeof value !== 'object' || Array.isArray(value) || value instanceof Date) + return (0, create_1.Create)(schema, references); + const subschemaPropertyName = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const subschema = schema.patternProperties[subschemaPropertyName]; + const result = {}; + for (const [propKey, propValue] of Object.entries(value)) { + result[propKey] = Visit(subschema, references, propValue); + } + return result; +} +function TRef(schema, references, value) { + return Visit((0, deref_1.Deref)(schema, references), references, value); +} +function TThis(schema, references, value) { + return Visit((0, deref_1.Deref)(schema, references), references, value); +} +function TTuple(schema, references, value) { + if ((0, check_1.Check)(schema, references, value)) + return (0, clone_1.Clone)(value); + if (!(0, guard_1.IsArray)(value)) + return (0, create_1.Create)(schema, references); + if (schema.items === undefined) + return []; + return schema.items.map((schema, index) => Visit(schema, references, value[index])); +} +function TUnion(schema, references, value) { + return (0, check_1.Check)(schema, references, value) ? (0, clone_1.Clone)(value) : UnionCastCreate.Create(schema, references, value); +} +function Visit(schema, references, value) { + const references_ = (0, guard_1.IsString)(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + switch (schema[Types.Kind]) { + // ------------------------------------------------------ + // Structural + // ------------------------------------------------------ + case 'Array': + return TArray(schema_, references_, value); + case 'Constructor': + return TConstructor(schema_, references_, value); + case 'Intersect': + return TIntersect(schema_, references_, value); + case 'Never': + return TNever(schema_, references_, value); + case 'Object': + return TObject(schema_, references_, value); + case 'Record': + return TRecord(schema_, references_, value); + case 'Ref': + return TRef(schema_, references_, value); + case 'This': + return TThis(schema_, references_, value); + case 'Tuple': + return TTuple(schema_, references_, value); + case 'Union': + return TUnion(schema_, references_, value); + // ------------------------------------------------------ + // DefaultClone + // ------------------------------------------------------ + case 'Date': + case 'Symbol': + case 'Uint8Array': + return DefaultClone(schema, references, value); + // ------------------------------------------------------ + // Default + // ------------------------------------------------------ + case 'Any': + case 'AsyncIterator': + case 'BigInt': + case 'Boolean': + case 'Function': + case 'Integer': + case 'Iterator': + case 'Literal': + case 'Not': + case 'Null': + case 'Number': + case 'Promise': + case 'String': + case 'TemplateLiteral': + case 'Undefined': + case 'Unknown': + case 'Void': + return Default(schema_, references_, value); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new ValueCastUnknownTypeError(schema_); + return Default(schema_, references_, value); + } +} +/** Casts a value into a given type. The return value will retain as much information of the original value as possible. */ +function Cast(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} +exports.Cast = Cast; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/check.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/check.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Check = exports.ValueCheckUnknownTypeError = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const index_1 = __webpack_require__(/*! ../system/index */ "./node_modules/@sinclair/typebox/system/index.js"); +const deref_1 = __webpack_require__(/*! ./deref */ "./node_modules/@sinclair/typebox/value/deref.js"); +const hash_1 = __webpack_require__(/*! ./hash */ "./node_modules/@sinclair/typebox/value/hash.js"); +const Types = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class ValueCheckUnknownTypeError extends Types.TypeBoxError { + constructor(schema) { + super(`Unknown type`); + this.schema = schema; + } +} +exports.ValueCheckUnknownTypeError = ValueCheckUnknownTypeError; +// -------------------------------------------------------------------------- +// TypeGuards +// -------------------------------------------------------------------------- +function IsAnyOrUnknown(schema) { + return schema[Types.Kind] === 'Any' || schema[Types.Kind] === 'Unknown'; +} +// -------------------------------------------------------------------------- +// Guards +// -------------------------------------------------------------------------- +function IsDefined(value) { + return value !== undefined; +} +// -------------------------------------------------------------------------- +// Types +// -------------------------------------------------------------------------- +function TAny(schema, references, value) { + return true; +} +function TArray(schema, references, value) { + if (!(0, guard_1.IsArray)(value)) + return false; + if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) { + return false; + } + if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) { + return false; + } + if (!value.every((value) => Visit(schema.items, references, value))) { + return false; + } + // prettier-ignore + if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) { + const hashed = (0, hash_1.Hash)(element); + if (set.has(hashed)) { + return false; + } + else { + set.add(hashed); + } + } return true; })())) { + return false; + } + // contains + if (!(IsDefined(schema.contains) || (0, guard_1.IsNumber)(schema.minContains) || (0, guard_1.IsNumber)(schema.maxContains))) { + return true; // exit + } + const containsSchema = IsDefined(schema.contains) ? schema.contains : Types.Type.Never(); + const containsCount = value.reduce((acc, value) => (Visit(containsSchema, references, value) ? acc + 1 : acc), 0); + if (containsCount === 0) { + return false; + } + if ((0, guard_1.IsNumber)(schema.minContains) && containsCount < schema.minContains) { + return false; + } + if ((0, guard_1.IsNumber)(schema.maxContains) && containsCount > schema.maxContains) { + return false; + } + return true; +} +function TAsyncIterator(schema, references, value) { + return (0, guard_1.IsAsyncIterator)(value); +} +function TBigInt(schema, references, value) { + if (!(0, guard_1.IsBigInt)(value)) + return false; + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === BigInt(0))) { + return false; + } + return true; +} +function TBoolean(schema, references, value) { + return (0, guard_1.IsBoolean)(value); +} +function TConstructor(schema, references, value) { + return Visit(schema.returns, references, value.prototype); +} +function TDate(schema, references, value) { + if (!(0, guard_1.IsDate)(value)) + return false; + if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) { + return false; + } + if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) { + return false; + } + if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) { + return false; + } + if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) { + return false; + } + if (IsDefined(schema.multipleOfTimestamp) && !(value.getTime() % schema.multipleOfTimestamp === 0)) { + return false; + } + return true; +} +function TFunction(schema, references, value) { + return (0, guard_1.IsFunction)(value); +} +function TInteger(schema, references, value) { + if (!(0, guard_1.IsInteger)(value)) { + return false; + } + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + return false; + } + return true; +} +function TIntersect(schema, references, value) { + const check1 = schema.allOf.every((schema) => Visit(schema, references, value)); + if (schema.unevaluatedProperties === false) { + const keyPattern = new RegExp(Types.KeyResolver.ResolvePattern(schema)); + const check2 = Object.getOwnPropertyNames(value).every((key) => keyPattern.test(key)); + return check1 && check2; + } + else if (Types.TypeGuard.TSchema(schema.unevaluatedProperties)) { + const keyCheck = new RegExp(Types.KeyResolver.ResolvePattern(schema)); + const check2 = Object.getOwnPropertyNames(value).every((key) => keyCheck.test(key) || Visit(schema.unevaluatedProperties, references, value[key])); + return check1 && check2; + } + else { + return check1; + } +} +function TIterator(schema, references, value) { + return (0, guard_1.IsIterator)(value); +} +function TLiteral(schema, references, value) { + return value === schema.const; +} +function TNever(schema, references, value) { + return false; +} +function TNot(schema, references, value) { + return !Visit(schema.not, references, value); +} +function TNull(schema, references, value) { + return (0, guard_1.IsNull)(value); +} +function TNumber(schema, references, value) { + if (!index_1.TypeSystemPolicy.IsNumberLike(value)) + return false; + if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) { + return false; + } + if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) { + return false; + } + if (IsDefined(schema.minimum) && !(value >= schema.minimum)) { + return false; + } + if (IsDefined(schema.maximum) && !(value <= schema.maximum)) { + return false; + } + if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) { + return false; + } + return true; +} +function TObject(schema, references, value) { + if (!index_1.TypeSystemPolicy.IsObjectLike(value)) + return false; + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + return false; + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + return false; + } + const knownKeys = Object.getOwnPropertyNames(schema.properties); + for (const knownKey of knownKeys) { + const property = schema.properties[knownKey]; + if (schema.required && schema.required.includes(knownKey)) { + if (!Visit(property, references, value[knownKey])) { + return false; + } + if ((Types.ExtendsUndefined.Check(property) || IsAnyOrUnknown(property)) && !(knownKey in value)) { + return false; + } + } + else { + if (index_1.TypeSystemPolicy.IsExactOptionalProperty(value, knownKey) && !Visit(property, references, value[knownKey])) { + return false; + } + } + } + if (schema.additionalProperties === false) { + const valueKeys = Object.getOwnPropertyNames(value); + // optimization: value is valid if schemaKey length matches the valueKey length + if (schema.required && schema.required.length === knownKeys.length && valueKeys.length === knownKeys.length) { + return true; + } + else { + return valueKeys.every((valueKey) => knownKeys.includes(valueKey)); + } + } + else if (typeof schema.additionalProperties === 'object') { + const valueKeys = Object.getOwnPropertyNames(value); + return valueKeys.every((key) => knownKeys.includes(key) || Visit(schema.additionalProperties, references, value[key])); + } + else { + return true; + } +} +function TPromise(schema, references, value) { + return (0, guard_1.IsPromise)(value); +} +function TRecord(schema, references, value) { + if (!index_1.TypeSystemPolicy.IsRecordLike(value)) { + return false; + } + if (IsDefined(schema.minProperties) && !(Object.getOwnPropertyNames(value).length >= schema.minProperties)) { + return false; + } + if (IsDefined(schema.maxProperties) && !(Object.getOwnPropertyNames(value).length <= schema.maxProperties)) { + return false; + } + const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0]; + const regex = new RegExp(patternKey); + // prettier-ignore + const check1 = Object.entries(value).every(([key, value]) => { + return (regex.test(key)) ? Visit(patternSchema, references, value) : true; + }); + // prettier-ignore + const check2 = typeof schema.additionalProperties === 'object' ? Object.entries(value).every(([key, value]) => { + return (!regex.test(key)) ? Visit(schema.additionalProperties, references, value) : true; + }) : true; + const check3 = schema.additionalProperties === false + ? Object.getOwnPropertyNames(value).every((key) => { + return regex.test(key); + }) + : true; + return check1 && check2 && check3; +} +function TRef(schema, references, value) { + return Visit((0, deref_1.Deref)(schema, references), references, value); +} +function TString(schema, references, value) { + if (!(0, guard_1.IsString)(value)) { + return false; + } + if (IsDefined(schema.minLength)) { + if (!(value.length >= schema.minLength)) + return false; + } + if (IsDefined(schema.maxLength)) { + if (!(value.length <= schema.maxLength)) + return false; + } + if (IsDefined(schema.pattern)) { + const regex = new RegExp(schema.pattern); + if (!regex.test(value)) + return false; + } + if (IsDefined(schema.format)) { + if (!Types.FormatRegistry.Has(schema.format)) + return false; + const func = Types.FormatRegistry.Get(schema.format); + return func(value); + } + return true; +} +function TSymbol(schema, references, value) { + return (0, guard_1.IsSymbol)(value); +} +function TTemplateLiteral(schema, references, value) { + return (0, guard_1.IsString)(value) && new RegExp(schema.pattern).test(value); +} +function TThis(schema, references, value) { + return Visit((0, deref_1.Deref)(schema, references), references, value); +} +function TTuple(schema, references, value) { + if (!(0, guard_1.IsArray)(value)) { + return false; + } + if (schema.items === undefined && !(value.length === 0)) { + return false; + } + if (!(value.length === schema.maxItems)) { + return false; + } + if (!schema.items) { + return true; + } + for (let i = 0; i < schema.items.length; i++) { + if (!Visit(schema.items[i], references, value[i])) + return false; + } + return true; +} +function TUndefined(schema, references, value) { + return (0, guard_1.IsUndefined)(value); +} +function TUnion(schema, references, value) { + return schema.anyOf.some((inner) => Visit(inner, references, value)); +} +function TUint8Array(schema, references, value) { + if (!(0, guard_1.IsUint8Array)(value)) { + return false; + } + if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) { + return false; + } + if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) { + return false; + } + return true; +} +function TUnknown(schema, references, value) { + return true; +} +function TVoid(schema, references, value) { + return index_1.TypeSystemPolicy.IsVoidLike(value); +} +function TKind(schema, references, value) { + if (!Types.TypeRegistry.Has(schema[Types.Kind])) + return false; + const func = Types.TypeRegistry.Get(schema[Types.Kind]); + return func(schema, value); +} +function Visit(schema, references, value) { + const references_ = IsDefined(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + switch (schema_[Types.Kind]) { + case 'Any': + return TAny(schema_, references_, value); + case 'Array': + return TArray(schema_, references_, value); + case 'AsyncIterator': + return TAsyncIterator(schema_, references_, value); + case 'BigInt': + return TBigInt(schema_, references_, value); + case 'Boolean': + return TBoolean(schema_, references_, value); + case 'Constructor': + return TConstructor(schema_, references_, value); + case 'Date': + return TDate(schema_, references_, value); + case 'Function': + return TFunction(schema_, references_, value); + case 'Integer': + return TInteger(schema_, references_, value); + case 'Intersect': + return TIntersect(schema_, references_, value); + case 'Iterator': + return TIterator(schema_, references_, value); + case 'Literal': + return TLiteral(schema_, references_, value); + case 'Never': + return TNever(schema_, references_, value); + case 'Not': + return TNot(schema_, references_, value); + case 'Null': + return TNull(schema_, references_, value); + case 'Number': + return TNumber(schema_, references_, value); + case 'Object': + return TObject(schema_, references_, value); + case 'Promise': + return TPromise(schema_, references_, value); + case 'Record': + return TRecord(schema_, references_, value); + case 'Ref': + return TRef(schema_, references_, value); + case 'String': + return TString(schema_, references_, value); + case 'Symbol': + return TSymbol(schema_, references_, value); + case 'TemplateLiteral': + return TTemplateLiteral(schema_, references_, value); + case 'This': + return TThis(schema_, references_, value); + case 'Tuple': + return TTuple(schema_, references_, value); + case 'Undefined': + return TUndefined(schema_, references_, value); + case 'Union': + return TUnion(schema_, references_, value); + case 'Uint8Array': + return TUint8Array(schema_, references_, value); + case 'Unknown': + return TUnknown(schema_, references_, value); + case 'Void': + return TVoid(schema_, references_, value); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new ValueCheckUnknownTypeError(schema_); + return TKind(schema_, references_, value); + } +} +/** Returns true if the value matches the given type. */ +function Check(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} +exports.Check = Check; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/clone.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/clone.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Clone = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +// -------------------------------------------------------------------------- +// Clonable +// -------------------------------------------------------------------------- +function ObjectType(value) { + const keys = [...Object.getOwnPropertyNames(value), ...Object.getOwnPropertySymbols(value)]; + return keys.reduce((acc, key) => ({ ...acc, [key]: Clone(value[key]) }), {}); +} +function ArrayType(value) { + return value.map((element) => Clone(element)); +} +function TypedArrayType(value) { + return value.slice(); +} +function DateType(value) { + return new Date(value.toISOString()); +} +function ValueType(value) { + return value; +} +// -------------------------------------------------------------------------- +// Clone +// -------------------------------------------------------------------------- +/** Returns a clone of the given value */ +function Clone(value) { + if ((0, guard_1.IsArray)(value)) + return ArrayType(value); + if ((0, guard_1.IsDate)(value)) + return DateType(value); + if ((0, guard_1.IsPlainObject)(value)) + return ObjectType(value); + if ((0, guard_1.IsTypedArray)(value)) + return TypedArrayType(value); + if ((0, guard_1.IsValueType)(value)) + return ValueType(value); + throw new Error('ValueClone: Unable to clone value'); +} +exports.Clone = Clone; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/convert.js": +/*!*********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/convert.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Convert = exports.Default = exports.ValueConvertUnknownTypeError = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const clone_1 = __webpack_require__(/*! ./clone */ "./node_modules/@sinclair/typebox/value/clone.js"); +const check_1 = __webpack_require__(/*! ./check */ "./node_modules/@sinclair/typebox/value/check.js"); +const deref_1 = __webpack_require__(/*! ./deref */ "./node_modules/@sinclair/typebox/value/deref.js"); +const Types = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class ValueConvertUnknownTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +exports.ValueConvertUnknownTypeError = ValueConvertUnknownTypeError; +// -------------------------------------------------------------------------- +// Conversions +// -------------------------------------------------------------------------- +function IsStringNumeric(value) { + return (0, guard_1.IsString)(value) && !isNaN(value) && !isNaN(parseFloat(value)); +} +function IsValueToString(value) { + return (0, guard_1.IsBigInt)(value) || (0, guard_1.IsBoolean)(value) || (0, guard_1.IsNumber)(value); +} +function IsValueTrue(value) { + return value === true || ((0, guard_1.IsNumber)(value) && value === 1) || ((0, guard_1.IsBigInt)(value) && value === BigInt('1')) || ((0, guard_1.IsString)(value) && (value.toLowerCase() === 'true' || value === '1')); +} +function IsValueFalse(value) { + return value === false || ((0, guard_1.IsNumber)(value) && (value === 0 || Object.is(value, -0))) || ((0, guard_1.IsBigInt)(value) && value === BigInt('0')) || ((0, guard_1.IsString)(value) && (value.toLowerCase() === 'false' || value === '0' || value === '-0')); +} +function IsTimeStringWithTimeZone(value) { + return (0, guard_1.IsString)(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value); +} +function IsTimeStringWithoutTimeZone(value) { + return (0, guard_1.IsString)(value) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value); +} +function IsDateTimeStringWithTimeZone(value) { + return (0, guard_1.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(value); +} +function IsDateTimeStringWithoutTimeZone(value) { + return (0, guard_1.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(value); +} +function IsDateString(value) { + return (0, guard_1.IsString)(value) && /^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(value); +} +// -------------------------------------------------------------------------- +// Convert +// -------------------------------------------------------------------------- +function TryConvertLiteralString(value, target) { + const conversion = TryConvertString(value); + return conversion === target ? conversion : value; +} +function TryConvertLiteralNumber(value, target) { + const conversion = TryConvertNumber(value); + return conversion === target ? conversion : value; +} +function TryConvertLiteralBoolean(value, target) { + const conversion = TryConvertBoolean(value); + return conversion === target ? conversion : value; +} +function TryConvertLiteral(schema, value) { + if (typeof schema.const === 'string') { + return TryConvertLiteralString(value, schema.const); + } + else if (typeof schema.const === 'number') { + return TryConvertLiteralNumber(value, schema.const); + } + else if (typeof schema.const === 'boolean') { + return TryConvertLiteralBoolean(value, schema.const); + } + else { + return (0, clone_1.Clone)(value); + } +} +function TryConvertBoolean(value) { + return IsValueTrue(value) ? true : IsValueFalse(value) ? false : value; +} +function TryConvertBigInt(value) { + return IsStringNumeric(value) ? BigInt(parseInt(value)) : (0, guard_1.IsNumber)(value) ? BigInt(value | 0) : IsValueFalse(value) ? BigInt(0) : IsValueTrue(value) ? BigInt(1) : value; +} +function TryConvertString(value) { + return IsValueToString(value) ? value.toString() : (0, guard_1.IsSymbol)(value) && value.description !== undefined ? value.description.toString() : value; +} +function TryConvertNumber(value) { + return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value; +} +function TryConvertInteger(value) { + return IsStringNumeric(value) ? parseInt(value) : (0, guard_1.IsNumber)(value) ? value | 0 : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value; +} +function TryConvertNull(value) { + return (0, guard_1.IsString)(value) && value.toLowerCase() === 'null' ? null : value; +} +function TryConvertUndefined(value) { + return (0, guard_1.IsString)(value) && value === 'undefined' ? undefined : value; +} +function TryConvertDate(value) { + // -------------------------------------------------------------------------- + // note: this function may return an invalid dates for the regex tests + // above. Invalid dates will however be checked during the casting function + // and will return a epoch date if invalid. Consider better string parsing + // for the iso dates in future revisions. + // -------------------------------------------------------------------------- + return (0, guard_1.IsDate)(value) + ? value + : (0, guard_1.IsNumber)(value) + ? new Date(value) + : IsValueTrue(value) + ? new Date(1) + : IsValueFalse(value) + ? new Date(0) + : IsStringNumeric(value) + ? new Date(parseInt(value)) + : IsTimeStringWithoutTimeZone(value) + ? new Date(`1970-01-01T${value}.000Z`) + : IsTimeStringWithTimeZone(value) + ? new Date(`1970-01-01T${value}`) + : IsDateTimeStringWithoutTimeZone(value) + ? new Date(`${value}.000Z`) + : IsDateTimeStringWithTimeZone(value) + ? new Date(value) + : IsDateString(value) + ? new Date(`${value}T00:00:00.000Z`) + : value; +} +// -------------------------------------------------------------------------- +// Default +// -------------------------------------------------------------------------- +function Default(value) { + return value; +} +exports.Default = Default; +// -------------------------------------------------------------------------- +// Convert +// -------------------------------------------------------------------------- +function TArray(schema, references, value) { + if ((0, guard_1.IsArray)(value)) { + return value.map((value) => Visit(schema.items, references, value)); + } + return value; +} +function TBigInt(schema, references, value) { + return TryConvertBigInt(value); +} +function TBoolean(schema, references, value) { + return TryConvertBoolean(value); +} +function TDate(schema, references, value) { + return TryConvertDate(value); +} +function TInteger(schema, references, value) { + return TryConvertInteger(value); +} +function TIntersect(schema, references, value) { + // prettier-ignore + return (schema.allOf.every(schema => Types.TypeGuard.TObject(schema))) + ? Visit(Types.Type.Composite(schema.allOf), references, value) + : Visit(schema.allOf[0], references, value); +} +function TLiteral(schema, references, value) { + return TryConvertLiteral(schema, value); +} +function TNull(schema, references, value) { + return TryConvertNull(value); +} +function TNumber(schema, references, value) { + return TryConvertNumber(value); +} +function TObject(schema, references, value) { + if ((0, guard_1.IsObject)(value)) + return Object.getOwnPropertyNames(schema.properties).reduce((acc, key) => { + return value[key] !== undefined ? { ...acc, [key]: Visit(schema.properties[key], references, value[key]) } : { ...acc }; + }, value); + return value; +} +function TRecord(schema, references, value) { + const propertyKey = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const property = schema.patternProperties[propertyKey]; + const result = {}; + for (const [propKey, propValue] of Object.entries(value)) { + result[propKey] = Visit(property, references, propValue); + } + return result; +} +function TRef(schema, references, value) { + return Visit((0, deref_1.Deref)(schema, references), references, value); +} +function TString(schema, references, value) { + return TryConvertString(value); +} +function TSymbol(schema, references, value) { + return (0, guard_1.IsString)(value) || (0, guard_1.IsNumber)(value) ? Symbol(value) : value; +} +function TThis(schema, references, value) { + return Visit((0, deref_1.Deref)(schema, references), references, value); +} +function TTuple(schema, references, value) { + if ((0, guard_1.IsArray)(value) && !(0, guard_1.IsUndefined)(schema.items)) { + return value.map((value, index) => { + return index < schema.items.length ? Visit(schema.items[index], references, value) : value; + }); + } + return value; +} +function TUndefined(schema, references, value) { + return TryConvertUndefined(value); +} +function TUnion(schema, references, value) { + for (const subschema of schema.anyOf) { + const converted = Visit(subschema, references, value); + if ((0, check_1.Check)(subschema, references, converted)) { + return converted; + } + } + return value; +} +function Visit(schema, references, value) { + const references_ = (0, guard_1.IsString)(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + switch (schema[Types.Kind]) { + // ------------------------------------------------------ + // Structural + // ------------------------------------------------------ + case 'Array': + return TArray(schema_, references_, value); + case 'BigInt': + return TBigInt(schema_, references_, value); + case 'Boolean': + return TBoolean(schema_, references_, value); + case 'Date': + return TDate(schema_, references_, value); + case 'Integer': + return TInteger(schema_, references_, value); + case 'Intersect': + return TIntersect(schema_, references_, value); + case 'Literal': + return TLiteral(schema_, references_, value); + case 'Null': + return TNull(schema_, references_, value); + case 'Number': + return TNumber(schema_, references_, value); + case 'Object': + return TObject(schema_, references_, value); + case 'Record': + return TRecord(schema_, references_, value); + case 'Ref': + return TRef(schema_, references_, value); + case 'String': + return TString(schema_, references_, value); + case 'Symbol': + return TSymbol(schema_, references_, value); + case 'This': + return TThis(schema_, references_, value); + case 'Tuple': + return TTuple(schema_, references_, value); + case 'Undefined': + return TUndefined(schema_, references_, value); + case 'Union': + return TUnion(schema_, references_, value); + // ------------------------------------------------------ + // Default + // ------------------------------------------------------ + case 'Any': + case 'AsyncIterator': + case 'Constructor': + case 'Function': + case 'Iterator': + case 'Never': + case 'Promise': + case 'TemplateLiteral': + case 'Uint8Array': + case 'Unknown': + case 'Void': + return Default(value); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new ValueConvertUnknownTypeError(schema_); + return Default(value); + } +} +/** Converts any type mismatched values to their target type if a reasonable conversion is possible. */ +function Convert(...args) { + return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]); +} +exports.Convert = Convert; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/create.js": +/*!********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/create.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Create = exports.ValueCreateRecursiveInstantiationError = exports.ValueCreateTempateLiteralTypeError = exports.ValueCreateIntersectTypeError = exports.ValueCreateNotTypeError = exports.ValueCreateNeverTypeError = exports.ValueCreateUnknownTypeError = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const check_1 = __webpack_require__(/*! ./check */ "./node_modules/@sinclair/typebox/value/check.js"); +const deref_1 = __webpack_require__(/*! ./deref */ "./node_modules/@sinclair/typebox/value/deref.js"); +const Types = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class ValueCreateUnknownTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Unknown type'); + this.schema = schema; + } +} +exports.ValueCreateUnknownTypeError = ValueCreateUnknownTypeError; +class ValueCreateNeverTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Never types cannot be created'); + this.schema = schema; + } +} +exports.ValueCreateNeverTypeError = ValueCreateNeverTypeError; +class ValueCreateNotTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Not types must have a default value'); + this.schema = schema; + } +} +exports.ValueCreateNotTypeError = ValueCreateNotTypeError; +class ValueCreateIntersectTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Intersect produced invalid value. Consider using a default value.'); + this.schema = schema; + } +} +exports.ValueCreateIntersectTypeError = ValueCreateIntersectTypeError; +class ValueCreateTempateLiteralTypeError extends Types.TypeBoxError { + constructor(schema) { + super('Can only create template literal values from patterns that produce finite sequences. Consider using a default value.'); + this.schema = schema; + } +} +exports.ValueCreateTempateLiteralTypeError = ValueCreateTempateLiteralTypeError; +class ValueCreateRecursiveInstantiationError extends Types.TypeBoxError { + constructor(schema, recursiveMaxDepth) { + super('Value cannot be created as recursive type may produce value of infinite size. Consider using a default.'); + this.schema = schema; + this.recursiveMaxDepth = recursiveMaxDepth; + } +} +exports.ValueCreateRecursiveInstantiationError = ValueCreateRecursiveInstantiationError; +// -------------------------------------------------------------------------- +// Types +// -------------------------------------------------------------------------- +function TAny(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return {}; + } +} +function TArray(schema, references) { + if (schema.uniqueItems === true && !(0, guard_1.HasPropertyKey)(schema, 'default')) { + throw new Error('ValueCreate.Array: Array with the uniqueItems constraint requires a default value'); + } + else if ('contains' in schema && !(0, guard_1.HasPropertyKey)(schema, 'default')) { + throw new Error('ValueCreate.Array: Array with the contains constraint requires a default value'); + } + else if ('default' in schema) { + return schema.default; + } + else if (schema.minItems !== undefined) { + return Array.from({ length: schema.minItems }).map((item) => { + return Visit(schema.items, references); + }); + } + else { + return []; + } +} +function TAsyncIterator(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return (async function* () { })(); + } +} +function TBigInt(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return BigInt(0); + } +} +function TBoolean(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return false; + } +} +function TConstructor(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + const value = Visit(schema.returns, references); + if (typeof value === 'object' && !Array.isArray(value)) { + return class { + constructor() { + for (const [key, val] of Object.entries(value)) { + const self = this; + self[key] = val; + } + } + }; + } + else { + return class { + }; + } + } +} +function TDate(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else if (schema.minimumTimestamp !== undefined) { + return new Date(schema.minimumTimestamp); + } + else { + return new Date(0); + } +} +function TFunction(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return () => Visit(schema.returns, references); + } +} +function TInteger(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else if (schema.minimum !== undefined) { + return schema.minimum; + } + else { + return 0; + } +} +function TIntersect(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + // Note: The best we can do here is attempt to instance each sub type and apply through object assign. For non-object + // sub types, we just escape the assignment and just return the value. In the latter case, this is typically going to + // be a consequence of an illogical intersection. + const value = schema.allOf.reduce((acc, schema) => { + const next = Visit(schema, references); + return typeof next === 'object' ? { ...acc, ...next } : next; + }, {}); + if (!(0, check_1.Check)(schema, references, value)) + throw new ValueCreateIntersectTypeError(schema); + return value; + } +} +function TIterator(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return (function* () { })(); + } +} +function TLiteral(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return schema.const; + } +} +function TNever(schema, references) { + throw new ValueCreateNeverTypeError(schema); +} +function TNot(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + throw new ValueCreateNotTypeError(schema); + } +} +function TNull(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return null; + } +} +function TNumber(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else if (schema.minimum !== undefined) { + return schema.minimum; + } + else { + return 0; + } +} +function TObject(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + const required = new Set(schema.required); + return (schema.default || + Object.entries(schema.properties).reduce((acc, [key, schema]) => { + return required.has(key) ? { ...acc, [key]: Visit(schema, references) } : { ...acc }; + }, {})); + } +} +function TPromise(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return Promise.resolve(Visit(schema.item, references)); + } +} +function TRecord(schema, references) { + const [keyPattern, valueSchema] = Object.entries(schema.patternProperties)[0]; + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else if (!(keyPattern === Types.PatternStringExact || keyPattern === Types.PatternNumberExact)) { + const propertyKeys = keyPattern.slice(1, keyPattern.length - 1).split('|'); + return propertyKeys.reduce((acc, key) => { + return { ...acc, [key]: Visit(valueSchema, references) }; + }, {}); + } + else { + return {}; + } +} +function TRef(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return Visit((0, deref_1.Deref)(schema, references), references); + } +} +function TString(schema, references) { + if (schema.pattern !== undefined) { + if (!(0, guard_1.HasPropertyKey)(schema, 'default')) { + throw new Error('ValueCreate.String: String types with patterns must specify a default value'); + } + else { + return schema.default; + } + } + else if (schema.format !== undefined) { + if (!(0, guard_1.HasPropertyKey)(schema, 'default')) { + throw new Error('ValueCreate.String: String types with formats must specify a default value'); + } + else { + return schema.default; + } + } + else { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else if (schema.minLength !== undefined) { + return Array.from({ length: schema.minLength }) + .map(() => '.') + .join(''); + } + else { + return ''; + } + } +} +function TSymbol(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else if ('value' in schema) { + return Symbol.for(schema.value); + } + else { + return Symbol(); + } +} +function TTemplateLiteral(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + const expression = Types.TemplateLiteralParser.ParseExact(schema.pattern); + if (!Types.TemplateLiteralFinite.Check(expression)) + throw new ValueCreateTempateLiteralTypeError(schema); + const sequence = Types.TemplateLiteralGenerator.Generate(expression); + return sequence.next().value; +} +function TThis(schema, references) { + if (recursiveDepth++ > recursiveMaxDepth) + throw new ValueCreateRecursiveInstantiationError(schema, recursiveMaxDepth); + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return Visit((0, deref_1.Deref)(schema, references), references); + } +} +function TTuple(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + if (schema.items === undefined) { + return []; + } + else { + return Array.from({ length: schema.minItems }).map((_, index) => Visit(schema.items[index], references)); + } +} +function TUndefined(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return undefined; + } +} +function TUnion(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else if (schema.anyOf.length === 0) { + throw new Error('ValueCreate.Union: Cannot create Union with zero variants'); + } + else { + return Visit(schema.anyOf[0], references); + } +} +function TUint8Array(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else if (schema.minByteLength !== undefined) { + return new Uint8Array(schema.minByteLength); + } + else { + return new Uint8Array(0); + } +} +function TUnknown(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return {}; + } +} +function TVoid(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + return void 0; + } +} +function TKind(schema, references) { + if ((0, guard_1.HasPropertyKey)(schema, 'default')) { + return schema.default; + } + else { + throw new Error('User defined types must specify a default value'); + } +} +function Visit(schema, references) { + const references_ = (0, guard_1.IsString)(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + switch (schema_[Types.Kind]) { + case 'Any': + return TAny(schema_, references_); + case 'Array': + return TArray(schema_, references_); + case 'AsyncIterator': + return TAsyncIterator(schema_, references_); + case 'BigInt': + return TBigInt(schema_, references_); + case 'Boolean': + return TBoolean(schema_, references_); + case 'Constructor': + return TConstructor(schema_, references_); + case 'Date': + return TDate(schema_, references_); + case 'Function': + return TFunction(schema_, references_); + case 'Integer': + return TInteger(schema_, references_); + case 'Intersect': + return TIntersect(schema_, references_); + case 'Iterator': + return TIterator(schema_, references_); + case 'Literal': + return TLiteral(schema_, references_); + case 'Never': + return TNever(schema_, references_); + case 'Not': + return TNot(schema_, references_); + case 'Null': + return TNull(schema_, references_); + case 'Number': + return TNumber(schema_, references_); + case 'Object': + return TObject(schema_, references_); + case 'Promise': + return TPromise(schema_, references_); + case 'Record': + return TRecord(schema_, references_); + case 'Ref': + return TRef(schema_, references_); + case 'String': + return TString(schema_, references_); + case 'Symbol': + return TSymbol(schema_, references_); + case 'TemplateLiteral': + return TTemplateLiteral(schema_, references_); + case 'This': + return TThis(schema_, references_); + case 'Tuple': + return TTuple(schema_, references_); + case 'Undefined': + return TUndefined(schema_, references_); + case 'Union': + return TUnion(schema_, references_); + case 'Uint8Array': + return TUint8Array(schema_, references_); + case 'Unknown': + return TUnknown(schema_, references_); + case 'Void': + return TVoid(schema_, references_); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new ValueCreateUnknownTypeError(schema_); + return TKind(schema_, references_); + } +} +// -------------------------------------------------------------------------- +// State +// -------------------------------------------------------------------------- +const recursiveMaxDepth = 512; +let recursiveDepth = 0; +/** Creates a value from the given schema */ +function Create(...args) { + recursiveDepth = 0; + return args.length === 2 ? Visit(args[0], args[1]) : Visit(args[0], []); +} +exports.Create = Create; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/delta.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/delta.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Patch = exports.Diff = exports.ValueDeltaUnableToDiffUnknownValue = exports.ValueDeltaObjectWithSymbolKeyError = exports.Edit = exports.Delete = exports.Update = exports.Insert = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const typebox_1 = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +const pointer_1 = __webpack_require__(/*! ./pointer */ "./node_modules/@sinclair/typebox/value/pointer.js"); +const clone_1 = __webpack_require__(/*! ./clone */ "./node_modules/@sinclair/typebox/value/clone.js"); +exports.Insert = typebox_1.Type.Object({ + type: typebox_1.Type.Literal('insert'), + path: typebox_1.Type.String(), + value: typebox_1.Type.Unknown(), +}); +exports.Update = typebox_1.Type.Object({ + type: typebox_1.Type.Literal('update'), + path: typebox_1.Type.String(), + value: typebox_1.Type.Unknown(), +}); +exports.Delete = typebox_1.Type.Object({ + type: typebox_1.Type.Literal('delete'), + path: typebox_1.Type.String(), +}); +exports.Edit = typebox_1.Type.Union([exports.Insert, exports.Update, exports.Delete]); +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class ValueDeltaObjectWithSymbolKeyError extends Error { + constructor(key) { + super('Cannot diff objects with symbol keys'); + this.key = key; + } +} +exports.ValueDeltaObjectWithSymbolKeyError = ValueDeltaObjectWithSymbolKeyError; +class ValueDeltaUnableToDiffUnknownValue extends Error { + constructor(value) { + super('Unable to create diff edits for unknown value'); + this.value = value; + } +} +exports.ValueDeltaUnableToDiffUnknownValue = ValueDeltaUnableToDiffUnknownValue; +// -------------------------------------------------------------------------- +// Command Factory +// -------------------------------------------------------------------------- +function CreateUpdate(path, value) { + return { type: 'update', path, value }; +} +function CreateInsert(path, value) { + return { type: 'insert', path, value }; +} +function CreateDelete(path) { + return { type: 'delete', path }; +} +// -------------------------------------------------------------------------- +// Diffing Generators +// -------------------------------------------------------------------------- +function* ObjectType(path, current, next) { + if (!(0, guard_1.IsPlainObject)(next)) + return yield CreateUpdate(path, next); + const currentKeys = [...Object.keys(current), ...Object.getOwnPropertySymbols(current)]; + const nextKeys = [...Object.keys(next), ...Object.getOwnPropertySymbols(next)]; + for (const key of currentKeys) { + if ((0, guard_1.IsSymbol)(key)) + throw new ValueDeltaObjectWithSymbolKeyError(key); + if ((0, guard_1.IsUndefined)(next[key]) && nextKeys.includes(key)) + yield CreateUpdate(`${path}/${String(key)}`, undefined); + } + for (const key of nextKeys) { + if ((0, guard_1.IsUndefined)(current[key]) || (0, guard_1.IsUndefined)(next[key])) + continue; + if ((0, guard_1.IsSymbol)(key)) + throw new ValueDeltaObjectWithSymbolKeyError(key); + yield* Visit(`${path}/${String(key)}`, current[key], next[key]); + } + for (const key of nextKeys) { + if ((0, guard_1.IsSymbol)(key)) + throw new ValueDeltaObjectWithSymbolKeyError(key); + if ((0, guard_1.IsUndefined)(current[key])) + yield CreateInsert(`${path}/${String(key)}`, next[key]); + } + for (const key of currentKeys.reverse()) { + if ((0, guard_1.IsSymbol)(key)) + throw new ValueDeltaObjectWithSymbolKeyError(key); + if ((0, guard_1.IsUndefined)(next[key]) && !nextKeys.includes(key)) + yield CreateDelete(`${path}/${String(key)}`); + } +} +function* ArrayType(path, current, next) { + if (!(0, guard_1.IsArray)(next)) + return yield CreateUpdate(path, next); + for (let i = 0; i < Math.min(current.length, next.length); i++) { + yield* Visit(`${path}/${i}`, current[i], next[i]); + } + for (let i = 0; i < next.length; i++) { + if (i < current.length) + continue; + yield CreateInsert(`${path}/${i}`, next[i]); + } + for (let i = current.length - 1; i >= 0; i--) { + if (i < next.length) + continue; + yield CreateDelete(`${path}/${i}`); + } +} +function* TypedArrayType(path, current, next) { + if (!(0, guard_1.IsTypedArray)(next) || current.length !== next.length || Object.getPrototypeOf(current).constructor.name !== Object.getPrototypeOf(next).constructor.name) + return yield CreateUpdate(path, next); + for (let i = 0; i < Math.min(current.length, next.length); i++) { + yield* Visit(`${path}/${i}`, current[i], next[i]); + } +} +function* ValueType(path, current, next) { + if (current === next) + return; + yield CreateUpdate(path, next); +} +function* Visit(path, current, next) { + if ((0, guard_1.IsPlainObject)(current)) + return yield* ObjectType(path, current, next); + if ((0, guard_1.IsArray)(current)) + return yield* ArrayType(path, current, next); + if ((0, guard_1.IsTypedArray)(current)) + return yield* TypedArrayType(path, current, next); + if ((0, guard_1.IsValueType)(current)) + return yield* ValueType(path, current, next); + throw new ValueDeltaUnableToDiffUnknownValue(current); +} +// --------------------------------------------------------------------- +// Diff +// --------------------------------------------------------------------- +function Diff(current, next) { + return [...Visit('', current, next)]; +} +exports.Diff = Diff; +// --------------------------------------------------------------------- +// Patch +// --------------------------------------------------------------------- +function IsRootUpdate(edits) { + return edits.length > 0 && edits[0].path === '' && edits[0].type === 'update'; +} +function IsIdentity(edits) { + return edits.length === 0; +} +function Patch(current, edits) { + if (IsRootUpdate(edits)) { + return (0, clone_1.Clone)(edits[0].value); + } + if (IsIdentity(edits)) { + return (0, clone_1.Clone)(current); + } + const clone = (0, clone_1.Clone)(current); + for (const edit of edits) { + switch (edit.type) { + case 'insert': { + pointer_1.ValuePointer.Set(clone, edit.path, edit.value); + break; + } + case 'update': { + pointer_1.ValuePointer.Set(clone, edit.path, edit.value); + break; + } + case 'delete': { + pointer_1.ValuePointer.Delete(clone, edit.path); + break; + } + } + } + return clone; +} +exports.Patch = Patch; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/deref.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/deref.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Deref = exports.TypeDereferenceError = void 0; +const typebox_1 = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +class TypeDereferenceError extends typebox_1.TypeBoxError { + constructor(schema) { + super(`Unable to dereference schema with $id '${schema.$id}'`); + this.schema = schema; + } +} +exports.TypeDereferenceError = TypeDereferenceError; +/** Dereferences a schema from the references array or throws if not found */ +function Deref(schema, references) { + const index = references.findIndex((target) => target.$id === schema.$ref); + if (index === -1) + throw new TypeDereferenceError(schema); + return references[index]; +} +exports.Deref = Deref; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/equal.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/equal.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Equal = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +// -------------------------------------------------------------------------- +// Equality Checks +// -------------------------------------------------------------------------- +function ObjectType(left, right) { + if (!(0, guard_1.IsPlainObject)(right)) + return false; + const leftKeys = [...Object.keys(left), ...Object.getOwnPropertySymbols(left)]; + const rightKeys = [...Object.keys(right), ...Object.getOwnPropertySymbols(right)]; + if (leftKeys.length !== rightKeys.length) + return false; + return leftKeys.every((key) => Equal(left[key], right[key])); +} +function DateType(left, right) { + return (0, guard_1.IsDate)(right) && left.getTime() === right.getTime(); +} +function ArrayType(left, right) { + if (!(0, guard_1.IsArray)(right) || left.length !== right.length) + return false; + return left.every((value, index) => Equal(value, right[index])); +} +function TypedArrayType(left, right) { + if (!(0, guard_1.IsTypedArray)(right) || left.length !== right.length || Object.getPrototypeOf(left).constructor.name !== Object.getPrototypeOf(right).constructor.name) + return false; + return left.every((value, index) => Equal(value, right[index])); +} +function ValueType(left, right) { + return left === right; +} +// -------------------------------------------------------------------------- +// Equal +// -------------------------------------------------------------------------- +/** Returns true if the left value deep-equals the right */ +function Equal(left, right) { + if ((0, guard_1.IsPlainObject)(left)) + return ObjectType(left, right); + if ((0, guard_1.IsDate)(left)) + return DateType(left, right); + if ((0, guard_1.IsTypedArray)(left)) + return TypedArrayType(left, right); + if ((0, guard_1.IsArray)(left)) + return ArrayType(left, right); + if ((0, guard_1.IsValueType)(left)) + return ValueType(left, right); + throw new Error('ValueEquals: Unable to compare value'); +} +exports.Equal = Equal; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/guard.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/guard.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IsValueType = exports.IsSymbol = exports.IsFunction = exports.IsString = exports.IsBigInt = exports.IsInteger = exports.IsNumber = exports.IsBoolean = exports.IsNull = exports.IsUndefined = exports.IsArray = exports.IsObject = exports.IsPlainObject = exports.HasPropertyKey = exports.IsDate = exports.IsUint8Array = exports.IsPromise = exports.IsTypedArray = exports.IsIterator = exports.IsAsyncIterator = void 0; +// -------------------------------------------------------------------------- +// Iterators +// -------------------------------------------------------------------------- +/** Returns true if this value is an async iterator */ +function IsAsyncIterator(value) { + return IsObject(value) && Symbol.asyncIterator in value; +} +exports.IsAsyncIterator = IsAsyncIterator; +/** Returns true if this value is an iterator */ +function IsIterator(value) { + return IsObject(value) && Symbol.iterator in value; +} +exports.IsIterator = IsIterator; +// -------------------------------------------------------------------------- +// Nominal +// -------------------------------------------------------------------------- +/** Returns true if this value is a typed array */ +function IsTypedArray(value) { + return ArrayBuffer.isView(value); +} +exports.IsTypedArray = IsTypedArray; +/** Returns true if this value is a Promise */ +function IsPromise(value) { + return value instanceof Promise; +} +exports.IsPromise = IsPromise; +/** Returns true if the value is a Uint8Array */ +function IsUint8Array(value) { + return value instanceof Uint8Array; +} +exports.IsUint8Array = IsUint8Array; +/** Returns true if this value is a Date */ +function IsDate(value) { + return value instanceof Date && Number.isFinite(value.getTime()); +} +exports.IsDate = IsDate; +// -------------------------------------------------------------------------- +// Standard +// -------------------------------------------------------------------------- +/** Returns true if this value has this property key */ +function HasPropertyKey(value, key) { + return key in value; +} +exports.HasPropertyKey = HasPropertyKey; +/** Returns true if this object is not an instance of any other type */ +function IsPlainObject(value) { + return IsObject(value) && IsFunction(value.constructor) && value.constructor.name === 'Object'; +} +exports.IsPlainObject = IsPlainObject; +/** Returns true of this value is an object type */ +function IsObject(value) { + return value !== null && typeof value === 'object'; +} +exports.IsObject = IsObject; +/** Returns true if this value is an array, but not a typed array */ +function IsArray(value) { + return Array.isArray(value) && !ArrayBuffer.isView(value); +} +exports.IsArray = IsArray; +/** Returns true if this value is an undefined */ +function IsUndefined(value) { + return value === undefined; +} +exports.IsUndefined = IsUndefined; +/** Returns true if this value is an null */ +function IsNull(value) { + return value === null; +} +exports.IsNull = IsNull; +/** Returns true if this value is an boolean */ +function IsBoolean(value) { + return typeof value === 'boolean'; +} +exports.IsBoolean = IsBoolean; +/** Returns true if this value is an number */ +function IsNumber(value) { + return typeof value === 'number'; +} +exports.IsNumber = IsNumber; +/** Returns true if this value is an integer */ +function IsInteger(value) { + return IsNumber(value) && Number.isInteger(value); +} +exports.IsInteger = IsInteger; +/** Returns true if this value is bigint */ +function IsBigInt(value) { + return typeof value === 'bigint'; +} +exports.IsBigInt = IsBigInt; +/** Returns true if this value is string */ +function IsString(value) { + return typeof value === 'string'; +} +exports.IsString = IsString; +/** Returns true if this value is a function */ +function IsFunction(value) { + return typeof value === 'function'; +} +exports.IsFunction = IsFunction; +/** Returns true if this value is a symbol */ +function IsSymbol(value) { + return typeof value === 'symbol'; +} +exports.IsSymbol = IsSymbol; +/** Returns true if this value is a value type such as number, string, boolean */ +function IsValueType(value) { + // prettier-ignore + return (IsBigInt(value) || + IsBoolean(value) || + IsNull(value) || + IsNumber(value) || + IsString(value) || + IsSymbol(value) || + IsUndefined(value)); +} +exports.IsValueType = IsValueType; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/hash.js": +/*!******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/hash.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Hash = exports.ByteMarker = exports.ValueHashError = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class ValueHashError extends Error { + constructor(value) { + super(`Unable to hash value`); + this.value = value; + } +} +exports.ValueHashError = ValueHashError; +// -------------------------------------------------------------------------- +// ByteMarker +// -------------------------------------------------------------------------- +var ByteMarker; +(function (ByteMarker) { + ByteMarker[ByteMarker["Undefined"] = 0] = "Undefined"; + ByteMarker[ByteMarker["Null"] = 1] = "Null"; + ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean"; + ByteMarker[ByteMarker["Number"] = 3] = "Number"; + ByteMarker[ByteMarker["String"] = 4] = "String"; + ByteMarker[ByteMarker["Object"] = 5] = "Object"; + ByteMarker[ByteMarker["Array"] = 6] = "Array"; + ByteMarker[ByteMarker["Date"] = 7] = "Date"; + ByteMarker[ByteMarker["Uint8Array"] = 8] = "Uint8Array"; + ByteMarker[ByteMarker["Symbol"] = 9] = "Symbol"; + ByteMarker[ByteMarker["BigInt"] = 10] = "BigInt"; +})(ByteMarker || (exports.ByteMarker = ByteMarker = {})); +// -------------------------------------------------------------------------- +// State +// -------------------------------------------------------------------------- +let Accumulator = BigInt('14695981039346656037'); +const [Prime, Size] = [BigInt('1099511628211'), BigInt('2') ** BigInt('64')]; +const Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i)); +const F64 = new Float64Array(1); +const F64In = new DataView(F64.buffer); +const F64Out = new Uint8Array(F64.buffer); +// -------------------------------------------------------------------------- +// NumberToBytes +// -------------------------------------------------------------------------- +function* NumberToBytes(value) { + const byteCount = value === 0 ? 1 : Math.ceil(Math.floor(Math.log2(value) + 1) / 8); + for (let i = 0; i < byteCount; i++) { + yield (value >> (8 * (byteCount - 1 - i))) & 0xff; + } +} +// -------------------------------------------------------------------------- +// Hashing Functions +// -------------------------------------------------------------------------- +function ArrayType(value) { + FNV1A64(ByteMarker.Array); + for (const item of value) { + Visit(item); + } +} +function BooleanType(value) { + FNV1A64(ByteMarker.Boolean); + FNV1A64(value ? 1 : 0); +} +function BigIntType(value) { + FNV1A64(ByteMarker.BigInt); + F64In.setBigInt64(0, value); + for (const byte of F64Out) { + FNV1A64(byte); + } +} +function DateType(value) { + FNV1A64(ByteMarker.Date); + Visit(value.getTime()); +} +function NullType(value) { + FNV1A64(ByteMarker.Null); +} +function NumberType(value) { + FNV1A64(ByteMarker.Number); + F64In.setFloat64(0, value); + for (const byte of F64Out) { + FNV1A64(byte); + } +} +function ObjectType(value) { + FNV1A64(ByteMarker.Object); + for (const key of globalThis.Object.keys(value).sort()) { + Visit(key); + Visit(value[key]); + } +} +function StringType(value) { + FNV1A64(ByteMarker.String); + for (let i = 0; i < value.length; i++) { + for (const byte of NumberToBytes(value.charCodeAt(i))) { + FNV1A64(byte); + } + } +} +function SymbolType(value) { + FNV1A64(ByteMarker.Symbol); + Visit(value.description); +} +function Uint8ArrayType(value) { + FNV1A64(ByteMarker.Uint8Array); + for (let i = 0; i < value.length; i++) { + FNV1A64(value[i]); + } +} +function UndefinedType(value) { + return FNV1A64(ByteMarker.Undefined); +} +function Visit(value) { + if ((0, guard_1.IsArray)(value)) + return ArrayType(value); + if ((0, guard_1.IsBoolean)(value)) + return BooleanType(value); + if ((0, guard_1.IsBigInt)(value)) + return BigIntType(value); + if ((0, guard_1.IsDate)(value)) + return DateType(value); + if ((0, guard_1.IsNull)(value)) + return NullType(value); + if ((0, guard_1.IsNumber)(value)) + return NumberType(value); + if ((0, guard_1.IsPlainObject)(value)) + return ObjectType(value); + if ((0, guard_1.IsString)(value)) + return StringType(value); + if ((0, guard_1.IsSymbol)(value)) + return SymbolType(value); + if ((0, guard_1.IsUint8Array)(value)) + return Uint8ArrayType(value); + if ((0, guard_1.IsUndefined)(value)) + return UndefinedType(value); + throw new ValueHashError(value); +} +function FNV1A64(byte) { + Accumulator = Accumulator ^ Bytes[byte]; + Accumulator = (Accumulator * Prime) % Size; +} +// -------------------------------------------------------------------------- +// Hash +// -------------------------------------------------------------------------- +/** Creates a FNV1A-64 non cryptographic hash of the given value */ +function Hash(value) { + Accumulator = BigInt('14695981039346656037'); + Visit(value); + return Accumulator; +} +exports.Hash = Hash; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/index.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Value = exports.ValuePointer = exports.Delete = exports.Update = exports.Insert = exports.Edit = exports.ValueErrorIterator = exports.ValueErrorType = void 0; +var index_1 = __webpack_require__(/*! ../errors/index */ "./node_modules/@sinclair/typebox/errors/index.js"); +Object.defineProperty(exports, "ValueErrorType", ({ enumerable: true, get: function () { return index_1.ValueErrorType; } })); +Object.defineProperty(exports, "ValueErrorIterator", ({ enumerable: true, get: function () { return index_1.ValueErrorIterator; } })); +var delta_1 = __webpack_require__(/*! ./delta */ "./node_modules/@sinclair/typebox/value/delta.js"); +Object.defineProperty(exports, "Edit", ({ enumerable: true, get: function () { return delta_1.Edit; } })); +Object.defineProperty(exports, "Insert", ({ enumerable: true, get: function () { return delta_1.Insert; } })); +Object.defineProperty(exports, "Update", ({ enumerable: true, get: function () { return delta_1.Update; } })); +Object.defineProperty(exports, "Delete", ({ enumerable: true, get: function () { return delta_1.Delete; } })); +var pointer_1 = __webpack_require__(/*! ./pointer */ "./node_modules/@sinclair/typebox/value/pointer.js"); +Object.defineProperty(exports, "ValuePointer", ({ enumerable: true, get: function () { return pointer_1.ValuePointer; } })); +var value_1 = __webpack_require__(/*! ./value */ "./node_modules/@sinclair/typebox/value/value.js"); +Object.defineProperty(exports, "Value", ({ enumerable: true, get: function () { return value_1.Value; } })); + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/mutate.js": +/*!********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/mutate.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Mutate = exports.ValueMutateInvalidRootMutationError = exports.ValueMutateTypeMismatchError = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const pointer_1 = __webpack_require__(/*! ./pointer */ "./node_modules/@sinclair/typebox/value/pointer.js"); +const clone_1 = __webpack_require__(/*! ./clone */ "./node_modules/@sinclair/typebox/value/clone.js"); +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class ValueMutateTypeMismatchError extends Error { + constructor() { + super('Cannot assign due type mismatch of assignable values'); + } +} +exports.ValueMutateTypeMismatchError = ValueMutateTypeMismatchError; +class ValueMutateInvalidRootMutationError extends Error { + constructor() { + super('Only object and array types can be mutated at the root level'); + } +} +exports.ValueMutateInvalidRootMutationError = ValueMutateInvalidRootMutationError; +function ObjectType(root, path, current, next) { + if (!(0, guard_1.IsPlainObject)(current)) { + pointer_1.ValuePointer.Set(root, path, (0, clone_1.Clone)(next)); + } + else { + const currentKeys = Object.keys(current); + const nextKeys = Object.keys(next); + for (const currentKey of currentKeys) { + if (!nextKeys.includes(currentKey)) { + delete current[currentKey]; + } + } + for (const nextKey of nextKeys) { + if (!currentKeys.includes(nextKey)) { + current[nextKey] = null; + } + } + for (const nextKey of nextKeys) { + Visit(root, `${path}/${nextKey}`, current[nextKey], next[nextKey]); + } + } +} +function ArrayType(root, path, current, next) { + if (!(0, guard_1.IsArray)(current)) { + pointer_1.ValuePointer.Set(root, path, (0, clone_1.Clone)(next)); + } + else { + for (let index = 0; index < next.length; index++) { + Visit(root, `${path}/${index}`, current[index], next[index]); + } + current.splice(next.length); + } +} +function TypedArrayType(root, path, current, next) { + if ((0, guard_1.IsTypedArray)(current) && current.length === next.length) { + for (let i = 0; i < current.length; i++) { + current[i] = next[i]; + } + } + else { + pointer_1.ValuePointer.Set(root, path, (0, clone_1.Clone)(next)); + } +} +function ValueType(root, path, current, next) { + if (current === next) + return; + pointer_1.ValuePointer.Set(root, path, next); +} +function Visit(root, path, current, next) { + if ((0, guard_1.IsArray)(next)) + return ArrayType(root, path, current, next); + if ((0, guard_1.IsTypedArray)(next)) + return TypedArrayType(root, path, current, next); + if ((0, guard_1.IsPlainObject)(next)) + return ObjectType(root, path, current, next); + if ((0, guard_1.IsValueType)(next)) + return ValueType(root, path, current, next); +} +// -------------------------------------------------------------------------- +// Mutate +// -------------------------------------------------------------------------- +function IsNonMutableValue(value) { + return (0, guard_1.IsTypedArray)(value) || (0, guard_1.IsValueType)(value); +} +function IsMismatchedValue(current, next) { + // prettier-ignore + return (((0, guard_1.IsPlainObject)(current) && (0, guard_1.IsArray)(next)) || + ((0, guard_1.IsArray)(current) && (0, guard_1.IsPlainObject)(next))); +} +// -------------------------------------------------------------------------- +// Mutate +// -------------------------------------------------------------------------- +/** Performs a deep mutable value assignment while retaining internal references */ +function Mutate(current, next) { + if (IsNonMutableValue(current) || IsNonMutableValue(next)) + throw new ValueMutateInvalidRootMutationError(); + if (IsMismatchedValue(current, next)) + throw new ValueMutateTypeMismatchError(); + Visit(current, '', current, next); +} +exports.Mutate = Mutate; + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/pointer.js": +/*!*********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/pointer.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ValuePointer = exports.ValuePointerRootDeleteError = exports.ValuePointerRootSetError = void 0; +// -------------------------------------------------------------------------- +// Errors +// -------------------------------------------------------------------------- +class ValuePointerRootSetError extends Error { + constructor(value, path, update) { + super('Cannot set root value'); + this.value = value; + this.path = path; + this.update = update; + } +} +exports.ValuePointerRootSetError = ValuePointerRootSetError; +class ValuePointerRootDeleteError extends Error { + constructor(value, path) { + super('Cannot delete root value'); + this.value = value; + this.path = path; + } +} +exports.ValuePointerRootDeleteError = ValuePointerRootDeleteError; +// -------------------------------------------------------------------------- +// ValuePointer +// -------------------------------------------------------------------------- +/** Provides functionality to update values through RFC6901 string pointers */ +var ValuePointer; +(function (ValuePointer) { + function Escape(component) { + return component.indexOf('~') === -1 ? component : component.replace(/~1/g, '/').replace(/~0/g, '~'); + } + /** Formats the given pointer into navigable key components */ + function* Format(pointer) { + if (pointer === '') + return; + let [start, end] = [0, 0]; + for (let i = 0; i < pointer.length; i++) { + const char = pointer.charAt(i); + if (char === '/') { + if (i === 0) { + start = i + 1; + } + else { + end = i; + yield Escape(pointer.slice(start, end)); + start = i + 1; + } + } + else { + end = i; + } + } + yield Escape(pointer.slice(start)); + } + ValuePointer.Format = Format; + /** Sets the value at the given pointer. If the value at the pointer does not exist it is created */ + function Set(value, pointer, update) { + if (pointer === '') + throw new ValuePointerRootSetError(value, pointer, update); + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined) + next[component] = {}; + owner = next; + next = next[component]; + key = component; + } + owner[key] = update; + } + ValuePointer.Set = Set; + /** Deletes a value at the given pointer */ + function Delete(value, pointer) { + if (pointer === '') + throw new ValuePointerRootDeleteError(value, pointer); + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined || next[component] === null) + return; + owner = next; + next = next[component]; + key = component; + } + if (Array.isArray(owner)) { + const index = parseInt(key); + owner.splice(index, 1); + } + else { + delete owner[key]; + } + } + ValuePointer.Delete = Delete; + /** Returns true if a value exists at the given pointer */ + function Has(value, pointer) { + if (pointer === '') + return true; + let [owner, next, key] = [null, value, '']; + for (const component of Format(pointer)) { + if (next[component] === undefined) + return false; + owner = next; + next = next[component]; + key = component; + } + return Object.getOwnPropertyNames(owner).includes(key); + } + ValuePointer.Has = Has; + /** Gets the value at the given pointer */ + function Get(value, pointer) { + if (pointer === '') + return value; + let current = value; + for (const component of Format(pointer)) { + if (current[component] === undefined) + return undefined; + current = current[component]; + } + return current; + } + ValuePointer.Get = Get; +})(ValuePointer || (exports.ValuePointer = ValuePointer = {})); + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/transform.js": +/*!***********************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/transform.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EncodeTransform = exports.DecodeTransform = exports.HasTransform = exports.TransformEncodeError = exports.TransformDecodeError = exports.TransformEncodeCheckError = exports.TransformDecodeCheckError = exports.TransformUnknownTypeError = void 0; +const guard_1 = __webpack_require__(/*! ./guard */ "./node_modules/@sinclair/typebox/value/guard.js"); +const deref_1 = __webpack_require__(/*! ./deref */ "./node_modules/@sinclair/typebox/value/deref.js"); +const Types = __webpack_require__(/*! ../typebox */ "./node_modules/@sinclair/typebox/typebox.js"); +// ------------------------------------------------------------------------- +// Errors +// ------------------------------------------------------------------------- +class TransformUnknownTypeError extends Types.TypeBoxError { + constructor(schema) { + super(`Unknown type`); + this.schema = schema; + } +} +exports.TransformUnknownTypeError = TransformUnknownTypeError; +class TransformDecodeCheckError extends Types.TypeBoxError { + constructor(schema, value, error) { + super(`Unable to decode due to invalid value`); + this.schema = schema; + this.value = value; + this.error = error; + } +} +exports.TransformDecodeCheckError = TransformDecodeCheckError; +class TransformEncodeCheckError extends Types.TypeBoxError { + constructor(schema, value, error) { + super(`Unable to encode due to invalid value`); + this.schema = schema; + this.value = value; + this.error = error; + } +} +exports.TransformEncodeCheckError = TransformEncodeCheckError; +class TransformDecodeError extends Types.TypeBoxError { + constructor(schema, value, error) { + super(`${error instanceof Error ? error.message : 'Unknown error'}`); + this.schema = schema; + this.value = value; + } +} +exports.TransformDecodeError = TransformDecodeError; +class TransformEncodeError extends Types.TypeBoxError { + constructor(schema, value, error) { + super(`${error instanceof Error ? error.message : 'Unknown error'}`); + this.schema = schema; + this.value = value; + } +} +exports.TransformEncodeError = TransformEncodeError; +// ------------------------------------------------------------------------- +// HasTransform +// ------------------------------------------------------------------------- +/** Recursively checks a schema for transform codecs */ +var HasTransform; +(function (HasTransform) { + function TArray(schema, references) { + return Types.TypeGuard.TTransform(schema) || Visit(schema.items, references); + } + function TAsyncIterator(schema, references) { + return Types.TypeGuard.TTransform(schema) || Visit(schema.items, references); + } + function TConstructor(schema, references) { + return Types.TypeGuard.TTransform(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references)); + } + function TFunction(schema, references) { + return Types.TypeGuard.TTransform(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references)); + } + function TIntersect(schema, references) { + return Types.TypeGuard.TTransform(schema) || Types.TypeGuard.TTransform(schema.unevaluatedProperties) || schema.allOf.some((schema) => Visit(schema, references)); + } + function TIterator(schema, references) { + return Types.TypeGuard.TTransform(schema) || Visit(schema.items, references); + } + function TNot(schema, references) { + return Types.TypeGuard.TTransform(schema) || Visit(schema.not, references); + } + function TObject(schema, references) { + // prettier-ignore + return (Types.TypeGuard.TTransform(schema) || Object.values(schema.properties).some((schema) => Visit(schema, references)) || Types.TypeGuard.TSchema(schema.additionalProperties) && Visit(schema.additionalProperties, references)); + } + function TPromise(schema, references) { + return Types.TypeGuard.TTransform(schema) || Visit(schema.item, references); + } + function TRecord(schema, references) { + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const property = schema.patternProperties[pattern]; + return Types.TypeGuard.TTransform(schema) || Visit(property, references) || (Types.TypeGuard.TSchema(schema.additionalProperties) && Types.TypeGuard.TTransform(schema.additionalProperties)); + } + function TRef(schema, references) { + if (Types.TypeGuard.TTransform(schema)) + return true; + return Visit((0, deref_1.Deref)(schema, references), references); + } + function TThis(schema, references) { + if (Types.TypeGuard.TTransform(schema)) + return true; + return Visit((0, deref_1.Deref)(schema, references), references); + } + function TTuple(schema, references) { + return Types.TypeGuard.TTransform(schema) || (Types.TypeGuard.TSchema(schema.items) && schema.items.some((schema) => Visit(schema, references))); + } + function TUnion(schema, references) { + return Types.TypeGuard.TTransform(schema) || schema.anyOf.some((schema) => Visit(schema, references)); + } + function Visit(schema, references) { + const references_ = (0, guard_1.IsString)(schema.$id) ? [...references, schema] : references; + const schema_ = schema; + if (schema.$id && visited.has(schema.$id)) + return false; + if (schema.$id) + visited.add(schema.$id); + switch (schema[Types.Kind]) { + // ------------------------------------------------------ + // Structural + // ------------------------------------------------------ + case 'Array': + return TArray(schema_, references_); + case 'AsyncIterator': + return TAsyncIterator(schema_, references_); + case 'Constructor': + return TConstructor(schema_, references_); + case 'Function': + return TFunction(schema_, references_); + case 'Intersect': + return TIntersect(schema_, references_); + case 'Iterator': + return TIterator(schema_, references_); + case 'Not': + return TNot(schema_, references_); + case 'Object': + return TObject(schema_, references_); + case 'Promise': + return TPromise(schema_, references_); + case 'Record': + return TRecord(schema_, references_); + case 'Ref': + return TRef(schema_, references_); + case 'This': + return TThis(schema_, references_); + case 'Tuple': + return TTuple(schema_, references_); + case 'Union': + return TUnion(schema_, references_); + // ------------------------------------------------------ + // Default + // ------------------------------------------------------ + case 'Any': + case 'BigInt': + case 'Boolean': + case 'Date': + case 'Integer': + case 'Literal': + case 'Never': + case 'Null': + case 'Number': + case 'String': + case 'Symbol': + case 'TemplateLiteral': + case 'Undefined': + case 'Uint8Array': + case 'Unknown': + case 'Void': + return Types.TypeGuard.TTransform(schema); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new TransformUnknownTypeError(schema_); + return Types.TypeGuard.TTransform(schema); + } + } + const visited = new Set(); + /** Returns true if this schema contains a transform codec */ + function Has(schema, references) { + visited.clear(); + return Visit(schema, references); + } + HasTransform.Has = Has; +})(HasTransform || (exports.HasTransform = HasTransform = {})); +// ------------------------------------------------------------------------- +// DecodeTransform +// ------------------------------------------------------------------------- +/** Decodes a value using transform decoders if available. Does not ensure correct results. */ +var DecodeTransform; +(function (DecodeTransform) { + function Default(schema, value) { + try { + return Types.TypeGuard.TTransform(schema) ? schema[Types.Transform].Decode(value) : value; + } + catch (error) { + throw new TransformDecodeError(schema, value, error); + } + } + function TArray(schema, references, value) { + const elements1 = value.map((value) => Visit(schema.items, references, value)); + return Default(schema, elements1); + } + function TIntersect(schema, references, value) { + if (!(0, guard_1.IsPlainObject)(value) || (0, guard_1.IsValueType)(value)) + return Default(schema, value); + const keys = Types.KeyResolver.ResolveKeys(schema, { includePatterns: false }); + const properties1 = Object.entries(value).reduce((acc, [key, value]) => { + return !keys.includes(key) ? { ...acc, [key]: value } : { ...acc, [key]: Default(Types.IndexedAccessor.Resolve(schema, [key]), value) }; + }, {}); + if (!Types.TypeGuard.TTransform(schema.unevaluatedProperties)) + return Default(schema, properties1); + const properties2 = Object.entries(properties1).reduce((acc, [key, value]) => { + return keys.includes(key) ? { ...acc, [key]: value } : { ...acc, [key]: Default(schema.unevaluatedProperties, value) }; + }, {}); + return Default(schema, properties2); + } + function TNot(schema, references, value) { + const value1 = Visit(schema.not, references, value); + return Default(schema, value1); + } + function TObject(schema, references, value) { + if (!(0, guard_1.IsPlainObject)(value)) + return Default(schema, value); + const properties1 = Object.entries(value).reduce((acc, [key, value]) => { + return !(key in schema.properties) ? { ...acc, [key]: value } : { ...acc, [key]: Visit(schema.properties[key], references, value) }; + }, {}); + if (!Types.TypeGuard.TSchema(schema.additionalProperties)) + return Default(schema, properties1); + const additionalProperties = schema.additionalProperties; + const properties2 = Object.entries(properties1).reduce((acc, [key, value]) => { + return key in schema.properties ? { ...acc, [key]: value } : { ...acc, [key]: Visit(additionalProperties, references, value) }; + }, {}); + return Default(schema, properties2); + } + function TRecord(schema, references, value) { + if (!(0, guard_1.IsPlainObject)(value)) + return Default(schema, value); + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const property = schema.patternProperties[pattern]; + const regex = new RegExp(pattern); + const properties1 = Object.entries(value).reduce((acc, [key, value]) => { + return !regex.test(key) ? { ...acc, [key]: value } : { ...acc, [key]: Visit(property, references, value) }; + }, {}); + if (!Types.TypeGuard.TSchema(schema.additionalProperties)) + return Default(schema, properties1); + const additionalProperties = schema.additionalProperties; + const properties2 = Object.entries(properties1).reduce((acc, [key, value]) => { + return regex.test(key) ? { ...acc, [key]: value } : { ...acc, [key]: Visit(additionalProperties, references, value) }; + }, {}); + return Default(schema, properties2); + } + function TRef(schema, references, value) { + const target = (0, deref_1.Deref)(schema, references); + const resolved = Visit(target, references, value); + return Default(schema, resolved); + } + function TThis(schema, references, value) { + const target = (0, deref_1.Deref)(schema, references); + const resolved = Visit(target, references, value); + return Default(schema, resolved); + } + function TTuple(schema, references, value) { + const value1 = (0, guard_1.IsArray)(schema.items) ? schema.items.map((schema, index) => Visit(schema, references, value[index])) : []; + return Default(schema, value1); + } + function TUnion(schema, references, value) { + const value1 = Default(schema, value); + for (const subschema of schema.anyOf) { + if (!checkFunction(subschema, references, value1)) + continue; + return Visit(subschema, references, value1); + } + return value1; + } + function Visit(schema, references, value) { + const references_ = typeof schema.$id === 'string' ? [...references, schema] : references; + const schema_ = schema; + switch (schema[Types.Kind]) { + // ------------------------------------------------------ + // Structural + // ------------------------------------------------------ + case 'Array': + return TArray(schema_, references_, value); + case 'Intersect': + return TIntersect(schema_, references_, value); + case 'Not': + return TNot(schema_, references_, value); + case 'Object': + return TObject(schema_, references_, value); + case 'Record': + return TRecord(schema_, references_, value); + case 'Ref': + return TRef(schema_, references_, value); + case 'Symbol': + return Default(schema_, value); + case 'This': + return TThis(schema_, references_, value); + case 'Tuple': + return TTuple(schema_, references_, value); + case 'Union': + return TUnion(schema_, references_, value); + // ------------------------------------------------------ + // Default + // ------------------------------------------------------ + case 'Any': + case 'AsyncIterator': + case 'BigInt': + case 'Boolean': + case 'Constructor': + case 'Date': + case 'Function': + case 'Integer': + case 'Iterator': + case 'Literal': + case 'Never': + case 'Null': + case 'Number': + case 'Promise': + case 'String': + case 'TemplateLiteral': + case 'Undefined': + case 'Uint8Array': + case 'Unknown': + case 'Void': + return Default(schema_, value); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new TransformUnknownTypeError(schema_); + return Default(schema_, value); + } + } + let checkFunction = () => false; + function Decode(schema, references, value, check) { + checkFunction = check; + return Visit(schema, references, value); + } + DecodeTransform.Decode = Decode; +})(DecodeTransform || (exports.DecodeTransform = DecodeTransform = {})); +// ------------------------------------------------------------------------- +// DecodeTransform +// ------------------------------------------------------------------------- +/** Encodes a value using transform encoders if available. Does not ensure correct results. */ +var EncodeTransform; +(function (EncodeTransform) { + function Default(schema, value) { + try { + return Types.TypeGuard.TTransform(schema) ? schema[Types.Transform].Encode(value) : value; + } + catch (error) { + throw new TransformEncodeError(schema, value, error); + } + } + function TArray(schema, references, value) { + const elements1 = Default(schema, value); + return elements1.map((value) => Visit(schema.items, references, value)); + } + function TIntersect(schema, references, value) { + const properties1 = Default(schema, value); + if (!(0, guard_1.IsPlainObject)(value) || (0, guard_1.IsValueType)(value)) + return properties1; + const keys = Types.KeyResolver.ResolveKeys(schema, { includePatterns: false }); + const properties2 = Object.entries(properties1).reduce((acc, [key, value]) => { + return !keys.includes(key) ? { ...acc, [key]: value } : { ...acc, [key]: Default(Types.IndexedAccessor.Resolve(schema, [key]), value) }; + }, {}); + if (!Types.TypeGuard.TTransform(schema.unevaluatedProperties)) + return Default(schema, properties2); + return Object.entries(properties2).reduce((acc, [key, value]) => { + return keys.includes(key) ? { ...acc, [key]: value } : { ...acc, [key]: Default(schema.unevaluatedProperties, value) }; + }, {}); + } + function TNot(schema, references, value) { + const value1 = Default(schema, value); + return Default(schema.not, value1); + } + function TObject(schema, references, value) { + const properties1 = Default(schema, value); + if (!(0, guard_1.IsPlainObject)(value)) + return properties1; + const properties2 = Object.entries(properties1).reduce((acc, [key, value]) => { + return !(key in schema.properties) ? { ...acc, [key]: value } : { ...acc, [key]: Visit(schema.properties[key], references, value) }; + }, {}); + if (!Types.TypeGuard.TSchema(schema.additionalProperties)) + return properties2; + const additionalProperties = schema.additionalProperties; + return Object.entries(properties2).reduce((acc, [key, value]) => { + return key in schema.properties ? { ...acc, [key]: value } : { ...acc, [key]: Visit(additionalProperties, references, value) }; + }, {}); + } + function TRecord(schema, references, value) { + const properties1 = Default(schema, value); + if (!(0, guard_1.IsPlainObject)(value)) + return properties1; + const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0]; + const property = schema.patternProperties[pattern]; + const regex = new RegExp(pattern); + const properties2 = Object.entries(properties1).reduce((acc, [key, value]) => { + return !regex.test(key) ? { ...acc, [key]: value } : { ...acc, [key]: Visit(property, references, value) }; + }, {}); + if (!Types.TypeGuard.TSchema(schema.additionalProperties)) + return Default(schema, properties2); + const additionalProperties = schema.additionalProperties; + return Object.entries(properties2).reduce((acc, [key, value]) => { + return regex.test(key) ? { ...acc, [key]: value } : { ...acc, [key]: Visit(additionalProperties, references, value) }; + }, {}); + } + function TRef(schema, references, value) { + const target = (0, deref_1.Deref)(schema, references); + const resolved = Visit(target, references, value); + return Default(schema, resolved); + } + function TThis(schema, references, value) { + const target = (0, deref_1.Deref)(schema, references); + const resolved = Visit(target, references, value); + return Default(schema, resolved); + } + function TTuple(schema, references, value) { + const value1 = Default(schema, value); + return (0, guard_1.IsArray)(schema.items) ? schema.items.map((schema, index) => Visit(schema, references, value1[index])) : []; + } + function TUnion(schema, references, value) { + for (const subschema of schema.anyOf) { + if (!checkFunction(subschema, references, value)) + continue; + const value1 = Visit(subschema, references, value); + return Default(schema, value1); + } + return Default(schema, value); + } + function Visit(schema, references, value) { + const references_ = typeof schema.$id === 'string' ? [...references, schema] : references; + const schema_ = schema; + switch (schema[Types.Kind]) { + // ------------------------------------------------------ + // Structural + // ------------------------------------------------------ + case 'Array': + return TArray(schema_, references_, value); + case 'Intersect': + return TIntersect(schema_, references_, value); + case 'Not': + return TNot(schema_, references_, value); + case 'Object': + return TObject(schema_, references_, value); + case 'Record': + return TRecord(schema_, references_, value); + case 'Ref': + return TRef(schema_, references_, value); + case 'This': + return TThis(schema_, references_, value); + case 'Tuple': + return TTuple(schema_, references_, value); + case 'Union': + return TUnion(schema_, references_, value); + // ------------------------------------------------------ + // Apply + // ------------------------------------------------------ + case 'Any': + case 'AsyncIterator': + case 'BigInt': + case 'Boolean': + case 'Constructor': + case 'Date': + case 'Function': + case 'Integer': + case 'Iterator': + case 'Literal': + case 'Never': + case 'Null': + case 'Number': + case 'Promise': + case 'String': + case 'Symbol': + case 'TemplateLiteral': + case 'Undefined': + case 'Uint8Array': + case 'Unknown': + case 'Void': + return Default(schema_, value); + default: + if (!Types.TypeRegistry.Has(schema_[Types.Kind])) + throw new TransformUnknownTypeError(schema_); + return Default(schema_, value); + } + } + let checkFunction = () => false; + function Encode(schema, references, value, check) { + checkFunction = check; + return Visit(schema, references, value); + } + EncodeTransform.Encode = Encode; +})(EncodeTransform || (exports.EncodeTransform = EncodeTransform = {})); + + +/***/ }), + +/***/ "./node_modules/@sinclair/typebox/value/value.js": +/*!*******************************************************!*\ + !*** ./node_modules/@sinclair/typebox/value/value.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Value = void 0; +const ValueErrors = __webpack_require__(/*! ../errors/index */ "./node_modules/@sinclair/typebox/errors/index.js"); +const ValueMutate = __webpack_require__(/*! ./mutate */ "./node_modules/@sinclair/typebox/value/mutate.js"); +const ValueHash = __webpack_require__(/*! ./hash */ "./node_modules/@sinclair/typebox/value/hash.js"); +const ValueEqual = __webpack_require__(/*! ./equal */ "./node_modules/@sinclair/typebox/value/equal.js"); +const ValueCast = __webpack_require__(/*! ./cast */ "./node_modules/@sinclair/typebox/value/cast.js"); +const ValueClone = __webpack_require__(/*! ./clone */ "./node_modules/@sinclair/typebox/value/clone.js"); +const ValueConvert = __webpack_require__(/*! ./convert */ "./node_modules/@sinclair/typebox/value/convert.js"); +const ValueCreate = __webpack_require__(/*! ./create */ "./node_modules/@sinclair/typebox/value/create.js"); +const ValueCheck = __webpack_require__(/*! ./check */ "./node_modules/@sinclair/typebox/value/check.js"); +const ValueDelta = __webpack_require__(/*! ./delta */ "./node_modules/@sinclair/typebox/value/delta.js"); +const ValueTransform = __webpack_require__(/*! ./transform */ "./node_modules/@sinclair/typebox/value/transform.js"); +/** Functions to perform structural operations on JavaScript values */ +var Value; +(function (Value) { + /** Casts a value into a given type. The return value will retain as much information of the original value as possible. */ + function Cast(...args) { + return ValueCast.Cast.apply(ValueCast, args); + } + Value.Cast = Cast; + /** Creates a value from the given type */ + function Create(...args) { + return ValueCreate.Create.apply(ValueCreate, args); + } + Value.Create = Create; + /** Returns true if the value matches the given type */ + function Check(...args) { + return ValueCheck.Check.apply(ValueCheck, args); + } + Value.Check = Check; + /** Converts any type mismatched values to their target type if a reasonable conversion is possible */ + function Convert(...args) { + return ValueConvert.Convert.apply(ValueConvert, args); + } + Value.Convert = Convert; + /** Returns a structural clone of the given value */ + function Clone(value) { + return ValueClone.Clone(value); + } + Value.Clone = Clone; + /** Decodes a value or throws if error */ + function Decode(...args) { + const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; + if (!Check(schema, references, value)) + throw new ValueTransform.TransformDecodeCheckError(schema, value, Errors(schema, references, value).First()); + return ValueTransform.DecodeTransform.Decode(schema, references, value, ValueCheck.Check); + } + Value.Decode = Decode; + /** Encodes a value or throws if error */ + function Encode(...args) { + const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]]; + const encoded = ValueTransform.EncodeTransform.Encode(schema, references, value, ValueCheck.Check); + if (!Check(schema, references, encoded)) + throw new ValueTransform.TransformEncodeCheckError(schema, value, Errors(schema, references, value).First()); + return encoded; + } + Value.Encode = Encode; + /** Returns an iterator for each error in this value. */ + function Errors(...args) { + return ValueErrors.Errors.apply(ValueErrors, args); + } + Value.Errors = Errors; + /** Returns true if left and right values are structurally equal */ + function Equal(left, right) { + return ValueEqual.Equal(left, right); + } + Value.Equal = Equal; + /** Returns edits to transform the current value into the next value */ + function Diff(current, next) { + return ValueDelta.Diff(current, next); + } + Value.Diff = Diff; + /** Returns a FNV1A-64 non cryptographic hash of the given value */ + function Hash(value) { + return ValueHash.Hash(value); + } + Value.Hash = Hash; + /** Returns a new value with edits applied to the given value */ + function Patch(current, edits) { + return ValueDelta.Patch(current, edits); + } + Value.Patch = Patch; + /** Performs a deep mutable value assignment while retaining internal references. */ + function Mutate(current, next) { + ValueMutate.Mutate(current, next); + } + Value.Mutate = Mutate; +})(Value || (exports.Value = Value = {})); + + +/***/ }), + +/***/ "./node_modules/array.prototype.find/implementation.js": +/*!*************************************************************!*\ + !*** ./node_modules/array.prototype.find/implementation.js ***! + \*************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var ToObject = __webpack_require__(/*! es-abstract/2023/ToObject */ "./node_modules/es-abstract/2023/ToObject.js"); +var ToLength = __webpack_require__(/*! es-abstract/2023/ToLength */ "./node_modules/es-abstract/2023/ToLength.js"); +var IsCallable = __webpack_require__(/*! es-abstract/2023/IsCallable */ "./node_modules/es-abstract/2023/IsCallable.js"); + +module.exports = function find(predicate) { + var list = ToObject(this); + var length = ToLength(list.length); + if (!IsCallable(predicate)) { + throw new TypeError('Array#find: predicate must be a function'); + } + if (length === 0) { + return void 0; + } + var thisArg; + if (arguments.length > 0) { + thisArg = arguments[1]; + } + + for (var i = 0, value; i < length; i++) { + value = list[i]; + // inlined for performance: if (Call(predicate, thisArg, [value, i, list])) { + if (predicate.apply(thisArg, [value, i, list])) { + return value; + } + } + return void 0; +}; + + +/***/ }), + +/***/ "./node_modules/array.prototype.find/index.js": +/*!****************************************************!*\ + !*** ./node_modules/array.prototype.find/index.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); +var RequireObjectCoercible = __webpack_require__(/*! es-abstract/2023/RequireObjectCoercible */ "./node_modules/es-abstract/2023/RequireObjectCoercible.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/array.prototype.find/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/array.prototype.find/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "./node_modules/array.prototype.find/shim.js"); + +var $slice = callBound('Array.prototype.slice'); + +var polyfill = getPolyfill(); + +var boundFindShim = function find(array, predicate) { // eslint-disable-line no-unused-vars + RequireObjectCoercible(array); + var args = $slice(arguments, 1); + return polyfill.apply(array, args); +}; + +define(boundFindShim, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = boundFindShim; + + +/***/ }), + +/***/ "./node_modules/array.prototype.find/polyfill.js": +/*!*******************************************************!*\ + !*** ./node_modules/array.prototype.find/polyfill.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +module.exports = function getPolyfill() { + // Detect if an implementation exists + // Detect early implementations which skipped holes in sparse arrays + // eslint-disable-next-line no-sparse-arrays + var implemented = Array.prototype.find && [, 1].find(function () { + return true; + }) !== 1; + + // eslint-disable-next-line global-require + return implemented ? Array.prototype.find : __webpack_require__(/*! ./implementation */ "./node_modules/array.prototype.find/implementation.js"); +}; + + +/***/ }), + +/***/ "./node_modules/array.prototype.find/shim.js": +/*!***************************************************!*\ + !*** ./node_modules/array.prototype.find/shim.js ***! + \***************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var shimUnscopables = __webpack_require__(/*! es-shim-unscopables */ "./node_modules/es-shim-unscopables/index.js"); + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/array.prototype.find/polyfill.js"); + +module.exports = function shimArrayPrototypeFind() { + var polyfill = getPolyfill(); + + define( + Array.prototype, + { find: polyfill }, + { + find: function () { return Array.prototype.find !== polyfill; } + } + ); + + shimUnscopables('find'); + + return polyfill; +}; + + +/***/ }), + +/***/ "./node_modules/blakejs/blake2b.js": +/*!*****************************************!*\ + !*** ./node_modules/blakejs/blake2b.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// Blake2B in pure Javascript +// Adapted from the reference implementation in RFC7693 +// Ported to Javascript by DC - https://github.com/dcposch + +const util = __webpack_require__(/*! ./util */ "./node_modules/blakejs/util.js") + +// 64-bit unsigned addition +// Sets v[a,a+1] += v[b,b+1] +// v should be a Uint32Array +function ADD64AA (v, a, b) { + const o0 = v[a] + v[b] + let o1 = v[a + 1] + v[b + 1] + if (o0 >= 0x100000000) { + o1++ + } + v[a] = o0 + v[a + 1] = o1 +} + +// 64-bit unsigned addition +// Sets v[a,a+1] += b +// b0 is the low 32 bits of b, b1 represents the high 32 bits +function ADD64AC (v, a, b0, b1) { + let o0 = v[a] + b0 + if (b0 < 0) { + o0 += 0x100000000 + } + let o1 = v[a + 1] + b1 + if (o0 >= 0x100000000) { + o1++ + } + v[a] = o0 + v[a + 1] = o1 +} + +// Little-endian byte access +function B2B_GET32 (arr, i) { + return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24) +} + +// G Mixing function +// The ROTRs are inlined for speed +function B2B_G (a, b, c, d, ix, iy) { + const x0 = m[ix] + const x1 = m[ix + 1] + const y0 = m[iy] + const y1 = m[iy + 1] + + ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s + ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits + + // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits + let xor0 = v[d] ^ v[a] + let xor1 = v[d + 1] ^ v[a + 1] + v[d] = xor1 + v[d + 1] = xor0 + + ADD64AA(v, c, d) + + // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits + xor0 = v[b] ^ v[c] + xor1 = v[b + 1] ^ v[c + 1] + v[b] = (xor0 >>> 24) ^ (xor1 << 8) + v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8) + + ADD64AA(v, a, b) + ADD64AC(v, a, y0, y1) + + // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits + xor0 = v[d] ^ v[a] + xor1 = v[d + 1] ^ v[a + 1] + v[d] = (xor0 >>> 16) ^ (xor1 << 16) + v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16) + + ADD64AA(v, c, d) + + // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits + xor0 = v[b] ^ v[c] + xor1 = v[b + 1] ^ v[c + 1] + v[b] = (xor1 >>> 31) ^ (xor0 << 1) + v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1) +} + +// Initialization Vector +const BLAKE2B_IV32 = new Uint32Array([ + 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, + 0x5f1d36f1, 0xa54ff53a, 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, + 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19 +]) + +const SIGMA8 = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, + 6, 1, 12, 0, 2, 11, 7, 5, 3, 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, + 9, 4, 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, 9, 0, 5, 7, 2, 4, + 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, + 15, 14, 1, 9, 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, 13, 11, 7, + 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, + 13, 7, 1, 4, 10, 5, 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, 6, + 1, 12, 0, 2, 11, 7, 5, 3 +] + +// These are offsets into a uint64 buffer. +// Multiply them all by 2 to make them offsets into a uint32 buffer, +// because this is Javascript and we don't have uint64s +const SIGMA82 = new Uint8Array( + SIGMA8.map(function (x) { + return x * 2 + }) +) + +// Compression function. 'last' flag indicates last block. +// Note we're representing 16 uint64s as 32 uint32s +const v = new Uint32Array(32) +const m = new Uint32Array(32) +function blake2bCompress (ctx, last) { + let i = 0 + + // init work variables + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i] + v[i + 16] = BLAKE2B_IV32[i] + } + + // low 64 bits of offset + v[24] = v[24] ^ ctx.t + v[25] = v[25] ^ (ctx.t / 0x100000000) + // high 64 bits not supported, offset may not be higher than 2**53-1 + + // last block flag set ? + if (last) { + v[28] = ~v[28] + v[29] = ~v[29] + } + + // get little-endian words + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i) + } + + // twelve rounds of mixing + // uncomment the DebugPrint calls to log the computation + // and match the RFC sample documentation + // util.debugPrint(' m[16]', m, 64) + for (i = 0; i < 12; i++) { + // util.debugPrint(' (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64) + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]) + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]) + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]) + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]) + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]) + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]) + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]) + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]) + } + // util.debugPrint(' (i=12) v[16]', v, 64) + + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16] + } + // util.debugPrint('h[8]', ctx.h, 64) +} + +// reusable parameterBlock +const parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, // 0: outlen, keylen, fanout, depth + 0, + 0, + 0, + 0, // 4: leaf length, sequential mode + 0, + 0, + 0, + 0, // 8: node offset + 0, + 0, + 0, + 0, // 12: node offset + 0, + 0, + 0, + 0, // 16: node depth, inner length, rfu + 0, + 0, + 0, + 0, // 20: rfu + 0, + 0, + 0, + 0, // 24: rfu + 0, + 0, + 0, + 0, // 28: rfu + 0, + 0, + 0, + 0, // 32: salt + 0, + 0, + 0, + 0, // 36: salt + 0, + 0, + 0, + 0, // 40: salt + 0, + 0, + 0, + 0, // 44: salt + 0, + 0, + 0, + 0, // 48: personal + 0, + 0, + 0, + 0, // 52: personal + 0, + 0, + 0, + 0, // 56: personal + 0, + 0, + 0, + 0 // 60: personal +]) + +// Creates a BLAKE2b hashing context +// Requires an output length between 1 and 64 bytes +// Takes an optional Uint8Array key +// Takes an optinal Uint8Array salt +// Takes an optinal Uint8Array personal +function blake2bInit (outlen, key, salt, personal) { + if (outlen === 0 || outlen > 64) { + throw new Error('Illegal output length, expected 0 < length <= 64') + } + if (key && key.length > 64) { + throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64') + } + if (salt && salt.length !== 16) { + throw new Error('Illegal salt, expected Uint8Array with length is 16') + } + if (personal && personal.length !== 16) { + throw new Error('Illegal personal, expected Uint8Array with length is 16') + } + + // state, 'param block' + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, // input count + c: 0, // pointer within buffer + outlen: outlen // output length in bytes + } + + // initialize parameterBlock before usage + parameterBlock.fill(0) + parameterBlock[0] = outlen + if (key) parameterBlock[1] = key.length + parameterBlock[2] = 1 // fanout + parameterBlock[3] = 1 // depth + if (salt) parameterBlock.set(salt, 32) + if (personal) parameterBlock.set(personal, 48) + + // initialize hash state + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4) + } + + // key the hash, if applicable + if (key) { + blake2bUpdate(ctx, key) + // at the end + ctx.c = 128 + } + + return ctx +} + +// Updates a BLAKE2b streaming hash +// Requires hash context and Uint8Array (byte array) +function blake2bUpdate (ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + // buffer full ? + ctx.t += ctx.c // add counters + blake2bCompress(ctx, false) // compress (not last) + ctx.c = 0 // counter to zero + } + ctx.b[ctx.c++] = input[i] + } +} + +// Completes a BLAKE2b streaming hash +// Returns a Uint8Array containing the message digest +function blake2bFinal (ctx) { + ctx.t += ctx.c // mark last block offset + + while (ctx.c < 128) { + // fill up with zeros + ctx.b[ctx.c++] = 0 + } + blake2bCompress(ctx, true) // final block flag = 1 + + // little endian convert and store + const out = new Uint8Array(ctx.outlen) + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> (8 * (i & 3)) + } + return out +} + +// Computes the BLAKE2B hash of a string or byte array, and returns a Uint8Array +// +// Returns a n-byte Uint8Array +// +// Parameters: +// - input - the input bytes, as a string, Buffer or Uint8Array +// - key - optional key Uint8Array, up to 64 bytes +// - outlen - optional output length in bytes, default 64 +// - salt - optional salt bytes, string, Buffer or Uint8Array +// - personal - optional personal bytes, string, Buffer or Uint8Array +function blake2b (input, key, outlen, salt, personal) { + // preprocess inputs + outlen = outlen || 64 + input = util.normalizeInput(input) + if (salt) { + salt = util.normalizeInput(salt) + } + if (personal) { + personal = util.normalizeInput(personal) + } + + // do the math + const ctx = blake2bInit(outlen, key, salt, personal) + blake2bUpdate(ctx, input) + return blake2bFinal(ctx) +} + +// Computes the BLAKE2B hash of a string or byte array +// +// Returns an n-byte hash in hex, all lowercase +// +// Parameters: +// - input - the input bytes, as a string, Buffer, or Uint8Array +// - key - optional key Uint8Array, up to 64 bytes +// - outlen - optional output length in bytes, default 64 +// - salt - optional salt bytes, string, Buffer or Uint8Array +// - personal - optional personal bytes, string, Buffer or Uint8Array +function blake2bHex (input, key, outlen, salt, personal) { + const output = blake2b(input, key, outlen, salt, personal) + return util.toHex(output) +} + +module.exports = { + blake2b: blake2b, + blake2bHex: blake2bHex, + blake2bInit: blake2bInit, + blake2bUpdate: blake2bUpdate, + blake2bFinal: blake2bFinal +} + + +/***/ }), + +/***/ "./node_modules/blakejs/blake2s.js": +/*!*****************************************!*\ + !*** ./node_modules/blakejs/blake2s.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// BLAKE2s hash function in pure Javascript +// Adapted from the reference implementation in RFC7693 +// Ported to Javascript by DC - https://github.com/dcposch + +const util = __webpack_require__(/*! ./util */ "./node_modules/blakejs/util.js") + +// Little-endian byte access. +// Expects a Uint8Array and an index +// Returns the little-endian uint32 at v[i..i+3] +function B2S_GET32 (v, i) { + return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24) +} + +// Mixing function G. +function B2S_G (a, b, c, d, x, y) { + v[a] = v[a] + v[b] + x + v[d] = ROTR32(v[d] ^ v[a], 16) + v[c] = v[c] + v[d] + v[b] = ROTR32(v[b] ^ v[c], 12) + v[a] = v[a] + v[b] + y + v[d] = ROTR32(v[d] ^ v[a], 8) + v[c] = v[c] + v[d] + v[b] = ROTR32(v[b] ^ v[c], 7) +} + +// 32-bit right rotation +// x should be a uint32 +// y must be between 1 and 31, inclusive +function ROTR32 (x, y) { + return (x >>> y) ^ (x << (32 - y)) +} + +// Initialization Vector. +const BLAKE2S_IV = new Uint32Array([ + 0x6a09e667, + 0xbb67ae85, + 0x3c6ef372, + 0xa54ff53a, + 0x510e527f, + 0x9b05688c, + 0x1f83d9ab, + 0x5be0cd19 +]) + +const SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 +]) + +// Compression function. "last" flag indicates last block +const v = new Uint32Array(16) +const m = new Uint32Array(16) +function blake2sCompress (ctx, last) { + let i = 0 + for (i = 0; i < 8; i++) { + // init work variables + v[i] = ctx.h[i] + v[i + 8] = BLAKE2S_IV[i] + } + + v[12] ^= ctx.t // low 32 bits of offset + v[13] ^= ctx.t / 0x100000000 // high 32 bits + if (last) { + // last block flag set ? + v[14] = ~v[14] + } + + for (i = 0; i < 16; i++) { + // get little-endian words + m[i] = B2S_GET32(ctx.b, 4 * i) + } + + // ten rounds of mixing + // uncomment the DebugPrint calls to log the computation + // and match the RFC sample documentation + // util.debugPrint(' m[16]', m, 32) + for (i = 0; i < 10; i++) { + // util.debugPrint(' (i=' + i + ') v[16]', v, 32) + B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]]) + B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]]) + B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]]) + B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]]) + B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]]) + B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]]) + B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]]) + B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]]) + } + // util.debugPrint(' (i=10) v[16]', v, 32) + + for (i = 0; i < 8; i++) { + ctx.h[i] ^= v[i] ^ v[i + 8] + } + // util.debugPrint('h[8]', ctx.h, 32) +} + +// Creates a BLAKE2s hashing context +// Requires an output length between 1 and 32 bytes +// Takes an optional Uint8Array key +function blake2sInit (outlen, key) { + if (!(outlen > 0 && outlen <= 32)) { + throw new Error('Incorrect output length, should be in [1, 32]') + } + const keylen = key ? key.length : 0 + if (key && !(keylen > 0 && keylen <= 32)) { + throw new Error('Incorrect key length, should be in [1, 32]') + } + + const ctx = { + h: new Uint32Array(BLAKE2S_IV), // hash state + b: new Uint8Array(64), // input block + c: 0, // pointer within block + t: 0, // input count + outlen: outlen // output length in bytes + } + ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen + + if (keylen > 0) { + blake2sUpdate(ctx, key) + ctx.c = 64 // at the end + } + + return ctx +} + +// Updates a BLAKE2s streaming hash +// Requires hash context and Uint8Array (byte array) +function blake2sUpdate (ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + // buffer full ? + ctx.t += ctx.c // add counters + blake2sCompress(ctx, false) // compress (not last) + ctx.c = 0 // counter to zero + } + ctx.b[ctx.c++] = input[i] + } +} + +// Completes a BLAKE2s streaming hash +// Returns a Uint8Array containing the message digest +function blake2sFinal (ctx) { + ctx.t += ctx.c // mark last block offset + while (ctx.c < 64) { + // fill up with zeros + ctx.b[ctx.c++] = 0 + } + blake2sCompress(ctx, true) // final block flag = 1 + + // little endian convert and store + const out = new Uint8Array(ctx.outlen) + for (let i = 0; i < ctx.outlen; i++) { + out[i] = (ctx.h[i >> 2] >> (8 * (i & 3))) & 0xff + } + return out +} + +// Computes the BLAKE2S hash of a string or byte array, and returns a Uint8Array +// +// Returns a n-byte Uint8Array +// +// Parameters: +// - input - the input bytes, as a string, Buffer, or Uint8Array +// - key - optional key Uint8Array, up to 32 bytes +// - outlen - optional output length in bytes, default 64 +function blake2s (input, key, outlen) { + // preprocess inputs + outlen = outlen || 32 + input = util.normalizeInput(input) + + // do the math + const ctx = blake2sInit(outlen, key) + blake2sUpdate(ctx, input) + return blake2sFinal(ctx) +} + +// Computes the BLAKE2S hash of a string or byte array +// +// Returns an n-byte hash in hex, all lowercase +// +// Parameters: +// - input - the input bytes, as a string, Buffer, or Uint8Array +// - key - optional key Uint8Array, up to 32 bytes +// - outlen - optional output length in bytes, default 64 +function blake2sHex (input, key, outlen) { + const output = blake2s(input, key, outlen) + return util.toHex(output) +} + +module.exports = { + blake2s: blake2s, + blake2sHex: blake2sHex, + blake2sInit: blake2sInit, + blake2sUpdate: blake2sUpdate, + blake2sFinal: blake2sFinal +} + + +/***/ }), + +/***/ "./node_modules/blakejs/index.js": +/*!***************************************!*\ + !*** ./node_modules/blakejs/index.js ***! + \***************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const b2b = __webpack_require__(/*! ./blake2b */ "./node_modules/blakejs/blake2b.js") +const b2s = __webpack_require__(/*! ./blake2s */ "./node_modules/blakejs/blake2s.js") + +module.exports = { + blake2b: b2b.blake2b, + blake2bHex: b2b.blake2bHex, + blake2bInit: b2b.blake2bInit, + blake2bUpdate: b2b.blake2bUpdate, + blake2bFinal: b2b.blake2bFinal, + blake2s: b2s.blake2s, + blake2sHex: b2s.blake2sHex, + blake2sInit: b2s.blake2sInit, + blake2sUpdate: b2s.blake2sUpdate, + blake2sFinal: b2s.blake2sFinal +} + + +/***/ }), + +/***/ "./node_modules/blakejs/util.js": +/*!**************************************!*\ + !*** ./node_modules/blakejs/util.js ***! + \**************************************/ +/***/ ((module) => { + +const ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array' + +// For convenience, let people hash a string, not just a Uint8Array +function normalizeInput (input) { + let ret + if (input instanceof Uint8Array) { + ret = input + } else if (typeof input === 'string') { + const encoder = new TextEncoder() + ret = encoder.encode(input) + } else { + throw new Error(ERROR_MSG_INPUT) + } + return ret +} + +// Converts a Uint8Array to a hexadecimal string +// For example, toHex([255, 0, 255]) returns "ff00ff" +function toHex (bytes) { + return Array.prototype.map + .call(bytes, function (n) { + return (n < 16 ? '0' : '') + n.toString(16) + }) + .join('') +} + +// Converts any value in [0...2^32-1] to an 8-character hex string +function uint32ToHex (val) { + return (0x100000000 + val).toString(16).substring(1) +} + +// For debugging: prints out hash state in the same format as the RFC +// sample computation exactly, so that you can diff +function debugPrint (label, arr, size) { + let msg = '\n' + label + ' = ' + for (let i = 0; i < arr.length; i += 2) { + if (size === 32) { + msg += uint32ToHex(arr[i]).toUpperCase() + msg += ' ' + msg += uint32ToHex(arr[i + 1]).toUpperCase() + } else if (size === 64) { + msg += uint32ToHex(arr[i + 1]).toUpperCase() + msg += uint32ToHex(arr[i]).toUpperCase() + } else throw new Error('Invalid size ' + size) + if (i % 6 === 4) { + msg += '\n' + new Array(label.length + 4).join(' ') + } else if (i < arr.length - 2) { + msg += ' ' + } + } + console.log(msg) +} + +// For performance testing: generates N bytes of input, hashes M times +// Measures and prints MB/second hash performance each time +function testSpeed (hashFn, N, M) { + let startMs = new Date().getTime() + + const input = new Uint8Array(N) + for (let i = 0; i < N; i++) { + input[i] = i % 256 + } + const genMs = new Date().getTime() + console.log('Generated random input in ' + (genMs - startMs) + 'ms') + startMs = genMs + + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input) + const hashMs = new Date().getTime() + const ms = hashMs - startMs + startMs = hashMs + console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...') + console.log( + Math.round((N / (1 << 20) / (ms / 1000)) * 100) / 100 + ' MB PER SECOND' + ) + } +} + +module.exports = { + normalizeInput: normalizeInput, + toHex: toHex, + debugPrint: debugPrint, + testSpeed: testSpeed +} + + +/***/ }), + +/***/ "./node_modules/call-bind/callBound.js": +/*!*********************************************!*\ + !*** ./node_modules/call-bind/callBound.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); + +var callBind = __webpack_require__(/*! ./ */ "./node_modules/call-bind/index.js"); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; + + +/***/ }), + +/***/ "./node_modules/call-bind/index.js": +/*!*****************************************!*\ + !*** ./node_modules/call-bind/index.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); +var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); +var $max = GetIntrinsic('%Math.max%'); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind(originalFunction) { + var func = $reflectApply(bind, $call, arguments); + if ($gOPD && $defineProperty) { + var desc = $gOPD(func, 'length'); + if (desc.configurable) { + // original length, plus the receiver, minus any additional arguments (after the receiver) + $defineProperty( + func, + 'length', + { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } + ); + } + } + return func; +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} + + +/***/ }), + +/***/ "./node_modules/consolidated-events/lib/index.esm.js": +/*!***********************************************************!*\ + !*** ./node_modules/consolidated-events/lib/index.esm.js ***! + \***********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addEventListener: () => (/* binding */ addEventListener) +/* harmony export */ }); +var CAN_USE_DOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + +// Adapted from Modernizr +// https://github.com/Modernizr/Modernizr/blob/acb3f0d9/feature-detects/dom/passiveeventlisteners.js#L26-L37 +function testPassiveEventListeners() { + if (!CAN_USE_DOM) { + return false; + } + + if (!window.addEventListener || !window.removeEventListener || !Object.defineProperty) { + return false; + } + + var supportsPassiveOption = false; + try { + var opts = Object.defineProperty({}, 'passive', { + // eslint-disable-next-line getter-return + get: function () { + function get() { + supportsPassiveOption = true; + } + + return get; + }() + }); + var noop = function noop() {}; + window.addEventListener('testPassiveEventSupport', noop, opts); + window.removeEventListener('testPassiveEventSupport', noop, opts); + } catch (e) { + // do nothing + } + + return supportsPassiveOption; +} + +var memoized = void 0; + +function canUsePassiveEventListeners() { + if (memoized === undefined) { + memoized = testPassiveEventListeners(); + } + return memoized; +} + +function normalizeEventOptions(eventOptions) { + if (!eventOptions) { + return undefined; + } + + if (!canUsePassiveEventListeners()) { + // If the browser does not support the passive option, then it is expecting + // a boolean for the options argument to specify whether it should use + // capture or not. In more modern browsers, this is passed via the `capture` + // option, so let's just hoist that value up. + return !!eventOptions.capture; + } + + return eventOptions; +} + +/* eslint-disable no-bitwise */ + +/** + * Generate a unique key for any set of event options + */ +function eventOptionsKey(normalizedEventOptions) { + if (!normalizedEventOptions) { + return 0; + } + + // If the browser does not support passive event listeners, the normalized + // event options will be a boolean. + if (normalizedEventOptions === true) { + return 100; + } + + // At this point, the browser supports passive event listeners, so we expect + // the event options to be an object with possible properties of capture, + // passive, and once. + // + // We want to consistently return the same value, regardless of the order of + // these properties, so let's use binary maths to assign each property to a + // bit, and then add those together (with an offset to account for the + // booleans at the beginning of this function). + var capture = normalizedEventOptions.capture << 0; + var passive = normalizedEventOptions.passive << 1; + var once = normalizedEventOptions.once << 2; + return capture + passive + once; +} + +function ensureCanMutateNextEventHandlers(eventHandlers) { + if (eventHandlers.handlers === eventHandlers.nextHandlers) { + // eslint-disable-next-line no-param-reassign + eventHandlers.nextHandlers = eventHandlers.handlers.slice(); + } +} + +function TargetEventHandlers(target) { + this.target = target; + this.events = {}; +} + +TargetEventHandlers.prototype.getEventHandlers = function () { + function getEventHandlers(eventName, options) { + var key = String(eventName) + ' ' + String(eventOptionsKey(options)); + + if (!this.events[key]) { + this.events[key] = { + handlers: [], + handleEvent: undefined + }; + this.events[key].nextHandlers = this.events[key].handlers; + } + + return this.events[key]; + } + + return getEventHandlers; +}(); + +TargetEventHandlers.prototype.handleEvent = function () { + function handleEvent(eventName, options, event) { + var eventHandlers = this.getEventHandlers(eventName, options); + eventHandlers.handlers = eventHandlers.nextHandlers; + eventHandlers.handlers.forEach(function (handler) { + if (handler) { + // We need to check for presence here because a handler function may + // cause later handlers to get removed. This can happen if you for + // instance have a waypoint that unmounts another waypoint as part of an + // onEnter/onLeave handler. + handler(event); + } + }); + } + + return handleEvent; +}(); + +TargetEventHandlers.prototype.add = function () { + function add(eventName, listener, options) { + var _this = this; + + // options has already been normalized at this point. + var eventHandlers = this.getEventHandlers(eventName, options); + + ensureCanMutateNextEventHandlers(eventHandlers); + + if (eventHandlers.nextHandlers.length === 0) { + eventHandlers.handleEvent = this.handleEvent.bind(this, eventName, options); + + this.target.addEventListener(eventName, eventHandlers.handleEvent, options); + } + + eventHandlers.nextHandlers.push(listener); + + var isSubscribed = true; + var unsubscribe = function () { + function unsubscribe() { + if (!isSubscribed) { + return; + } + + isSubscribed = false; + + ensureCanMutateNextEventHandlers(eventHandlers); + var index = eventHandlers.nextHandlers.indexOf(listener); + eventHandlers.nextHandlers.splice(index, 1); + + if (eventHandlers.nextHandlers.length === 0) { + // All event handlers have been removed, so we want to remove the event + // listener from the target node. + + if (_this.target) { + // There can be a race condition where the target may no longer exist + // when this function is called, e.g. when a React component is + // unmounting. Guarding against this prevents the following error: + // + // Cannot read property 'removeEventListener' of undefined + _this.target.removeEventListener(eventName, eventHandlers.handleEvent, options); + } + + eventHandlers.handleEvent = undefined; + } + } + + return unsubscribe; + }(); + return unsubscribe; + } + + return add; +}(); + +var EVENT_HANDLERS_KEY = '__consolidated_events_handlers__'; + +// eslint-disable-next-line import/prefer-default-export +function addEventListener(target, eventName, listener, options) { + if (!target[EVENT_HANDLERS_KEY]) { + // eslint-disable-next-line no-param-reassign + target[EVENT_HANDLERS_KEY] = new TargetEventHandlers(target); + } + var normalizedEventOptions = normalizeEventOptions(options); + return target[EVENT_HANDLERS_KEY].add(eventName, listener, normalizedEventOptions); +} + + + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/assets/icons.css": +/*!***********************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/assets/icons.css ***! + \***********************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/getUrl.js */ "./node_modules/css-loader/dist/runtime/getUrl.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__); +// Imports + + + +var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(/*! ./flags/cz.svg */ "./src/ui/assets/flags/cz.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_1___ = new URL(/* asset import */ __webpack_require__(/*! ./flags/nl.svg */ "./src/ui/assets/flags/nl.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_2___ = new URL(/* asset import */ __webpack_require__(/*! ./flags/it.svg */ "./src/ui/assets/flags/it.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_3___ = new URL(/* asset import */ __webpack_require__(/*! ./flags/fr.svg */ "./src/ui/assets/flags/fr.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_4___ = new URL(/* asset import */ __webpack_require__(/*! ./flags/de.svg */ "./src/ui/assets/flags/de.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_5___ = new URL(/* asset import */ __webpack_require__(/*! ./flags/sv.svg */ "./src/ui/assets/flags/sv.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_6___ = new URL(/* asset import */ __webpack_require__(/*! ./flags/gb-eng.svg */ "./src/ui/assets/flags/gb-eng.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_7___ = new URL(/* asset import */ __webpack_require__(/*! ./flags/bg.svg */ "./src/ui/assets/flags/bg.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_8___ = new URL(/* asset import */ __webpack_require__(/*! ./checkmark.svg */ "./src/ui/assets/checkmark.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_9___ = new URL(/* asset import */ __webpack_require__(/*! ./settings.svg */ "./src/ui/assets/settings.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_10___ = new URL(/* asset import */ __webpack_require__(/*! ./app_shortcut.svg */ "./src/ui/assets/app_shortcut.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_11___ = new URL(/* asset import */ __webpack_require__(/*! ./create.svg */ "./src/ui/assets/create.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_12___ = new URL(/* asset import */ __webpack_require__(/*! ./download.svg */ "./src/ui/assets/download.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_13___ = new URL(/* asset import */ __webpack_require__(/*! ./use-label.svg */ "./src/ui/assets/use-label.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_14___ = new URL(/* asset import */ __webpack_require__(/*! ./restore.svg */ "./src/ui/assets/restore.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_15___ = new URL(/* asset import */ __webpack_require__(/*! ./cross.svg */ "./src/ui/assets/cross.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_16___ = new URL(/* asset import */ __webpack_require__(/*! ./plus.svg */ "./src/ui/assets/plus.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_17___ = new URL(/* asset import */ __webpack_require__(/*! ./reset-instance.svg */ "./src/ui/assets/reset-instance.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_18___ = new URL(/* asset import */ __webpack_require__(/*! ./upload.svg */ "./src/ui/assets/upload.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_19___ = new URL(/* asset import */ __webpack_require__(/*! ./number_sign.svg */ "./src/ui/assets/number_sign.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_20___ = new URL(/* asset import */ __webpack_require__(/*! ./text_sign.svg */ "./src/ui/assets/text_sign.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_21___ = new URL(/* asset import */ __webpack_require__(/*! ./refresh.svg */ "./src/ui/assets/refresh.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_22___ = new URL(/* asset import */ __webpack_require__(/*! ./link.svg */ "./src/ui/assets/link.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_23___ = new URL(/* asset import */ __webpack_require__(/*! ./key.svg */ "./src/ui/assets/key.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_24___ = new URL(/* asset import */ __webpack_require__(/*! ./checkbox.svg */ "./src/ui/assets/checkbox.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_25___ = new URL(/* asset import */ __webpack_require__(/*! ./edit.svg */ "./src/ui/assets/edit.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_26___ = new URL(/* asset import */ __webpack_require__(/*! ./trash.svg */ "./src/ui/assets/trash.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_27___ = new URL(/* asset import */ __webpack_require__(/*! ./warning.svg */ "./src/ui/assets/warning.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_28___ = new URL(/* asset import */ __webpack_require__(/*! ./dot.svg */ "./src/ui/assets/dot.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_29___ = new URL(/* asset import */ __webpack_require__(/*! ./search.svg */ "./src/ui/assets/search.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_30___ = new URL(/* asset import */ __webpack_require__(/*! ./eye.svg */ "./src/ui/assets/eye.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_31___ = new URL(/* asset import */ __webpack_require__(/*! ./eye-closed.svg */ "./src/ui/assets/eye-closed.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_32___ = new URL(/* asset import */ __webpack_require__(/*! ./undo.svg */ "./src/ui/assets/undo.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_33___ = new URL(/* asset import */ __webpack_require__(/*! ./variable.svg */ "./src/ui/assets/variable.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_34___ = new URL(/* asset import */ __webpack_require__(/*! ./expand.svg */ "./src/ui/assets/expand.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_35___ = new URL(/* asset import */ __webpack_require__(/*! ./linked.svg */ "./src/ui/assets/linked.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_36___ = new URL(/* asset import */ __webpack_require__(/*! ./unlinked.svg */ "./src/ui/assets/unlinked.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_37___ = new URL(/* asset import */ __webpack_require__(/*! ./arrow_up.svg */ "./src/ui/assets/arrow_up.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_38___ = new URL(/* asset import */ __webpack_require__(/*! ./arrow_down.svg */ "./src/ui/assets/arrow_down.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_39___ = new URL(/* asset import */ __webpack_require__(/*! ./world.svg */ "./src/ui/assets/world.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_40___ = new URL(/* asset import */ __webpack_require__(/*! ./caret.svg */ "./src/ui/assets/caret.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_41___ = new URL(/* asset import */ __webpack_require__(/*! ./history.svg */ "./src/ui/assets/history.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_42___ = new URL(/* asset import */ __webpack_require__(/*! ./plural.svg */ "./src/ui/assets/plural.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_43___ = new URL(/* asset import */ __webpack_require__(/*! ./no-plural.svg */ "./src/ui/assets/no-plural.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_44___ = new URL(/* asset import */ __webpack_require__(/*! ./placeholder-filled.svg */ "./src/ui/assets/placeholder-filled.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_45___ = new URL(/* asset import */ __webpack_require__(/*! ./placeholder.svg */ "./src/ui/assets/placeholder.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_46___ = new URL(/* asset import */ __webpack_require__(/*! ./window_mode_window.svg */ "./src/ui/assets/window_mode_window.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_47___ = new URL(/* asset import */ __webpack_require__(/*! ./window_mode_fullscreen.svg */ "./src/ui/assets/window_mode_fullscreen.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_48___ = new URL(/* asset import */ __webpack_require__(/*! ./window_mode_minimized.svg */ "./src/ui/assets/window_mode_minimized.svg"), __webpack_require__.b); +var ___CSS_LOADER_URL_IMPORT_49___ = new URL(/* asset import */ __webpack_require__(/*! ./window_mode_bottom_attached.svg */ "./src/ui/assets/window_mode_bottom_attached.svg"), __webpack_require__.b); +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___); +var ___CSS_LOADER_URL_REPLACEMENT_1___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_1___); +var ___CSS_LOADER_URL_REPLACEMENT_2___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_2___); +var ___CSS_LOADER_URL_REPLACEMENT_3___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_3___); +var ___CSS_LOADER_URL_REPLACEMENT_4___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_4___); +var ___CSS_LOADER_URL_REPLACEMENT_5___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_5___); +var ___CSS_LOADER_URL_REPLACEMENT_6___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_6___); +var ___CSS_LOADER_URL_REPLACEMENT_7___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_7___); +var ___CSS_LOADER_URL_REPLACEMENT_8___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_8___); +var ___CSS_LOADER_URL_REPLACEMENT_9___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_9___); +var ___CSS_LOADER_URL_REPLACEMENT_10___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_10___); +var ___CSS_LOADER_URL_REPLACEMENT_11___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_11___); +var ___CSS_LOADER_URL_REPLACEMENT_12___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_12___); +var ___CSS_LOADER_URL_REPLACEMENT_13___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_13___); +var ___CSS_LOADER_URL_REPLACEMENT_14___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_14___); +var ___CSS_LOADER_URL_REPLACEMENT_15___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_15___); +var ___CSS_LOADER_URL_REPLACEMENT_16___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_16___); +var ___CSS_LOADER_URL_REPLACEMENT_17___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_17___); +var ___CSS_LOADER_URL_REPLACEMENT_18___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_18___); +var ___CSS_LOADER_URL_REPLACEMENT_19___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_19___); +var ___CSS_LOADER_URL_REPLACEMENT_20___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_20___); +var ___CSS_LOADER_URL_REPLACEMENT_21___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_21___); +var ___CSS_LOADER_URL_REPLACEMENT_22___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_22___); +var ___CSS_LOADER_URL_REPLACEMENT_23___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_23___); +var ___CSS_LOADER_URL_REPLACEMENT_24___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_24___); +var ___CSS_LOADER_URL_REPLACEMENT_25___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_25___); +var ___CSS_LOADER_URL_REPLACEMENT_26___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_26___); +var ___CSS_LOADER_URL_REPLACEMENT_27___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_27___); +var ___CSS_LOADER_URL_REPLACEMENT_28___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_28___); +var ___CSS_LOADER_URL_REPLACEMENT_29___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_29___); +var ___CSS_LOADER_URL_REPLACEMENT_30___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_30___); +var ___CSS_LOADER_URL_REPLACEMENT_31___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_31___); +var ___CSS_LOADER_URL_REPLACEMENT_32___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_32___); +var ___CSS_LOADER_URL_REPLACEMENT_33___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_33___); +var ___CSS_LOADER_URL_REPLACEMENT_34___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_34___); +var ___CSS_LOADER_URL_REPLACEMENT_35___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_35___); +var ___CSS_LOADER_URL_REPLACEMENT_36___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_36___); +var ___CSS_LOADER_URL_REPLACEMENT_37___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_37___); +var ___CSS_LOADER_URL_REPLACEMENT_38___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_38___); +var ___CSS_LOADER_URL_REPLACEMENT_39___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_39___); +var ___CSS_LOADER_URL_REPLACEMENT_40___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_40___); +var ___CSS_LOADER_URL_REPLACEMENT_41___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_41___); +var ___CSS_LOADER_URL_REPLACEMENT_42___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_42___); +var ___CSS_LOADER_URL_REPLACEMENT_43___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_43___); +var ___CSS_LOADER_URL_REPLACEMENT_44___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_44___); +var ___CSS_LOADER_URL_REPLACEMENT_45___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_45___); +var ___CSS_LOADER_URL_REPLACEMENT_46___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_46___); +var ___CSS_LOADER_URL_REPLACEMENT_47___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_47___); +var ___CSS_LOADER_URL_REPLACEMENT_48___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_48___); +var ___CSS_LOADER_URL_REPLACEMENT_49___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_49___); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` +.svg-container { + background-color: var(--figma-color-icon); + + -webkit-mask-position-x: 50%; + -webkit-mask-position-y: 50%; + -webkit-mask-repeat-x: no-repeat; + -webkit-mask-repeat-y: no-repeat; + -webkit-mask-size: cover; +} + + +.svg-container { + width: 16px; + height: 16px; +} + + + +.flag-cs { + width: 16px; + height: 16px; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_0___}); + } + .flag-nil { + width: 16px; + height: 16px; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_1___}); + } + + + .flag-it { + width: 16px; + height: 16px; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_2___}); + } + + +.flag-fr { + width: 16px; + height: 16px; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_3___}); + } + + + .flag-de { + width: 16px; + height: 16px; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_4___}); + } + .flag-sv { + width: 16px; + height: 16px; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_5___}); + } + +.flag-en { + width: 16px; + height: 16px; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_6___}); + +} + +.flag-bg { + width: 16px; + height: 16px; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_7___}); + +} + +.checkmark-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_8___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_8___}); +} + +.settings-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_9___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_9___}); + } + + .app-short-cut-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_10___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_10___}); + } + + .create-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_11___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_11___}); + } + + .download-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_12___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_12___}); + } + + .use-label-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_13___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_13___}); + } + + + .restore-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_14___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_14___}); + } + + + .cross-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_15___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_15___}); + } + + .plus-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_16___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_16___}); + } + + .reset-instance-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_17___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_17___}); + } + + .upload-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_18___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_18___}); + } + + .number-sign-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_19___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_19___}); + } + + .text-sign-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_20___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_20___}); + } + + .refresh-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_21___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_21___}); + } + + .link-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_22___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_22___}); + } + + .key-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_23___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_23___}); + } + + .checkbox-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_24___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_24___}); + } + + .edit-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_25___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_25___}); + } + + + .trash-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_26___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_26___}); + } + + .warning-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_27___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_27___}); + } + .dot-svg { + width: 7px; + height: 7px; + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_28___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_28___}); + } + + .search-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_29___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_29___}); + } + + .eye-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_30___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_30___}); + } + + .eye-closed-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_31___}); + + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_31___}); + } + + + .undo-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_32___}); + + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_32___}); + } + .variable-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_33___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_33___}); + } + + .expand-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_34___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_34___}); + } + + .linked-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_35___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_35___}); + } + + .unlinked-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_36___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_36___}); + } + + .arrow-up-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_37___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_37___}); + } + + .arrow-down-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_38___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_38___}); + } + + + .world-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_39___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_39___}); + } + + .caret-svg { + width: 8px; + height: 7px; + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_40___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_40___}); + } + + + + .history-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_41___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_41___}); + } + + .plural-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_42___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_42___}); + } + + .no-plural-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_43___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_43___}); + } + + .placeholder-filled-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_44___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_44___}); + } + + .placeholder-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_45___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_45___}); + } + + .window-mode-window-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_46___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_46___}); + } + + .window-mode-fullscreen-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_47___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_47___}); + } + + .window-mode-minimized-svg { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_48___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_48___}); + } + + .window-mode-bottom-attached-svg { + width: 10px !important; + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_49___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_49___}); + }`, "",{"version":3,"sources":["webpack://./src/ui/assets/icons.css"],"names":[],"mappings":";AACA;IACI,yCAAyC;;IAEzC,4BAA4B;IAC5B,4BAA4B;IAC5B,gCAAgC;IAChC,gCAAgC;IAChC,wBAAwB;AAC5B;;;AAGA;IACI,WAAW;IACX,YAAY;AAChB;;;;AAIA;IACI,WAAW;IACX,YAAY;IACZ,yDAAqC;EACvC;EACA;MACI,WAAW;MACX,YAAY;MACZ,yDAAqC;IACvC;;;EAGF;IACE,WAAW;IACX,YAAY;IACZ,yDAAqC;EACvC;;;AAGF;IACI,WAAW;IACX,YAAY;IACZ,yDAAqC;EACvC;;;EAGA;IACE,WAAW;IACX,YAAY;IACZ,yDAAqC;EACvC;EACA;MACI,WAAW;MACX,YAAY;MACZ,yDAAqC;IACvC;;AAEJ;IACI,WAAW;IACX,YAAY;IACZ,yDAAyC;;AAE7C;;AAEA;IACI,WAAW;IACX,YAAY;IACZ,yDAAqC;;AAEzC;;AAEA;IACI,2DAAwC;IACxC,mDAAgC;AACpC;;AAEA;IACI,2DAAuC;IACvC,mDAA+B;EACjC;;EAEA;IACE,4DAA2C;IAC3C,oDAAmC;EACrC;;EAEA;IACE,4DAAqC;IACrC,oDAA6B;EAC/B;;EAEA;IACE,4DAAuC;IACvC,oDAA+B;EACjC;;EAEA;IACE,4DAAwC;IACxC,oDAAgC;EAClC;;;EAGA;IACE,4DAAsC;IACtC,oDAA8B;EAChC;;;EAGA;IACE,4DAAoC;IACpC,oDAA4B;EAC9B;;EAEA;IACE,4DAAmC;IACnC,oDAA2B;EAC7B;;EAEA;IACE,4DAA6C;IAC7C,oDAAqC;EACvC;;EAEA;IACE,4DAAqC;IACrC,oDAA6B;EAC/B;;EAEA;IACE,4DAA0C;IAC1C,oDAAkC;EACpC;;EAEA;IACE,4DAAwC;IACxC,oDAAgC;EAClC;;EAEA;IACE,4DAAsC;IACtC,oDAA8B;EAChC;;EAEA;IACE,4DAAmC;IACnC,oDAA2B;EAC7B;;EAEA;IACE,4DAAkC;IAClC,oDAA0B;EAC5B;;EAEA;IACE,4DAAuC;IACvC,oDAA+B;EACjC;;EAEA;IACE,4DAAmC;IACnC,oDAA2B;EAC7B;;;EAGA;IACE,4DAAoC;IACpC,oDAA4B;EAC9B;;EAEA;IACE,4DAAsC;IACtC,oDAA8B;EAChC;EACA;IACE,UAAU;IACV,WAAW;IACX,4DAAkC;IAClC,oDAA0B;EAC5B;;EAEA;IACE,4DAAqC;IACrC,oDAA6B;EAC/B;;EAEA;IACE,4DAAkC;IAClC,oDAA0B;EAC5B;;EAEA;IACE,4DAAyC;;IAEzC,oDAAiC;EACnC;;;EAGA;IACE,4DAAmC;;IAEnC,oDAA2B;EAC7B;EACA;IACE,4DAAuC;IACvC,oDAA+B;EACjC;;EAEA;IACE,4DAAqC;IACrC,oDAA6B;EAC/B;;EAEA;IACE,4DAAqC;IACrC,oDAA6B;EAC/B;;EAEA;IACE,4DAAuC;IACvC,oDAA+B;EACjC;;EAEA;IACE,4DAAuC;IACvC,oDAA+B;EACjC;;EAEA;IACE,4DAAyC;IACzC,oDAAiC;EACnC;;;EAGA;IACE,4DAAoC;IACpC,oDAA4B;EAC9B;;EAEA;IACE,UAAU;IACV,WAAW;IACX,4DAAoC;IACpC,oDAA4B;EAC9B;;;;EAIA;IACE,4DAAsC;IACtC,oDAA8B;EAChC;;EAEA;IACE,4DAAqC;IACrC,oDAA6B;EAC/B;;EAEA;IACE,4DAAwC;IACxC,oDAAgC;EAClC;;EAEA;IACE,4DAAiD;IACjD,oDAAyC;EAC3C;;EAEA;IACE,4DAA0C;IAC1C,oDAAkC;EACpC;;EAEA;IACE,4DAAiD;IACjD,oDAAyC;EAC3C;;EAEA;IACE,4DAAqD;IACrD,oDAA6C;EAC/C;;EAEA;IACE,4DAAoD;IACpD,oDAA4C;EAC9C;;EAEA;MACI,sBAAsB;MACtB,4DAA0D;MAC1D,oDAAkD;EACtD","sourcesContent":["\n.svg-container {\n background-color: var(--figma-color-icon);\n\n -webkit-mask-position-x: 50%;\n -webkit-mask-position-y: 50%;\n -webkit-mask-repeat-x: no-repeat;\n -webkit-mask-repeat-y: no-repeat;\n -webkit-mask-size: cover;\n}\n\n\n.svg-container {\n width: 16px;\n height: 16px;\n}\n\n\n\n.flag-cs {\n width: 16px;\n height: 16px;\n background-image: url(./flags/cz.svg);\n }\n .flag-nil {\n width: 16px;\n height: 16px;\n background-image: url(./flags/nl.svg);\n }\n\n\n .flag-it {\n width: 16px;\n height: 16px;\n background-image: url(./flags/it.svg);\n }\n\n\n.flag-fr {\n width: 16px;\n height: 16px;\n background-image: url(./flags/fr.svg);\n }\n\n\n .flag-de {\n width: 16px;\n height: 16px;\n background-image: url(./flags/de.svg);\n }\n .flag-sv {\n width: 16px;\n height: 16px;\n background-image: url(./flags/sv.svg);\n }\n\n.flag-en {\n width: 16px;\n height: 16px;\n background-image: url(./flags/gb-eng.svg);\n \n}\n\n.flag-bg {\n width: 16px;\n height: 16px;\n background-image: url(./flags/bg.svg);\n \n}\n\n.checkmark-svg {\n -webkit-mask-image: url(./checkmark.svg);\n mask-image: url(./checkmark.svg);\n}\n\n.settings-svg {\n -webkit-mask-image: url(./settings.svg);\n mask-image: url(./settings.svg);\n }\n\n .app-short-cut-svg {\n -webkit-mask-image: url(./app_shortcut.svg);\n mask-image: url(./app_shortcut.svg);\n }\n\n .create-svg {\n -webkit-mask-image: url(./create.svg);\n mask-image: url(./create.svg);\n }\n\n .download-svg {\n -webkit-mask-image: url(./download.svg);\n mask-image: url(./download.svg);\n }\n\n .use-label-svg {\n -webkit-mask-image: url(./use-label.svg);\n mask-image: url(./use-label.svg);\n }\n\n\n .restore-svg {\n -webkit-mask-image: url(./restore.svg);\n mask-image: url(./restore.svg);\n }\n\n\n .cross-svg {\n -webkit-mask-image: url(./cross.svg);\n mask-image: url(./cross.svg);\n }\n\n .plus-svg {\n -webkit-mask-image: url(./plus.svg);\n mask-image: url(./plus.svg);\n }\n\n .reset-instance-svg {\n -webkit-mask-image: url(./reset-instance.svg);\n mask-image: url(./reset-instance.svg);\n }\n\n .upload-svg {\n -webkit-mask-image: url(./upload.svg);\n mask-image: url(./upload.svg);\n }\n \n .number-sign-svg {\n -webkit-mask-image: url(./number_sign.svg);\n mask-image: url(./number_sign.svg);\n }\n \n .text-sign-svg {\n -webkit-mask-image: url(./text_sign.svg);\n mask-image: url(./text_sign.svg);\n }\n \n .refresh-svg {\n -webkit-mask-image: url(./refresh.svg);\n mask-image: url(./refresh.svg);\n }\n \n .link-svg {\n -webkit-mask-image: url(./link.svg);\n mask-image: url(./link.svg);\n }\n\n .key-svg {\n -webkit-mask-image: url(./key.svg);\n mask-image: url(./key.svg);\n }\n\n .checkbox-svg {\n -webkit-mask-image: url(./checkbox.svg);\n mask-image: url(./checkbox.svg);\n }\n\n .edit-svg {\n -webkit-mask-image: url(./edit.svg);\n mask-image: url(./edit.svg);\n }\n\n\n .trash-svg {\n -webkit-mask-image: url(./trash.svg);\n mask-image: url(./trash.svg);\n }\n\n .warning-svg {\n -webkit-mask-image: url(./warning.svg);\n mask-image: url(./warning.svg);\n }\n .dot-svg {\n width: 7px;\n height: 7px;\n -webkit-mask-image: url(./dot.svg);\n mask-image: url(./dot.svg);\n }\n\n .search-svg {\n -webkit-mask-image: url(./search.svg);\n mask-image: url(./search.svg);\n }\n\n .eye-svg {\n -webkit-mask-image: url(./eye.svg);\n mask-image: url(./eye.svg);\n }\n\n .eye-closed-svg {\n -webkit-mask-image: url(./eye-closed.svg);\n\n mask-image: url(./eye-closed.svg);\n }\n \n\n .undo-svg {\n -webkit-mask-image: url(./undo.svg);\n\n mask-image: url(./undo.svg);\n }\n .variable-svg {\n -webkit-mask-image: url(./variable.svg);\n mask-image: url(./variable.svg);\n }\n\n .expand-svg {\n -webkit-mask-image: url(./expand.svg);\n mask-image: url(./expand.svg);\n }\n\n .linked-svg {\n -webkit-mask-image: url(./linked.svg);\n mask-image: url(./linked.svg);\n }\n\n .unlinked-svg {\n -webkit-mask-image: url(./unlinked.svg);\n mask-image: url(./unlinked.svg);\n }\n\n .arrow-up-svg {\n -webkit-mask-image: url(./arrow_up.svg);\n mask-image: url(./arrow_up.svg);\n }\n\n .arrow-down-svg {\n -webkit-mask-image: url(./arrow_down.svg);\n mask-image: url(./arrow_down.svg);\n }\n\n\n .world-svg {\n -webkit-mask-image: url(./world.svg);\n mask-image: url(./world.svg);\n }\n\n .caret-svg {\n width: 8px;\n height: 7px;\n -webkit-mask-image: url(./caret.svg);\n mask-image: url(./caret.svg);\n }\n\n\n\n .history-svg {\n -webkit-mask-image: url(./history.svg);\n mask-image: url(./history.svg);\n }\n\n .plural-svg {\n -webkit-mask-image: url(./plural.svg);\n mask-image: url(./plural.svg);\n }\n\n .no-plural-svg {\n -webkit-mask-image: url(./no-plural.svg);\n mask-image: url(./no-plural.svg);\n }\n\n .placeholder-filled-svg {\n -webkit-mask-image: url(./placeholder-filled.svg);\n mask-image: url(./placeholder-filled.svg);\n }\n\n .placeholder-svg {\n -webkit-mask-image: url(./placeholder.svg);\n mask-image: url(./placeholder.svg);\n }\n\n .window-mode-window-svg {\n -webkit-mask-image: url(./window_mode_window.svg);\n mask-image: url(./window_mode_window.svg);\n }\n\n .window-mode-fullscreen-svg {\n -webkit-mask-image: url(./window_mode_fullscreen.svg);\n mask-image: url(./window_mode_fullscreen.svg);\n }\n\n .window-mode-minimized-svg {\n -webkit-mask-image: url(./window_mode_minimized.svg);\n mask-image: url(./window_mode_minimized.svg);\n }\n\n .window-mode-bottom-attached-svg {\n width: 10px !important;\n -webkit-mask-image: url(./window_mode_bottom_attached.svg);\n mask-image: url(./window_mode_bottom_attached.svg);\n }"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/drawer/Drawer.css": +/*!************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/drawer/Drawer.css ***! + \************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` +.modal-window-background { + background: rgba(0, 0, 0, .3); + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + justify-content: center; + align-items: center; + z-index: 10; +} +.modal-window { + position: absolute; + padding: 24px; + left: 50%; + transform: translate(-50%, 0px); + top: 10px; + background-color: var(--figma-color-bg); + + border: 0.5px solid rgba(0, 0, 0, 0.2); + box-shadow: 0px 2px 14px rgb(0 0 0 / 15%); + border-radius: 2px; + } + + .modal-window-title { + font-size: 14px; + line-height: 24px; + letter-spacing: calc(-.006px + var(--text-tracking-pos, 0)*14px); + font-family: Inter,sans-serif; + } + + .modal-window-section { + margin-top: 12px; + } + + .modal-window-input { + width: 100%; + color: var(--color-text, black); + background-color: var(--figma-color-bg, white); + border: 1px solid var(--figma-color-border, #d4d4d4); + border-radius: 2px; + box-sizing: border-box; + font-family: Inter,sans-serif; + outline: none; + resize: none; + padding: 6px; + height: 2.5em; + min-width: 300px; + font-size: 11px; +} + +.modal-window-input:focus { + border-color: var(--figma-color-border-selected, white); +} + +.modal-window-input:placeholder-shown { + color: var(--figma-color-text-tertiary, black); +} + +.modal-window-button-row { + margin-top: 8px; +} +.buttonGroup { + display: flex; + position: sticky; + flex-direction: row; + bottom: 16px; + margin: 16px; +} + +.buttonGroup-reversed { + flex-direction: row-reverse; +} +`, "",{"version":3,"sources":["webpack://./src/ui/compontents/drawer/Drawer.css"],"names":[],"mappings":";AACA;IACI,6BAA6B;IAC7B,eAAe;IACf,MAAM;IACN,OAAO;IACP,QAAQ;IACR,SAAS;IACT,aAAa;IACb,uBAAuB;IACvB,mBAAmB;IACnB,WAAW;AACf;AACA;IACI,kBAAkB;IAClB,aAAa;IACb,SAAS;IACT,+BAA+B;IAC/B,SAAS;IACT,uCAAuC;;IAEvC,sCAAsC;IACtC,yCAAyC;IACzC,kBAAkB;EACpB;;EAEA;IACE,eAAe;MACb,iBAAiB;MACjB,gEAAgE;MAChE,6BAA6B;EACjC;;EAEA;IACE,gBAAgB;EAClB;;EAEA;IACE,WAAW;IACX,+BAA+B;IAC/B,8CAA8C;IAC9C,oDAAoD;IACpD,kBAAkB;IAClB,sBAAsB;IACtB,6BAA6B;IAC7B,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,eAAe;AACnB;;AAEA;IACI,uDAAuD;AAC3D;;AAEA;IACI,8CAA8C;AAClD;;AAEA;IACI,eAAe;AACnB;AACA;IACI,aAAa;IACb,gBAAgB;IAChB,mBAAmB;IACnB,YAAY;IACZ,YAAY;AAChB;;AAEA;IACI,2BAA2B;AAC/B","sourcesContent":["\n.modal-window-background {\n background: rgba(0, 0, 0, .3);\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10;\n}\n.modal-window {\n position: absolute;\n padding: 24px;\n left: 50%;\n transform: translate(-50%, 0px);\n top: 10px;\n background-color: var(--figma-color-bg); \n \n border: 0.5px solid rgba(0, 0, 0, 0.2);\n box-shadow: 0px 2px 14px rgb(0 0 0 / 15%);\n border-radius: 2px;\n }\n\n .modal-window-title {\n font-size: 14px;\n line-height: 24px;\n letter-spacing: calc(-.006px + var(--text-tracking-pos, 0)*14px);\n font-family: Inter,sans-serif;\n }\n\n .modal-window-section {\n margin-top: 12px;\n }\n\n .modal-window-input {\n width: 100%;\n color: var(--color-text, black);\n background-color: var(--figma-color-bg, white);\n border: 1px solid var(--figma-color-border, #d4d4d4);\n border-radius: 2px;\n box-sizing: border-box;\n font-family: Inter,sans-serif;\n outline: none;\n resize: none;\n padding: 6px;\n height: 2.5em;\n min-width: 300px;\n font-size: 11px;\n}\n\n.modal-window-input:focus {\n border-color: var(--figma-color-border-selected, white);\n}\n\n.modal-window-input:placeholder-shown {\n color: var(--figma-color-text-tertiary, black);\n}\n\n.modal-window-button-row {\n margin-top: 8px;\n}\n.buttonGroup {\n display: flex;\n position: sticky;\n flex-direction: row;\n bottom: 16px;\n margin: 16px;\n}\n\n.buttonGroup-reversed {\n flex-direction: row-reverse;\n}\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/fileselect/FileSelect.css": +/*!********************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/fileselect/FileSelect.css ***! + \********************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `.file-select { + vertical-align: middle; + display: table-cell; + position: relative; + overflow: hidden; + width: 100%; +} + +.file-select input { + position: absolute; + top: 0; + right: 0; + cursor: pointer; + opacity: 0; + font-size: 300px; + height: 100%; +} +`, "",{"version":3,"sources":["webpack://./src/ui/compontents/fileselect/FileSelect.css"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,kBAAkB;EAClB,gBAAgB;EAChB,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,QAAQ;EACR,eAAe;EACf,UAAU;EACV,gBAAgB;EAChB,YAAY;AACd","sourcesContent":[".file-select {\n vertical-align: middle;\n display: table-cell;\n position: relative;\n overflow: hidden;\n width: 100%;\n}\n\n.file-select input {\n position: absolute;\n top: 0;\n right: 0;\n cursor: pointer;\n opacity: 0;\n font-size: 300px;\n height: 100%;\n}\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/languageSetup/LanguageSetup.css": +/*!**************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/languageSetup/LanguageSetup.css ***! + \**************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/getUrl.js */ "./node_modules/css-loader/dist/runtime/getUrl.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__); +// Imports + + + +var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(/*! ../../assets/world.svg */ "./src/ui/assets/world.svg"), __webpack_require__.b); +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `.available-language { + display: flex; +} + +.available-language .svg-container { + align-self: center; +} + +.available-language .language { + align-self: center; + padding-left: 8px; +} + + +.choose-language-control { + + margin-right: 8px; + margin-left: 8px +} + + +.choosen-languages { + display: grid; + grid-template-columns: auto 2fr auto;; + width: 100%; + padding-top: 2px; + padding-bottom: 2px; + padding-left: 3px; + margin-left: +} + + +.choosen-language-control .change-control { + display: flex; + align-items: flex-start; +} + +.choosen-language-control .svg-container { + margin-left: 25px; + margin-right: 6px; + margin-top: 8px; + flex-grow: 0; + flex-shrink: 0; + flex-basis: 15px; + width: 15px; + height: 15px; +} + +.language-name { + background-color: var(--figma-color-bg); + border-color: var(--figma-color-border); + border-style: solid; + border-radius: 4px; + margin-top: 2px; + margin-right: auto; + margin-bottom: 2px; + margin-left: 2px; + + align-items: center; + padding-left: 6px; + padding-right: 6px; + display: flex; + height: 24px; +} + +.language-name-wrapper { + display: flex; +} + +.choosen-language-change { + + margin-right: 15px; + padding: 8px; + color: var(--figma-color-text-brand); + margin-left: auto; +} +.language-import-action { + + margin-right: 15px; + padding: 8px; + color: var(--figma-color-text-brand); + margin-left: auto; +} +.language-summary { + margin-right: 15px; + padding: 8px; + +} +.setup-header { + display: flex; +} +.setup-header-title { + margin-left: 8px; + padding: 8px; + font-size: 11px; + font-family: Inter; + font-style: normal; + font-weight: 600; + line-height: 16px; + letter-spacing: 0.055px; + display: flex; +} +.setup-text { + margin-left: 8px; + padding-left: 8px; + padding-bottom: 16px; + font-size: 11px; + font-family: Inter; + font-style: normal; + line-height: 16px; + letter-spacing: 0.055px; +} + + +.setup-baselanguage-select { + width: 100%; + display: flex; + align-items: center; +} + +div.react-select__single-value { + color: var(--figma-color-text-disabled); +} + +input.react-select__input { + color: var(--figma-color-text) !important; +} + +.react-select__control::before { + -webkit-mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_0___}); + mask-image: url(${___CSS_LOADER_URL_REPLACEMENT_0___}); + mask-size: 15px; + -webkit-mask-size: 15px; + background-color: var(--figma-color-icon); + content: ' '; + display: inline-block; + width: 13px; + height: 13px; + margin-left: 7.5px; + margin-top: 7.5px; + + +} + +.view .react-select__control { + margin-left: 16.5px; + margin-right: 16px; + outline-offset: 0.39px; + border: 1px solid transparent; + outline: 1px solid var(--figma-color-border-selected); + background-color: var(--figma-color-bg); + border-radius: 2px; + min-height: 32px; + justify-content: flex-start; + align-items: flex-start; +} + +.view .react-select__menu { + width: calc(100% - 32px); + + margin-left: 16px; + margin-right: 16px; + border-radius: 2px; + margin-top: 0px; + margin-bottom: 16px; + box-shadow: none; + color: var(--figma-color-text-onbrand); + background-color: var(--figma-color-bg-menu-hover); +} + + +.view .react-select__menu-list { + + max-height: 180px; + +} + +.view .react-select__option { + display: flex; +} + +.view .react-select__option--is-disabled { + background-color: transparent !important; +} + + + +.view .react-select__option--is-disabled .svg-container { + background-color: var(--figma-color-icon-onbrand-tertiary) !important; +} + +.view .react-select__option--is-selected { + background-color: transparent; +} + +.view .react-select__option--is-focused { + background-color: var(--figma-color-bg-brand-hover); +} + + +.view .react-select__option.react-select__option--is-selected .svg-container { + + background-color: var(--figma-color-icon-onbrand); +} + + +.view .react-select__option .svg-container { + width: 10px; + height: 7px; + margin-top: 4px; + margin-right: 8px; + margin-left: 0px; + background-color: transparent; +} + +div.react-select__multi-value { + display: flex; + align-items: center; + height: 24px; + + background-color: var(--figma-color-bg); + border-color: var(--figma-color-border); + border-style: solid; + border-radius: 4px; +} + +.view .react-select__multi-value__label { + font-size: inherit; + color: inherit; +} + +.view .react-select__remove_language:hover { + background-color: var(--figma-color-icon); +} + +.view .react-select__remove_language { + width: 18px; + height: 18px; + flex: 0 0 16px; + line-height: 16px; + margin-left: 3px; + background-color: var(--figma-color-icon-tertiary); +} + +.view .react-select__indicator-separator { + visibility: hidden; +} +.view .react-select__dropdown_indicator { + margin:8px; +} + +.view .react-select__multi-value__remove:hover { + color: inherit; + background-color: inherit; +} + +.view .react-select__input-container { + flex: 0; +} + +.view .react-select__value-container { + flex: inherit; + max-width: calc(100% - 50px); + +} + +.view .single-value .react-select__value-container { + margin-top: 3px; +} + +.view .react-select__indicators { + + margin-left: -20px; +} + + +.view .react-select__indicators { + margin-left: auto; +} + + +.view .react-select__placeholder { + margin-right: 8px; + margin-top: 6px; +} + +.view .single-value .react-select__placeholder { + margin-right: 8px; + margin-top: 0px; +} + +.no-base-language .needs-base-language { + color: var(--figma-color-text-disabled); +} + +.no-base-language .needs-base-language * { + color: var(--figma-color-text-disabled); +} + + +.no-base-language .needs-base-language .caret-svg { + background-color: var(--figma-color-icon-disabled); +} + +.no-base-language .needs-base-language .react-select__control::before { + background-color: var(--figma-color-icon-disabled); +}`, "",{"version":3,"sources":["webpack://./src/ui/compontents/languageSetup/LanguageSetup.css"],"names":[],"mappings":"AAAA;IACI,aAAa;AACjB;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,iBAAiB;AACrB;;;AAGA;;IAEI,iBAAiB;IACjB;AACJ;;;AAGA;IACI,aAAa;IACb,oCAAoC;IACpC,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB;AACJ;;;AAGA;IACI,aAAa;IACb,uBAAuB;AAC3B;;AAEA;IACI,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,YAAY;AAChB;;AAEA;IACI,uCAAuC;IACvC,uCAAuC;IACvC,mBAAmB;IACnB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;;IAEhB,mBAAmB;IACnB,iBAAiB;IACjB,kBAAkB;IAClB,aAAa;IACb,YAAY;AAChB;;AAEA;IACI,aAAa;AACjB;;AAEA;;IAEI,kBAAkB;IAClB,YAAY;IACZ,oCAAoC;IACpC,iBAAiB;AACrB;AACA;;IAEI,kBAAkB;IAClB,YAAY;IACZ,oCAAoC;IACpC,iBAAiB;AACrB;AACA;IACI,kBAAkB;IAClB,YAAY;;AAEhB;AACA;IACI,aAAa;AACjB;AACA;IACI,gBAAgB;IAChB,YAAY;IACZ,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,iBAAiB;IACjB,uBAAuB;IACvB,aAAa;AACjB;AACA;IACI,gBAAgB;IAChB,iBAAiB;IACjB,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,uBAAuB;AAC3B;;;AAGA;IACI,WAAW;IACX,aAAa;IACb,mBAAmB;AACvB;;AAEA;IACI,uCAAuC;AAC3C;;AAEA;IACI,yCAAyC;AAC7C;;AAEA;IACI,2DAA+C;IAC/C,mDAAuC;IACvC,eAAe;IACf,uBAAuB;IACvB,yCAAyC;IACzC,YAAY;IACZ,qBAAqB;IACrB,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,iBAAiB;;;AAGrB;;AAEA;IACI,mBAAmB;IACnB,kBAAkB;IAClB,sBAAsB;IACtB,6BAA6B;IAC7B,qDAAqD;IACrD,uCAAuC;IACvC,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,uBAAuB;AAC3B;;AAEA;IACI,wBAAwB;;IAExB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,mBAAmB;IACnB,gBAAgB;IAChB,sCAAsC;IACtC,kDAAkD;AACtD;;;AAGA;;IAEI,iBAAiB;;AAErB;;AAEA;IACI,aAAa;AACjB;;AAEA;IACI,wCAAwC;AAC5C;;;;AAIA;IACI,qEAAqE;AACzE;;AAEA;IACI,6BAA6B;AACjC;;AAEA;IACI,mDAAmD;AACvD;;;AAGA;;IAEI,iDAAiD;AACrD;;;AAGA;IACI,WAAW;IACX,WAAW;IACX,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,6BAA6B;AACjC;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,YAAY;;IAEZ,uCAAuC;IACvC,uCAAuC;IACvC,mBAAmB;IACnB,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,cAAc;AAClB;;AAEA;IACI,yCAAyC;AAC7C;;AAEA;IACI,WAAW;IACX,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,kDAAkD;AACtD;;AAEA;IACI,kBAAkB;AACtB;AACA;IACI,UAAU;AACd;;AAEA;IACI,cAAc;IACd,yBAAyB;AAC7B;;AAEA;IACI,OAAO;AACX;;AAEA;IACI,aAAa;IACb,4BAA4B;;AAEhC;;AAEA;IACI,eAAe;AACnB;;AAEA;;IAEI,kBAAkB;AACtB;;;AAGA;IACI,iBAAiB;AACrB;;;AAGA;IACI,iBAAiB;IACjB,eAAe;AACnB;;AAEA;IACI,iBAAiB;IACjB,eAAe;AACnB;;AAEA;IACI,uCAAuC;AAC3C;;AAEA;IACI,uCAAuC;AAC3C;;;AAGA;IACI,kDAAkD;AACtD;;AAEA;IACI,kDAAkD;AACtD","sourcesContent":[".available-language {\n display: flex;\n}\n\n.available-language .svg-container {\n align-self: center;\n}\n\n.available-language .language {\n align-self: center;\n padding-left: 8px;\n}\n\n\n.choose-language-control {\n \n margin-right: 8px;\n margin-left: 8px\n}\n\n\n.choosen-languages {\n display: grid;\n grid-template-columns: auto 2fr auto;;\n width: 100%;\n padding-top: 2px;\n padding-bottom: 2px;\n padding-left: 3px;\n margin-left: \n}\n\n\n.choosen-language-control .change-control {\n display: flex;\n align-items: flex-start;\n}\n\n.choosen-language-control .svg-container {\n margin-left: 25px;\n margin-right: 6px;\n margin-top: 8px;\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: 15px;\n width: 15px;\n height: 15px;\n}\n\n.language-name { \n background-color: var(--figma-color-bg);\n border-color: var(--figma-color-border);\n border-style: solid;\n border-radius: 4px;\n margin-top: 2px;\n margin-right: auto;\n margin-bottom: 2px;\n margin-left: 2px;\n \n align-items: center;\n padding-left: 6px;\n padding-right: 6px;\n display: flex;\n height: 24px;\n}\n\n.language-name-wrapper {\n display: flex;\n}\n\n.choosen-language-change {\n \n margin-right: 15px;\n padding: 8px;\n color: var(--figma-color-text-brand);\n margin-left: auto;\n}\n.language-import-action {\n \n margin-right: 15px;\n padding: 8px;\n color: var(--figma-color-text-brand);\n margin-left: auto;\n}\n.language-summary {\n margin-right: 15px;\n padding: 8px;\n \n}\n.setup-header {\n display: flex;\n}\n.setup-header-title {\n margin-left: 8px;\n padding: 8px;\n font-size: 11px;\n font-family: Inter;\n font-style: normal;\n font-weight: 600;\n line-height: 16px;\n letter-spacing: 0.055px; \n display: flex;\n}\n.setup-text {\n margin-left: 8px;\n padding-left: 8px;\n padding-bottom: 16px;\n font-size: 11px;\n font-family: Inter;\n font-style: normal;\n line-height: 16px;\n letter-spacing: 0.055px; \n}\n\n\n.setup-baselanguage-select {\n width: 100%;\n display: flex;\n align-items: center;\n}\n\ndiv.react-select__single-value {\n color: var(--figma-color-text-disabled);\n}\n\ninput.react-select__input {\n color: var(--figma-color-text) !important;\n}\n\n.react-select__control::before {\n -webkit-mask-image: url(../../assets/world.svg);\n mask-image: url(../../assets/world.svg);\n mask-size: 15px;\n -webkit-mask-size: 15px;\n background-color: var(--figma-color-icon);\n content: ' ';\n display: inline-block;\n width: 13px;\n height: 13px;\n margin-left: 7.5px;\n margin-top: 7.5px;\n \n \n}\n\n.view .react-select__control {\n margin-left: 16.5px;\n margin-right: 16px;\n outline-offset: 0.39px;\n border: 1px solid transparent;\n outline: 1px solid var(--figma-color-border-selected);\n background-color: var(--figma-color-bg);\n border-radius: 2px;\n min-height: 32px;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.view .react-select__menu {\n width: calc(100% - 32px);\n \n margin-left: 16px;\n margin-right: 16px;\n border-radius: 2px;\n margin-top: 0px;\n margin-bottom: 16px;\n box-shadow: none;\n color: var(--figma-color-text-onbrand);\n background-color: var(--figma-color-bg-menu-hover);\n}\n\n\n.view .react-select__menu-list {\n \n max-height: 180px;\n \n}\n\n.view .react-select__option {\n display: flex;\n}\n\n.view .react-select__option--is-disabled {\n background-color: transparent !important;\n}\n\n\n\n.view .react-select__option--is-disabled .svg-container {\n background-color: var(--figma-color-icon-onbrand-tertiary) !important;\n}\n\n.view .react-select__option--is-selected {\n background-color: transparent;\n}\n\n.view .react-select__option--is-focused {\n background-color: var(--figma-color-bg-brand-hover);\n}\n\n\n.view .react-select__option.react-select__option--is-selected .svg-container {\n\n background-color: var(--figma-color-icon-onbrand);\n}\n\n\n.view .react-select__option .svg-container {\n width: 10px;\n height: 7px;\n margin-top: 4px;\n margin-right: 8px;\n margin-left: 0px;\n background-color: transparent;\n}\n\ndiv.react-select__multi-value {\n display: flex;\n align-items: center;\n height: 24px;\n\n background-color: var(--figma-color-bg);\n border-color: var(--figma-color-border);\n border-style: solid;\n border-radius: 4px;\n}\n\n.view .react-select__multi-value__label {\n font-size: inherit;\n color: inherit;\n}\n\n.view .react-select__remove_language:hover {\n background-color: var(--figma-color-icon);\n}\n\n.view .react-select__remove_language {\n width: 18px;\n height: 18px;\n flex: 0 0 16px;\n line-height: 16px;\n margin-left: 3px;\n background-color: var(--figma-color-icon-tertiary);\n}\n\n.view .react-select__indicator-separator {\n visibility: hidden;\n}\n.view .react-select__dropdown_indicator {\n margin:8px;\n}\n\n.view .react-select__multi-value__remove:hover {\n color: inherit;\n background-color: inherit;\n}\n\n.view .react-select__input-container {\n flex: 0;\n}\n\n.view .react-select__value-container {\n flex: inherit;\n max-width: calc(100% - 50px);\n\n}\n\n.view .single-value .react-select__value-container {\n margin-top: 3px;\n}\n\n.view .react-select__indicators {\n \n margin-left: -20px;\n}\n\n\n.view .react-select__indicators {\n margin-left: auto;\n}\n\n\n.view .react-select__placeholder {\n margin-right: 8px;\n margin-top: 6px;\n}\n\n.view .single-value .react-select__placeholder {\n margin-right: 8px;\n margin-top: 0px;\n}\n\n.no-base-language .needs-base-language {\n color: var(--figma-color-text-disabled);\n}\n\n.no-base-language .needs-base-language * {\n color: var(--figma-color-text-disabled);\n}\n\n\n.no-base-language .needs-base-language .caret-svg {\n background-color: var(--figma-color-icon-disabled);\n}\n\n.no-base-language .needs-base-language .react-select__control::before {\n background-color: var(--figma-color-icon-disabled);\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/segmentedControl/SegmentedControl.css": +/*!********************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/segmentedControl/SegmentedControl.css ***! + \********************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `.segmented-control { + display: inline-flex; + justify-content: center; + align-items: center; + border-radius: 2px; + height: 24px; + padding: 0 1px; + +} + +.segmented-control:hover { + box-shadow: inset 0 0 0 1px var(--figma-color-bg-hover); + +} + +.segmented-control-segment { + flex: 0 0 24px; + width: 24px; + height: 24px; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + background-clip: padding-box; + position: relative; + border-radius: 2px; +} + + +.segmented-control-segment:hover { + background-color: var(--figma-color-bg-hover); +} + + +.segmented-control-segment.selected { + box-shadow: inset 0 0 0 1px var(--figma-color-border); + background-color: var(--figma-color-border); +} + +.segmented-control .svg-container { + width: 14px; + height: 14px; +}`, "",{"version":3,"sources":["webpack://./src/ui/compontents/segmentedControl/SegmentedControl.css"],"names":[],"mappings":"AAAA;IACI,oBAAoB;IACpB,uBAAuB;IACvB,mBAAmB;IACnB,kBAAkB;IAClB,YAAY;IACZ,cAAc;;AAElB;;AAEA;IACI,uDAAuD;;AAE3D;;AAEA;IACI,cAAc;IACd,WAAW;IACX,YAAY;IACZ,sBAAsB;IACtB,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,4BAA4B;IAC5B,kBAAkB;IAClB,kBAAkB;AACtB;;;AAGA;IACI,6CAA6C;AACjD;;;AAGA;IACI,qDAAqD;IACrD,2CAA2C;AAC/C;;AAEA;IACI,WAAW;IACX,YAAY;AAChB","sourcesContent":[".segmented-control {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n border-radius: 2px;\n height: 24px;\n padding: 0 1px;\n \n}\n\n.segmented-control:hover {\n box-shadow: inset 0 0 0 1px var(--figma-color-bg-hover);\n \n}\n\n.segmented-control-segment {\n flex: 0 0 24px;\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n background-clip: padding-box;\n position: relative;\n border-radius: 2px;\n}\n\n\n.segmented-control-segment:hover {\n background-color: var(--figma-color-bg-hover);\n}\n\n\n.segmented-control-segment.selected {\n box-shadow: inset 0 0 0 1px var(--figma-color-border);\n background-color: var(--figma-color-border);\n}\n\n.segmented-control .svg-container {\n width: 14px;\n height: 14px;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/select/select.css": +/*!************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/select/select.css ***! + \************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/getUrl.js */ "./node_modules/css-loader/dist/runtime/getUrl.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__); +// Imports + + + +var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(/*! data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII= */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="), __webpack_require__.b); +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `:root { + --figma-color-bg-menu-hover: #2c2c2c; + --figma-color-bg-menu-pressed: #2c2c2c; + --figma-color-bg-menu-secondary: #383838; + --figma-color-bg-menu-selected: #0d99ff; + --figma-color-bg-menu-selected-hover: #007be5; + --figma-color-bg-menu-selected-pressed: #007be5; + --figma-color-bg-menu-selected-secondary: #394360; + --figma-color-bg-menu-selected-tertiary: #394360; + --figma-color-bg-menu-tertiary: #444444; + + --color-icon-menu: rgba(255, 255, 255, 1); + --color-icon-menu-danger: #f24822; + --color-icon-menu-disabled: rgba(255, 255, 255, .4); + --color-icon-menu-hover: rgba(255, 255, 255, 1); + --color-icon-menu-ondisabled: #1e1e1e; + --color-icon-menu-onselected: rgba(255, 255, 255, 1); + --color-icon-menu-pressed: #0d99ff; + --color-icon-menu-secondary: rgba(255, 255, 255, .7); + --color-icon-menu-secondary-hover: rgba(255, 255, 255, 1); + --color-icon-menu-selected: #80caff; + --color-icon-menu-selected-secondary: #80caff; + --color-icon-menu-selected-tertiary: #80caff; + --color-icon-menu-tertiary: rgba(255, 255, 255, .4); + --color-icon-menu-tertiary-hover: rgba(255, 255, 255, 1); + --color-icon-menu-warning: #ffcd29; + + + --color-text-menu: rgba(255, 255, 255, 1); + --color-text-menu-danger: #ffafa3; + --color-text-menu-disabled: rgba(255, 255, 255, .4); + --color-text-menu-hover: rgba(255, 255, 255, 1); + --color-text-menu-ondisabled: #1e1e1e; + --color-text-menu-onselected: rgba(255, 255, 255, 1); + --color-text-menu-secondary: rgba(255, 255, 255, .7); + --color-text-menu-secondary-hover: rgba(255, 255, 255, 1); + --color-text-menu-selected: #80caff; + --color-text-menu-selected-secondary: #80caff; + --color-text-menu-selected-tertiary: #80caff; + --color-text-menu-tertiary: rgba(255, 255, 255, .4); + --color-text-menu-tertiary-hover: rgba(255, 255, 255, 1); + --color-text-menu-warning: #ffd966; + + --color-border-menu: #383838; + + /* TYPOGRAPHY */ + /* Pos = positive applications (black on white) */ + /* Neg = negative applications (white on black) */ + /* Font stack */ + --font-stack: 'Inter', sans-serif; + /* Font sizes */ + --font-size-xsmall: 11px; + --font-size-small: 12px; + --font-size-large: 13px; + --font-size-xlarge: 14px; + /* Font weights */ + --font-weight-normal: 400; + --font-weight-medium: 500; + --font-weight-bold: 600; + /* Lineheight */ + --font-line-height: 16px; + /* Use For xsmall, small font sizes */ + --font-line-height-large: 24px; + /* Use For large, xlarge font sizes */ + /* Letterspacing */ + --font-letter-spacing-pos-xsmall: .005em; + --font-letter-spacing-neg-xsmall: .01em; + --font-letter-spacing-pos-small: 0; + --font-letter-spacing-neg-small: .005em; + --font-letter-spacing-pos-large: -.0025em; + --font-letter-spacing-neg-large: .0025em; + --font-letter-spacing-pos-xlarge: -.001em; + --font-letter-spacing-neg-xlarge: -.001em; + /* BORDER RADIUS */ + --border-radius-small: 2px; + --border-radius-med: 5px; + --border-radius-large: 6px; + /* SHADOWS */ + --shadow-hud: 0 5px 17px rgba(0, 0, 0, .2), 0 2px 7px rgba(0, 0, 0, .15); + --shadow-floating-window: 0 2px 14px rgba(0, 0, 0, .15); + /* SPACING + SIZING */ + --size-xxxsmall: 4px; + --size-xxsmall: 8px; + --size-xsmall: 16px; + --size-small: 24px; + --size-medium: 32px; + --size-large: 40px; + --size-xlarge: 48px; + --size-xxlarge: 64px; + --size-xxxlarge: 80px; +} + +select.select-menu { + display: none; +} + +.select-menu { + position: relative; +} + +.select-menu__button.placeholder { + color: var(--figma-color-text-disabled); +} + + +.select-menu__button { + display: flex; + align-items: center; + border: 1px solid transparent; + height: 30px; + width: 100%; + margin: 1px 0 1px 0; + padding: 0px 10px 0px 10px; + overflow-y: hidden; + border-radius: var(--border-radius-small); + background-color: transparent; +} + +.select-menu__button:hover { + border-color: var(--figma-color-border); +} + +.select-menu__button:focus { + border: 1px solid var(--figma-color-border); + outline: 1px solid var(--figma-color-border); + outline-offset: -2px; +} + +.select-menu__button:disabled:hover { + justify-content: flex-start; + border-color: transparent; +} + +.select-menu__button * { + pointer-events: none; +} + + + +.select-menu__button:hover .select-menu__caret { + background-color: var(--figma-color-text-tertiary-hover); +} + +.select-menu__button:hover .select-menu__label--placeholder { + color: var(--black8); +} + +.select-menu__button:focus .select-menu__label--placeholder { + color: var(--black8); +} + +.select-menu__button:disabled:hover .select-menu__label--placeholder { + color: var(--black3); +} + +.select-menu__button:hover .select-menu__caret, .select-menu__button:focus .select-menu__caret { + background-color: var(--figma-color-text-tertiary-hover); + + margin-left: auto; +} + +.select-menu__button:disabled:hover .select-menu__caret { + color: var(--figma-color-text-tertiary-hover); + margin-left: -12px; +} + +.select-menu__button:disabled .select-menu__label { + color: var(--black3); +} + + +.select-menu__label.select-menu__label-part1 { + margin-right: 4px; +} + +.select-menu__label.select-menu__label-part2 { + overflow-x: visible; + +} + +.select-menu__label { + font-size: var(--font-size-xsmall); + font-weight: var(--font-weight-normal); + letter-spacing: var(--font-letter-spacing-neg-xsmall); + line-height: var(--line-height); + color: var(--figma-color-text); + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; +} + +.placeholder .select-menu__label { + color: var(--figma-color-text-disabled); +} + + +.select-menu__label--placeholder { + color: var(--figma-color-text-tertiary); +} + +.select-menu__caret { + width: 28px; + height: 30px; + display: block; + margin-top: -1px; + +} + +.select-menu .icon { + margin-left: -8px; + margin-top: -2px; + margin-right: 0; + opacity: 0.3; +} + +.select-menu__menu { + display: none; + + /* position will be calculated by the component + + top: 0; + left: 0; + */ + background-color: var(--figma-color-bg-menu-hover); + box-shadow: var(--shadow-hud); + padding: var(--size-xxsmall) 0 var(--size-xxsmall) 0; + border-radius: var(--border-radius-small); + margin: 0; + + overflow-x: overlay; + overflow-y: auto; +} + +.select-menu__menu--active { + display: block; +} + +.select-menu__menu::-webkit-scrollbar { + width: 12px; + background-color: transparent; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_0___}); + background-repeat: repeat; + background-size: 100% auto; +} + +.select-menu__menu::-webkit-scrollbar-track { + border: solid 3px transparent; + box-shadow: inset 0 0 10px 10px transparent; +} + +.select-menu__menu::-webkit-scrollbar-thumb { + border: solid 3px transparent; + border-radius: 6px; + box-shadow: inset 0 0 10px 10px rgba(255, 255, 255, 0.4); +} + +.select-menu__item { + align-items: center; + color: var(--color-text-menu); + cursor: default; + display: flex; + font-family: var(--font-stack); + font-size: var(--font-size-small); + font-weight: var(--font-weight-normal); + letter-spacing: var(--font-letter-spacing-neg-xsmall); + line-height: var(--font-line-height); + height: var(--size-small); + padding: 0px 0px 0px 0px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + outline: none; +} + +.select-menu__item--selected .select-menu__item-selected-checkmark { + opacity: 1.0; +} + +.select-menu__item-check { + width: 18px; + padding-left: 8px; + padding-right: 6px; + flex-shrink: 0; +} + +.select-menu__item-icon { + display: flex; + align-items: center; + justify-content: center; + height: 24px; + line-height: 24px; + pointer-events: none; + margin-right: 8px; +} + +.select-menu__item-label { + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; + pointer-events: none; + padding-right: 8px; +} + +.select-menu__item-icon .svg-container { + width: 15px; + height: 15px; +} + +.select-menu__item-check .svg-container.checkmark-svg { + width: 10px; + height: 10px; + background-color: var(--color-text-menu); +} + + +.select-menu--highlight, .select-menu__item:hover, .select-menu__item:focus { + background-color: var(--figma-color-bg-selected-strong); +} + +.select-menu__divider-label { + font-size: var(--font-size-small); + font-weight: var(--font-weight-normal); + letter-spacing: var(--font-letter-spacing-neg-small); + line-height: var(--line-height); + display: flex; + align-items: center; + height: var(--size-small); + padding: 0 var(--size-xxsmall) 0 var(--size-medium); + color: var( --color-border-menu); + margin-top: 0; +} + +.select-menu__divider { + background-color: var(--figma-color-bg-menu-secondary); + display: block; + height: 1px; + margin: 8px 0 7px 0; +} + + +.select-menu__menu_container.select-menu__menu_container-expanded { + display: inherit; +} + +.select-menu__menu_container { + display: none; + height: 30px; + position: absolute; + /* + gets calculated + width: 100px; + height: 100px; + top: 10px; + left: 20px; + */ + z-index: 1000000; +} + +.select-menu__menu_wrapper::-webkit-scrollbar { + display: none; +} + +.select-menu__menu_wrapper { + height: 100%; + width: 100%; + overflow: scroll; + + /* + gets calculated + width: 100px; + height: 100px; + top: 10px; + left: 20px; + */ + z-index: 1000000; + -ms-overflow-style: none; + scrollbar-width: none; + +} + +.select-menu__menu-scroll-up { + background-color: var(--figma-color-bg-menu-hover); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0px; + left: 0px; + height: 16px; + width: 100%; +} + +.select-menu .select-menu__menu-scroll-up > .svg-container { + background-color: var(--color-text-menu); + width: 8px; + height: 8px; +} + +.select-menu__menu-scroll-down { + background-color: var(--figma-color-bg-menu-hover); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + bottom: 0px; + left: 0px; + height: 16px; + width: 100%; +} + +.select-menu .select-menu__menu-scroll-down > .svg-container { + background-color: var(--color-text-menu); + width: 8px; + height: 8px; +}`, "",{"version":3,"sources":["webpack://./src/ui/compontents/select/select.css"],"names":[],"mappings":"AAAA;EACE,oCAAoC;EACpC,sCAAsC;EACtC,wCAAwC;EACxC,uCAAuC;EACvC,6CAA6C;EAC7C,+CAA+C;EAC/C,iDAAiD;EACjD,gDAAgD;EAChD,uCAAuC;;EAEvC,yCAAyC;EACzC,iCAAiC;EACjC,mDAAmD;EACnD,+CAA+C;EAC/C,qCAAqC;EACrC,oDAAoD;EACpD,kCAAkC;EAClC,oDAAoD;EACpD,yDAAyD;EACzD,mCAAmC;EACnC,6CAA6C;EAC7C,4CAA4C;EAC5C,mDAAmD;EACnD,wDAAwD;EACxD,kCAAkC;;;EAGlC,yCAAyC;EACzC,iCAAiC;EACjC,mDAAmD;EACnD,+CAA+C;EAC/C,qCAAqC;EACrC,oDAAoD;EACpD,oDAAoD;EACpD,yDAAyD;EACzD,mCAAmC;EACnC,6CAA6C;EAC7C,4CAA4C;EAC5C,mDAAmD;EACnD,wDAAwD;EACxD,kCAAkC;;EAElC,4BAA4B;;EAE5B,eAAe;EACf,iDAAiD;EACjD,iDAAiD;EACjD,eAAe;EACf,iCAAiC;EACjC,eAAe;EACf,wBAAwB;EACxB,uBAAuB;EACvB,uBAAuB;EACvB,wBAAwB;EACxB,iBAAiB;EACjB,yBAAyB;EACzB,yBAAyB;EACzB,uBAAuB;EACvB,eAAe;EACf,wBAAwB;EACxB,qCAAqC;EACrC,8BAA8B;EAC9B,qCAAqC;EACrC,kBAAkB;EAClB,wCAAwC;EACxC,uCAAuC;EACvC,kCAAkC;EAClC,uCAAuC;EACvC,yCAAyC;EACzC,wCAAwC;EACxC,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,0BAA0B;EAC1B,wBAAwB;EACxB,0BAA0B;EAC1B,YAAY;EACZ,wEAAwE;EACxE,uDAAuD;EACvD,qBAAqB;EACrB,oBAAoB;EACpB,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClB,mBAAmB;EACnB,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;EACpB,qBAAqB;AACvB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,uCAAuC;AACzC;;;AAGA;EACE,aAAa;EACb,mBAAmB;EACnB,6BAA6B;EAC7B,YAAY;EACZ,WAAW;EACX,mBAAmB;EACnB,0BAA0B;EAC1B,kBAAkB;EAClB,yCAAyC;EACzC,6BAA6B;AAC/B;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,2CAA2C;EAC3C,4CAA4C;EAC5C,oBAAoB;AACtB;;AAEA;EACE,2BAA2B;EAC3B,yBAAyB;AAC3B;;AAEA;EACE,oBAAoB;AACtB;;;;AAIA;EACE,wDAAwD;AAC1D;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,wDAAwD;;EAExD,iBAAiB;AACnB;;AAEA;EACE,6CAA6C;EAC7C,kBAAkB;AACpB;;AAEA;EACE,oBAAoB;AACtB;;;AAGA;EACE,iBAAiB;AACnB;;AAEA;EACE,mBAAmB;;AAErB;;AAEA;EACE,kCAAkC;EAClC,sCAAsC;EACtC,qDAAqD;EACrD,+BAA+B;EAC/B,8BAA8B;EAC9B,mBAAmB;EACnB,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,uCAAuC;AACzC;;;AAGA;EACE,uCAAuC;AACzC;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,cAAc;EACd,gBAAgB;;AAElB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;EACf,YAAY;AACd;;AAEA;EACE,aAAa;;EAEb;;;;GAIC;EACD,kDAAkD;EAClD,6BAA6B;EAC7B,oDAAoD;EACpD,yCAAyC;EACzC,SAAS;;EAET,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,WAAW;EACX,6BAA6B;EAC7B,yDAAyI;EACzI,yBAAyB;EACzB,0BAA0B;AAC5B;;AAEA;EACE,6BAA6B;EAC7B,2CAA2C;AAC7C;;AAEA;EACE,6BAA6B;EAC7B,kBAAkB;EAClB,wDAAwD;AAC1D;;AAEA;EACE,mBAAmB;EACnB,6BAA6B;EAC7B,eAAe;EACf,aAAa;EACb,8BAA8B;EAC9B,iCAAiC;EACjC,sCAAsC;EACtC,qDAAqD;EACrD,oCAAoC;EACpC,yBAAyB;EACzB,wBAAwB;EACxB,yBAAyB;KACtB,sBAAsB;MACrB,qBAAqB;UACjB,iBAAiB;EACzB,aAAa;AACf;;AAEA;EACE,YAAY;AACd;;AAEA;IACI,WAAW;IACX,iBAAiB;IACjB,kBAAkB;IAClB,cAAc;AAClB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,YAAY;EACZ,iBAAiB;EACjB,oBAAoB;EACpB,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;EACnB,uBAAuB;EACvB,oBAAoB;EACpB,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,wCAAwC;AAC1C;;;AAGA;EACE,uDAAuD;AACzD;;AAEA;EACE,iCAAiC;EACjC,sCAAsC;EACtC,oDAAoD;EACpD,+BAA+B;EAC/B,aAAa;EACb,mBAAmB;EACnB,yBAAyB;EACzB,mDAAmD;EACnD,gCAAgC;EAChC,aAAa;AACf;;AAEA;EACE,sDAAsD;EACtD,cAAc;EACd,WAAW;EACX,mBAAmB;AACrB;;;AAGA;EACE,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,kBAAkB;EAClB;;;;;;GAMC;EACD,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,YAAY;EACZ,WAAW;EACX,gBAAgB;;EAEhB;;;;;;GAMC;EACD,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;;AAEvB;;AAEA;EACE,kDAAkD;EAClD,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,wCAAwC;EACxC,UAAU;EACV,WAAW;AACb;;AAEA;EACE,kDAAkD;EAClD,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,wCAAwC;EACxC,UAAU;EACV,WAAW;AACb","sourcesContent":[":root {\n --figma-color-bg-menu-hover: #2c2c2c;\n --figma-color-bg-menu-pressed: #2c2c2c;\n --figma-color-bg-menu-secondary: #383838;\n --figma-color-bg-menu-selected: #0d99ff;\n --figma-color-bg-menu-selected-hover: #007be5;\n --figma-color-bg-menu-selected-pressed: #007be5;\n --figma-color-bg-menu-selected-secondary: #394360;\n --figma-color-bg-menu-selected-tertiary: #394360;\n --figma-color-bg-menu-tertiary: #444444;\n\n --color-icon-menu: rgba(255, 255, 255, 1);\n --color-icon-menu-danger: #f24822;\n --color-icon-menu-disabled: rgba(255, 255, 255, .4);\n --color-icon-menu-hover: rgba(255, 255, 255, 1);\n --color-icon-menu-ondisabled: #1e1e1e;\n --color-icon-menu-onselected: rgba(255, 255, 255, 1);\n --color-icon-menu-pressed: #0d99ff;\n --color-icon-menu-secondary: rgba(255, 255, 255, .7);\n --color-icon-menu-secondary-hover: rgba(255, 255, 255, 1);\n --color-icon-menu-selected: #80caff;\n --color-icon-menu-selected-secondary: #80caff;\n --color-icon-menu-selected-tertiary: #80caff;\n --color-icon-menu-tertiary: rgba(255, 255, 255, .4);\n --color-icon-menu-tertiary-hover: rgba(255, 255, 255, 1);\n --color-icon-menu-warning: #ffcd29;\n\n\n --color-text-menu: rgba(255, 255, 255, 1);\n --color-text-menu-danger: #ffafa3;\n --color-text-menu-disabled: rgba(255, 255, 255, .4);\n --color-text-menu-hover: rgba(255, 255, 255, 1);\n --color-text-menu-ondisabled: #1e1e1e;\n --color-text-menu-onselected: rgba(255, 255, 255, 1);\n --color-text-menu-secondary: rgba(255, 255, 255, .7);\n --color-text-menu-secondary-hover: rgba(255, 255, 255, 1);\n --color-text-menu-selected: #80caff;\n --color-text-menu-selected-secondary: #80caff;\n --color-text-menu-selected-tertiary: #80caff;\n --color-text-menu-tertiary: rgba(255, 255, 255, .4);\n --color-text-menu-tertiary-hover: rgba(255, 255, 255, 1);\n --color-text-menu-warning: #ffd966;\n\n --color-border-menu: #383838;\n\n /* TYPOGRAPHY */\n /* Pos = positive applications (black on white) */\n /* Neg = negative applications (white on black) */\n /* Font stack */\n --font-stack: 'Inter', sans-serif;\n /* Font sizes */\n --font-size-xsmall: 11px;\n --font-size-small: 12px;\n --font-size-large: 13px;\n --font-size-xlarge: 14px;\n /* Font weights */\n --font-weight-normal: 400;\n --font-weight-medium: 500;\n --font-weight-bold: 600;\n /* Lineheight */\n --font-line-height: 16px;\n /* Use For xsmall, small font sizes */\n --font-line-height-large: 24px;\n /* Use For large, xlarge font sizes */\n /* Letterspacing */\n --font-letter-spacing-pos-xsmall: .005em;\n --font-letter-spacing-neg-xsmall: .01em;\n --font-letter-spacing-pos-small: 0;\n --font-letter-spacing-neg-small: .005em;\n --font-letter-spacing-pos-large: -.0025em;\n --font-letter-spacing-neg-large: .0025em;\n --font-letter-spacing-pos-xlarge: -.001em;\n --font-letter-spacing-neg-xlarge: -.001em;\n /* BORDER RADIUS */\n --border-radius-small: 2px;\n --border-radius-med: 5px;\n --border-radius-large: 6px;\n /* SHADOWS */\n --shadow-hud: 0 5px 17px rgba(0, 0, 0, .2), 0 2px 7px rgba(0, 0, 0, .15);\n --shadow-floating-window: 0 2px 14px rgba(0, 0, 0, .15);\n /* SPACING + SIZING */\n --size-xxxsmall: 4px;\n --size-xxsmall: 8px;\n --size-xsmall: 16px;\n --size-small: 24px;\n --size-medium: 32px;\n --size-large: 40px;\n --size-xlarge: 48px;\n --size-xxlarge: 64px;\n --size-xxxlarge: 80px;\n}\n\nselect.select-menu {\n display: none;\n}\n\n.select-menu {\n position: relative;\n}\n\n.select-menu__button.placeholder {\n color: var(--figma-color-text-disabled);\n}\n\n\n.select-menu__button {\n display: flex;\n align-items: center;\n border: 1px solid transparent;\n height: 30px;\n width: 100%;\n margin: 1px 0 1px 0;\n padding: 0px 10px 0px 10px;\n overflow-y: hidden;\n border-radius: var(--border-radius-small);\n background-color: transparent;\n}\n\n.select-menu__button:hover {\n border-color: var(--figma-color-border);\n}\n\n.select-menu__button:focus {\n border: 1px solid var(--figma-color-border);\n outline: 1px solid var(--figma-color-border);\n outline-offset: -2px;\n}\n\n.select-menu__button:disabled:hover {\n justify-content: flex-start;\n border-color: transparent;\n}\n\n.select-menu__button * {\n pointer-events: none;\n}\n\n\n\n.select-menu__button:hover .select-menu__caret {\n background-color: var(--figma-color-text-tertiary-hover);\n}\n\n.select-menu__button:hover .select-menu__label--placeholder {\n color: var(--black8);\n}\n\n.select-menu__button:focus .select-menu__label--placeholder {\n color: var(--black8);\n}\n\n.select-menu__button:disabled:hover .select-menu__label--placeholder {\n color: var(--black3);\n}\n\n.select-menu__button:hover .select-menu__caret, .select-menu__button:focus .select-menu__caret {\n background-color: var(--figma-color-text-tertiary-hover);\n \n margin-left: auto;\n}\n\n.select-menu__button:disabled:hover .select-menu__caret {\n color: var(--figma-color-text-tertiary-hover);\n margin-left: -12px;\n}\n\n.select-menu__button:disabled .select-menu__label {\n color: var(--black3);\n}\n\n\n.select-menu__label.select-menu__label-part1 {\n margin-right: 4px;\n}\n\n.select-menu__label.select-menu__label-part2 {\n overflow-x: visible;\n \n}\n\n.select-menu__label {\n font-size: var(--font-size-xsmall);\n font-weight: var(--font-weight-normal);\n letter-spacing: var(--font-letter-spacing-neg-xsmall);\n line-height: var(--line-height);\n color: var(--figma-color-text);\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n}\n\n.placeholder .select-menu__label {\n color: var(--figma-color-text-disabled);\n}\n\n\n.select-menu__label--placeholder {\n color: var(--figma-color-text-tertiary);\n}\n\n.select-menu__caret {\n width: 28px;\n height: 30px;\n display: block;\n margin-top: -1px;\n \n}\n\n.select-menu .icon {\n margin-left: -8px;\n margin-top: -2px;\n margin-right: 0;\n opacity: 0.3;\n}\n\n.select-menu__menu {\n display: none;\n \n /* position will be calculated by the component\n \n top: 0;\n left: 0;\n */\n background-color: var(--figma-color-bg-menu-hover);\n box-shadow: var(--shadow-hud);\n padding: var(--size-xxsmall) 0 var(--size-xxsmall) 0;\n border-radius: var(--border-radius-small);\n margin: 0;\n \n overflow-x: overlay;\n overflow-y: auto;\n}\n\n.select-menu__menu--active {\n display: block;\n}\n\n.select-menu__menu::-webkit-scrollbar {\n width: 12px;\n background-color: transparent;\n background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=);\n background-repeat: repeat;\n background-size: 100% auto;\n}\n\n.select-menu__menu::-webkit-scrollbar-track {\n border: solid 3px transparent;\n box-shadow: inset 0 0 10px 10px transparent;\n}\n\n.select-menu__menu::-webkit-scrollbar-thumb {\n border: solid 3px transparent;\n border-radius: 6px;\n box-shadow: inset 0 0 10px 10px rgba(255, 255, 255, 0.4);\n}\n\n.select-menu__item {\n align-items: center;\n color: var(--color-text-menu);\n cursor: default;\n display: flex;\n font-family: var(--font-stack);\n font-size: var(--font-size-small);\n font-weight: var(--font-weight-normal);\n letter-spacing: var(--font-letter-spacing-neg-xsmall);\n line-height: var(--font-line-height);\n height: var(--size-small);\n padding: 0px 0px 0px 0px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n outline: none;\n}\n\n.select-menu__item--selected .select-menu__item-selected-checkmark {\n opacity: 1.0;\n}\n\n.select-menu__item-check {\n width: 18px;\n padding-left: 8px;\n padding-right: 6px;\n flex-shrink: 0;\n}\n\n.select-menu__item-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n line-height: 24px;\n pointer-events: none;\n margin-right: 8px;\n}\n\n.select-menu__item-label {\n overflow-x: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n pointer-events: none;\n padding-right: 8px;\n}\n\n.select-menu__item-icon .svg-container {\n width: 15px;\n height: 15px;\n}\n\n.select-menu__item-check .svg-container.checkmark-svg {\n width: 10px;\n height: 10px;\n background-color: var(--color-text-menu);\n}\n\n\n.select-menu--highlight, .select-menu__item:hover, .select-menu__item:focus {\n background-color: var(--figma-color-bg-selected-strong);\n}\n\n.select-menu__divider-label {\n font-size: var(--font-size-small);\n font-weight: var(--font-weight-normal);\n letter-spacing: var(--font-letter-spacing-neg-small);\n line-height: var(--line-height);\n display: flex;\n align-items: center;\n height: var(--size-small);\n padding: 0 var(--size-xxsmall) 0 var(--size-medium);\n color: var( --color-border-menu);\n margin-top: 0;\n}\n\n.select-menu__divider {\n background-color: var(--figma-color-bg-menu-secondary);\n display: block;\n height: 1px;\n margin: 8px 0 7px 0;\n}\n\n\n.select-menu__menu_container.select-menu__menu_container-expanded {\n display: inherit;\n}\n\n.select-menu__menu_container {\n display: none;\n height: 30px;\n position: absolute;\n /*\n gets calculated\n width: 100px;\n height: 100px;\n top: 10px;\n left: 20px;\n */\n z-index: 1000000;\n}\n\n.select-menu__menu_wrapper::-webkit-scrollbar {\n display: none;\n}\n\n.select-menu__menu_wrapper {\n height: 100%;\n width: 100%;\n overflow: scroll;\n \n /*\n gets calculated\n width: 100px;\n height: 100px;\n top: 10px;\n left: 20px;\n */\n z-index: 1000000;\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n}\n\n.select-menu__menu-scroll-up {\n background-color: var(--figma-color-bg-menu-hover);\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0px;\n left: 0px;\n height: 16px;\n width: 100%;\n}\n\n.select-menu .select-menu__menu-scroll-up > .svg-container {\n background-color: var(--color-text-menu);\n width: 8px;\n height: 8px;\n}\n\n.select-menu__menu-scroll-down {\n background-color: var(--figma-color-bg-menu-hover);\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n bottom: 0px;\n left: 0px;\n height: 16px;\n width: 100%;\n}\n\n.select-menu .select-menu__menu-scroll-down > .svg-container {\n background-color: var(--color-text-menu);\n width: 8px;\n height: 8px;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/selectInput/inputselect.css": +/*!**********************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/selectInput/inputselect.css ***! + \**********************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/getUrl.js */ "./node_modules/css-loader/dist/runtime/getUrl.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__); +// Imports + + + +var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(/*! data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII= */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="), __webpack_require__.b); +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `:root { + --figma-color-bg-menu-hover: #2c2c2c; + --figma-color-bg-menu-pressed: #2c2c2c; + --figma-color-bg-menu-secondary: #383838; + --figma-color-bg-menu-selected: #0d99ff; + --figma-color-bg-menu-selected-hover: #007be5; + --figma-color-bg-menu-selected-pressed: #007be5; + --figma-color-bg-menu-selected-secondary: #394360; + --figma-color-bg-menu-selected-tertiary: #394360; + --figma-color-bg-menu-tertiary: #444444; + + --color-icon-menu: rgba(255, 255, 255, 1); + --color-icon-menu-danger: #f24822; + --color-icon-menu-disabled: rgba(255, 255, 255, .4); + --color-icon-menu-hover: rgba(255, 255, 255, 1); + --color-icon-menu-ondisabled: #1e1e1e; + --color-icon-menu-onselected: rgba(255, 255, 255, 1); + --color-icon-menu-pressed: #0d99ff; + --color-icon-menu-secondary: rgba(255, 255, 255, .7); + --color-icon-menu-secondary-hover: rgba(255, 255, 255, 1); + --color-icon-menu-selected: #80caff; + --color-icon-menu-selected-secondary: #80caff; + --color-icon-menu-selected-tertiary: #80caff; + --color-icon-menu-tertiary: rgba(255, 255, 255, .4); + --color-icon-menu-tertiary-hover: rgba(255, 255, 255, 1); + --color-icon-menu-warning: #ffcd29; + + + --color-text-menu: rgba(255, 255, 255, 1); + --color-text-menu-danger: #ffafa3; + --color-text-menu-disabled: rgba(255, 255, 255, .4); + --color-text-menu-hover: rgba(255, 255, 255, 1); + --color-text-menu-ondisabled: #1e1e1e; + --color-text-menu-onselected: rgba(255, 255, 255, 1); + --color-text-menu-secondary: rgba(255, 255, 255, .7); + --color-text-menu-secondary-hover: rgba(255, 255, 255, 1); + --color-text-menu-selected: #80caff; + --color-text-menu-selected-secondary: #80caff; + --color-text-menu-selected-tertiary: #80caff; + --color-text-menu-tertiary: rgba(255, 255, 255, .4); + --color-text-menu-tertiary-hover: rgba(255, 255, 255, 1); + --color-text-menu-warning: #ffd966; + + --color-border-menu: #383838; + + /* TYPOGRAPHY */ + /* Pos = positive applications (black on white) */ + /* Neg = negative applications (white on black) */ + /* Font stack */ + --font-stack: 'Inter', sans-serif; + /* Font sizes */ + --font-size-xsmall: 11px; + --font-size-small: 12px; + --font-size-large: 13px; + --font-size-xlarge: 14px; + /* Font weights */ + --font-weight-normal: 400; + --font-weight-medium: 500; + --font-weight-bold: 600; + /* Lineheight */ + --font-line-height: 16px; + /* Use For xsmall, small font sizes */ + --font-line-height-large: 24px; + /* Use For large, xlarge font sizes */ + /* Letterspacing */ + --font-letter-spacing-pos-xsmall: .005em; + --font-letter-spacing-neg-xsmall: .01em; + --font-letter-spacing-pos-small: 0; + --font-letter-spacing-neg-small: .005em; + --font-letter-spacing-pos-large: -.0025em; + --font-letter-spacing-neg-large: .0025em; + --font-letter-spacing-pos-xlarge: -.001em; + --font-letter-spacing-neg-xlarge: -.001em; + /* BORDER RADIUS */ + --border-radius-small: 2px; + --border-radius-med: 5px; + --border-radius-large: 6px; + /* SHADOWS */ + --shadow-hud: 0 5px 17px rgba(0, 0, 0, .2), 0 2px 7px rgba(0, 0, 0, .15); + --shadow-floating-window: 0 2px 14px rgba(0, 0, 0, .15); + /* SPACING + SIZING */ + --size-xxxsmall: 4px; + --size-xxsmall: 8px; + --size-xsmall: 16px; + --size-small: 24px; + --size-medium: 32px; + --size-large: 40px; + --size-xlarge: 48px; + --size-xxlarge: 64px; + --size-xxxlarge: 80px; +} + +select.input-select-menu { + display: none; +} + +.input-select-menu { + position: relative; +} + +.input-select-menu__button.placeholder { + color: var(--figma-color-text-disabled); +} + + +.input-select-menu__button { + display: flex; + align-items: center; + border: 1px solid transparent; + height: 30px; + width: 100%; + margin: 1px 0 1px 0; + padding: 0px 10px 0px 10px; + overflow-y: hidden; + border-radius: var(--border-radius-small); + background-color: transparent; +} + +.input-select-menu__button:hover { + border-color: var(--figma-color-border); +} + +.input-select-menu__button:focus { + border: 1px solid var(--figma-color-border); + outline: 1px solid var(--figma-color-border); + outline-offset: -2px; +} + +.input-select-menu__button:disabled:hover { + + border-color: transparent; + background-color: transparent; +} + +.input-select-menu__button:disabled { + + border-color: transparent; + background-color: transparent; +} + +.input-select-menu__button * { + pointer-events: none; +} + + + +.input-select-menu__button:hover .input-select-menu__caret { + background-color: var(--figma-color-text-tertiary-hover); +} + +.input-select-menu__button:hover .input-select-menu__label--placeholder { + color: var(--black8); +} + +.input-select-menu__button:focus .input-select-menu__label--placeholder { + color: var(--black8); +} + +.input-select-menu__button:disabled:hover .input-select-menu__label--placeholder { + color: var(--black3); +} + +.input-select-menu__button:hover .input-select-menu__caret, .input-select-menu__button:focus .input-select-menu__caret { + background-color: var(--figma-color-text-tertiary-hover); + + margin-left: auto; +} + +.input-select-menu__button:disabled:hover .input-select-menu__caret { + margin-left: unset; +} + +.input-select-menu__button:disabled .input-select-menu__caret { + background-color: var(--figma-color-text-disabled); +} + +.input-select-menu__button:disabled .input-select-menu__label { + color: var(--black3); +} + + +.input-select-menu__label.input-select-menu__label-part1 { + margin-right: 4px; +} + +.input-select-menu__label.input-select-menu__label-part2 { + overflow-x: visible; + +} + +.input-select-menu__label { + font-size: var(--font-size-xsmall); + font-weight: var(--font-weight-normal); + letter-spacing: var(--font-letter-spacing-neg-xsmall); + line-height: var(--line-height); + color: var(--figma-color-text); + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; +} + +.placeholder .input-select-menu__label { + color: var(--figma-color-text-disabled); +} + + +.input-select-menu__label--placeholder { + color: var(--figma-color-text-tertiary); +} + +.input-select-menu__caret { + width: 28px; + height: 30px; + display: block; + margin-top: -1px; + +} + +.input-select-menu .icon { + margin-left: -8px; + margin-top: -2px; + margin-right: 0; + opacity: 0.3; +} + +.input-select-menu__menu { + display: none; + + /* position will be calculated by the component + + top: 0; + left: 0; + */ + background-color: var(--figma-color-bg-menu-hover); + box-shadow: var(--shadow-hud); + padding: var(--size-xxsmall) 0 var(--size-xxsmall) 0; + border-radius: var(--border-radius-small); + margin: 0; + + overflow-x: overlay; + overflow-y: auto; +} + +.input-select-menu__menu--active { + display: block; +} + +.input-select-menu__menu::-webkit-scrollbar { + width: 12px; + background-color: transparent; + background-image: url(${___CSS_LOADER_URL_REPLACEMENT_0___}); + background-repeat: repeat; + background-size: 100% auto; +} + +.input-select-menu__menu::-webkit-scrollbar-track { + border: solid 3px transparent; + box-shadow: inset 0 0 10px 10px transparent; +} + +.input-select-menu__menu::-webkit-scrollbar-thumb { + border: solid 3px transparent; + border-radius: 6px; + box-shadow: inset 0 0 10px 10px rgba(255, 255, 255, 0.4); +} + +.input-select-menu__item { + align-items: center; + color: var(--color-text-menu); + cursor: default; + display: flex; + font-family: var(--font-stack); + font-size: var(--font-size-small); + font-weight: var(--font-weight-normal); + letter-spacing: var(--font-letter-spacing-neg-xsmall); + line-height: var(--font-line-height); + height: var(--size-small); + padding: 0px 0px 0px 0px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + outline: none; +} + +.input-select-menu__item--selected .input-select-menu__item-selected-checkmark { + opacity: 1.0; +} + +.input-select-menu__item-check { + width: 18px; + padding-left: 8px; + padding-right: 6px; + flex-shrink: 0; +} + +.input-select-menu__item-icon { + display: flex; + align-items: center; + justify-content: center; + height: 24px; + line-height: 24px; + pointer-events: none; + margin-right: 8px; +} + +.input-select-menu__item-label { + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; + pointer-events: none; + padding-right: 16px; + padding-left: 16px; +} + +.input-select-menu__item-icon .svg-container { + width: 15px; + height: 15px; +} + +.input-select-menu__item-check .svg-container.checkmark-svg { + width: 10px; + height: 10px; + background-color: var(--color-text-menu); +} + + +.input-select-menu__item--highlighted { + background-color: var(--figma-color-bg-selected-strong); +} + +.input-select-menu__divider-label { + font-size: var(--font-size-small); + font-weight: var(--font-weight-normal); + letter-spacing: var(--font-letter-spacing-neg-small); + line-height: var(--line-height); + display: flex; + align-items: center; + height: var(--size-small); + padding: 0 16px 0 16px; + color: var(--figma-color-text-onbrand-tertiary); + margin-top: 0; +} + +.input-select-menu__divider { + background-color: var(--figma-color-bg-menu-secondary); + display: block; + height: 1px; + margin: 8px 0 7px 0; +} + +.input-select-menu__menu_container { + height: 30px; + position: relative; + /* + gets calculated + width: 100px; + height: 100px; + top: 10px; + left: 20px; + */ +} + +.input-select-menu__menu_wrapper::-webkit-scrollbar { + display: none; +} + +.input-select-menu__menu_wrapper { + height: 100%; + width: 100%; + overflow: scroll; + position: relative; + + /* + gets calculated + width: 100px; + height: 100px; + top: 10px; + left: 20px; + */ + z-index: 1000000; + -ms-overflow-style: none; + scrollbar-width: none; + +} + +.input-select-menu__menu-scroll-up { + background-color: var(--figma-color-bg-menu-hover); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000001; + position: absolute; + top: 0px; + left: 0px; + height: 16px; + width: 100%; +} + +.input-select-menu .input-select-menu__menu-scroll-up > .svg-container { + background-color: var(--color-text-menu); + width: 8px; + height: 8px; +} + +.input-select-menu__menu-scroll-down { + background-color: var(--figma-color-bg-menu-hover); + display: flex; + align-items: center; + justify-content: center; + position: absolute; + z-index: 1000001; + bottom: 0px; + left: 0px; + height: 16px; + width: 100%; +} + +.input-select-menu .input-select-menu__menu-scroll-down > .svg-container { + background-color: var(--color-text-menu); + width: 8px; + height: 8px; +} + + +.input-select-menu__input.input-select-menu__menu--active { + margin-top: 4px; + margin-bottom: 4px; + margin-left: 8px; + margin-right: 8px; + position: relative; + display: flex; + flex: 0 0; + min-width: 150px; +} + +.input-select-menu__input { + display: none; +} + +.input-select-menu__input p { + width: 100%; + min-height: 14px; + margin: 0px; + padding-left: 5px; + padding-top: 5px; + padding-bottom: 5px; + padding-right: 5px; + display: inherit; + background-color: var(--figma-color-bg-menu-secondary); + border-radius: 2px; + border-style: solid; + border-color: var(--figma-color-border-selected-strong); + color: var(--figma-color-text-oncomponent-tertiary); +} + + +.input-select-menu__input input.addVisible { + width: calc(100% - 32px); +} + +@-moz-document url-prefix() { + /* Apply the styles only in Firefox */ + .input-select-menu__input input { + padding-left: 8px !important; + padding-top: 8px !important; + } +} +.input-select-menu__input input { + position:absolute; + padding-left: 6px; + padding-top: 6px; + padding-bottom: 5px; + width: 100%; + border: none; + outline: none; + outline-offset: -2px; + resize: none; + color: var(--figma-color-text-oncomponent); + background-color: transparent; + font-family: "Inter", sans-serif; + font-style: normal; + font-weight: 400; + font-size: 11px; + line-height: 14px; + letter-spacing: 0.01em; +} + +.input-select-menu__item_add { + /* background-color: #007be5; */ +} + +.input-select-menu-add { + background-color: transparent; + position: absolute; + top: 0px; + right: 0px; + padding: 7px; + bottom: 0px; + border-width: 1px 1px 1px 0px; + border-radius: 0px 2px 2px 0px; + border-style: solid; + border-color: var(--figma-color-border-selected-strong); +} + +.input-select-menu-add .svg-container { + background-color: var(--figma-color-icon-onselected-strong); + width: 11px; + height: 11px; +} + +.input-select-menu-add.on-primary { + background-color: var(--figma-color-bg-selected-strong); +} + +.input-select-menu-add.on-primary .svg-container { + background-color: var(--figma-color-icon-onselected-strong); +} + +.input-select-editoverlay { + position: fixed; + display: flex; + background-color: var(--figma-color-bg-menu-hover); + z-index: 100000; +}`, "",{"version":3,"sources":["webpack://./src/ui/compontents/selectInput/inputselect.css"],"names":[],"mappings":"AAAA;EACE,oCAAoC;EACpC,sCAAsC;EACtC,wCAAwC;EACxC,uCAAuC;EACvC,6CAA6C;EAC7C,+CAA+C;EAC/C,iDAAiD;EACjD,gDAAgD;EAChD,uCAAuC;;EAEvC,yCAAyC;EACzC,iCAAiC;EACjC,mDAAmD;EACnD,+CAA+C;EAC/C,qCAAqC;EACrC,oDAAoD;EACpD,kCAAkC;EAClC,oDAAoD;EACpD,yDAAyD;EACzD,mCAAmC;EACnC,6CAA6C;EAC7C,4CAA4C;EAC5C,mDAAmD;EACnD,wDAAwD;EACxD,kCAAkC;;;EAGlC,yCAAyC;EACzC,iCAAiC;EACjC,mDAAmD;EACnD,+CAA+C;EAC/C,qCAAqC;EACrC,oDAAoD;EACpD,oDAAoD;EACpD,yDAAyD;EACzD,mCAAmC;EACnC,6CAA6C;EAC7C,4CAA4C;EAC5C,mDAAmD;EACnD,wDAAwD;EACxD,kCAAkC;;EAElC,4BAA4B;;EAE5B,eAAe;EACf,iDAAiD;EACjD,iDAAiD;EACjD,eAAe;EACf,iCAAiC;EACjC,eAAe;EACf,wBAAwB;EACxB,uBAAuB;EACvB,uBAAuB;EACvB,wBAAwB;EACxB,iBAAiB;EACjB,yBAAyB;EACzB,yBAAyB;EACzB,uBAAuB;EACvB,eAAe;EACf,wBAAwB;EACxB,qCAAqC;EACrC,8BAA8B;EAC9B,qCAAqC;EACrC,kBAAkB;EAClB,wCAAwC;EACxC,uCAAuC;EACvC,kCAAkC;EAClC,uCAAuC;EACvC,yCAAyC;EACzC,wCAAwC;EACxC,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,0BAA0B;EAC1B,wBAAwB;EACxB,0BAA0B;EAC1B,YAAY;EACZ,wEAAwE;EACxE,uDAAuD;EACvD,qBAAqB;EACrB,oBAAoB;EACpB,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClB,mBAAmB;EACnB,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;EACpB,qBAAqB;AACvB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,uCAAuC;AACzC;;;AAGA;EACE,aAAa;EACb,mBAAmB;EACnB,6BAA6B;EAC7B,YAAY;EACZ,WAAW;EACX,mBAAmB;EACnB,0BAA0B;EAC1B,kBAAkB;EAClB,yCAAyC;EACzC,6BAA6B;AAC/B;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,2CAA2C;EAC3C,4CAA4C;EAC5C,oBAAoB;AACtB;;AAEA;;EAEE,yBAAyB;EACzB,6BAA6B;AAC/B;;AAEA;;EAEE,yBAAyB;EACzB,6BAA6B;AAC/B;;AAEA;EACE,oBAAoB;AACtB;;;;AAIA;EACE,wDAAwD;AAC1D;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,wDAAwD;;EAExD,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kDAAkD;AACpD;;AAEA;EACE,oBAAoB;AACtB;;;AAGA;EACE,iBAAiB;AACnB;;AAEA;EACE,mBAAmB;;AAErB;;AAEA;EACE,kCAAkC;EAClC,sCAAsC;EACtC,qDAAqD;EACrD,+BAA+B;EAC/B,8BAA8B;EAC9B,mBAAmB;EACnB,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,uCAAuC;AACzC;;;AAGA;EACE,uCAAuC;AACzC;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,cAAc;EACd,gBAAgB;;AAElB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;EACf,YAAY;AACd;;AAEA;EACE,aAAa;;EAEb;;;;GAIC;EACD,kDAAkD;EAClD,6BAA6B;EAC7B,oDAAoD;EACpD,yCAAyC;EACzC,SAAS;;EAET,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,WAAW;EACX,6BAA6B;EAC7B,yDAAyI;EACzI,yBAAyB;EACzB,0BAA0B;AAC5B;;AAEA;EACE,6BAA6B;EAC7B,2CAA2C;AAC7C;;AAEA;EACE,6BAA6B;EAC7B,kBAAkB;EAClB,wDAAwD;AAC1D;;AAEA;EACE,mBAAmB;EACnB,6BAA6B;EAC7B,eAAe;EACf,aAAa;EACb,8BAA8B;EAC9B,iCAAiC;EACjC,sCAAsC;EACtC,qDAAqD;EACrD,oCAAoC;EACpC,yBAAyB;EACzB,wBAAwB;EACxB,yBAAyB;KACtB,sBAAsB;MACrB,qBAAqB;UACjB,iBAAiB;EACzB,aAAa;AACf;;AAEA;EACE,YAAY;AACd;;AAEA;IACI,WAAW;IACX,iBAAiB;IACjB,kBAAkB;IAClB,cAAc;AAClB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,YAAY;EACZ,iBAAiB;EACjB,oBAAoB;EACpB,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;EACnB,uBAAuB;EACvB,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,wCAAwC;AAC1C;;;AAGA;EACE,uDAAuD;AACzD;;AAEA;EACE,iCAAiC;EACjC,sCAAsC;EACtC,oDAAoD;EACpD,+BAA+B;EAC/B,aAAa;EACb,mBAAmB;EACnB,yBAAyB;EACzB,sBAAsB;EACtB,+CAA+C;EAC/C,aAAa;AACf;;AAEA;EACE,sDAAsD;EACtD,cAAc;EACd,WAAW;EACX,mBAAmB;AACrB;;AAEA;EACE,YAAY;EACZ,kBAAkB;EAClB;;;;;;GAMC;AACH;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,YAAY;EACZ,WAAW;EACX,gBAAgB;EAChB,kBAAkB;;EAElB;;;;;;GAMC;EACD,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;;AAEvB;;AAEA;EACE,kDAAkD;EAClD,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,gBAAgB;EAChB,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,wCAAwC;EACxC,UAAU;EACV,WAAW;AACb;;AAEA;EACE,kDAAkD;EAClD,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;EAClB,gBAAgB;EAChB,WAAW;EACX,SAAS;EACT,YAAY;EACZ,WAAW;AACb;;AAEA;EACE,wCAAwC;EACxC,UAAU;EACV,WAAW;AACb;;;AAGA;EACE,eAAe;EACf,kBAAkB;EAClB,gBAAgB;EAChB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,SAAS;EACT,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,WAAW;EACX,gBAAgB;EAChB,WAAW;EACX,iBAAiB;EACjB,gBAAgB;EAChB,mBAAmB;EACnB,kBAAkB;EAClB,gBAAgB;EAChB,sDAAsD;EACtD,kBAAkB;EAClB,mBAAmB;EACnB,uDAAuD;EACvD,oDAAoD;AACtD;;;AAGA;EACE,wBAAwB;AAC1B;;AAEA;EACE,qCAAqC;EACrC;IACE,4BAA4B;IAC5B,2BAA2B;EAC7B;AACF;AACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,gBAAgB;EAChB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,oBAAoB;EACpB,YAAY;EACZ,2CAA2C;EAC3C,6BAA6B;EAC7B,gCAAgC;EAChC,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,iBAAiB;EACjB,sBAAsB;AACxB;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,6BAA6B;EAC7B,kBAAkB;EAClB,QAAQ;EACR,UAAU;EACV,YAAY;EACZ,WAAW;EACX,6BAA6B;EAC7B,8BAA8B;EAC9B,mBAAmB;EACnB,uDAAuD;AACzD;;AAEA;EACE,2DAA2D;EAC3D,WAAW;EACX,YAAY;AACd;;AAEA;EACE,uDAAuD;AACzD;;AAEA;EACE,2DAA2D;AAC7D;;AAEA;EACE,eAAe;EACf,aAAa;EACb,kDAAkD;EAClD,eAAe;AACjB","sourcesContent":[":root {\n --figma-color-bg-menu-hover: #2c2c2c;\n --figma-color-bg-menu-pressed: #2c2c2c;\n --figma-color-bg-menu-secondary: #383838;\n --figma-color-bg-menu-selected: #0d99ff;\n --figma-color-bg-menu-selected-hover: #007be5;\n --figma-color-bg-menu-selected-pressed: #007be5;\n --figma-color-bg-menu-selected-secondary: #394360;\n --figma-color-bg-menu-selected-tertiary: #394360;\n --figma-color-bg-menu-tertiary: #444444;\n\n --color-icon-menu: rgba(255, 255, 255, 1);\n --color-icon-menu-danger: #f24822;\n --color-icon-menu-disabled: rgba(255, 255, 255, .4);\n --color-icon-menu-hover: rgba(255, 255, 255, 1);\n --color-icon-menu-ondisabled: #1e1e1e;\n --color-icon-menu-onselected: rgba(255, 255, 255, 1);\n --color-icon-menu-pressed: #0d99ff;\n --color-icon-menu-secondary: rgba(255, 255, 255, .7);\n --color-icon-menu-secondary-hover: rgba(255, 255, 255, 1);\n --color-icon-menu-selected: #80caff;\n --color-icon-menu-selected-secondary: #80caff;\n --color-icon-menu-selected-tertiary: #80caff;\n --color-icon-menu-tertiary: rgba(255, 255, 255, .4);\n --color-icon-menu-tertiary-hover: rgba(255, 255, 255, 1);\n --color-icon-menu-warning: #ffcd29;\n\n\n --color-text-menu: rgba(255, 255, 255, 1);\n --color-text-menu-danger: #ffafa3;\n --color-text-menu-disabled: rgba(255, 255, 255, .4);\n --color-text-menu-hover: rgba(255, 255, 255, 1);\n --color-text-menu-ondisabled: #1e1e1e;\n --color-text-menu-onselected: rgba(255, 255, 255, 1);\n --color-text-menu-secondary: rgba(255, 255, 255, .7);\n --color-text-menu-secondary-hover: rgba(255, 255, 255, 1);\n --color-text-menu-selected: #80caff;\n --color-text-menu-selected-secondary: #80caff;\n --color-text-menu-selected-tertiary: #80caff;\n --color-text-menu-tertiary: rgba(255, 255, 255, .4);\n --color-text-menu-tertiary-hover: rgba(255, 255, 255, 1);\n --color-text-menu-warning: #ffd966;\n\n --color-border-menu: #383838;\n\n /* TYPOGRAPHY */\n /* Pos = positive applications (black on white) */\n /* Neg = negative applications (white on black) */\n /* Font stack */\n --font-stack: 'Inter', sans-serif;\n /* Font sizes */\n --font-size-xsmall: 11px;\n --font-size-small: 12px;\n --font-size-large: 13px;\n --font-size-xlarge: 14px;\n /* Font weights */\n --font-weight-normal: 400;\n --font-weight-medium: 500;\n --font-weight-bold: 600;\n /* Lineheight */\n --font-line-height: 16px;\n /* Use For xsmall, small font sizes */\n --font-line-height-large: 24px;\n /* Use For large, xlarge font sizes */\n /* Letterspacing */\n --font-letter-spacing-pos-xsmall: .005em;\n --font-letter-spacing-neg-xsmall: .01em;\n --font-letter-spacing-pos-small: 0;\n --font-letter-spacing-neg-small: .005em;\n --font-letter-spacing-pos-large: -.0025em;\n --font-letter-spacing-neg-large: .0025em;\n --font-letter-spacing-pos-xlarge: -.001em;\n --font-letter-spacing-neg-xlarge: -.001em;\n /* BORDER RADIUS */\n --border-radius-small: 2px;\n --border-radius-med: 5px;\n --border-radius-large: 6px;\n /* SHADOWS */\n --shadow-hud: 0 5px 17px rgba(0, 0, 0, .2), 0 2px 7px rgba(0, 0, 0, .15);\n --shadow-floating-window: 0 2px 14px rgba(0, 0, 0, .15);\n /* SPACING + SIZING */\n --size-xxxsmall: 4px;\n --size-xxsmall: 8px;\n --size-xsmall: 16px;\n --size-small: 24px;\n --size-medium: 32px;\n --size-large: 40px;\n --size-xlarge: 48px;\n --size-xxlarge: 64px;\n --size-xxxlarge: 80px;\n}\n\nselect.input-select-menu {\n display: none;\n}\n\n.input-select-menu {\n position: relative;\n}\n\n.input-select-menu__button.placeholder {\n color: var(--figma-color-text-disabled);\n}\n\n\n.input-select-menu__button {\n display: flex;\n align-items: center;\n border: 1px solid transparent;\n height: 30px;\n width: 100%;\n margin: 1px 0 1px 0;\n padding: 0px 10px 0px 10px;\n overflow-y: hidden;\n border-radius: var(--border-radius-small);\n background-color: transparent;\n}\n\n.input-select-menu__button:hover {\n border-color: var(--figma-color-border);\n}\n\n.input-select-menu__button:focus {\n border: 1px solid var(--figma-color-border);\n outline: 1px solid var(--figma-color-border);\n outline-offset: -2px;\n}\n\n.input-select-menu__button:disabled:hover {\n \n border-color: transparent;\n background-color: transparent;\n}\n\n.input-select-menu__button:disabled {\n \n border-color: transparent;\n background-color: transparent;\n}\n\n.input-select-menu__button * {\n pointer-events: none;\n}\n\n\n\n.input-select-menu__button:hover .input-select-menu__caret {\n background-color: var(--figma-color-text-tertiary-hover);\n}\n\n.input-select-menu__button:hover .input-select-menu__label--placeholder {\n color: var(--black8);\n}\n\n.input-select-menu__button:focus .input-select-menu__label--placeholder {\n color: var(--black8);\n}\n\n.input-select-menu__button:disabled:hover .input-select-menu__label--placeholder {\n color: var(--black3);\n}\n\n.input-select-menu__button:hover .input-select-menu__caret, .input-select-menu__button:focus .input-select-menu__caret {\n background-color: var(--figma-color-text-tertiary-hover);\n \n margin-left: auto;\n}\n\n.input-select-menu__button:disabled:hover .input-select-menu__caret {\n margin-left: unset;\n}\n\n.input-select-menu__button:disabled .input-select-menu__caret {\n background-color: var(--figma-color-text-disabled);\n}\n\n.input-select-menu__button:disabled .input-select-menu__label {\n color: var(--black3);\n}\n\n\n.input-select-menu__label.input-select-menu__label-part1 {\n margin-right: 4px;\n}\n\n.input-select-menu__label.input-select-menu__label-part2 {\n overflow-x: visible;\n \n}\n\n.input-select-menu__label {\n font-size: var(--font-size-xsmall);\n font-weight: var(--font-weight-normal);\n letter-spacing: var(--font-letter-spacing-neg-xsmall);\n line-height: var(--line-height);\n color: var(--figma-color-text);\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n}\n\n.placeholder .input-select-menu__label {\n color: var(--figma-color-text-disabled);\n}\n\n\n.input-select-menu__label--placeholder {\n color: var(--figma-color-text-tertiary);\n}\n\n.input-select-menu__caret {\n width: 28px;\n height: 30px;\n display: block;\n margin-top: -1px;\n \n}\n\n.input-select-menu .icon {\n margin-left: -8px;\n margin-top: -2px;\n margin-right: 0;\n opacity: 0.3;\n}\n\n.input-select-menu__menu {\n display: none;\n \n /* position will be calculated by the component\n \n top: 0;\n left: 0;\n */\n background-color: var(--figma-color-bg-menu-hover);\n box-shadow: var(--shadow-hud);\n padding: var(--size-xxsmall) 0 var(--size-xxsmall) 0;\n border-radius: var(--border-radius-small);\n margin: 0;\n \n overflow-x: overlay;\n overflow-y: auto;\n}\n\n.input-select-menu__menu--active {\n display: block;\n}\n\n.input-select-menu__menu::-webkit-scrollbar {\n width: 12px;\n background-color: transparent;\n background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=);\n background-repeat: repeat;\n background-size: 100% auto;\n}\n\n.input-select-menu__menu::-webkit-scrollbar-track {\n border: solid 3px transparent;\n box-shadow: inset 0 0 10px 10px transparent;\n}\n\n.input-select-menu__menu::-webkit-scrollbar-thumb {\n border: solid 3px transparent;\n border-radius: 6px;\n box-shadow: inset 0 0 10px 10px rgba(255, 255, 255, 0.4);\n}\n\n.input-select-menu__item {\n align-items: center;\n color: var(--color-text-menu);\n cursor: default;\n display: flex;\n font-family: var(--font-stack);\n font-size: var(--font-size-small);\n font-weight: var(--font-weight-normal);\n letter-spacing: var(--font-letter-spacing-neg-xsmall);\n line-height: var(--font-line-height);\n height: var(--size-small);\n padding: 0px 0px 0px 0px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n outline: none;\n}\n\n.input-select-menu__item--selected .input-select-menu__item-selected-checkmark {\n opacity: 1.0;\n}\n\n.input-select-menu__item-check {\n width: 18px;\n padding-left: 8px;\n padding-right: 6px;\n flex-shrink: 0;\n}\n\n.input-select-menu__item-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n line-height: 24px;\n pointer-events: none;\n margin-right: 8px;\n}\n\n.input-select-menu__item-label {\n overflow-x: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n pointer-events: none;\n padding-right: 16px;\n padding-left: 16px;\n}\n\n.input-select-menu__item-icon .svg-container {\n width: 15px;\n height: 15px;\n}\n\n.input-select-menu__item-check .svg-container.checkmark-svg {\n width: 10px;\n height: 10px;\n background-color: var(--color-text-menu);\n}\n\n\n.input-select-menu__item--highlighted {\n background-color: var(--figma-color-bg-selected-strong);\n}\n\n.input-select-menu__divider-label {\n font-size: var(--font-size-small);\n font-weight: var(--font-weight-normal);\n letter-spacing: var(--font-letter-spacing-neg-small);\n line-height: var(--line-height);\n display: flex;\n align-items: center;\n height: var(--size-small);\n padding: 0 16px 0 16px;\n color: var(--figma-color-text-onbrand-tertiary);\n margin-top: 0;\n}\n\n.input-select-menu__divider {\n background-color: var(--figma-color-bg-menu-secondary);\n display: block;\n height: 1px;\n margin: 8px 0 7px 0;\n}\n\n.input-select-menu__menu_container {\n height: 30px;\n position: relative;\n /*\n gets calculated\n width: 100px;\n height: 100px;\n top: 10px;\n left: 20px;\n */\n}\n\n.input-select-menu__menu_wrapper::-webkit-scrollbar {\n display: none;\n}\n\n.input-select-menu__menu_wrapper {\n height: 100%;\n width: 100%;\n overflow: scroll;\n position: relative;\n \n /*\n gets calculated\n width: 100px;\n height: 100px;\n top: 10px;\n left: 20px;\n */\n z-index: 1000000;\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n}\n\n.input-select-menu__menu-scroll-up {\n background-color: var(--figma-color-bg-menu-hover);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000001;\n position: absolute;\n top: 0px;\n left: 0px;\n height: 16px;\n width: 100%;\n}\n\n.input-select-menu .input-select-menu__menu-scroll-up > .svg-container {\n background-color: var(--color-text-menu);\n width: 8px;\n height: 8px;\n}\n\n.input-select-menu__menu-scroll-down {\n background-color: var(--figma-color-bg-menu-hover);\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n z-index: 1000001;\n bottom: 0px;\n left: 0px;\n height: 16px;\n width: 100%;\n}\n\n.input-select-menu .input-select-menu__menu-scroll-down > .svg-container {\n background-color: var(--color-text-menu);\n width: 8px;\n height: 8px;\n}\n\n\n.input-select-menu__input.input-select-menu__menu--active {\n margin-top: 4px;\n margin-bottom: 4px;\n margin-left: 8px;\n margin-right: 8px;\n position: relative;\n display: flex;\n flex: 0 0;\n min-width: 150px;\n}\n\n.input-select-menu__input {\n display: none;\n}\n\n.input-select-menu__input p {\n width: 100%;\n min-height: 14px;\n margin: 0px;\n padding-left: 5px;\n padding-top: 5px;\n padding-bottom: 5px;\n padding-right: 5px;\n display: inherit;\n background-color: var(--figma-color-bg-menu-secondary);\n border-radius: 2px;\n border-style: solid;\n border-color: var(--figma-color-border-selected-strong);\n color: var(--figma-color-text-oncomponent-tertiary);\n}\n\n\n.input-select-menu__input input.addVisible {\n width: calc(100% - 32px);\n}\n\n@-moz-document url-prefix() {\n /* Apply the styles only in Firefox */\n .input-select-menu__input input {\n padding-left: 8px !important;\n padding-top: 8px !important;\n }\n}\n.input-select-menu__input input {\n position:absolute;\n padding-left: 6px;\n padding-top: 6px;\n padding-bottom: 5px;\n width: 100%;\n border: none;\n outline: none;\n outline-offset: -2px;\n resize: none;\n color: var(--figma-color-text-oncomponent);\n background-color: transparent;\n font-family: \"Inter\", sans-serif;\n font-style: normal;\n font-weight: 400;\n font-size: 11px;\n line-height: 14px;\n letter-spacing: 0.01em;\n}\n\n.input-select-menu__item_add {\n /* background-color: #007be5; */\n}\n\n.input-select-menu-add {\n background-color: transparent;\n position: absolute;\n top: 0px;\n right: 0px;\n padding: 7px;\n bottom: 0px;\n border-width: 1px 1px 1px 0px;\n border-radius: 0px 2px 2px 0px;\n border-style: solid;\n border-color: var(--figma-color-border-selected-strong);\n}\n\n.input-select-menu-add .svg-container {\n background-color: var(--figma-color-icon-onselected-strong);\n width: 11px;\n height: 11px;\n}\n\n.input-select-menu-add.on-primary {\n background-color: var(--figma-color-bg-selected-strong);\n}\n\n.input-select-menu-add.on-primary .svg-container {\n background-color: var(--figma-color-icon-onselected-strong);\n}\n\n.input-select-editoverlay {\n position: fixed;\n display: flex;\n background-color: var(--figma-color-bg-menu-hover);\n z-index: 100000;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/textfield/TextField.css": +/*!******************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/textfield/TextField.css ***! + \******************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` +.text-field { + + margin-top: 4px; + margin-bottom: 4px; +} + +.text-field-text { + flex-grow: 1; + position: relative; + border: 1px solid transparent; + border-radius: var(--border-radius-small); + +} + +.text-field-text.editing { + border-color: var(--figma-color-border-brand-strong); +} + + +.text-field-text .missing { + color: var(--figma-color-text-danger); +} + +.skipped .translation-editor-text p { + color: var(--figma-color-text-warning); +} + +.translation-editor-text a { + text-decoration: inherit !important; +} + +.missing.translation { + color: var(--figma-color-text-danger); +} + +.text-field-text:hover { + border-color: var(--figma-color-border); +} + +.text-field-text p { + padding-left: 5px; + padding-top: 5px; + padding-bottom: 5px; + padding-right: 5px; + display: inherit; + margin-block-start: inherit; + margin-block-end: inherit; + margin-inline-start: inherit; + margin-inline-end: inherit; +} + +.text-field-text input { + position:absolute; + padding-left: 5px; + padding-top: 5px; + padding-bottom: 5px; + + border: none; + outline: none; + width: 100%; + height: 100%; + + outline-offset: -2px; + resize: none; + color: var(--figma-color-text); + background-color: var(--figma-color-bg); + font-family: "Inter", sans-serif; + font-style: normal; + font-weight: 400; + font-size: 11px; + line-height: 14px; + letter-spacing: 0.01em; +} + +.text-field-text.icon-right:hover input { + padding-right: 26px; +} +.text-field-text.icon-right:hover p { + padding-right: 26px; +} + + +.text-field-text.icon-right.editing input { + padding-right: 26px; +} +.text-field-text.icon-right.editing p { + padding-right: 26px; +} + +.text-field-text:hover .svg-container.right:hover { + background-color: red; +} + +.text-field-text:hover .svg-container.right { + visibility: visible; +} + + +.text-field-text.icon-left input { + padding-left: 26px; + padding-right: 26px; +} +.text-field-text.icon-left p { + padding-left: 26px; + padding-right: 26px; +} + + +.text-field-text .svg-container { + position: absolute; + left: 5px; + top: 7px; + width: 12px; + height: 12px; +} + + +.text-field-text .svg-container.right { + position: absolute; + visibility: hidden; + right: 5px; + left: unset; + top: 7px; + width: 12px; + height: 12px; +} + +.text-field-text .svg-container.right.unlinked-svg { + width: 7px; + right: 7px; +}`, "",{"version":3,"sources":["webpack://./src/ui/compontents/textfield/TextField.css"],"names":[],"mappings":";AACA;;EAEE,eAAe;EACf,kBAAkB;AACpB;;AAEA;EACE,YAAY;EACZ,kBAAkB;EAClB,6BAA6B;EAC7B,yCAAyC;;AAE3C;;AAEA;EACE,oDAAoD;AACtD;;;AAGA;EACE,qCAAqC;AACvC;;AAEA;EACE,sCAAsC;AACxC;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,qCAAqC;AACvC;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,mBAAmB;EACnB,kBAAkB;EAClB,gBAAgB;EAChB,2BAA2B;EAC3B,yBAAyB;EACzB,4BAA4B;EAC5B,0BAA0B;AAC5B;;AAEA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,gBAAgB;EAChB,mBAAmB;;EAEnB,YAAY;EACZ,aAAa;EACb,WAAW;EACX,YAAY;;EAEZ,oBAAoB;EACpB,YAAY;EACZ,+BAA+B;EAC/B,uCAAuC;EACvC,gCAAgC;EAChC,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,iBAAiB;EACjB,sBAAsB;AACxB;;AAEA;EACE,mBAAmB;AACrB;AACA;EACE,mBAAmB;AACrB;;;AAGA;EACE,mBAAmB;AACrB;AACA;EACE,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,mBAAmB;AACrB;;;AAGA;EACE,kBAAkB;EAClB,mBAAmB;AACrB;AACA;EACE,kBAAkB;EAClB,mBAAmB;AACrB;;;AAGA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,WAAW;EACX,YAAY;AACd;;;AAGA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,QAAQ;EACR,WAAW;EACX,YAAY;AACd;;AAEA;CACC,UAAU;CACV,UAAU;AACX","sourcesContent":["\n.text-field {\n \n margin-top: 4px;\n margin-bottom: 4px;\n}\n\n.text-field-text {\n flex-grow: 1;\n position: relative;\n border: 1px solid transparent;\n border-radius: var(--border-radius-small);\n \n}\n\n.text-field-text.editing {\n border-color: var(--figma-color-border-brand-strong);\n}\n\n\n.text-field-text .missing {\n color: var(--figma-color-text-danger);\n}\n\n.skipped .translation-editor-text p {\n color: var(--figma-color-text-warning);\n}\n\n.translation-editor-text a {\n text-decoration: inherit !important;\n}\n\n.missing.translation {\n color: var(--figma-color-text-danger);\n}\n\n.text-field-text:hover {\n border-color: var(--figma-color-border);\n}\n\n.text-field-text p {\n padding-left: 5px;\n padding-top: 5px;\n padding-bottom: 5px;\n padding-right: 5px;\n display: inherit;\n margin-block-start: inherit;\n margin-block-end: inherit;\n margin-inline-start: inherit;\n margin-inline-end: inherit;\n}\n\n.text-field-text input {\n position:absolute;\n padding-left: 5px;\n padding-top: 5px;\n padding-bottom: 5px;\n \n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n \n outline-offset: -2px;\n resize: none;\n color: var(--figma-color-text);\n background-color: var(--figma-color-bg);\n font-family: \"Inter\", sans-serif;\n font-style: normal;\n font-weight: 400;\n font-size: 11px;\n line-height: 14px;\n letter-spacing: 0.01em;\n}\n\n.text-field-text.icon-right:hover input {\n padding-right: 26px;\n}\n.text-field-text.icon-right:hover p {\n padding-right: 26px;\n}\n\n\n.text-field-text.icon-right.editing input {\n padding-right: 26px;\n}\n.text-field-text.icon-right.editing p {\n padding-right: 26px;\n}\n\n.text-field-text:hover .svg-container.right:hover {\n background-color: red;\n}\n\n.text-field-text:hover .svg-container.right {\n visibility: visible;\n}\n\n\n.text-field-text.icon-left input {\n padding-left: 26px;\n padding-right: 26px;\n}\n.text-field-text.icon-left p {\n padding-left: 26px;\n padding-right: 26px;\n}\n\n\n.text-field-text .svg-container {\n position: absolute;\n left: 5px;\n top: 7px;\n width: 12px;\n height: 12px;\n}\n\n\n.text-field-text .svg-container.right {\n position: absolute;\n visibility: hidden;\n right: 5px;\n left: unset;\n top: 7px;\n width: 12px;\n height: 12px;\n}\n\n.text-field-text .svg-container.right.unlinked-svg {\n width: 7px;\n right: 7px;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/tooltip/Tooltip.css": +/*!**************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/tooltip/Tooltip.css ***! + \**************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `.tooltip--notInteractiv { + pointer-events: none; +} + +.tooltip--notInteractive { + pointer-events: none; +} + +.tooltip--arrow { + position: fixed; + width: 0; + height: 0; + border-style: solid; + border-color: transparent; + border-width: 6px; + z-index: 400; +} + +.tooltip--arrowInset { + border-width: 7px; + margin: 0 -1px; +} + +.tooltip--upArrow { + transform: translate(-50%, 0); + border-top: none; + border-bottom-color: var(--color-bg-tooltip, #050505); +} + +.tooltip--downArrow { + transform: translate(-50%, 0); + border-top-color: var(--color-bg-tooltip, #050505); + border-bottom: none; + margin: 26px -1px; +} + +.tooltip--content { + position: fixed; + margin-top: 7px; + padding: 6px 8px; + transform: translate(-50%, 0); + background: var(--color-bg-tooltip, #050505); + color: var(--color-text-tooltip, white); + z-index: 400; + border-radius: 2px; + white-space: nowrap; + box-shadow: var(--elevation-300-tooltip, 0 2px 7px rgba(0, 0, 0, .15)); +} + +.tooltip--content-down { + margin-bottom: 7px; + margin-top: 0px; +} + +.tooltip--text { + display: inline-block; + text-align: center; +}`, "",{"version":3,"sources":["webpack://./src/ui/compontents/tooltip/Tooltip.css"],"names":[],"mappings":"AAAA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,eAAe;EACf,QAAQ;EACR,SAAS;EACT,mBAAmB;EACnB,yBAAyB;EACzB,iBAAiB;EACjB,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,cAAc;AAChB;;AAEA;EACE,6BAA6B;EAC7B,gBAAgB;EAChB,qDAAqD;AACvD;;AAEA;EACE,6BAA6B;EAC7B,kDAAkD;EAClD,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,eAAe;EACf,eAAe;EACf,gBAAgB;EAChB,6BAA6B;EAC7B,4CAA4C;EAC5C,uCAAuC;EACvC,YAAY;EACZ,kBAAkB;EAClB,mBAAmB;EACnB,sEAAsE;AACxE;;AAEA;EACE,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,qBAAqB;EACrB,kBAAkB;AACpB","sourcesContent":[".tooltip--notInteractiv {\n pointer-events: none;\n}\n\n.tooltip--notInteractive {\n pointer-events: none;\n}\n\n.tooltip--arrow {\n position: fixed;\n width: 0;\n height: 0;\n border-style: solid;\n border-color: transparent;\n border-width: 6px;\n z-index: 400;\n}\n\n.tooltip--arrowInset {\n border-width: 7px;\n margin: 0 -1px;\n}\n\n.tooltip--upArrow {\n transform: translate(-50%, 0);\n border-top: none;\n border-bottom-color: var(--color-bg-tooltip, #050505);\n}\n\n.tooltip--downArrow {\n transform: translate(-50%, 0);\n border-top-color: var(--color-bg-tooltip, #050505);\n border-bottom: none;\n margin: 26px -1px;\n}\n\n.tooltip--content {\n position: fixed;\n margin-top: 7px;\n padding: 6px 8px;\n transform: translate(-50%, 0);\n background: var(--color-bg-tooltip, #050505);\n color: var(--color-text-tooltip, white);\n z-index: 400;\n border-radius: 2px;\n white-space: nowrap;\n box-shadow: var(--elevation-300-tooltip, 0 2px 7px rgba(0, 0, 0, .15));\n}\n\n.tooltip--content-down {\n margin-bottom: 7px;\n margin-top: 0px;\n}\n\n.tooltip--text {\n display: inline-block;\n text-align: center;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/translationEditor/TranslationEditor.css": +/*!**********************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/translationEditor/TranslationEditor.css ***! + \**********************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` +.translation-editor { + margin-top: 1px; + margin-bottom: 1px; + width: 100%; +} + + + +.translation-editor-text { + display: grid; + grid-template-columns: 1fr; + position: relative; + border: 1px solid transparent; +} + + +.translation-editor-text p, +.translation-editor-text ul, +.translation-editor-text ol { + margin: 0; + padding: 0; +} + +.translation-editor-text .translation { + grid-row-start: 1; + grid-column-start: 1; +} + + +.translation-editor-text .ql-container { + position: absolute; + left: 0px; + right: 0px; + top: 0px; + bottom: 0px; + padding-right: 5px; +} + +.translation-editor-text ul > li::before { + content: '\\2022'; +} + +.ql-editor ol, +.ql-editor ul { + padding-left: 0em !important; +} + +.ql-bubble .ql-hidden { + display: none !important; +} + +.ql-bubble .ql-button.ql-placeholder { + color: #ccc; +} + +.ql-bubble .ql-button.ql-placeholder.ql-active { + color: #fff; +} + +.translation-editor-text pre { + grid-row-start: 1; + grid-column-start: 1; +} + + +.translation-editor-text:hover { + border-color: var(--figma-color-border); +} + +.translation-editor-text.editing { + background-color: var(--figma-color-bg); + border-color: var(--figma-color-border-brand-strong); +} + +.translation-editor-text.editing .translation { + visibility: hidden; +} + + + +.translation-editor-text { + min-height: 18px; + border-radius: 2px; + border: 1px solid transparent; + outline: none; + padding-left: 8px; + padding-top: 5px; + padding-bottom: 3px; + padding-right: 5px; +} + +.translation-editor-text:hover { + border: 1px solid var(--figma-color-border, rgba(0, 0, 0, .1)); + +} + + +.translation-editor-text.editing { + outline-offset: 0.39px; + border: 1px solid var(--figma-color-border-selected); + outline: 1px solid var(--figma-color-border-selected); +} + + + +.ql-toolbar { + display: flex; +} + +.ql-formats { + flex: 0 0 auto; +} + +.ql-placeholder-editor { + flex: 0 0 auto; + margin: 8px 12px 8px 0px; +} + +.ql-placeholder-editor input { + background: transparent; + border: none; + color: #fff; + font-size: 13px; + height: 100%; + outline: none; + width: 100px; +} + +.ql-tooltip-editor.ql-editing { + height: 100%; + position: absolute; + width: 100%; + left: 0px; + top: 0px; + background-color: rgb(18, 13, 13); + display: block !important; + +} + +.cm-theme .cm-editor { + outline: none !important; + padding-left: 8px; + padding-right: 4px; +} + +.cm-line { + padding: 0px !important; +} + +.translation-editor-text * { + color: var(--figma-color-text); + line-height: 18px; + + /*font-family: "Inter", sans-serif; + font-style: normal; + font-weight: 400; + font-size: 11px; + line-height: 14px; + letter-spacing: 0.01em;*/ +} + +.translation-editor-disabled .translation-editor-text * { + color: var(--figma-color-text-disabled); + line-height: 18px; + + /*font-family: "Inter", sans-serif; + font-style: normal; + font-weight: 400; + font-size: 11px; + line-height: 14px; + letter-spacing: 0.01em;*/ +} + +.translation-editor-text ol, .translation-editor-text ul { + /* padding-left: 1.5em; */ +} + +.translation-editor-text ol > li, .translation-editor-text ul > li { + list-style-type: none; +} + +.translation-editor-text ol li:not(.translation-editor-text-direction-rtl), .translation-editor-text ul li:not(.translation-editor-text-direction-rtl) { + padding-left: 1.5em; +} +.translation-editor-text ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-0; +} + +.translation-editor-text li:not(.translation-editor-text-rtl)::before { + margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} + +.translation-editor-text ol li:before { + content: counter(list-0, decimal) '. '; +} +.translation-editor-text li::before { + display: inline-block; + white-space: nowrap; + width: 1.2em; +} + +.translation-editor-text em, .translation-editor-text em * { + font-style: italic; +} + +.translation-editor-text strong, .translation-editor-text strong * { + font-weight: 800; +} + + +div.ql-tooltip { + position: absolute !important; + + z-index: 1 !important; + background-color: #222 !important; + border: 1px solid #2c2c2c !important; + + box-shadow: 0 4px 14px rgba(0, 0, 0, 0.9) !important; + color: var(--figma-color-text-tooltip, #333333) !important; + white-space: nowrap !important; + border-radius: 2px !important; +} + +.ql-placeholder-fillin { + background: transparent; + border: none; + color: #fff; + font-size: 13px; + outline: none; + padding: 3px 12px; + +} + +.cm-theme { +} +.cm-theme .cm-selectionLayer { + z-index: -1 !important; +} + +.translation-editor-text .cm-theme .cm-scroller { + /* background-color: var(--figma-color-bg);*/ +} + +.ql-placeholder-group { + margin: 7px 12px 7px 0px; +} + +.ql-bubble .ql-toolbar .ql-formats { + margin: 7px 0px 7px 12px !important; +} + +.ql-bubble.ql-toolbar button, .ql-bubble .ql-toolbar button { + height: 20px !important; +} + +ph { + cursor: pointer; + color: var(--figma-color-text-component) !important; + border-radius: 7px; + padding: 1 6.55px; + background-color: var(--figma-color-bg-component-tertiary); + border-color: transparent; + margin-right: 1px; + border-width: 1px; + border-style: solid; +} + +ph:hover { + border-color: var(--color-border-component-hover, #a094e6); +} + +ph::selection { + + background-color: transparent; +} + +.placholder-container.selected { + border: 1px solid blue; + border-radius: 7px; + padding: 1 6.55px; + background-color: blue; + margin-right: 1px; +} + +.placholder-container { + border: 1px solid blue; + border-radius: 7px; + padding: 1 6.55px; + background-color: lightblue; + margin-right: 1px; +} + +.placholder-argument-position { + padding-left: 5px; + padding-right: 2px; +} + +.placholder-argument-position-match { + +} + +.placholder-argument-position-missmatch { + color: red; +} + +.placholder-argument-position-derived { + display: none; +} + +.placholder-container:hover .placholder-argument-position-derived { + display: inherit; + color: grey; +} + +.placholder-argument-position-spacer { + display: none; +} + + +.placholder-argument-position-spacer { + padding: 0px 2px; +}`, "",{"version":3,"sources":["webpack://./src/ui/compontents/translationEditor/TranslationEditor.css"],"names":[],"mappings":";AACA;EACE,eAAe;EACf,kBAAkB;EAClB,WAAW;AACb;;;;AAIA;EACE,aAAa;EACb,0BAA0B;EAC1B,kBAAkB;EAClB,6BAA6B;AAC/B;;;AAGA;;;EAGE,SAAS;EACT,UAAU;AACZ;;AAEA;EACE,iBAAiB;EACjB,oBAAoB;AACtB;;;AAGA;EACE,kBAAkB;EAClB,SAAS;EACT,UAAU;EACV,QAAQ;EACR,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;;EAEE,4BAA4B;AAC9B;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,iBAAiB;EACjB,oBAAoB;AACtB;;;AAGA;EACE,uCAAuC;AACzC;;AAEA;EACE,uCAAuC;EACvC,oDAAoD;AACtD;;AAEA;EACE,kBAAkB;AACpB;;;;AAIA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,6BAA6B;EAC7B,aAAa;EACb,iBAAiB;EACjB,gBAAgB;EAChB,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;EACE,8DAA8D;;AAEhE;;;AAGA;EACE,sBAAsB;EACtB,oDAAoD;EACpD,qDAAqD;AACvD;;;;AAIA;EACE,aAAa;AACf;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,cAAc;EACd,wBAAwB;AAC1B;;AAEA;EACE,uBAAuB;EACvB,YAAY;EACZ,WAAW;EACX,eAAe;EACf,YAAY;EACZ,aAAa;EACb,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,QAAQ;EACR,iCAAiC;EACjC,yBAAyB;;AAE3B;;AAEA;EACE,wBAAwB;EACxB,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,+BAA+B;EAC/B,iBAAiB;;EAEjB;;;;;0BAKwB;AAC1B;;AAEA;EACE,wCAAwC;EACxC,iBAAiB;;EAEjB;;;;;0BAKwB;AAC1B;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,mBAAmB;AACrB;AACA;EACE,6EAA6E;EAC7E,yBAAyB;AAC3B;;AAEA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,sCAAsC;AACxC;AACA;EACE,qBAAqB;EACrB,mBAAmB;EACnB,YAAY;AACd;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;AAClB;;;AAGA;EACE,6BAA6B;;EAE7B,qBAAqB;EACrB,iCAAiC;EACjC,oCAAoC;;EAEpC,oDAAoD;EACpD,0DAA0D;EAC1D,8BAA8B;EAC9B,6BAA6B;AAC/B;;AAEA;IACI,uBAAuB;IACvB,YAAY;IACZ,WAAW;IACX,eAAe;IACf,aAAa;IACb,iBAAiB;;AAErB;;AAEA;AACA;AACA;EACE,sBAAsB;AACxB;;AAEA;EACE,4CAA4C;AAC9C;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,eAAe;EACf,oDAAoD;EACpD,kBAAkB;EAClB,iBAAiB;EACjB,0DAA0D;EAC1D,yBAAyB;EACzB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;AACrB;;AAEA;EACE,0DAA0D;AAC5D;;AAEA;;EAEE,6BAA6B;AAC/B;;AAEA;EACE,sBAAsB;EACtB,kBAAkB;EAClB,iBAAiB;EACjB,sBAAsB;EACtB,iBAAiB;AACnB;;AAEA;EACE,sBAAsB;EACtB,kBAAkB;EAClB,iBAAiB;EACjB,2BAA2B;EAC3B,iBAAiB;AACnB;;AAEA;CACC,iBAAiB;CACjB,kBAAkB;AACnB;;AAEA;;AAEA;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,gBAAgB;EAChB,WAAW;AACb;;AAEA;EACE,aAAa;AACf;;;AAGA;EACE,gBAAgB;AAClB","sourcesContent":["\n.translation-editor {\n margin-top: 1px;\n margin-bottom: 1px;\n width: 100%;\n}\n\n\n\n.translation-editor-text {\n display: grid;\n grid-template-columns: 1fr;\n position: relative;\n border: 1px solid transparent;\n}\n\n\n.translation-editor-text p, \n.translation-editor-text ul, \n.translation-editor-text ol {\n margin: 0;\n padding: 0;\n}\n\n.translation-editor-text .translation {\n grid-row-start: 1;\n grid-column-start: 1;\n}\n\n\n.translation-editor-text .ql-container {\n position: absolute;\n left: 0px;\n right: 0px;\n top: 0px;\n bottom: 0px;\n padding-right: 5px;\n}\n\n.translation-editor-text ul > li::before {\n content: '\\2022';\n}\n\n.ql-editor ol,\n.ql-editor ul {\n padding-left: 0em !important;\n}\n\n.ql-bubble .ql-hidden {\n display: none !important;\n}\n\n.ql-bubble .ql-button.ql-placeholder {\n color: #ccc;\n}\n\n.ql-bubble .ql-button.ql-placeholder.ql-active {\n color: #fff;\n}\n\n.translation-editor-text pre {\n grid-row-start: 1;\n grid-column-start: 1;\n}\n\n\n.translation-editor-text:hover {\n border-color: var(--figma-color-border);\n}\n\n.translation-editor-text.editing {\n background-color: var(--figma-color-bg);\n border-color: var(--figma-color-border-brand-strong);\n}\n\n.translation-editor-text.editing .translation {\n visibility: hidden;\n}\n\n\n\n.translation-editor-text {\n min-height: 18px;\n border-radius: 2px;\n border: 1px solid transparent;\n outline: none;\n padding-left: 8px;\n padding-top: 5px;\n padding-bottom: 3px;\n padding-right: 5px;\n}\n\n.translation-editor-text:hover {\n border: 1px solid var(--figma-color-border, rgba(0, 0, 0, .1));\n \n}\n\n\n.translation-editor-text.editing {\n outline-offset: 0.39px;\n border: 1px solid var(--figma-color-border-selected);\n outline: 1px solid var(--figma-color-border-selected);\n}\n\n\n\n.ql-toolbar {\n display: flex;\n}\n\n.ql-formats {\n flex: 0 0 auto;\n}\n\n.ql-placeholder-editor {\n flex: 0 0 auto;\n margin: 8px 12px 8px 0px;\n}\n\n.ql-placeholder-editor input {\n background: transparent;\n border: none;\n color: #fff;\n font-size: 13px;\n height: 100%;\n outline: none;\n width: 100px;\n}\n\n.ql-tooltip-editor.ql-editing {\n height: 100%;\n position: absolute;\n width: 100%;\n left: 0px;\n top: 0px;\n background-color: rgb(18, 13, 13);\n display: block !important;\n \n}\n\n.cm-theme .cm-editor {\n outline: none !important;\n padding-left: 8px;\n padding-right: 4px;\n}\n\n.cm-line {\n padding: 0px !important;\n}\n\n.translation-editor-text * {\n color: var(--figma-color-text);\n line-height: 18px;\n\n /*font-family: \"Inter\", sans-serif;\n font-style: normal;\n font-weight: 400;\n font-size: 11px;\n line-height: 14px;\n letter-spacing: 0.01em;*/\n}\n\n.translation-editor-disabled .translation-editor-text * {\n color: var(--figma-color-text-disabled);\n line-height: 18px;\n\n /*font-family: \"Inter\", sans-serif;\n font-style: normal;\n font-weight: 400;\n font-size: 11px;\n line-height: 14px;\n letter-spacing: 0.01em;*/\n}\n\n.translation-editor-text ol, .translation-editor-text ul {\n /* padding-left: 1.5em; */\n}\n\n.translation-editor-text ol > li, .translation-editor-text ul > li {\n list-style-type: none;\n}\n\n.translation-editor-text ol li:not(.translation-editor-text-direction-rtl), .translation-editor-text ul li:not(.translation-editor-text-direction-rtl) {\n padding-left: 1.5em;\n}\n.translation-editor-text ol li {\n counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n counter-increment: list-0;\n}\n\n.translation-editor-text li:not(.translation-editor-text-rtl)::before {\n margin-left: -1.5em;\n margin-right: 0.3em;\n text-align: right;\n}\n\n.translation-editor-text ol li:before {\n content: counter(list-0, decimal) '. ';\n}\n.translation-editor-text li::before {\n display: inline-block;\n white-space: nowrap;\n width: 1.2em;\n}\n\n.translation-editor-text em, .translation-editor-text em * {\n font-style: italic; \n}\n\n.translation-editor-text strong, .translation-editor-text strong * {\n font-weight: 800;\n}\n\n\ndiv.ql-tooltip {\n position: absolute !important;\n \n z-index: 1 !important;\n background-color: #222 !important;\n border: 1px solid #2c2c2c !important;\n \n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.9) !important;\n color: var(--figma-color-text-tooltip, #333333) !important;\n white-space: nowrap !important;\n border-radius: 2px !important;\n}\n\n.ql-placeholder-fillin {\n background: transparent;\n border: none;\n color: #fff;\n font-size: 13px;\n outline: none;\n padding: 3px 12px;\n\n}\n\n.cm-theme {\n}\n.cm-theme .cm-selectionLayer {\n z-index: -1 !important;\n}\n\n.translation-editor-text .cm-theme .cm-scroller {\n /* background-color: var(--figma-color-bg);*/\n}\n\n.ql-placeholder-group {\n margin: 7px 12px 7px 0px;\n}\n\n.ql-bubble .ql-toolbar .ql-formats {\n margin: 7px 0px 7px 12px !important;\n}\n\n.ql-bubble.ql-toolbar button, .ql-bubble .ql-toolbar button {\n height: 20px !important;\n}\n\nph {\n cursor: pointer;\n color: var(--figma-color-text-component) !important;\n border-radius: 7px;\n padding: 1 6.55px;\n background-color: var(--figma-color-bg-component-tertiary);\n border-color: transparent;\n margin-right: 1px; \n border-width: 1px;\n border-style: solid;\n}\n\nph:hover {\n border-color: var(--color-border-component-hover, #a094e6);\n}\n\nph::selection {\n \n background-color: transparent;\n}\n\n.placholder-container.selected {\n border: 1px solid blue;\n border-radius: 7px;\n padding: 1 6.55px;\n background-color: blue;\n margin-right: 1px;\n}\n\n.placholder-container {\n border: 1px solid blue;\n border-radius: 7px;\n padding: 1 6.55px;\n background-color: lightblue;\n margin-right: 1px;\n}\n\n.placholder-argument-position {\n padding-left: 5px;\n padding-right: 2px;\n}\n\n.placholder-argument-position-match {\n \n}\n\n.placholder-argument-position-missmatch {\n color: red;\n}\n\n.placholder-argument-position-derived {\n display: none;\n}\n\n.placholder-container:hover .placholder-argument-position-derived {\n display: inherit;\n color: grey;\n}\n\n.placholder-argument-position-spacer {\n display: none;\n}\n\n\n.placholder-argument-position-spacer {\n padding: 0px 2px;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/translationEditor/quill.bubble.css": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/compontents/translationEditor/quill.bubble.css ***! + \*****************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `/*! + * Quill Editor v1.3.7 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +.ql-container { + box-sizing: border-box; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + height: 100%; + outline: none; + overflow-y: auto; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor > * { + cursor: text; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + /* padding-left: 1.5em; */ +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\\2610'; +} +.ql-editor li::before { + display: inline-block; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { + padding-left: 1.5em; +} +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-0; +} +.ql-editor ol li:before { + content: counter(list-0, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + left: 15px; + pointer-events: none; + position: absolute; + right: 15px; +} +.ql-bubble.ql-toolbar:after, +.ql-bubble .ql-toolbar:after { + clear: both; + content: ''; + display: table; +} +.ql-bubble.ql-toolbar button, +.ql-bubble .ql-toolbar button { + background: none; + border: none; + cursor: pointer; + display: inline-block; + float: left; + height: 24px; + padding: 3px 5px; + width: 28px; +} +.ql-bubble.ql-toolbar button svg, +.ql-bubble .ql-toolbar button svg { + float: left; + height: 100%; +} +.ql-bubble.ql-toolbar button:active:hover, +.ql-bubble .ql-toolbar button:active:hover { + outline: none; +} +.ql-bubble.ql-toolbar input.ql-image[type=file], +.ql-bubble .ql-toolbar input.ql-image[type=file] { + display: none; +} +.ql-bubble.ql-toolbar button:hover, +.ql-bubble .ql-toolbar button:hover, +.ql-bubble.ql-toolbar button:focus, +.ql-bubble .ql-toolbar button:focus, +.ql-bubble.ql-toolbar button.ql-active, +.ql-bubble .ql-toolbar button.ql-active, +.ql-bubble.ql-toolbar .ql-picker-label:hover, +.ql-bubble .ql-toolbar .ql-picker-label:hover, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active, +.ql-bubble.ql-toolbar .ql-picker-item:hover, +.ql-bubble .ql-toolbar .ql-picker-item:hover, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected { + color: #fff; +} +.ql-bubble.ql-toolbar button:hover .ql-fill, +.ql-bubble .ql-toolbar button:hover .ql-fill, +.ql-bubble.ql-toolbar button:focus .ql-fill, +.ql-bubble .ql-toolbar button:focus .ql-fill, +.ql-bubble.ql-toolbar button.ql-active .ql-fill, +.ql-bubble .ql-toolbar button.ql-active .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { + fill: #fff; +} +.ql-bubble.ql-toolbar button:hover .ql-stroke, +.ql-bubble .ql-toolbar button:hover .ql-stroke, +.ql-bubble.ql-toolbar button:focus .ql-stroke, +.ql-bubble .ql-toolbar button:focus .ql-stroke, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-bubble.ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar button:focus .ql-stroke-miter, +.ql-bubble .ql-toolbar button:focus .ql-stroke-miter, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { + stroke: #fff; +} +@media (pointer: coarse) { + .ql-bubble.ql-toolbar button:hover:not(.ql-active), + .ql-bubble .ql-toolbar button:hover:not(.ql-active) { + color: #ccc; + } + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { + fill: #ccc; + } + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { + stroke: #ccc; + } +} +.ql-bubble { + box-sizing: border-box; +} +.ql-bubble * { + box-sizing: border-box; +} +.ql-bubble .ql-hidden { + display: none; +} +.ql-bubble .ql-out-bottom, +.ql-bubble .ql-out-top { + visibility: hidden; +} +.ql-bubble .ql-tooltip { + z-index: 1; + position: absolute; + transform: translateY(10px); +} +.ql-bubble .ql-tooltip a { + cursor: pointer; + text-decoration: none; +} +.ql-bubble .ql-tooltip.ql-flip { + transform: translateY(-10px); +} +.ql-bubble .ql-formats { + display: inline-block; + vertical-align: middle; +} +.ql-bubble .ql-formats:after { + clear: both; + content: ''; + display: table; +} +.ql-bubble .ql-stroke { + fill: none; + stroke: #ccc; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 2; +} +.ql-bubble .ql-stroke-miter { + fill: none; + stroke: #ccc; + stroke-miterlimit: 10; + stroke-width: 2; +} +.ql-bubble .ql-fill, +.ql-bubble .ql-stroke.ql-fill { + fill: #ccc; +} +.ql-bubble .ql-empty { + fill: none; +} +.ql-bubble .ql-even { + fill-rule: evenodd; +} +.ql-bubble .ql-thin, +.ql-bubble .ql-stroke.ql-thin { + stroke-width: 1; +} +.ql-bubble .ql-transparent { + opacity: 0.4; +} +.ql-bubble .ql-direction svg:last-child { + display: none; +} +.ql-bubble .ql-direction.ql-active svg:last-child { + display: inline; +} +.ql-bubble .ql-direction.ql-active svg:first-child { + display: none; +} +.ql-bubble .ql-editor h1 { + font-size: 2em; +} +.ql-bubble .ql-editor h2 { + font-size: 1.5em; +} +.ql-bubble .ql-editor h3 { + font-size: 1.17em; +} +.ql-bubble .ql-editor h4 { + font-size: 1em; +} +.ql-bubble .ql-editor h5 { + font-size: 0.83em; +} +.ql-bubble .ql-editor h6 { + font-size: 0.67em; +} +.ql-bubble .ql-editor a { + text-decoration: underline; +} +.ql-bubble .ql-editor blockquote { + border-left: 4px solid #ccc; + margin-bottom: 5px; + margin-top: 5px; + padding-left: 16px; +} +.ql-bubble .ql-editor code, +.ql-bubble .ql-editor pre { + background-color: #f0f0f0; + border-radius: 3px; +} +.ql-bubble .ql-editor pre { + white-space: pre-wrap; + margin-bottom: 5px; + margin-top: 5px; + padding: 5px 10px; +} +.ql-bubble .ql-editor code { + font-size: 85%; + padding: 2px 4px; +} +.ql-bubble .ql-editor pre.ql-syntax { + background-color: #23241f; + color: #f8f8f2; + overflow: visible; +} +.ql-bubble .ql-editor img { + max-width: 100%; +} +.ql-bubble .ql-picker { + color: #ccc; + display: inline-block; + float: left; + font-size: 14px; + font-weight: 500; + height: 24px; + position: relative; + vertical-align: middle; +} +.ql-bubble .ql-picker-label { + cursor: pointer; + display: inline-block; + height: 100%; + padding-left: 8px; + padding-right: 2px; + position: relative; + width: 100%; +} +.ql-bubble .ql-picker-label::before { + display: inline-block; + line-height: 22px; +} +.ql-bubble .ql-picker-options { + background-color: #444; + display: none; + min-width: 100%; + padding: 4px 8px; + position: absolute; + white-space: nowrap; +} +.ql-bubble .ql-picker-options .ql-picker-item { + cursor: pointer; + display: block; + padding-bottom: 5px; + padding-top: 5px; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label { + color: #777; + z-index: 2; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill { + fill: #777; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke { + stroke: #777; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-options { + display: block; + margin-top: -1px; + top: 100%; + z-index: 1; +} +.ql-bubble .ql-color-picker, +.ql-bubble .ql-icon-picker { + width: 28px; +} +.ql-bubble .ql-color-picker .ql-picker-label, +.ql-bubble .ql-icon-picker .ql-picker-label { + padding: 2px 4px; +} +.ql-bubble .ql-color-picker .ql-picker-label svg, +.ql-bubble .ql-icon-picker .ql-picker-label svg { + right: 4px; +} +.ql-bubble .ql-icon-picker .ql-picker-options { + padding: 4px 0px; +} +.ql-bubble .ql-icon-picker .ql-picker-item { + height: 24px; + width: 24px; + padding: 2px 4px; +} +.ql-bubble .ql-color-picker .ql-picker-options { + padding: 3px 5px; + width: 152px; +} +.ql-bubble .ql-color-picker .ql-picker-item { + border: 1px solid transparent; + float: left; + height: 16px; + margin: 2px; + padding: 0px; + width: 16px; +} +.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { + position: absolute; + margin-top: -9px; + right: 0; + top: 50%; + width: 18px; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { + content: attr(data-label); +} +.ql-bubble .ql-picker.ql-header { + width: 98px; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item::before { + content: 'Normal'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + content: 'Heading 1'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + content: 'Heading 2'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + content: 'Heading 3'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + content: 'Heading 4'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + content: 'Heading 5'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + content: 'Heading 6'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + font-size: 2em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + font-size: 1.5em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + font-size: 1.17em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + font-size: 1em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + font-size: 0.83em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + font-size: 0.67em; +} +.ql-bubble .ql-picker.ql-font { + width: 108px; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item::before { + content: 'Sans Serif'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + content: 'Serif'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + content: 'Monospace'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + font-family: Georgia, Times New Roman, serif; +} +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + font-family: Monaco, Courier New, monospace; +} +.ql-bubble .ql-picker.ql-size { + width: 98px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item::before { + content: 'Normal'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + content: 'Small'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + content: 'Large'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + content: 'Huge'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + font-size: 10px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + font-size: 18px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + font-size: 32px; +} +.ql-bubble .ql-color-picker.ql-background .ql-picker-item { + background-color: #fff; +} +.ql-bubble .ql-color-picker.ql-color .ql-picker-item { + background-color: #000; +} +.ql-bubble .ql-toolbar .ql-formats { + margin: 8px 12px 8px 0px; +} +.ql-bubble .ql-toolbar .ql-formats:first-child { + margin-left: 12px; +} +.ql-bubble .ql-color-picker svg { + margin: 1px; +} +.ql-bubble .ql-color-picker .ql-picker-item.ql-selected, +.ql-bubble .ql-color-picker .ql-picker-item:hover { + border-color: #fff; +} +.ql-bubble .ql-tooltip { + background-color: #444; + border-radius: 25px; + color: #fff; +} +.ql-bubble .ql-tooltip-arrow { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + content: " "; + display: block; + left: 50%; + margin-left: -6px; + position: absolute; +} +.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow { + border-bottom: 6px solid #444; + top: -6px; +} +.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow { + border-top: 6px solid #444; + bottom: -6px; +} +.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor { + display: block; +} +.ql-bubble .ql-tooltip.ql-editing .ql-formats { + visibility: hidden; +} +.ql-bubble .ql-tooltip-editor { + display: none; +} +.ql-bubble .ql-tooltip-editor input[type=text] { + background: transparent; + border: none; + color: #fff; + font-size: 13px; + height: 100%; + outline: none; + padding: 10px 20px; + position: absolute; + width: 100%; +} +.ql-bubble .ql-tooltip-editor a { + top: 10px; + position: absolute; + right: 20px; +} +.ql-bubble .ql-tooltip-editor a:before { + color: #ccc; + content: "\\D7"; + font-size: 16px; + font-weight: bold; +} +.ql-container.ql-bubble:not(.ql-disabled) a { + position: relative; + white-space: nowrap; +} +.ql-container.ql-bubble:not(.ql-disabled) a::before { + background-color: #444; + border-radius: 15px; + top: -5px; + font-size: 12px; + color: #fff; + content: attr(href); + font-weight: normal; + overflow: hidden; + padding: 5px 15px; + text-decoration: none; + z-index: 1; +} +.ql-container.ql-bubble:not(.ql-disabled) a::after { + border-top: 6px solid #444; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + top: 0; + content: " "; + height: 0; + width: 0; +} +.ql-container.ql-bubble:not(.ql-disabled) a::before, +.ql-container.ql-bubble:not(.ql-disabled) a::after { + left: 0; + margin-left: 50%; + position: absolute; + transform: translate(-50%, -100%); + transition: visibility 0s ease 200ms; + visibility: hidden; +} +.ql-container.ql-bubble:not(.ql-disabled) a:hover::before, +.ql-container.ql-bubble:not(.ql-disabled) a:hover::after { + visibility: visible; +} +`, "",{"version":3,"sources":["webpack://./src/ui/compontents/translationEditor/quill.bubble.css"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF;EACE,sBAAsB;EACtB,YAAY;EACZ,WAAW;EACX,kBAAkB;AACpB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,WAAW;EACX,kBAAkB;EAClB,kBAAkB;EAClB,QAAQ;AACV;AACA;EACE,SAAS;EACT,UAAU;AACZ;AACA;EACE,sBAAsB;EACtB,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,WAAW;EACX,gBAAgB;EAChB,gBAAgB;EAChB,qBAAqB;EACrB,qBAAqB;AACvB;AACA;EACE,YAAY;AACd;AACA;;;;;;;;;;;EAWE,SAAS;EACT,UAAU;EACV,6EAA6E;AAC/E;AACA;;EAEE,yBAAyB;AAC3B;AACA;;EAEE,qBAAqB;AACvB;AACA;EACE,gBAAgB;AAClB;AACA;;EAEE,oBAAoB;AACtB;AACA;;EAEE,mBAAmB;AACrB;AACA;;EAEE,WAAW;EACX,eAAe;EACf,mBAAmB;AACrB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,qBAAqB;EACrB,mBAAmB;EACnB,YAAY;AACd;AACA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,oBAAoB;AACtB;AACA;;EAEE,mBAAmB;AACrB;AACA;;EAEE,oBAAoB;AACtB;AACA;EACE,6EAA6E;EAC7E,yBAAyB;AAC3B;AACA;EACE,sCAAsC;AACxC;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,0CAA0C;AAC5C;AACA;EACE,sEAAsE;AACxE;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,0CAA0C;AAC5C;AACA;EACE,+DAA+D;AACjE;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sCAAsC;AACxC;AACA;EACE,wDAAwD;AAC1D;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,0CAA0C;AAC5C;AACA;EACE,iDAAiD;AACnD;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,0CAA0C;AAC5C;AACA;EACE,0CAA0C;AAC5C;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sCAAsC;AACxC;AACA;EACE,mCAAmC;AACrC;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,0CAA0C;AAC5C;AACA;EACE,4BAA4B;AAC9B;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,0CAA0C;AAC5C;AACA;EACE,qBAAqB;AACvB;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sCAAsC;AACxC;AACA;EACE,iBAAiB;AACnB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,oBAAoB;AACtB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;EACd,eAAe;AACjB;AACA;EACE,cAAc;AAChB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sBAAsB;AACxB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,sBAAsB;AACxB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,WAAW;AACb;AACA;EACE,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,WAAW;AACb;AACA;EACE,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,WAAW;AACb;AACA;EACE,4CAA4C;AAC9C;AACA;EACE,2CAA2C;AAC7C;AACA;EACE,iBAAiB;AACnB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,cAAc;EACd,mBAAmB;AACrB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,sBAAsB;EACtB,+BAA+B;EAC/B,kBAAkB;EAClB,UAAU;EACV,oBAAoB;EACpB,kBAAkB;EAClB,WAAW;AACb;AACA;;EAEE,WAAW;EACX,WAAW;EACX,cAAc;AAChB;AACA;;EAEE,gBAAgB;EAChB,YAAY;EACZ,eAAe;EACf,qBAAqB;EACrB,WAAW;EACX,YAAY;EACZ,gBAAgB;EAChB,WAAW;AACb;AACA;;EAEE,WAAW;EACX,YAAY;AACd;AACA;;EAEE,aAAa;AACf;AACA;;EAEE,aAAa;AACf;AACA;;;;;;;;;;;;;;EAcE,WAAW;AACb;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BE,UAAU;AACZ;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BE,YAAY;AACd;AACA;EACE;;IAEE,WAAW;EACb;EACA;;;;IAIE,UAAU;EACZ;EACA;;;;IAIE,YAAY;EACd;AACF;AACA;EACE,sBAAsB;AACxB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,aAAa;AACf;AACA;;EAEE,kBAAkB;AACpB;AACA;EACE,UAAU;EACV,kBAAkB;EAClB,2BAA2B;AAC7B;AACA;EACE,eAAe;EACf,qBAAqB;AACvB;AACA;EACE,4BAA4B;AAC9B;AACA;EACE,qBAAqB;EACrB,sBAAsB;AACxB;AACA;EACE,WAAW;EACX,WAAW;EACX,cAAc;AAChB;AACA;EACE,UAAU;EACV,YAAY;EACZ,qBAAqB;EACrB,sBAAsB;EACtB,eAAe;AACjB;AACA;EACE,UAAU;EACV,YAAY;EACZ,qBAAqB;EACrB,eAAe;AACjB;AACA;;EAEE,UAAU;AACZ;AACA;EACE,UAAU;AACZ;AACA;EACE,kBAAkB;AACpB;AACA;;EAEE,eAAe;AACjB;AACA;EACE,YAAY;AACd;AACA;EACE,aAAa;AACf;AACA;EACE,eAAe;AACjB;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,cAAc;AAChB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,0BAA0B;AAC5B;AACA;EACE,2BAA2B;EAC3B,kBAAkB;EAClB,eAAe;EACf,kBAAkB;AACpB;AACA;;EAEE,yBAAyB;EACzB,kBAAkB;AACpB;AACA;EACE,qBAAqB;EACrB,kBAAkB;EAClB,eAAe;EACf,iBAAiB;AACnB;AACA;EACE,cAAc;EACd,gBAAgB;AAClB;AACA;EACE,yBAAyB;EACzB,cAAc;EACd,iBAAiB;AACnB;AACA;EACE,eAAe;AACjB;AACA;EACE,WAAW;EACX,qBAAqB;EACrB,WAAW;EACX,eAAe;EACf,gBAAgB;EAChB,YAAY;EACZ,kBAAkB;EAClB,sBAAsB;AACxB;AACA;EACE,eAAe;EACf,qBAAqB;EACrB,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;EAClB,kBAAkB;EAClB,WAAW;AACb;AACA;EACE,qBAAqB;EACrB,iBAAiB;AACnB;AACA;EACE,sBAAsB;EACtB,aAAa;EACb,eAAe;EACf,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;AACrB;AACA;EACE,eAAe;EACf,cAAc;EACd,mBAAmB;EACnB,gBAAgB;AAClB;AACA;EACE,WAAW;EACX,UAAU;AACZ;AACA;EACE,UAAU;AACZ;AACA;EACE,YAAY;AACd;AACA;EACE,cAAc;EACd,gBAAgB;EAChB,SAAS;EACT,UAAU;AACZ;AACA;;EAEE,WAAW;AACb;AACA;;EAEE,gBAAgB;AAClB;AACA;;EAEE,UAAU;AACZ;AACA;EACE,gBAAgB;AAClB;AACA;EACE,YAAY;EACZ,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,gBAAgB;EAChB,YAAY;AACd;AACA;EACE,6BAA6B;EAC7B,WAAW;EACX,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,gBAAgB;EAChB,QAAQ;EACR,QAAQ;EACR,WAAW;AACb;AACA;;;;;;EAME,yBAAyB;AAC3B;AACA;EACE,WAAW;AACb;AACA;;EAEE,iBAAiB;AACnB;AACA;;EAEE,oBAAoB;AACtB;AACA;;EAEE,oBAAoB;AACtB;AACA;;EAEE,oBAAoB;AACtB;AACA;;EAEE,oBAAoB;AACtB;AACA;;EAEE,oBAAoB;AACtB;AACA;;EAEE,oBAAoB;AACtB;AACA;EACE,cAAc;AAChB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,cAAc;AAChB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,YAAY;AACd;AACA;;EAEE,qBAAqB;AACvB;AACA;;EAEE,gBAAgB;AAClB;AACA;;EAEE,oBAAoB;AACtB;AACA;EACE,4CAA4C;AAC9C;AACA;EACE,2CAA2C;AAC7C;AACA;EACE,WAAW;AACb;AACA;;EAEE,iBAAiB;AACnB;AACA;;EAEE,gBAAgB;AAClB;AACA;;EAEE,gBAAgB;AAClB;AACA;;EAEE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;AACjB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,sBAAsB;AACxB;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,iBAAiB;AACnB;AACA;EACE,WAAW;AACb;AACA;;EAEE,kBAAkB;AACpB;AACA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,WAAW;AACb;AACA;EACE,kCAAkC;EAClC,mCAAmC;EACnC,YAAY;EACZ,cAAc;EACd,SAAS;EACT,iBAAiB;EACjB,kBAAkB;AACpB;AACA;EACE,6BAA6B;EAC7B,SAAS;AACX;AACA;EACE,0BAA0B;EAC1B,YAAY;AACd;AACA;EACE,cAAc;AAChB;AACA;EACE,kBAAkB;AACpB;AACA;EACE,aAAa;AACf;AACA;EACE,uBAAuB;EACvB,YAAY;EACZ,WAAW;EACX,eAAe;EACf,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,kBAAkB;EAClB,WAAW;AACb;AACA;EACE,SAAS;EACT,kBAAkB;EAClB,WAAW;AACb;AACA;EACE,WAAW;EACX,cAAc;EACd,eAAe;EACf,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,mBAAmB;AACrB;AACA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,SAAS;EACT,eAAe;EACf,WAAW;EACX,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,iBAAiB;EACjB,qBAAqB;EACrB,UAAU;AACZ;AACA;EACE,0BAA0B;EAC1B,kCAAkC;EAClC,mCAAmC;EACnC,MAAM;EACN,YAAY;EACZ,SAAS;EACT,QAAQ;AACV;AACA;;EAEE,OAAO;EACP,gBAAgB;EAChB,kBAAkB;EAClB,iCAAiC;EACjC,oCAAoC;EACpC,kBAAkB;AACpB;AACA;;EAEE,mBAAmB;AACrB","sourcesContent":["/*!\n * Quill Editor v1.3.7\n * https://quilljs.com/\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container {\n box-sizing: border-box;\n height: 100%;\n margin: 0px;\n position: relative;\n}\n.ql-container.ql-disabled .ql-tooltip {\n visibility: hidden;\n}\n.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before {\n pointer-events: none;\n}\n.ql-clipboard {\n left: -100000px;\n height: 1px;\n overflow-y: hidden;\n position: absolute;\n top: 50%;\n}\n.ql-clipboard p {\n margin: 0;\n padding: 0;\n}\n.ql-editor {\n box-sizing: border-box;\n height: 100%;\n outline: none;\n overflow-y: auto;\n tab-size: 4;\n -moz-tab-size: 4;\n text-align: left;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n.ql-editor > * {\n cursor: text;\n}\n.ql-editor p,\n.ql-editor ol,\n.ql-editor ul,\n.ql-editor pre,\n.ql-editor blockquote,\n.ql-editor h1,\n.ql-editor h2,\n.ql-editor h3,\n.ql-editor h4,\n.ql-editor h5,\n.ql-editor h6 {\n margin: 0;\n padding: 0;\n counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol,\n.ql-editor ul {\n /* padding-left: 1.5em; */\n}\n.ql-editor ol > li,\n.ql-editor ul > li {\n list-style-type: none;\n}\n.ql-editor ul > li::before {\n content: '\\2022';\n}\n.ql-editor ul[data-checked=true],\n.ql-editor ul[data-checked=false] {\n pointer-events: none;\n}\n.ql-editor ul[data-checked=true] > li *,\n.ql-editor ul[data-checked=false] > li * {\n pointer-events: all;\n}\n.ql-editor ul[data-checked=true] > li::before,\n.ql-editor ul[data-checked=false] > li::before {\n color: #777;\n cursor: pointer;\n pointer-events: all;\n}\n.ql-editor ul[data-checked=true] > li::before {\n content: '\\2611';\n}\n.ql-editor ul[data-checked=false] > li::before {\n content: '\\2610';\n}\n.ql-editor li::before {\n display: inline-block;\n white-space: nowrap;\n width: 1.2em;\n}\n.ql-editor li:not(.ql-direction-rtl)::before {\n margin-left: -1.5em;\n margin-right: 0.3em;\n text-align: right;\n}\n.ql-editor li.ql-direction-rtl::before {\n margin-left: 0.3em;\n margin-right: -1.5em;\n}\n.ql-editor ol li:not(.ql-direction-rtl),\n.ql-editor ul li:not(.ql-direction-rtl) {\n padding-left: 1.5em;\n}\n.ql-editor ol li.ql-direction-rtl,\n.ql-editor ul li.ql-direction-rtl {\n padding-right: 1.5em;\n}\n.ql-editor ol li {\n counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n counter-increment: list-0;\n}\n.ql-editor ol li:before {\n content: counter(list-0, decimal) '. ';\n}\n.ql-editor ol li.ql-indent-1 {\n counter-increment: list-1;\n}\n.ql-editor ol li.ql-indent-1:before {\n content: counter(list-1, lower-alpha) '. ';\n}\n.ql-editor ol li.ql-indent-1 {\n counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-2 {\n counter-increment: list-2;\n}\n.ql-editor ol li.ql-indent-2:before {\n content: counter(list-2, lower-roman) '. ';\n}\n.ql-editor ol li.ql-indent-2 {\n counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-3 {\n counter-increment: list-3;\n}\n.ql-editor ol li.ql-indent-3:before {\n content: counter(list-3, decimal) '. ';\n}\n.ql-editor ol li.ql-indent-3 {\n counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-4 {\n counter-increment: list-4;\n}\n.ql-editor ol li.ql-indent-4:before {\n content: counter(list-4, lower-alpha) '. ';\n}\n.ql-editor ol li.ql-indent-4 {\n counter-reset: list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-5 {\n counter-increment: list-5;\n}\n.ql-editor ol li.ql-indent-5:before {\n content: counter(list-5, lower-roman) '. ';\n}\n.ql-editor ol li.ql-indent-5 {\n counter-reset: list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-6 {\n counter-increment: list-6;\n}\n.ql-editor ol li.ql-indent-6:before {\n content: counter(list-6, decimal) '. ';\n}\n.ql-editor ol li.ql-indent-6 {\n counter-reset: list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-7 {\n counter-increment: list-7;\n}\n.ql-editor ol li.ql-indent-7:before {\n content: counter(list-7, lower-alpha) '. ';\n}\n.ql-editor ol li.ql-indent-7 {\n counter-reset: list-8 list-9;\n}\n.ql-editor ol li.ql-indent-8 {\n counter-increment: list-8;\n}\n.ql-editor ol li.ql-indent-8:before {\n content: counter(list-8, lower-roman) '. ';\n}\n.ql-editor ol li.ql-indent-8 {\n counter-reset: list-9;\n}\n.ql-editor ol li.ql-indent-9 {\n counter-increment: list-9;\n}\n.ql-editor ol li.ql-indent-9:before {\n content: counter(list-9, decimal) '. ';\n}\n.ql-editor .ql-indent-1:not(.ql-direction-rtl) {\n padding-left: 3em;\n}\n.ql-editor li.ql-indent-1:not(.ql-direction-rtl) {\n padding-left: 4.5em;\n}\n.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {\n padding-right: 3em;\n}\n.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {\n padding-right: 4.5em;\n}\n.ql-editor .ql-indent-2:not(.ql-direction-rtl) {\n padding-left: 6em;\n}\n.ql-editor li.ql-indent-2:not(.ql-direction-rtl) {\n padding-left: 7.5em;\n}\n.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {\n padding-right: 6em;\n}\n.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {\n padding-right: 7.5em;\n}\n.ql-editor .ql-indent-3:not(.ql-direction-rtl) {\n padding-left: 9em;\n}\n.ql-editor li.ql-indent-3:not(.ql-direction-rtl) {\n padding-left: 10.5em;\n}\n.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {\n padding-right: 9em;\n}\n.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {\n padding-right: 10.5em;\n}\n.ql-editor .ql-indent-4:not(.ql-direction-rtl) {\n padding-left: 12em;\n}\n.ql-editor li.ql-indent-4:not(.ql-direction-rtl) {\n padding-left: 13.5em;\n}\n.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {\n padding-right: 12em;\n}\n.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {\n padding-right: 13.5em;\n}\n.ql-editor .ql-indent-5:not(.ql-direction-rtl) {\n padding-left: 15em;\n}\n.ql-editor li.ql-indent-5:not(.ql-direction-rtl) {\n padding-left: 16.5em;\n}\n.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {\n padding-right: 15em;\n}\n.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {\n padding-right: 16.5em;\n}\n.ql-editor .ql-indent-6:not(.ql-direction-rtl) {\n padding-left: 18em;\n}\n.ql-editor li.ql-indent-6:not(.ql-direction-rtl) {\n padding-left: 19.5em;\n}\n.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {\n padding-right: 18em;\n}\n.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {\n padding-right: 19.5em;\n}\n.ql-editor .ql-indent-7:not(.ql-direction-rtl) {\n padding-left: 21em;\n}\n.ql-editor li.ql-indent-7:not(.ql-direction-rtl) {\n padding-left: 22.5em;\n}\n.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {\n padding-right: 21em;\n}\n.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {\n padding-right: 22.5em;\n}\n.ql-editor .ql-indent-8:not(.ql-direction-rtl) {\n padding-left: 24em;\n}\n.ql-editor li.ql-indent-8:not(.ql-direction-rtl) {\n padding-left: 25.5em;\n}\n.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {\n padding-right: 24em;\n}\n.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {\n padding-right: 25.5em;\n}\n.ql-editor .ql-indent-9:not(.ql-direction-rtl) {\n padding-left: 27em;\n}\n.ql-editor li.ql-indent-9:not(.ql-direction-rtl) {\n padding-left: 28.5em;\n}\n.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {\n padding-right: 27em;\n}\n.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {\n padding-right: 28.5em;\n}\n.ql-editor .ql-video {\n display: block;\n max-width: 100%;\n}\n.ql-editor .ql-video.ql-align-center {\n margin: 0 auto;\n}\n.ql-editor .ql-video.ql-align-right {\n margin: 0 0 0 auto;\n}\n.ql-editor .ql-bg-black {\n background-color: #000;\n}\n.ql-editor .ql-bg-red {\n background-color: #e60000;\n}\n.ql-editor .ql-bg-orange {\n background-color: #f90;\n}\n.ql-editor .ql-bg-yellow {\n background-color: #ff0;\n}\n.ql-editor .ql-bg-green {\n background-color: #008a00;\n}\n.ql-editor .ql-bg-blue {\n background-color: #06c;\n}\n.ql-editor .ql-bg-purple {\n background-color: #93f;\n}\n.ql-editor .ql-color-white {\n color: #fff;\n}\n.ql-editor .ql-color-red {\n color: #e60000;\n}\n.ql-editor .ql-color-orange {\n color: #f90;\n}\n.ql-editor .ql-color-yellow {\n color: #ff0;\n}\n.ql-editor .ql-color-green {\n color: #008a00;\n}\n.ql-editor .ql-color-blue {\n color: #06c;\n}\n.ql-editor .ql-color-purple {\n color: #93f;\n}\n.ql-editor .ql-font-serif {\n font-family: Georgia, Times New Roman, serif;\n}\n.ql-editor .ql-font-monospace {\n font-family: Monaco, Courier New, monospace;\n}\n.ql-editor .ql-size-small {\n font-size: 0.75em;\n}\n.ql-editor .ql-size-large {\n font-size: 1.5em;\n}\n.ql-editor .ql-size-huge {\n font-size: 2.5em;\n}\n.ql-editor .ql-direction-rtl {\n direction: rtl;\n text-align: inherit;\n}\n.ql-editor .ql-align-center {\n text-align: center;\n}\n.ql-editor .ql-align-justify {\n text-align: justify;\n}\n.ql-editor .ql-align-right {\n text-align: right;\n}\n.ql-editor.ql-blank::before {\n color: rgba(0,0,0,0.6);\n content: attr(data-placeholder);\n font-style: italic;\n left: 15px;\n pointer-events: none;\n position: absolute;\n right: 15px;\n}\n.ql-bubble.ql-toolbar:after,\n.ql-bubble .ql-toolbar:after {\n clear: both;\n content: '';\n display: table;\n}\n.ql-bubble.ql-toolbar button,\n.ql-bubble .ql-toolbar button {\n background: none;\n border: none;\n cursor: pointer;\n display: inline-block;\n float: left;\n height: 24px;\n padding: 3px 5px;\n width: 28px;\n}\n.ql-bubble.ql-toolbar button svg,\n.ql-bubble .ql-toolbar button svg {\n float: left;\n height: 100%;\n}\n.ql-bubble.ql-toolbar button:active:hover,\n.ql-bubble .ql-toolbar button:active:hover {\n outline: none;\n}\n.ql-bubble.ql-toolbar input.ql-image[type=file],\n.ql-bubble .ql-toolbar input.ql-image[type=file] {\n display: none;\n}\n.ql-bubble.ql-toolbar button:hover,\n.ql-bubble .ql-toolbar button:hover,\n.ql-bubble.ql-toolbar button:focus,\n.ql-bubble .ql-toolbar button:focus,\n.ql-bubble.ql-toolbar button.ql-active,\n.ql-bubble .ql-toolbar button.ql-active,\n.ql-bubble.ql-toolbar .ql-picker-label:hover,\n.ql-bubble .ql-toolbar .ql-picker-label:hover,\n.ql-bubble.ql-toolbar .ql-picker-label.ql-active,\n.ql-bubble .ql-toolbar .ql-picker-label.ql-active,\n.ql-bubble.ql-toolbar .ql-picker-item:hover,\n.ql-bubble .ql-toolbar .ql-picker-item:hover,\n.ql-bubble.ql-toolbar .ql-picker-item.ql-selected,\n.ql-bubble .ql-toolbar .ql-picker-item.ql-selected {\n color: #fff;\n}\n.ql-bubble.ql-toolbar button:hover .ql-fill,\n.ql-bubble .ql-toolbar button:hover .ql-fill,\n.ql-bubble.ql-toolbar button:focus .ql-fill,\n.ql-bubble .ql-toolbar button:focus .ql-fill,\n.ql-bubble.ql-toolbar button.ql-active .ql-fill,\n.ql-bubble .ql-toolbar button.ql-active .ql-fill,\n.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill,\n.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill,\n.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill,\n.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill,\n.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill,\n.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill,\n.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill,\n.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill,\n.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill,\n.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill,\n.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill,\n.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill,\n.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill,\n.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill,\n.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,\n.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,\n.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,\n.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,\n.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,\n.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,\n.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,\n.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill {\n fill: #fff;\n}\n.ql-bubble.ql-toolbar button:hover .ql-stroke,\n.ql-bubble .ql-toolbar button:hover .ql-stroke,\n.ql-bubble.ql-toolbar button:focus .ql-stroke,\n.ql-bubble .ql-toolbar button:focus .ql-stroke,\n.ql-bubble.ql-toolbar button.ql-active .ql-stroke,\n.ql-bubble .ql-toolbar button.ql-active .ql-stroke,\n.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke,\n.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke,\n.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke,\n.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke,\n.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke,\n.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke,\n.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,\n.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,\n.ql-bubble.ql-toolbar button:hover .ql-stroke-miter,\n.ql-bubble .ql-toolbar button:hover .ql-stroke-miter,\n.ql-bubble.ql-toolbar button:focus .ql-stroke-miter,\n.ql-bubble .ql-toolbar button:focus .ql-stroke-miter,\n.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter,\n.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter,\n.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,\n.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,\n.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,\n.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,\n.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,\n.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,\n.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,\n.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter {\n stroke: #fff;\n}\n@media (pointer: coarse) {\n .ql-bubble.ql-toolbar button:hover:not(.ql-active),\n .ql-bubble .ql-toolbar button:hover:not(.ql-active) {\n color: #ccc;\n }\n .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill,\n .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill,\n .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,\n .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill {\n fill: #ccc;\n }\n .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke,\n .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke,\n .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,\n .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter {\n stroke: #ccc;\n }\n}\n.ql-bubble {\n box-sizing: border-box;\n}\n.ql-bubble * {\n box-sizing: border-box;\n}\n.ql-bubble .ql-hidden {\n display: none;\n}\n.ql-bubble .ql-out-bottom,\n.ql-bubble .ql-out-top {\n visibility: hidden;\n}\n.ql-bubble .ql-tooltip {\n z-index: 1;\n position: absolute;\n transform: translateY(10px);\n}\n.ql-bubble .ql-tooltip a {\n cursor: pointer;\n text-decoration: none;\n}\n.ql-bubble .ql-tooltip.ql-flip {\n transform: translateY(-10px);\n}\n.ql-bubble .ql-formats {\n display: inline-block;\n vertical-align: middle;\n}\n.ql-bubble .ql-formats:after {\n clear: both;\n content: '';\n display: table;\n}\n.ql-bubble .ql-stroke {\n fill: none;\n stroke: #ccc;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 2;\n}\n.ql-bubble .ql-stroke-miter {\n fill: none;\n stroke: #ccc;\n stroke-miterlimit: 10;\n stroke-width: 2;\n}\n.ql-bubble .ql-fill,\n.ql-bubble .ql-stroke.ql-fill {\n fill: #ccc;\n}\n.ql-bubble .ql-empty {\n fill: none;\n}\n.ql-bubble .ql-even {\n fill-rule: evenodd;\n}\n.ql-bubble .ql-thin,\n.ql-bubble .ql-stroke.ql-thin {\n stroke-width: 1;\n}\n.ql-bubble .ql-transparent {\n opacity: 0.4;\n}\n.ql-bubble .ql-direction svg:last-child {\n display: none;\n}\n.ql-bubble .ql-direction.ql-active svg:last-child {\n display: inline;\n}\n.ql-bubble .ql-direction.ql-active svg:first-child {\n display: none;\n}\n.ql-bubble .ql-editor h1 {\n font-size: 2em;\n}\n.ql-bubble .ql-editor h2 {\n font-size: 1.5em;\n}\n.ql-bubble .ql-editor h3 {\n font-size: 1.17em;\n}\n.ql-bubble .ql-editor h4 {\n font-size: 1em;\n}\n.ql-bubble .ql-editor h5 {\n font-size: 0.83em;\n}\n.ql-bubble .ql-editor h6 {\n font-size: 0.67em;\n}\n.ql-bubble .ql-editor a {\n text-decoration: underline;\n}\n.ql-bubble .ql-editor blockquote {\n border-left: 4px solid #ccc;\n margin-bottom: 5px;\n margin-top: 5px;\n padding-left: 16px;\n}\n.ql-bubble .ql-editor code,\n.ql-bubble .ql-editor pre {\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n.ql-bubble .ql-editor pre {\n white-space: pre-wrap;\n margin-bottom: 5px;\n margin-top: 5px;\n padding: 5px 10px;\n}\n.ql-bubble .ql-editor code {\n font-size: 85%;\n padding: 2px 4px;\n}\n.ql-bubble .ql-editor pre.ql-syntax {\n background-color: #23241f;\n color: #f8f8f2;\n overflow: visible;\n}\n.ql-bubble .ql-editor img {\n max-width: 100%;\n}\n.ql-bubble .ql-picker {\n color: #ccc;\n display: inline-block;\n float: left;\n font-size: 14px;\n font-weight: 500;\n height: 24px;\n position: relative;\n vertical-align: middle;\n}\n.ql-bubble .ql-picker-label {\n cursor: pointer;\n display: inline-block;\n height: 100%;\n padding-left: 8px;\n padding-right: 2px;\n position: relative;\n width: 100%;\n}\n.ql-bubble .ql-picker-label::before {\n display: inline-block;\n line-height: 22px;\n}\n.ql-bubble .ql-picker-options {\n background-color: #444;\n display: none;\n min-width: 100%;\n padding: 4px 8px;\n position: absolute;\n white-space: nowrap;\n}\n.ql-bubble .ql-picker-options .ql-picker-item {\n cursor: pointer;\n display: block;\n padding-bottom: 5px;\n padding-top: 5px;\n}\n.ql-bubble .ql-picker.ql-expanded .ql-picker-label {\n color: #777;\n z-index: 2;\n}\n.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill {\n fill: #777;\n}\n.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke {\n stroke: #777;\n}\n.ql-bubble .ql-picker.ql-expanded .ql-picker-options {\n display: block;\n margin-top: -1px;\n top: 100%;\n z-index: 1;\n}\n.ql-bubble .ql-color-picker,\n.ql-bubble .ql-icon-picker {\n width: 28px;\n}\n.ql-bubble .ql-color-picker .ql-picker-label,\n.ql-bubble .ql-icon-picker .ql-picker-label {\n padding: 2px 4px;\n}\n.ql-bubble .ql-color-picker .ql-picker-label svg,\n.ql-bubble .ql-icon-picker .ql-picker-label svg {\n right: 4px;\n}\n.ql-bubble .ql-icon-picker .ql-picker-options {\n padding: 4px 0px;\n}\n.ql-bubble .ql-icon-picker .ql-picker-item {\n height: 24px;\n width: 24px;\n padding: 2px 4px;\n}\n.ql-bubble .ql-color-picker .ql-picker-options {\n padding: 3px 5px;\n width: 152px;\n}\n.ql-bubble .ql-color-picker .ql-picker-item {\n border: 1px solid transparent;\n float: left;\n height: 16px;\n margin: 2px;\n padding: 0px;\n width: 16px;\n}\n.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg {\n position: absolute;\n margin-top: -9px;\n right: 0;\n top: 50%;\n width: 18px;\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,\n.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,\n.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,\n.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,\n.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before {\n content: attr(data-label);\n}\n.ql-bubble .ql-picker.ql-header {\n width: 98px;\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-label::before,\n.ql-bubble .ql-picker.ql-header .ql-picker-item::before {\n content: 'Normal';\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before {\n content: 'Heading 1';\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before {\n content: 'Heading 2';\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before {\n content: 'Heading 3';\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before {\n content: 'Heading 4';\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before {\n content: 'Heading 5';\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before {\n content: 'Heading 6';\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before {\n font-size: 2em;\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before {\n font-size: 1.5em;\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before {\n font-size: 1.17em;\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before {\n font-size: 1em;\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before {\n font-size: 0.83em;\n}\n.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before {\n font-size: 0.67em;\n}\n.ql-bubble .ql-picker.ql-font {\n width: 108px;\n}\n.ql-bubble .ql-picker.ql-font .ql-picker-label::before,\n.ql-bubble .ql-picker.ql-font .ql-picker-item::before {\n content: 'Sans Serif';\n}\n.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,\n.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before {\n content: 'Serif';\n}\n.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,\n.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before {\n content: 'Monospace';\n}\n.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before {\n font-family: Georgia, Times New Roman, serif;\n}\n.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before {\n font-family: Monaco, Courier New, monospace;\n}\n.ql-bubble .ql-picker.ql-size {\n width: 98px;\n}\n.ql-bubble .ql-picker.ql-size .ql-picker-label::before,\n.ql-bubble .ql-picker.ql-size .ql-picker-item::before {\n content: 'Normal';\n}\n.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before,\n.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before {\n content: 'Small';\n}\n.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before,\n.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before {\n content: 'Large';\n}\n.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,\n.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before {\n content: 'Huge';\n}\n.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before {\n font-size: 10px;\n}\n.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before {\n font-size: 18px;\n}\n.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before {\n font-size: 32px;\n}\n.ql-bubble .ql-color-picker.ql-background .ql-picker-item {\n background-color: #fff;\n}\n.ql-bubble .ql-color-picker.ql-color .ql-picker-item {\n background-color: #000;\n}\n.ql-bubble .ql-toolbar .ql-formats {\n margin: 8px 12px 8px 0px;\n}\n.ql-bubble .ql-toolbar .ql-formats:first-child {\n margin-left: 12px;\n}\n.ql-bubble .ql-color-picker svg {\n margin: 1px;\n}\n.ql-bubble .ql-color-picker .ql-picker-item.ql-selected,\n.ql-bubble .ql-color-picker .ql-picker-item:hover {\n border-color: #fff;\n}\n.ql-bubble .ql-tooltip {\n background-color: #444;\n border-radius: 25px;\n color: #fff;\n}\n.ql-bubble .ql-tooltip-arrow {\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n content: \" \";\n display: block;\n left: 50%;\n margin-left: -6px;\n position: absolute;\n}\n.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow {\n border-bottom: 6px solid #444;\n top: -6px;\n}\n.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow {\n border-top: 6px solid #444;\n bottom: -6px;\n}\n.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor {\n display: block;\n}\n.ql-bubble .ql-tooltip.ql-editing .ql-formats {\n visibility: hidden;\n}\n.ql-bubble .ql-tooltip-editor {\n display: none;\n}\n.ql-bubble .ql-tooltip-editor input[type=text] {\n background: transparent;\n border: none;\n color: #fff;\n font-size: 13px;\n height: 100%;\n outline: none;\n padding: 10px 20px;\n position: absolute;\n width: 100%;\n}\n.ql-bubble .ql-tooltip-editor a {\n top: 10px;\n position: absolute;\n right: 20px;\n}\n.ql-bubble .ql-tooltip-editor a:before {\n color: #ccc;\n content: \"\\D7\";\n font-size: 16px;\n font-weight: bold;\n}\n.ql-container.ql-bubble:not(.ql-disabled) a {\n position: relative;\n white-space: nowrap;\n}\n.ql-container.ql-bubble:not(.ql-disabled) a::before {\n background-color: #444;\n border-radius: 15px;\n top: -5px;\n font-size: 12px;\n color: #fff;\n content: attr(href);\n font-weight: normal;\n overflow: hidden;\n padding: 5px 15px;\n text-decoration: none;\n z-index: 1;\n}\n.ql-container.ql-bubble:not(.ql-disabled) a::after {\n border-top: 6px solid #444;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n top: 0;\n content: \" \";\n height: 0;\n width: 0;\n}\n.ql-container.ql-bubble:not(.ql-disabled) a::before,\n.ql-container.ql-bubble:not(.ql-disabled) a::after {\n left: 0;\n margin-left: 50%;\n position: absolute;\n transform: translate(-50%, -100%);\n transition: visibility 0s ease 200ms;\n visibility: hidden;\n}\n.ql-container.ql-bubble:not(.ql-disabled) a:hover::before,\n.ql-container.ql-bubble:not(.ql-disabled) a:hover::after {\n visibility: visible;\n}\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/tabbar.css": +/*!*****************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/tabbar.css ***! + \*****************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` +.tabHeader { + padding-left: 16px; + padding: 0 8px; + display: flex; + align-items: center; + flex-shrink: 0; + height: 40px; +} + +.tab { + cursor: default; + font-weight: 500; + padding-left: 8px; + padding-right: 8px; + display: flex; + align-items: center; + flex-shrink: 0; + height: 40px; + color: var(--figma-color-text-secondary); +} + +.tab:hover { + color: var(--figma-color-text-hover); +} + +.tab.active { + color: var(--figma-color-text); +} + + + `, "",{"version":3,"sources":["webpack://./src/ui/tabbar.css"],"names":[],"mappings":";AACA;EACE,kBAAkB;EAClB,cAAc;EACd,aAAa;EACb,mBAAmB;EACnB,cAAc;EACd,YAAY;AACd;;AAEA;EACE,eAAe;EACf,gBAAgB;EAChB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,cAAc;EACd,YAAY;EACZ,wCAAwC;AAC1C;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,8BAA8B;AAChC","sourcesContent":["\n.tabHeader {\n padding-left: 16px;\n padding: 0 8px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 40px;\n}\n\n.tab {\n cursor: default;\n font-weight: 500;\n padding-left: 8px;\n padding-right: 8px;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 40px;\n color: var(--figma-color-text-secondary);\n}\n\n.tab:hover {\n color: var(--figma-color-text-hover);\n}\n\n.tab.active {\n color: var(--figma-color-text);\n}\n\n \n "],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/ui.css": +/*!*************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/ui.css ***! + \*************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` + +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, input, select, button, textarea { + font: inherit; +} + + +body { + + margin: 0px; + /* Body — 11 Regular */ + + font-family: Inter,sans-serif; + font-style: normal; + font-weight: 400; + font-size: 11px; + line-height: 14px; + /* identical to box height, or 117% */ + + letter-spacing: 0.01em; + + /* OnColor/Surfaces/OnSurface */ + background-color: var(--figma-color-bg); + color: var(--figma-color-text); +} + +.windowmanager-bottomSheet { + height: calc(100% - var(--resize-detection-overlap)) !important; +} + +.windowmanager-bottomSheet .toolbar-resize-handle { + cursor: ns-resize +} + +.window-control { + align-self: center; + justify-self: flex-end; + margin-left: auto; + margin-right: 7px; +} + +.window-control:hover { + align-self: center; + justify-self: flex-end; + margin-left: auto; +} + +.window-control .segmented-control-segment:hover { + background-color: var(--figma-color-bg-hover); +} + + +.window-control .segmented-control-segment.selected { + box-shadow: inset 0 0 0 1px transparent; + background-color: transparent; +} + + +.window-control .segmented-control-segment.selected .svg-container { + background-color: var(--figma-color-icon); +} + +.window-control .segmented-control-segment .svg-container { + background-color: var(--figma-color-text-disabled); +} + +.key-frame { + display: inline-block; + right: 120px; + position: absolute; +} + +.language-options.selected { + filter: none; +} + +.key-table-text-node { + height: 32px; + padding-left: 24px; +} + +.key-table-key { + font-family: monospace; + font-size: 11px; + font-weight: 400; + letter-spacing: 0.055px; + line-height: 16px; + padding-left: 0px; +} + +.figma-text { + width: calc(100% - 80px); + font-family: Inter, sans-serif; + font-size: 11px; + font-weight: 400; + letter-spacing: 0.055px; + line-height: 16px; + padding-top: 8px; +} + +.key-action { + font-size: 12; + text-decoration: underline; + cursor: pointer; + margin-left: 5px; + margin-bottom: 5px; +} + +#main { + height: 100%; + width: 100%; +} + + +#resize-handle.window { + position: fixed; + right: 1px; + bottom: 2px; + cursor: nwse-resize; +} + +#resize-handle.bottomSheet { + position: fixed; + right: 0px; + left: 0px; + top: 0px; + height: 5px; + cursor: ns-resize; +} + +#resize-handle.bottomSheet svg { + visibility: hidden; +} + +#resize-handle { + position: fixed; + cursor: nwse-resize; +} + + +.settings { + right: 0px; + position: absolute; + font-size: 16; + text-decoration: underline; + cursor: pointer; + margin: 5px; + padding-right: 140px; +} + + + #react-page { + height: 100%; + } + + .view.filesetup { + overflow: visible; + height: auto; + } + + .view { + overflow: auto; + + height: calc(100% - 40px); + } + + .element-symbol { + width: 16px; + height: 32px; + } + + + .element-symbol .svg-container.number-sign-svg { + width: 12px; + height: 12px; + } + + + .element-symbol .svg-container.text-sign-svg { + width: 10px; + height: 10px; + } + + .circular-button:hover { + background-color: var(--neutral10) + } + + .circular-button:hover div { + background-color: var(--onneutral10) + } + + + .variable-svg.active { + background-color: red; + } + + .toolbar { + /* border-bottom: 1px solid var(--figma-color-border); */ + flex-direction: row; + display: flex; + } + + .dropdown { + display: flex; + flex-direction: row; + align-items: center; + padding: 0px; + + width: 210px; + height: 30px; + } + + + .frame-actions { + position: absolute; + right: 8px; + top:0px; + display: flex; + flex-direction: row; + } + + + .translations .actions { + position: absolute; + right: 8px; + top:0px; + display: flex; + flex-direction: row; + } + + + .translations td.language { + padding-left: 0px; + width: 52px; + font-weight: 800; + } + + .translation { + white-space: pre-wrap; + } + + + +.circular-button { + background-color: transparent; + margin: 2px; + width: 32px; + height: 32px; + border-radius: 42px; + display: flex; + justify-content: center; + align-items: center; +} + +.circular-button div { + width: 60%; + height: 60%; + background-color: #161616; + mask-size: cover; + -webkit-mask-position-x: 50%; + -webkit-mask-position-y: 50%; + -webkit-mask-repeat-x: no-repeat; + -webkit-mask-repeat-y: no-repeat; + -webkit-mask-size: cover; + mask-position: 50% 50%; + mask-repeat: no-repeat; + mask-size: cover; +} + + +.emptyState { + height: 100%; + display: flex; + flex-direction: column; + text-align: center; + justify-content: center; +} + + +.emptyStateTitle { + font-size: 14px; +} + +.emptyStateSubtitle { + margin-top: 18px; + color: var(--figma-color-text-secondary, #b3b3b3); +} + + + +button.button { + background-color: var(--figma-color-bg); + color: var(--figma-color-text); + border-color: var(--figma-color-border); + border-width: 1px; + padding: 0 12px; + font-size: 11px; + line-height: 16px; + letter-spacing: calc(0.005px + var(--text-tracking-pos, 0) * 11px); + font-weight: 400; + max-width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: flex; + font-family: Inter,sans-serif; + align-items: center; + box-sizing: border-box; + background-clip: border-box; + height: 32px; + max-width: 200px; + flex-shrink: 0; + border-radius: 6px; + cursor: default; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border-style: solid; + margin-left: 10px; +} + +button.button-primary { + font-weight: 500; + background-color: var(--figma-color-bg-brand); + color: var(--figma-color-text-onbrand, #fff); +} + + +button.button-primary-destructive { + font-weight: 500; + background-color: var(--figma-color-bg-danger); + color: var(--figma-color-text-ondanger, #fff); +} + + + +button:disabled { + color: var(--figma-color-text-ondisabled, #fff); + background-color: var(--figma-color-bg-disabled, rgba(0, 0, 0, .3)); + border-color: transparent; +} + +button:focus:not(:disabled), .basic_form--btn--t7Y67:active:not(:disabled) { + +} + +.view.dev-panel { + display: flex; + justify-content: center; + align-items: center; +} + +.comming-soon { + flex: 0 0 150px; + text-align: center; +} + + +#version-outdated.visible { + + + position: absolute; + left:0; + right: 0; + bottom: 0; + top: 0; + z-index: 10000000000; + background-color: rgba(0, 0, 0, 0.6); + display: flex; + justify-content: center; + align-items: center; +} + +#version-outdated.visible div { + flex: 0 0 150px; + text-align: center; + background-color: white; + border: solid 16px white; + border-radius: 5px; +} +#version-outdated.gone { + display: none; +}`, "",{"version":3,"sources":["webpack://./src/ui/ui.css"],"names":[],"mappings":";;AAEA;EACE,aAAa;AACf;;;AAGA;;EAEE,WAAW;EACX,sBAAsB;;EAEtB,6BAA6B;EAC7B,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,iBAAiB;EACjB,qCAAqC;;EAErC,sBAAsB;;EAEtB,+BAA+B;EAC/B,uCAAuC;EACvC,8BAA8B;AAChC;;AAEA;EACE,+DAA+D;AACjE;;AAEA;EACE;AACF;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB,iBAAiB;EACjB,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB,iBAAiB;AACnB;;AAEA;EACE,6CAA6C;AAC/C;;;AAGA;EACE,uCAAuC;EACvC,6BAA6B;AAC/B;;;AAGA;EACE,yCAAyC;AAC3C;;AAEA;EACE,kDAAkD;AACpD;;AAEA;IACI,qBAAqB;IACrB,YAAY;IACZ,kBAAkB;AACtB;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,YAAY;IACZ,kBAAkB;AACtB;;AAEA;IACI,sBAAsB;IACtB,eAAe;IACf,gBAAgB;IAChB,uBAAuB;IACvB,iBAAiB;IACjB,iBAAiB;AACrB;;AAEA;IACI,wBAAwB;IACxB,8BAA8B;IAC9B,eAAe;IACf,gBAAgB;IAChB,uBAAuB;IACvB,iBAAiB;IACjB,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,0BAA0B;IAC1B,eAAe;IACf,gBAAgB;IAChB,kBAAkB;AACtB;;AAEA;IACI,YAAY;IACZ,WAAW;AACf;;;AAGA;EACE,eAAe;EACf,UAAU;EACV,WAAW;EACX,mBAAmB;AACrB;;AAEA;EACE,eAAe;EACf,UAAU;EACV,SAAS;EACT,QAAQ;EACR,WAAW;EACX,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;IACI,eAAe;IACf,mBAAmB;AACvB;;;AAGA;IACI,UAAU;IACV,kBAAkB;IAClB,aAAa;IACb,0BAA0B;IAC1B,eAAe;IACf,WAAW;IACX,oBAAoB;AACxB;;;EAGE;IACE,YAAY;EACd;;EAEA;IACE,iBAAiB;IACjB,YAAY;EACd;;EAEA;IACE,cAAc;;IAEd,yBAAyB;EAC3B;;EAEA;IACE,WAAW;IACX,YAAY;EACd;;;EAGA;IACE,WAAW;IACX,YAAY;EACd;;;EAGA;IACE,WAAW;IACX,YAAY;EACd;;EAEA;IACE;EACF;;EAEA;IACE;EACF;;;EAGA;IACE,qBAAqB;EACvB;;EAEA;IACE,wDAAwD;IACxD,mBAAmB;IACnB,aAAa;EACf;;EAEA;IACE,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,YAAY;;IAEZ,YAAY;IACZ,YAAY;EACd;;;EAGA;IACE,kBAAkB;IAClB,UAAU;IACV,OAAO;IACP,aAAa;IACb,mBAAmB;EACrB;;;EAGA;IACE,kBAAkB;IAClB,UAAU;IACV,OAAO;IACP,aAAa;IACb,mBAAmB;EACrB;;;EAGA;IACE,iBAAiB;IACjB,WAAW;IACX,gBAAgB;EAClB;;EAEA;IACE,qBAAqB;EACvB;;;;AAIF;EACE,6BAA6B;EAC7B,WAAW;EACX,WAAW;EACX,YAAY;EACZ,mBAAmB;EACnB,aAAa;EACb,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;EACE,UAAU;EACV,WAAW;EACX,yBAAyB;EACzB,gBAAgB;EAChB,4BAA4B;EAC5B,4BAA4B;EAC5B,gCAAgC;EAChC,gCAAgC;EAChC,wBAAwB;EACxB,sBAAsB;EACtB,sBAAsB;EACtB,gBAAgB;AAClB;;;AAGA;EACE,YAAY;EACZ,aAAa;EACb,sBAAsB;EACtB,kBAAkB;EAClB,uBAAuB;AACzB;;;AAGA;EACE,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,iDAAiD;AACnD;;;;AAIA;EACE,uCAAuC;EACvC,8BAA8B;EAC9B,uCAAuC;EACvC,iBAAiB;EACjB,eAAe;EACf,eAAe;EACf,iBAAiB;EACjB,kEAAkE;EAClE,gBAAgB;EAChB,eAAe;EACf,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;EACvB,aAAa;EACb,6BAA6B;EAC7B,mBAAmB;EACnB,sBAAsB;EACtB,2BAA2B;EAC3B,YAAY;EACZ,gBAAgB;EAChB,cAAc;EACd,kBAAkB;EAClB,eAAe;EACf,yBAAyB;EACzB,sBAAsB;EACtB,qBAAqB;EACrB,iBAAiB;EACjB,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,gBAAgB;EAChB,6CAA6C;EAC7C,4CAA4C;AAC9C;;;AAGA;EACE,gBAAgB;EAChB,8CAA8C;EAC9C,6CAA6C;AAC/C;;;;AAIA;EACE,+CAA+C;EAC/C,mEAAmE;EACnE,yBAAyB;AAC3B;;AAEA;;AAEA;;AAEA;EACE,aAAa;EACb,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;EACE,eAAe;EACf,kBAAkB;AACpB;;;AAGA;;;EAGE,kBAAkB;EAClB,MAAM;EACN,QAAQ;EACR,SAAS;EACT,MAAM;EACN,oBAAoB;EACpB,oCAAoC;EACpC,aAAa;EACb,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;EACE,eAAe;EACf,kBAAkB;EAClB,uBAAuB;EACvB,wBAAwB;EACxB,kBAAkB;AACpB;AACA;EACE,aAAa;AACf","sourcesContent":["\n\nhtml, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, input, select, button, textarea {\n font: inherit;\n}\n\n\nbody {\n\n margin: 0px;\n /* Body — 11 Regular */\n\n font-family: Inter,sans-serif;\n font-style: normal;\n font-weight: 400;\n font-size: 11px;\n line-height: 14px;\n /* identical to box height, or 117% */\n\n letter-spacing: 0.01em;\n\n /* OnColor/Surfaces/OnSurface */\n background-color: var(--figma-color-bg);\n color: var(--figma-color-text);\n}\n\n.windowmanager-bottomSheet {\n height: calc(100% - var(--resize-detection-overlap)) !important;\n}\n\n.windowmanager-bottomSheet .toolbar-resize-handle {\n cursor: ns-resize\n}\n\n.window-control {\n align-self: center;\n justify-self: flex-end;\n margin-left: auto;\n margin-right: 7px;\n}\n\n.window-control:hover {\n align-self: center;\n justify-self: flex-end;\n margin-left: auto;\n}\n\n.window-control .segmented-control-segment:hover {\n background-color: var(--figma-color-bg-hover);\n}\n\n\n.window-control .segmented-control-segment.selected {\n box-shadow: inset 0 0 0 1px transparent;\n background-color: transparent;\n}\n\n\n.window-control .segmented-control-segment.selected .svg-container {\n background-color: var(--figma-color-icon);\n}\n\n.window-control .segmented-control-segment .svg-container {\n background-color: var(--figma-color-text-disabled);\n}\n\n.key-frame {\n display: inline-block;\n right: 120px;\n position: absolute;\n}\n\n.language-options.selected {\n filter: none;\n}\n\n.key-table-text-node {\n height: 32px;\n padding-left: 24px;\n}\n\n.key-table-key {\n font-family: monospace;\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.055px;\n line-height: 16px;\n padding-left: 0px;\n}\n\n.figma-text {\n width: calc(100% - 80px);\n font-family: Inter, sans-serif;\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.055px;\n line-height: 16px;\n padding-top: 8px;\n}\n\n.key-action {\n font-size: 12;\n text-decoration: underline;\n cursor: pointer;\n margin-left: 5px;\n margin-bottom: 5px;\n}\n\n#main {\n height: 100%;\n width: 100%;\n}\n\n\n#resize-handle.window {\n position: fixed;\n right: 1px;\n bottom: 2px;\n cursor: nwse-resize;\n}\n\n#resize-handle.bottomSheet {\n position: fixed;\n right: 0px;\n left: 0px;\n top: 0px;\n height: 5px;\n cursor: ns-resize;\n}\n\n#resize-handle.bottomSheet svg {\n visibility: hidden;\n}\n\n#resize-handle {\n position: fixed;\n cursor: nwse-resize;\n}\n\n\n.settings {\n right: 0px;\n position: absolute;\n font-size: 16;\n text-decoration: underline;\n cursor: pointer;\n margin: 5px;\n padding-right: 140px;\n}\n\n\n #react-page {\n height: 100%;\n }\n\n .view.filesetup {\n overflow: visible;\n height: auto;\n }\n\n .view {\n overflow: auto;\n \n height: calc(100% - 40px);\n }\n\n .element-symbol {\n width: 16px;\n height: 32px;\n }\n\n\n .element-symbol .svg-container.number-sign-svg {\n width: 12px;\n height: 12px;\n }\n\n\n .element-symbol .svg-container.text-sign-svg {\n width: 10px;\n height: 10px;\n }\n \n .circular-button:hover {\n background-color: var(--neutral10)\n }\n \n .circular-button:hover div {\n background-color: var(--onneutral10) \n }\n \n\n .variable-svg.active {\n background-color: red;\n }\n \n .toolbar {\n /* border-bottom: 1px solid var(--figma-color-border); */\n flex-direction: row;\n display: flex;\n }\n \n .dropdown {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0px;\n \n width: 210px;\n height: 30px;\n }\n \n \n .frame-actions {\n position: absolute;\n right: 8px;\n top:0px;\n display: flex;\n flex-direction: row;\n }\n \n \n .translations .actions {\n position: absolute;\n right: 8px;\n top:0px;\n display: flex;\n flex-direction: row;\n }\n \n \n .translations td.language {\n padding-left: 0px;\n width: 52px;\n font-weight: 800;\n }\n \n .translation {\n white-space: pre-wrap;\n }\n \n \n \n.circular-button {\n background-color: transparent;\n margin: 2px;\n width: 32px;\n height: 32px;\n border-radius: 42px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.circular-button div {\n width: 60%;\n height: 60%;\n background-color: #161616;\n mask-size: cover;\n -webkit-mask-position-x: 50%;\n -webkit-mask-position-y: 50%;\n -webkit-mask-repeat-x: no-repeat;\n -webkit-mask-repeat-y: no-repeat;\n -webkit-mask-size: cover;\n mask-position: 50% 50%;\n mask-repeat: no-repeat;\n mask-size: cover;\n}\n\n\n.emptyState {\n height: 100%;\n display: flex;\n flex-direction: column;\n text-align: center;\n justify-content: center;\n}\n\n\n.emptyStateTitle {\n font-size: 14px;\n}\n\n.emptyStateSubtitle {\n margin-top: 18px;\n color: var(--figma-color-text-secondary, #b3b3b3);\n}\n\n\n\nbutton.button {\n background-color: var(--figma-color-bg);\n color: var(--figma-color-text);\n border-color: var(--figma-color-border);\n border-width: 1px;\n padding: 0 12px;\n font-size: 11px;\n line-height: 16px;\n letter-spacing: calc(0.005px + var(--text-tracking-pos, 0) * 11px);\n font-weight: 400;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n font-family: Inter,sans-serif;\n align-items: center;\n box-sizing: border-box;\n background-clip: border-box;\n height: 32px;\n max-width: 200px;\n flex-shrink: 0;\n border-radius: 6px;\n cursor: default;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n border-style: solid;\n margin-left: 10px;\n}\n\nbutton.button-primary {\n font-weight: 500;\n background-color: var(--figma-color-bg-brand);\n color: var(--figma-color-text-onbrand, #fff);\n}\n\n\nbutton.button-primary-destructive {\n font-weight: 500;\n background-color: var(--figma-color-bg-danger);\n color: var(--figma-color-text-ondanger, #fff);\n}\n\n\n\nbutton:disabled {\n color: var(--figma-color-text-ondisabled, #fff);\n background-color: var(--figma-color-bg-disabled, rgba(0, 0, 0, .3));\n border-color: transparent;\n}\n\nbutton:focus:not(:disabled), .basic_form--btn--t7Y67:active:not(:disabled) {\n \n}\n\n.view.dev-panel {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.comming-soon {\n flex: 0 0 150px;\n text-align: center;\n}\n\n\n#version-outdated.visible {\n \n \n position: absolute;\n left:0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: 10000000000;\n background-color: rgba(0, 0, 0, 0.6);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n#version-outdated.visible div {\n flex: 0 0 150px; \n text-align: center;\n background-color: white;\n border: solid 16px white;\n border-radius: 5px;\n}\n#version-outdated.gone {\n display: none;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/views/export/Export.css": +/*!******************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/views/export/Export.css ***! + \******************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` +.modal-window-background { + background: rgba(0, 0, 0, .3); + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + justify-content: center; + align-items: center; + z-index: 10; +} +.modal-window { + position: absolute; + padding: 24px; + left: 50%; + transform: translate(-50%, 0px); + top: 10px; + background-color: var(--figma-color-bg); + + border: 0.5px solid rgba(0, 0, 0, 0.2); + box-shadow: 0px 2px 14px rgb(0 0 0 / 15%); + border-radius: 2px; + } + + .modal-window-title { + font-size: 14px; + line-height: 24px; + letter-spacing: calc(-.006px + var(--text-tracking-pos, 0)*14px); + font-family: Inter,sans-serif; + } + + .modal-window-section { + margin-top: 12px; + } + + .modal-window-input { + width: 100%; + color: var(--color-text, black); + background-color: var(--figma-color-bg, white); + border: 1px solid var(--figma-color-border, #d4d4d4); + border-radius: 2px; + box-sizing: border-box; + font-family: Inter,sans-serif; + outline: none; + resize: none; + padding: 6px; + height: 2.5em; + min-width: 300px; + font-size: 11px; +} + +.modal-window-input:focus { + border-color: var(--figma-color-border-selected, white); +} + +.modal-window-input:placeholder-shown { + color: var(--figma-color-text-tertiary, black); +} + +.modal-window-button-row { + margin-top: 8px; +} +.buttonGroup { + display: flex; + position: sticky; + flex-direction: row; + bottom: 16px; + margin: 16px; +} + +.buttonGroup-reversed { + flex-direction: row-reverse; +} + +.language-export-action { + + margin-right: 8px; + margin-left: auto; +}`, "",{"version":3,"sources":["webpack://./src/ui/views/export/Export.css"],"names":[],"mappings":";AACA;IACI,6BAA6B;IAC7B,eAAe;IACf,MAAM;IACN,OAAO;IACP,QAAQ;IACR,SAAS;IACT,aAAa;IACb,uBAAuB;IACvB,mBAAmB;IACnB,WAAW;AACf;AACA;IACI,kBAAkB;IAClB,aAAa;IACb,SAAS;IACT,+BAA+B;IAC/B,SAAS;IACT,uCAAuC;;IAEvC,sCAAsC;IACtC,yCAAyC;IACzC,kBAAkB;EACpB;;EAEA;IACE,eAAe;MACb,iBAAiB;MACjB,gEAAgE;MAChE,6BAA6B;EACjC;;EAEA;IACE,gBAAgB;EAClB;;EAEA;IACE,WAAW;IACX,+BAA+B;IAC/B,8CAA8C;IAC9C,oDAAoD;IACpD,kBAAkB;IAClB,sBAAsB;IACtB,6BAA6B;IAC7B,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,eAAe;AACnB;;AAEA;IACI,uDAAuD;AAC3D;;AAEA;IACI,8CAA8C;AAClD;;AAEA;IACI,eAAe;AACnB;AACA;IACI,aAAa;IACb,gBAAgB;IAChB,mBAAmB;IACnB,YAAY;IACZ,YAAY;AAChB;;AAEA;IACI,2BAA2B;AAC/B;;AAEA;;IAEI,iBAAiB;IACjB,iBAAiB;AACrB","sourcesContent":["\n.modal-window-background {\n background: rgba(0, 0, 0, .3);\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10;\n}\n.modal-window {\n position: absolute;\n padding: 24px;\n left: 50%;\n transform: translate(-50%, 0px);\n top: 10px;\n background-color: var(--figma-color-bg); \n \n border: 0.5px solid rgba(0, 0, 0, 0.2);\n box-shadow: 0px 2px 14px rgb(0 0 0 / 15%);\n border-radius: 2px;\n }\n\n .modal-window-title {\n font-size: 14px;\n line-height: 24px;\n letter-spacing: calc(-.006px + var(--text-tracking-pos, 0)*14px);\n font-family: Inter,sans-serif;\n }\n\n .modal-window-section {\n margin-top: 12px;\n }\n\n .modal-window-input {\n width: 100%;\n color: var(--color-text, black);\n background-color: var(--figma-color-bg, white);\n border: 1px solid var(--figma-color-border, #d4d4d4);\n border-radius: 2px;\n box-sizing: border-box;\n font-family: Inter,sans-serif;\n outline: none;\n resize: none;\n padding: 6px;\n height: 2.5em;\n min-width: 300px;\n font-size: 11px;\n}\n\n.modal-window-input:focus {\n border-color: var(--figma-color-border-selected, white);\n}\n\n.modal-window-input:placeholder-shown {\n color: var(--figma-color-text-tertiary, black);\n}\n\n.modal-window-button-row {\n margin-top: 8px;\n}\n.buttonGroup {\n display: flex;\n position: sticky;\n flex-direction: row;\n bottom: 16px;\n margin: 16px;\n}\n\n.buttonGroup-reversed {\n flex-direction: row-reverse;\n}\n\n.language-export-action {\n \n margin-right: 8px;\n margin-left: auto;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/views/localizedlabelslist/LocalizedLabelsListView.css": +/*!************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/views/localizedlabelslist/LocalizedLabelsListView.css ***! + \************************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` + +.spacer { + width: 16px; + flex-shrink: 0; + flex-grow: 0; +} + +.element-symbol { + width: 16px; + display: flex; + justify-content: center; + flex-shrink: 0; + height: 100%; + align-items: center; +} + +.table { + + display: grid; + grid-template-columns: 20% 1fr; +} + +.header { + display: contents; +} + +.header>div { + position: sticky; + top: 0; + z-index: 200; + background-color: var(--figma-color-bg); +} + +.header>div.column-1 { + display: flex; + align-items: center; + align-content: center; +} + +.header .element-name { + font-weight: 600; +} + + + +.header .frame-actions .frame-icon .svg-container { + width: 26px; + height: 16px; + background-color: var(--figma-color-text); +} + +.row-actions { + padding-right: 8px; + display: flex; + justify-content: right; + align-items: top; +} + +.header .row-actions { + align-items: center; +} + +.nodes-parent { + border: solid 1px; + border-color: transparent; +} + +.nodes-parent:hover { + border-color: var(--figma-color-border-selected); +} + + +.nodes-parent.selected { + border-color: transparent; + background-color: var(--figma-color-bg-selected); +} + +.nodes-parent.selected:hover { + border-color: transparent; +} + +.row-actions .row-action-icon { + display: flex; + align-items: center; + justify-content: center; + width: 16px; + height: 32px; + /*background-color: var(--figma-color-text);*/ +} + +.row { + display: contents; +} + +.row:hover .column-1, .row:hover .column-2 { + border-color: var(--figma-color-border-selected); +} + +.row.selected .column-1, .row.selected .column-2 { + border-color: transparent; + background-color: var(--figma-color-bg-selected); + scroll-margin-top: 32px; +} + +.row.selected:hover .column-1, .row.selected:hover .column-2 { + border-color: transparent; + background-color: var(--figma-color-bg-selected); +} + +.row.selected-by-parent .column-1, .row.selected-by-parent .column-2 { + border-color: transparent; + background-color: var(--figma-color-bg-selected-secondary); + scroll-margin-top: 32px; +} + +.row.selected-by-parent:hover .column-1, .row.selected-by-parent:hover .column-2 { + border-color: transparent; + background-color: var(--figma-color-bg-selected-secondary); +} + + + +.row .column-1 { + border-top-width: 1px; + border-left-width: 1px; + border-bottom-width: 1px; + border-right-width: 0px; + border-style: solid; + border-color: transparent; + +} + +.row:hover .column-1 { + border-color: var(--figma-color-border-selected); +} + + +.row .column-2 { + display: flex; + border-top-width: 1px; + border-left-width: 0px; + border-bottom-width: 1px; + border-right-width: 1px; + border-style: solid; + border-color: transparent; +} + +.row:hover .column-2 { + border-color: var(--figma-color-border-selected); +} + + +.row:nth-child(even) {} + +.row.selected {} + +.row:hover {} + + +.element-symbol .svg-container { + background-color: var(--figma-color-icon-tertiary); +} + +.nodes-parent .element-symbol .svg-container { + background-color: var(--figma-color-icon); +} + + +.selected .element-symbol .svg-container { + background-color: var(--figma-color-icon); +} + +.translation-container { + flex-flow: column; + display: flex; + align-items: flex-start; + flex-grow: 2; + align-content: center; +} + +.localized-label { + display: flex; + align-items: center; +} + +.localized-label-details { + width: 100%; + min-height: 32px; + display: flex; + align-items: center; +} + +.header .column-1 { + grid-column: 1 / 3; +} +.header .element-name { + flex-grow: 1; +} + +.element-name { + text-align: left; + overflow: hidden; + text-overflow: ellipsis; + font-feature-settings: "ss02" on, "liga" on, "calt" on; + padding-top: -1px; + padding-right: 8px; + padding-bottom: 0px; + padding-left: 8px; +} + +.number-sign-svg { + width: 12px; + height: 12px; +} + +.key-panel { + width: 100%; + display: flex; + align-items: center; + align-content: center; +} + +.key-panel .button.layerIcon { + align-self: self-start; +} + +.key-panel .input-select-menu.key-select { + min-width: 160px; + max-width: 160px; + align-self: self-start; + display: flex; +} +.key-panel .input-select-menu.key-select { +margin-left: auto; +} + +.key-panel .input-select-menu__caret { + /* margin-left: auto; */ +} + +.text-sign-svg { + width: 10px; + height: 10px; +} + +.key-unset .key-panel .text-field-text input { + color: var(--color-text-disabled, #b3b3b3); +} + +.key-unset .key-panel .text-field-text p { + color: var(--color-text-disabled, #b3b3b3); +} + +.key-unset .key-panel .text-field .svg-container.key-svg { + background-color: var(--color-text-disabled, #b3b3b3); +} + + +.localized-label .text-field-text p { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + + +.localized-label .text-field { + + overflow: hidden; +} + +.key-panel .grid { + display: flex; + flex-grow: 1; +} + +.top-drawer { + overflow: scroll; + max-width: calc(100% - 20px); + max-height: calc(100% - 10px); + background: var(--figma-color-bg); + position: fixed; + top: 0; + right: 0; + left: 0; + margin: auto; + z-index: 200; + box-shadow: 0 0px 0px rgba(0,0,0,0.15); + transform: translateY(-100%); + transition: box-shadow 0.3s ease-out, transform 0.3s ease-out; + width: max-content; + + } + + .top-drawer.open { + + box-shadow: 1px 0px 7px rgba(0, 0, 0, 0.5); + transform: translateY(0); + transition: box-shadow 0.3s ease-out, transform 0.3s ease-out; + } +`, "",{"version":3,"sources":["webpack://./src/ui/views/localizedlabelslist/LocalizedLabelsListView.css"],"names":[],"mappings":";;AAEA;IACI,WAAW;IACX,cAAc;IACd,YAAY;AAChB;;AAEA;IACI,WAAW;IACX,aAAa;IACb,uBAAuB;IACvB,cAAc;IACd,YAAY;IACZ,mBAAmB;AACvB;;AAEA;;IAEI,aAAa;IACb,8BAA8B;AAClC;;AAEA;IACI,iBAAiB;AACrB;;AAEA;IACI,gBAAgB;IAChB,MAAM;IACN,YAAY;IACZ,uCAAuC;AAC3C;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,qBAAqB;AACzB;;AAEA;IACI,gBAAgB;AACpB;;;;AAIA;IACI,WAAW;IACX,YAAY;IACZ,yCAAyC;AAC7C;;AAEA;IACI,kBAAkB;IAClB,aAAa;IACb,sBAAsB;IACtB,gBAAgB;AACpB;;AAEA;IACI,mBAAmB;AACvB;;AAEA;IACI,iBAAiB;IACjB,yBAAyB;AAC7B;;AAEA;IACI,gDAAgD;AACpD;;;AAGA;IACI,yBAAyB;IACzB,gDAAgD;AACpD;;AAEA;IACI,yBAAyB;AAC7B;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,WAAW;IACX,YAAY;IACZ,6CAA6C;AACjD;;AAEA;IACI,iBAAiB;AACrB;;AAEA;IACI,gDAAgD;AACpD;;AAEA;IACI,yBAAyB;IACzB,gDAAgD;IAChD,uBAAuB;AAC3B;;AAEA;IACI,yBAAyB;IACzB,gDAAgD;AACpD;;AAEA;IACI,yBAAyB;IACzB,0DAA0D;IAC1D,uBAAuB;AAC3B;;AAEA;IACI,yBAAyB;IACzB,0DAA0D;AAC9D;;;;AAIA;IACI,qBAAqB;IACrB,sBAAsB;IACtB,wBAAwB;IACxB,uBAAuB;IACvB,mBAAmB;IACnB,yBAAyB;;AAE7B;;AAEA;IACI,gDAAgD;AACpD;;;AAGA;IACI,aAAa;IACb,qBAAqB;IACrB,sBAAsB;IACtB,wBAAwB;IACxB,uBAAuB;IACvB,mBAAmB;IACnB,yBAAyB;AAC7B;;AAEA;IACI,gDAAgD;AACpD;;;AAGA,sBAAsB;;AAEtB,eAAe;;AAEf,YAAY;;;AAGZ;IACI,kDAAkD;AACtD;;AAEA;IACI,yCAAyC;AAC7C;;;AAGA;IACI,yCAAyC;AAC7C;;AAEA;IACI,iBAAiB;IACjB,aAAa;IACb,uBAAuB;IACvB,YAAY;IACZ,qBAAqB;AACzB;;AAEA;IACI,aAAa;IACb,mBAAmB;AACvB;;AAEA;IACI,WAAW;IACX,gBAAgB;IAChB,aAAa;IACb,mBAAmB;AACvB;;AAEA;IACI,kBAAkB;AACtB;AACA;IACI,YAAY;AAChB;;AAEA;IACI,gBAAgB;IAChB,gBAAgB;IAChB,uBAAuB;IACvB,sDAAsD;IACtD,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;AACrB;;AAEA;IACI,WAAW;IACX,YAAY;AAChB;;AAEA;IACI,WAAW;IACX,aAAa;IACb,mBAAmB;IACnB,qBAAqB;AACzB;;AAEA;IACI,sBAAsB;AAC1B;;AAEA;IACI,gBAAgB;IAChB,gBAAgB;IAChB,sBAAsB;IACtB,aAAa;AACjB;AACA;AACA,iBAAiB;AACjB;;AAEA;IACI,uBAAuB;AAC3B;;AAEA;IACI,WAAW;IACX,YAAY;AAChB;;AAEA;IACI,0CAA0C;AAC9C;;AAEA;IACI,0CAA0C;AAC9C;;AAEA;IACI,qDAAqD;AACzD;;;AAGA;IACI,uBAAuB;IACvB,mBAAmB;IACnB,gBAAgB;AACpB;;;AAGA;;IAEI,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,YAAY;AAChB;;AAEA;IACI,gBAAgB;IAChB,4BAA4B;IAC5B,6BAA6B;IAC7B,iCAAiC;IACjC,eAAe;IACf,MAAM;IACN,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,YAAY;IACZ,sCAAsC;IACtC,4BAA4B;IAC5B,6DAA6D;IAC7D,kBAAkB;;EAEpB;;EAEA;;IAEE,0CAA0C;IAC1C,wBAAwB;IACxB,6DAA6D;EAC/D","sourcesContent":["\n\n.spacer {\n width: 16px;\n flex-shrink: 0;\n flex-grow: 0;\n}\n\n.element-symbol {\n width: 16px;\n display: flex;\n justify-content: center;\n flex-shrink: 0;\n height: 100%;\n align-items: center;\n}\n\n.table { \n\n display: grid;\n grid-template-columns: 20% 1fr;\n}\n\n.header {\n display: contents;\n}\n\n.header>div {\n position: sticky;\n top: 0;\n z-index: 200;\n background-color: var(--figma-color-bg);\n}\n\n.header>div.column-1 {\n display: flex;\n align-items: center;\n align-content: center;\n}\n\n.header .element-name {\n font-weight: 600;\n}\n\n\n\n.header .frame-actions .frame-icon .svg-container {\n width: 26px;\n height: 16px;\n background-color: var(--figma-color-text);\n}\n\n.row-actions {\n padding-right: 8px;\n display: flex;\n justify-content: right;\n align-items: top;\n}\n\n.header .row-actions {\n align-items: center;\n}\n\n.nodes-parent {\n border: solid 1px;\n border-color: transparent;\n} \n\n.nodes-parent:hover {\n border-color: var(--figma-color-border-selected);\n} \n\n\n.nodes-parent.selected {\n border-color: transparent;\n background-color: var(--figma-color-bg-selected);\n} \n\n.nodes-parent.selected:hover {\n border-color: transparent;\n} \n\n.row-actions .row-action-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 32px;\n /*background-color: var(--figma-color-text);*/\n}\n\n.row {\n display: contents;\n}\n\n.row:hover .column-1, .row:hover .column-2 {\n border-color: var(--figma-color-border-selected);\n}\n\n.row.selected .column-1, .row.selected .column-2 {\n border-color: transparent;\n background-color: var(--figma-color-bg-selected);\n scroll-margin-top: 32px;\n}\n\n.row.selected:hover .column-1, .row.selected:hover .column-2 {\n border-color: transparent;\n background-color: var(--figma-color-bg-selected);\n}\n\n.row.selected-by-parent .column-1, .row.selected-by-parent .column-2 {\n border-color: transparent;\n background-color: var(--figma-color-bg-selected-secondary);\n scroll-margin-top: 32px;\n}\n\n.row.selected-by-parent:hover .column-1, .row.selected-by-parent:hover .column-2 {\n border-color: transparent;\n background-color: var(--figma-color-bg-selected-secondary);\n}\n\n\n\n.row .column-1 {\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n border-right-width: 0px;\n border-style: solid;\n border-color: transparent;\n \n}\n\n.row:hover .column-1 {\n border-color: var(--figma-color-border-selected);\n}\n\n\n.row .column-2 {\n display: flex;\n border-top-width: 1px;\n border-left-width: 0px;\n border-bottom-width: 1px;\n border-right-width: 1px;\n border-style: solid;\n border-color: transparent;\n}\n\n.row:hover .column-2 {\n border-color: var(--figma-color-border-selected);\n}\n\n\n.row:nth-child(even) {}\n\n.row.selected {}\n\n.row:hover {}\n\n\n.element-symbol .svg-container {\n background-color: var(--figma-color-icon-tertiary);\n}\n\n.nodes-parent .element-symbol .svg-container {\n background-color: var(--figma-color-icon);\n}\n\n\n.selected .element-symbol .svg-container {\n background-color: var(--figma-color-icon);\n}\n \n.translation-container {\n flex-flow: column;\n display: flex;\n align-items: flex-start;\n flex-grow: 2;\n align-content: center;\n}\n\n.localized-label {\n display: flex;\n align-items: center;\n}\n\n.localized-label-details {\n width: 100%;\n min-height: 32px;\n display: flex;\n align-items: center;\n}\n\n.header .column-1 {\n grid-column: 1 / 3;\n}\n.header .element-name {\n flex-grow: 1;\n}\n\n.element-name {\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n font-feature-settings: \"ss02\" on, \"liga\" on, \"calt\" on;\n padding-top: -1px;\n padding-right: 8px;\n padding-bottom: 0px;\n padding-left: 8px;\n}\n\n.number-sign-svg {\n width: 12px;\n height: 12px;\n}\n\n.key-panel {\n width: 100%;\n display: flex;\n align-items: center;\n align-content: center;\n}\n\n.key-panel .button.layerIcon {\n align-self: self-start;\n}\n\n.key-panel .input-select-menu.key-select {\n min-width: 160px;\n max-width: 160px;\n align-self: self-start;\n display: flex;\n}\n.key-panel .input-select-menu.key-select {\nmargin-left: auto;\n}\n\n.key-panel .input-select-menu__caret {\n /* margin-left: auto; */\n}\n\n.text-sign-svg {\n width: 10px;\n height: 10px;\n}\n\n.key-unset .key-panel .text-field-text input {\n color: var(--color-text-disabled, #b3b3b3);\n}\n\n.key-unset .key-panel .text-field-text p {\n color: var(--color-text-disabled, #b3b3b3);\n}\n\n.key-unset .key-panel .text-field .svg-container.key-svg {\n background-color: var(--color-text-disabled, #b3b3b3);\n}\n\n\n.localized-label .text-field-text p {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n\n\n.localized-label .text-field {\n \n overflow: hidden;\n}\n\n.key-panel .grid {\n display: flex;\n flex-grow: 1;\n}\n\n.top-drawer {\n overflow: scroll;\n max-width: calc(100% - 20px);\n max-height: calc(100% - 10px);\n background: var(--figma-color-bg);\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n margin: auto;\n z-index: 200;\n box-shadow: 0 0px 0px rgba(0,0,0,0.15);\n transform: translateY(-100%);\n transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;\n width: max-content;\n \n }\n \n .top-drawer.open {\n \n box-shadow: 1px 0px 7px rgba(0, 0, 0, 0.5);\n transform: translateY(0);\n transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;\n }\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/views/messages/MessageView.css": +/*!*************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/views/messages/MessageView.css ***! + \*************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `.grid { + display: grid; + grid-template-columns: [selector] min-content [height-helper] min-content [key] min-content [language] min-content [gender] min-content [plural] min-content [translation] auto [actions] min-content; + grid-template-rows: auto; + +} + + +.hidden-helper-row * { + height: 0px !important; + overflow: hidden; +} + +.row { + display: contents; +} + +.group { + display: contents; +} + +.row-key .column { + background: var(--figma-color-bg); + border-style: solid; + border-color: transparent; + border-right-width: 0px; + border-bottom-width: 0px; + border-top-width: 0px; + border-left-width: 0px; +} + +.row-key:hover .column { + background: var(--figma-color-bg); + border-style: solid; + border-color: var(--figma-color-border-selected); + border-right-width: 0px; + border-bottom-width: 0px; + border-top-width: 0px; + border-left-width: 0px; +} + +.row-key.row-key.selected .column { + background: var(--figma-color-bg-selected) !important; + border-style: solid; + border-color: transparent !important; +} + +.column-key { + grid-column-start: key; + grid-row-end: span 1000; + /* grid-row: 1 / span 2; /* Set the row span to take 2 rows */ +} + +.column-language { + grid-column-start: language; + grid-row-end: span 100; +} + +.column-gender { + grid-column-start: gender; + grid-row-end: span 100; +} + +.column-plural { + grid-column-start: plural; +} + +.row-key>div.column-key { + border-left-width: 1px !important; +} + +.row-key>div:nth-child(1 of .column-key), +.row-key>div:nth-child(1 of .language-group)>.column-language, +.row-key>div:nth-child(1 of .language-group)>div:nth-child(1 of .gender-group)>div, +.row-key>div:nth-child(1 of .language-group)>div:nth-child(1 of .gender-group)>div:nth-child(1 of .plural-group)>div { + border-top-width: 1px; +} + +.row-key>.language-group>.gender-group>.plural-group>.column-actions { + border-right-width: 1px !important; +} + + +.row-key>div:nth-last-child(1 of .column-key), +.row-key>div:nth-last-child(1 of .language-group)>.column-language, +.row-key>div:nth-last-child(1 of .language-group)>div:nth-last-child(1 of .gender-group)>div, +.row-key>div:nth-last-child(1 of .language-group)>div:nth-last-child(1 of .gender-group)>div:nth-last-child(1 of .plural-group)>div { + border-bottom-width: 1px; +} + +.column-translation { + grid-column-start: translation; +} + +.column-actions { + grid-column-start: actions; +} + +.grid-item-selector { + display: flex; +} + +.grid-item-key { + display: flex; + flex-direction: column; +} + +.grid-item-key.selected { + width: 100%; + border-color: var(--figma-color-bg-selected); +} + +.grid-item-key.selected .grid-item-key-header { + background-color: var(--figma-color-bg-selected); + width: 100%; +} + +.grid-item-key .key-usage .localized-label .name { + white-space: nowrap; +} + +.grid-item-key .key-usage .collapsible-header { + display: flex; +} + +.grid-item-key .key-usage .collapsible-header .svg-container { + width: 7px; + height: 7px; + margin: 3px; +} + +.grid-item-key .key-usage .collapsible-header .title { + padding: 0 8px; + font-feature-settings: "ss02" on, "liga" on, "calt" on; + white-space: pre; + text-align: left; +} + +.grid-item-key-header { + display: flex; + font-weight: 600; +} + +.rowText .text-field-text * { + font-weight: 600; +} + +.rowText .text-field-text p { + padding-left: 5px; + padding-right: 8px; + font-feature-settings: "ss02" on, "liga" on, "calt" on; + line-height: 12px; + height: 12px; + white-space: pre; + text-align: left; +} + +.rowText { + flex-grow: 1; + padding-left: 8px; + padding-right: 8px; + font-feature-settings: "ss02" on, "liga" on, "calt" on; + line-height: 32px; + height: 32px; + white-space: pre; + text-align: left; +} + +.skipped .rowText { + text-decoration: line-through; +} + +.checkboxHitbox { + display: flex; + margin-right: 0; + flex: 0 0 32px; + height: 32px; + width: 32px; + user-select: none; + justify-content: center; + align-items: center; + cursor: default; + position: relative; +} + +.checkboxHitbox .svg-container { + + background-color: var(--figma-color-icon-onbrand, #fff); + width: 8px; + height: 8px; +} + +.checkboxInput { + margin: 0; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + display: flex; + justify-content: center; + align-items: center; + + flex: 0 0 32px; + width: 14px; + height: 14px; + display: inline-flex; + outline: none; +} + +.checkboxInput:after { + width: 12px; + height: 12px; + box-sizing: border-box; + background-color: transparent; +} + +.checkboxInput:after { + content: ""; + display: inline-flex; + margin: 1px; + width: 12px; + height: 12px; + border-radius: 2px; + box-sizing: border-box; + background-color: var(--color-bg, white); + border: 1px solid var(--color-icon, #333333); + background-clip: padding-box; +} + +.checkboxInput:checked:after { + border-color: var(--color-bg-brand, #0d99ff); + background-color: var(--color-bg-brand, #0d99ff); +} + +.checkbox--checkmark { + position: absolute; + top: 50%; + left: 50%; + transform: translate3d(-50%, -50%, 0) !important; +} + +.grid-item-key .layerIcon { + width: 16px; + display: flex; + justify-content: center; + flex-shrink: 0; + height: 32px; + align-items: center; + color: var(--color-icon-tertiary, #b3b3b3); + fill: var(--color-icon-tertiary, #b3b3b3); + stroke: var(--color-icon-tertiary, #b3b3b3); + color: var(--color-icon, #333333); + fill: var(--color-icon, #333333); + stroke: var(--color-icon, #333333); +} + +.grid-item-key .iconWrapper { + position: relative; +} + +.grid-item-border { + border-style: solid; + border-color: red; + border-bottom-width: 0px; + border-right-width: 0px; + border-top-width: 0px; + border-left-width: 0px; +} + +.grid-item-border-bottom { + border-bottom-width: 1px; +} +.grid-item-border-left { + border-left-width: 1px; +} + +.grid-item-border-rigth { + border-right-width: 1px; +} + +.grid-item-language { + flex-shrink: 0; + color: var(--figma-color-text-disabled); + width: 30px; +} + +.grid-item-gender { + flex-shrink: 0; + /* width: 72px; */ +} + +.grid-item-plural { + flex-shrink: 0; + /* width: 72px; */ +} + +.grid-item-translation { + padding: 0px; +} + +.grid-translation { + justify-self: stretch; +} + +.grid-item-actions { + display: flex; + justify-content: flex-end; + padding-right: 6px; +} + +.grid-item-actions>span { + visibility: hidden; +} + +.language-group:hover .grid-item-actions>span { + visibility: visible; +} + + +.row-key:hover .grid-item-key>.grid-item-actions>span { + visibility: visible; +} + + + +.button .svg-container { + width: 32px; + height: 32px; + +} + +.button .svg-container.history-svg { + width: 16px; + height: 16px; +} + + +.button .svg-container.eye-closed-svg { + width: 16px; + height: 16px; +} + +.button .svg-container.eye-svg { + width: 16px; + height: 16px; +} + +.button .svg-container.linked-svg { + width: 9px; + height: 15px; +} + + +.button .svg-container.unlinked-svg { + width: 9px; + height: 15px; +} + +.button.layerIcon { + width: 16px; + display: flex; + justify-content: center; + flex-shrink: 0; + height: 100%; + align-items: center; + color: var(--color-icon-tertiary, #b3b3b3); + fill: var(--color-icon-tertiary, #b3b3b3); + stroke: var(--color-icon-tertiary, #b3b3b3); + color: var(--color-icon, #333333); + fill: var(--color-icon, #333333); + stroke: var(--color-icon, #333333); + +} + +.button.layerIcon { + position: relative; + border: 1px solid transparent; + height: 32px; + width: 32px; + border-radius: 2px; +} + + + +.selected .button.iconWrapper:hover { + background-color: var(--figma-color-bg-selected-hover); +} + + +.button.iconWrapper:hover { + background-color: var(--figma-color-bg-hover); +} + + +.keyWrapper { + display: contents; +} + + +.keyPluralWrapper { + display: contents; +} + +.languageWrapper { + display: contents; +} +.keyPluralWrapper .grid-item-actions { + visibility: visible; +} + + +.keyPluralWrapper .grid-item-actions .button { + visibility: hidden; +} + + + +.keyPluralWrapper:hover .grid-item-actions .button { + visibility: visible; +} + + + +.keyPluralWrapper:nth-child(even)>div { + /* background-color: green;*/ +} + + +.keyPluralWrapper.onePlural>div { + background-color: transparent; +} + +.languageWrapper>div:first-child { + /* background-color: #E5E5E5; */ +} + +.languageWrapper:nth-child(odd)>div:last-child>div {} + +.languageWrapper:nth-child(even)>div:last-child>div { + /* background-color: #F0F0F0; */ +} + + + +.side-drawer { + + overflow: auto; + height: 100%; + max-height: 100%; + background: white; + position: fixed; + top: 0; + right: 0; + width: 40%; + z-index: 200; + + transform: translateX(100%); + transition: box-shadow 0.3s ease-out, transform 0.3s ease-out; + +} + +.side-drawer.open { + + box-shadow: 1px 0px 7px rgba(0, 0, 0, 0.5); + transform: translateX(0); + transition: box-shadow 0.3s ease-out, transform 0.3s ease-out; +} + + +.keyWrapper.selected>div { + background-color: var(--figma-color-bg-selected-secondary, #daebf7); +} + +.keyWrapper.selected>div>div { + background-color: var(--figma-color-bg-selected-hover, #daebf7); +} + +.keyWrapper.selected .languageWrapper:nth-child(even)>div:last-child>div { + background-color: var(--figma-color-bg-selected, #daebf7); +} + +.keyWrapper.selected .languageWrapper:nth-child(odd)>div:last-child>div { + background-color: var(--figma-color-bg-selected-secondary, #daebf7); +} + +.style_picker--search { + position: sticky; + z-index: 10; + top: 0; + box-sizing: border-box; + padding-right: 8px; + height: 40px; + display: flex; + align-items: center; + width: 100%; + overflow: hidden; + background-color: var(--figma-color-bg); + color: var(--figma-color-text); + fill: var(--figma-color-text); +} + +.style_picker--search:after { + content: ""; + z-index: 10; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 1px; + background-color: var(--figma-color-border, rgba(0, 0, 0, .1)); +} + +.style_picker--search .svg-container { + position: absolute; + left: 16px; + width: 10px; + height: 10px; +} + +.search--searchInput { + padding: 0 8px 0 35px; +} + +.search--searchInput { + outline: none; + border: none; + height: 100%; + width: 100%; + box-sizing: border-box; + flex: 1; + background-color: var(--color-bg); + color: var(--color-text); +} + +.lazy_input { + cursor: auto; +} + +.searchResults { + + box-sizing: border-box; + + + padding: 0 8px 0 16px; + height: 40px; + display: flex; + align-items: center; + width: 100%; + overflow: hidden; + background-color: var(--figma-color-bg); + color: var(--figma-color-text); + fill: var(--figma-color-text); + +} + + +.searchResults-suggestion { + + height: 24px; + display: flex; + align-items: center; + white-space: nowrap; + border-radius: 4px; + padding-left: 7px; + margin-right: 10px; + padding-right: 5px; + + border: 1px solid var(--figma-color-border); + border-radius: 4px; +} + +.searchResults-suggestion .text { + +} + + +.searchResults-suggestion .close { + width: 18px; + height: 18px; + flex: 0 0 16px; + line-height: 16px; + margin-left: 3px; + background-color: var(--figma-color-icon-tertiary); +} + +.searchResults-suggestion .close:hover { + background-color: var(--figma-color-icon); + +} + + +.searchResults-suggestion.active { + /* background-color: red; */ + +} + +.placeholder-view-grid { + display: grid; + grid-template-columns: [drag] auto [type] 12px [name] 1fr [value] 2fr [decimal] 0px;; +}`, "",{"version":3,"sources":["webpack://./src/ui/views/messages/MessageView.css"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sMAAsM;EACtM,wBAAwB;;AAE1B;;;AAGA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,iCAAiC;EACjC,mBAAmB;EACnB,yBAAyB;EACzB,uBAAuB;EACvB,wBAAwB;EACxB,qBAAqB;EACrB,sBAAsB;AACxB;;AAEA;EACE,iCAAiC;EACjC,mBAAmB;EACnB,gDAAgD;EAChD,uBAAuB;EACvB,wBAAwB;EACxB,qBAAqB;EACrB,sBAAsB;AACxB;;AAEA;EACE,qDAAqD;EACrD,mBAAmB;EACnB,oCAAoC;AACtC;;AAEA;EACE,sBAAsB;EACtB,uBAAuB;EACvB,6DAA6D;AAC/D;;AAEA;EACE,2BAA2B;EAC3B,sBAAsB;AACxB;;AAEA;EACE,yBAAyB;EACzB,sBAAsB;AACxB;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,iCAAiC;AACnC;;AAEA;;;;EAIE,qBAAqB;AACvB;;AAEA;EACE,kCAAkC;AACpC;;;AAGA;;;;EAIE,wBAAwB;AAC1B;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,0BAA0B;AAC5B;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,aAAa;EACb,sBAAsB;AACxB;;AAEA;EACE,WAAW;EACX,4CAA4C;AAC9C;;AAEA;EACE,gDAAgD;EAChD,WAAW;AACb;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,UAAU;EACV,WAAW;EACX,WAAW;AACb;;AAEA;EACE,cAAc;EACd,sDAAsD;EACtD,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;EAClB,sDAAsD;EACtD,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;EAClB,sDAAsD;EACtD,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;EACE,aAAa;EACb,eAAe;EACf,cAAc;EACd,YAAY;EACZ,WAAW;EACX,iBAAiB;EACjB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,kBAAkB;AACpB;;AAEA;;EAEE,uDAAuD;EACvD,UAAU;EACV,WAAW;AACb;;AAEA;EACE,SAAS;EACT,wBAAwB;EACxB,qBAAqB;EACrB,gBAAgB;EAChB,aAAa;EACb,uBAAuB;EACvB,mBAAmB;;EAEnB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,oBAAoB;EACpB,aAAa;AACf;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,sBAAsB;EACtB,6BAA6B;AAC/B;;AAEA;EACE,WAAW;EACX,oBAAoB;EACpB,WAAW;EACX,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,sBAAsB;EACtB,wCAAwC;EACxC,4CAA4C;EAC5C,4BAA4B;AAC9B;;AAEA;EACE,4CAA4C;EAC5C,gDAAgD;AAClD;;AAEA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,gDAAgD;AAClD;;AAEA;EACE,WAAW;EACX,aAAa;EACb,uBAAuB;EACvB,cAAc;EACd,YAAY;EACZ,mBAAmB;EACnB,0CAA0C;EAC1C,yCAAyC;EACzC,2CAA2C;EAC3C,iCAAiC;EACjC,gCAAgC;EAChC,kCAAkC;AACpC;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,mBAAmB;EACnB,iBAAiB;EACjB,wBAAwB;EACxB,uBAAuB;EACvB,qBAAqB;EACrB,sBAAsB;AACxB;;AAEA;EACE,wBAAwB;AAC1B;AACA;EACE,sBAAsB;AACxB;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,cAAc;EACd,uCAAuC;EACvC,WAAW;AACb;;AAEA;EACE,cAAc;EACd,iBAAiB;AACnB;;AAEA;EACE,cAAc;EACd,iBAAiB;AACnB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,aAAa;EACb,yBAAyB;EACzB,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,mBAAmB;AACrB;;;AAGA;EACE,mBAAmB;AACrB;;;;AAIA;EACE,WAAW;EACX,YAAY;;AAEd;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;;AAGA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,UAAU;EACV,YAAY;AACd;;;AAGA;EACE,UAAU;EACV,YAAY;AACd;;AAEA;EACE,WAAW;EACX,aAAa;EACb,uBAAuB;EACvB,cAAc;EACd,YAAY;EACZ,mBAAmB;EACnB,0CAA0C;EAC1C,yCAAyC;EACzC,2CAA2C;EAC3C,iCAAiC;EACjC,gCAAgC;EAChC,kCAAkC;;AAEpC;;AAEA;EACE,kBAAkB;EAClB,6BAA6B;EAC7B,YAAY;EACZ,WAAW;EACX,kBAAkB;AACpB;;;;AAIA;EACE,sDAAsD;AACxD;;;AAGA;EACE,6CAA6C;AAC/C;;;AAGA;EACE,iBAAiB;AACnB;;;AAGA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;AACA;EACE,mBAAmB;AACrB;;;AAGA;EACE,kBAAkB;AACpB;;;;AAIA;EACE,mBAAmB;AACrB;;;;AAIA;EACE,4BAA4B;AAC9B;;;AAGA;EACE,6BAA6B;AAC/B;;AAEA;EACE,+BAA+B;AACjC;;AAEA,oDAAoD;;AAEpD;EACE,+BAA+B;AACjC;;;;AAIA;;EAEE,cAAc;EACd,YAAY;EACZ,gBAAgB;EAChB,iBAAiB;EACjB,eAAe;EACf,MAAM;EACN,QAAQ;EACR,UAAU;EACV,YAAY;;EAEZ,2BAA2B;EAC3B,6DAA6D;;AAE/D;;AAEA;;EAEE,0CAA0C;EAC1C,wBAAwB;EACxB,6DAA6D;AAC/D;;;AAGA;EACE,mEAAmE;AACrE;;AAEA;EACE,+DAA+D;AACjE;;AAEA;EACE,yDAAyD;AAC3D;;AAEA;EACE,mEAAmE;AACrE;;AAEA;EACE,gBAAgB;EAChB,WAAW;EACX,MAAM;EACN,sBAAsB;EACtB,kBAAkB;EAClB,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,WAAW;EACX,gBAAgB;EAChB,uCAAuC;EACvC,8BAA8B;EAC9B,6BAA6B;AAC/B;;AAEA;EACE,WAAW;EACX,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;EACR,WAAW;EACX,8DAA8D;AAChE;;AAEA;EACE,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,YAAY;AACd;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,sBAAsB;EACtB,OAAO;EACP,iCAAiC;EACjC,wBAAwB;AAC1B;;AAEA;EACE,YAAY;AACd;;AAEA;;EAEE,sBAAsB;;;EAGtB,qBAAqB;EACrB,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,WAAW;EACX,gBAAgB;EAChB,uCAAuC;EACvC,8BAA8B;EAC9B,6BAA6B;;AAE/B;;;AAGA;;EAEE,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClB,iBAAiB;EACjB,kBAAkB;EAClB,kBAAkB;;EAElB,2CAA2C;EAC3C,kBAAkB;AACpB;;AAEA;;AAEA;;;AAGA;EACE,WAAW;EACX,YAAY;EACZ,cAAc;EACd,iBAAiB;EACjB,gBAAgB;EAChB,kDAAkD;AACpD;;AAEA;EACE,yCAAyC;;AAE3C;;;AAGA;EACE,2BAA2B;;AAE7B;;AAEA;EACE,aAAa;EACb,mFAAmF;AACrF","sourcesContent":[".grid {\n display: grid;\n grid-template-columns: [selector] min-content [height-helper] min-content [key] min-content [language] min-content [gender] min-content [plural] min-content [translation] auto [actions] min-content;\n grid-template-rows: auto;\n\n}\n\n\n.hidden-helper-row * {\n height: 0px !important;\n overflow: hidden;\n}\n\n.row {\n display: contents;\n}\n\n.group {\n display: contents;\n}\n\n.row-key .column {\n background: var(--figma-color-bg);\n border-style: solid;\n border-color: transparent;\n border-right-width: 0px;\n border-bottom-width: 0px;\n border-top-width: 0px;\n border-left-width: 0px;\n}\n\n.row-key:hover .column {\n background: var(--figma-color-bg);\n border-style: solid;\n border-color: var(--figma-color-border-selected);\n border-right-width: 0px;\n border-bottom-width: 0px;\n border-top-width: 0px;\n border-left-width: 0px;\n}\n\n.row-key.row-key.selected .column {\n background: var(--figma-color-bg-selected) !important;\n border-style: solid;\n border-color: transparent !important;\n}\n\n.column-key {\n grid-column-start: key;\n grid-row-end: span 1000;\n /* grid-row: 1 / span 2; /* Set the row span to take 2 rows */\n}\n\n.column-language {\n grid-column-start: language;\n grid-row-end: span 100;\n}\n\n.column-gender {\n grid-column-start: gender;\n grid-row-end: span 100;\n}\n\n.column-plural {\n grid-column-start: plural;\n}\n\n.row-key>div.column-key {\n border-left-width: 1px !important;\n}\n\n.row-key>div:nth-child(1 of .column-key),\n.row-key>div:nth-child(1 of .language-group)>.column-language,\n.row-key>div:nth-child(1 of .language-group)>div:nth-child(1 of .gender-group)>div,\n.row-key>div:nth-child(1 of .language-group)>div:nth-child(1 of .gender-group)>div:nth-child(1 of .plural-group)>div {\n border-top-width: 1px;\n}\n\n.row-key>.language-group>.gender-group>.plural-group>.column-actions {\n border-right-width: 1px !important;\n}\n\n\n.row-key>div:nth-last-child(1 of .column-key),\n.row-key>div:nth-last-child(1 of .language-group)>.column-language,\n.row-key>div:nth-last-child(1 of .language-group)>div:nth-last-child(1 of .gender-group)>div,\n.row-key>div:nth-last-child(1 of .language-group)>div:nth-last-child(1 of .gender-group)>div:nth-last-child(1 of .plural-group)>div {\n border-bottom-width: 1px;\n}\n\n.column-translation {\n grid-column-start: translation;\n}\n\n.column-actions {\n grid-column-start: actions;\n}\n\n.grid-item-selector {\n display: flex;\n}\n\n.grid-item-key {\n display: flex;\n flex-direction: column;\n}\n\n.grid-item-key.selected {\n width: 100%;\n border-color: var(--figma-color-bg-selected);\n}\n\n.grid-item-key.selected .grid-item-key-header {\n background-color: var(--figma-color-bg-selected);\n width: 100%;\n}\n\n.grid-item-key .key-usage .localized-label .name {\n white-space: nowrap;\n}\n\n.grid-item-key .key-usage .collapsible-header {\n display: flex;\n}\n\n.grid-item-key .key-usage .collapsible-header .svg-container {\n width: 7px;\n height: 7px;\n margin: 3px;\n}\n\n.grid-item-key .key-usage .collapsible-header .title {\n padding: 0 8px;\n font-feature-settings: \"ss02\" on, \"liga\" on, \"calt\" on;\n white-space: pre;\n text-align: left;\n}\n\n.grid-item-key-header {\n display: flex;\n font-weight: 600;\n}\n\n.rowText .text-field-text * {\n font-weight: 600;\n}\n\n.rowText .text-field-text p {\n padding-left: 5px;\n padding-right: 8px;\n font-feature-settings: \"ss02\" on, \"liga\" on, \"calt\" on;\n line-height: 12px;\n height: 12px;\n white-space: pre;\n text-align: left;\n}\n\n.rowText {\n flex-grow: 1;\n padding-left: 8px;\n padding-right: 8px;\n font-feature-settings: \"ss02\" on, \"liga\" on, \"calt\" on;\n line-height: 32px;\n height: 32px;\n white-space: pre;\n text-align: left;\n}\n\n.skipped .rowText {\n text-decoration: line-through;\n}\n\n.checkboxHitbox {\n display: flex;\n margin-right: 0;\n flex: 0 0 32px;\n height: 32px;\n width: 32px;\n user-select: none;\n justify-content: center;\n align-items: center;\n cursor: default;\n position: relative;\n}\n\n.checkboxHitbox .svg-container {\n\n background-color: var(--figma-color-icon-onbrand, #fff);\n width: 8px;\n height: 8px;\n}\n\n.checkboxInput {\n margin: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: flex;\n justify-content: center;\n align-items: center;\n\n flex: 0 0 32px;\n width: 14px;\n height: 14px;\n display: inline-flex;\n outline: none;\n}\n\n.checkboxInput:after {\n width: 12px;\n height: 12px;\n box-sizing: border-box;\n background-color: transparent;\n}\n\n.checkboxInput:after {\n content: \"\";\n display: inline-flex;\n margin: 1px;\n width: 12px;\n height: 12px;\n border-radius: 2px;\n box-sizing: border-box;\n background-color: var(--color-bg, white);\n border: 1px solid var(--color-icon, #333333);\n background-clip: padding-box;\n}\n\n.checkboxInput:checked:after {\n border-color: var(--color-bg-brand, #0d99ff);\n background-color: var(--color-bg-brand, #0d99ff);\n}\n\n.checkbox--checkmark {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0) !important;\n}\n\n.grid-item-key .layerIcon {\n width: 16px;\n display: flex;\n justify-content: center;\n flex-shrink: 0;\n height: 32px;\n align-items: center;\n color: var(--color-icon-tertiary, #b3b3b3);\n fill: var(--color-icon-tertiary, #b3b3b3);\n stroke: var(--color-icon-tertiary, #b3b3b3);\n color: var(--color-icon, #333333);\n fill: var(--color-icon, #333333);\n stroke: var(--color-icon, #333333);\n}\n\n.grid-item-key .iconWrapper {\n position: relative;\n}\n\n.grid-item-border {\n border-style: solid;\n border-color: red;\n border-bottom-width: 0px;\n border-right-width: 0px;\n border-top-width: 0px;\n border-left-width: 0px;\n}\n\n.grid-item-border-bottom {\n border-bottom-width: 1px;\n}\n.grid-item-border-left {\n border-left-width: 1px;\n}\n\n.grid-item-border-rigth {\n border-right-width: 1px;\n}\n\n.grid-item-language {\n flex-shrink: 0;\n color: var(--figma-color-text-disabled);\n width: 30px;\n}\n\n.grid-item-gender {\n flex-shrink: 0;\n /* width: 72px; */\n}\n\n.grid-item-plural {\n flex-shrink: 0;\n /* width: 72px; */\n}\n\n.grid-item-translation {\n padding: 0px;\n}\n\n.grid-translation {\n justify-self: stretch;\n}\n\n.grid-item-actions {\n display: flex;\n justify-content: flex-end;\n padding-right: 6px;\n}\n\n.grid-item-actions>span {\n visibility: hidden;\n}\n\n.language-group:hover .grid-item-actions>span {\n visibility: visible;\n}\n\n\n.row-key:hover .grid-item-key>.grid-item-actions>span {\n visibility: visible;\n}\n\n\n\n.button .svg-container {\n width: 32px;\n height: 32px;\n\n}\n\n.button .svg-container.history-svg {\n width: 16px;\n height: 16px;\n}\n\n\n.button .svg-container.eye-closed-svg {\n width: 16px;\n height: 16px;\n}\n\n.button .svg-container.eye-svg {\n width: 16px;\n height: 16px;\n}\n\n.button .svg-container.linked-svg {\n width: 9px;\n height: 15px;\n}\n\n\n.button .svg-container.unlinked-svg {\n width: 9px;\n height: 15px;\n}\n\n.button.layerIcon {\n width: 16px;\n display: flex;\n justify-content: center;\n flex-shrink: 0;\n height: 100%;\n align-items: center;\n color: var(--color-icon-tertiary, #b3b3b3);\n fill: var(--color-icon-tertiary, #b3b3b3);\n stroke: var(--color-icon-tertiary, #b3b3b3);\n color: var(--color-icon, #333333);\n fill: var(--color-icon, #333333);\n stroke: var(--color-icon, #333333);\n\n}\n\n.button.layerIcon {\n position: relative;\n border: 1px solid transparent;\n height: 32px;\n width: 32px;\n border-radius: 2px;\n}\n\n\n\n.selected .button.iconWrapper:hover {\n background-color: var(--figma-color-bg-selected-hover);\n}\n\n\n.button.iconWrapper:hover {\n background-color: var(--figma-color-bg-hover);\n}\n\n\n.keyWrapper {\n display: contents;\n}\n\n\n.keyPluralWrapper {\n display: contents;\n}\n\n.languageWrapper {\n display: contents;\n}\n.keyPluralWrapper .grid-item-actions {\n visibility: visible;\n}\n\n\n.keyPluralWrapper .grid-item-actions .button {\n visibility: hidden;\n}\n\n\n\n.keyPluralWrapper:hover .grid-item-actions .button {\n visibility: visible;\n}\n\n\n\n.keyPluralWrapper:nth-child(even)>div {\n /* background-color: green;*/\n}\n\n\n.keyPluralWrapper.onePlural>div {\n background-color: transparent;\n}\n\n.languageWrapper>div:first-child {\n /* background-color: #E5E5E5; */\n}\n\n.languageWrapper:nth-child(odd)>div:last-child>div {}\n\n.languageWrapper:nth-child(even)>div:last-child>div {\n /* background-color: #F0F0F0; */\n}\n\n\n\n.side-drawer {\n \n overflow: auto;\n height: 100%;\n max-height: 100%;\n background: white;\n position: fixed;\n top: 0;\n right: 0;\n width: 40%;\n z-index: 200;\n \n transform: translateX(100%);\n transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;\n \n}\n\n.side-drawer.open {\n \n box-shadow: 1px 0px 7px rgba(0, 0, 0, 0.5);\n transform: translateX(0);\n transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;\n}\n\n\n.keyWrapper.selected>div {\n background-color: var(--figma-color-bg-selected-secondary, #daebf7);\n}\n\n.keyWrapper.selected>div>div {\n background-color: var(--figma-color-bg-selected-hover, #daebf7);\n}\n\n.keyWrapper.selected .languageWrapper:nth-child(even)>div:last-child>div {\n background-color: var(--figma-color-bg-selected, #daebf7);\n}\n\n.keyWrapper.selected .languageWrapper:nth-child(odd)>div:last-child>div {\n background-color: var(--figma-color-bg-selected-secondary, #daebf7);\n}\n\n.style_picker--search {\n position: sticky;\n z-index: 10;\n top: 0;\n box-sizing: border-box;\n padding-right: 8px;\n height: 40px;\n display: flex;\n align-items: center;\n width: 100%;\n overflow: hidden;\n background-color: var(--figma-color-bg);\n color: var(--figma-color-text);\n fill: var(--figma-color-text);\n}\n\n.style_picker--search:after {\n content: \"\";\n z-index: 10;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 1px;\n background-color: var(--figma-color-border, rgba(0, 0, 0, .1));\n}\n\n.style_picker--search .svg-container {\n position: absolute;\n left: 16px;\n width: 10px;\n height: 10px;\n}\n\n.search--searchInput {\n padding: 0 8px 0 35px;\n}\n\n.search--searchInput {\n outline: none;\n border: none;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n flex: 1;\n background-color: var(--color-bg);\n color: var(--color-text);\n}\n\n.lazy_input {\n cursor: auto;\n}\n\n.searchResults {\n \n box-sizing: border-box;\n \n \n padding: 0 8px 0 16px;\n height: 40px;\n display: flex;\n align-items: center;\n width: 100%;\n overflow: hidden;\n background-color: var(--figma-color-bg);\n color: var(--figma-color-text);\n fill: var(--figma-color-text);\n\n}\n\n\n.searchResults-suggestion {\n \n height: 24px;\n display: flex;\n align-items: center;\n white-space: nowrap;\n border-radius: 4px;\n padding-left: 7px;\n margin-right: 10px;\n padding-right: 5px;\n\n border: 1px solid var(--figma-color-border);\n border-radius: 4px;\n}\n\n.searchResults-suggestion .text {\n \n}\n\n\n.searchResults-suggestion .close { \n width: 18px;\n height: 18px;\n flex: 0 0 16px;\n line-height: 16px;\n margin-left: 3px;\n background-color: var(--figma-color-icon-tertiary);\n}\n\n.searchResults-suggestion .close:hover {\n background-color: var(--figma-color-icon);\n \n}\n\n\n.searchResults-suggestion.active {\n /* background-color: red; */\n\n}\n\n.placeholder-view-grid {\n display: grid;\n grid-template-columns: [drag] auto [type] 12px [name] 1fr [value] 2fr [decimal] 0px;;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/ui/views/onboarding/Onboarding.css": +/*!**************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./src/ui/views/onboarding/Onboarding.css ***! + \**************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ` + +.setup-baselanguage-select { + width: 100%; + display: flex; + align-items: center; +} + + +.available-language { + display: flex; +} + +.available-language .svg-container { + align-self: center; +} + +.available-language .language { + align-self: center; + padding-left: 8px; +} + +.onboarding-buttonbar { + display: flex; + margin-right: 15px; + height: 100px; +} + +.onboarding-buttonbar .button { + margin-left: auto; + margin-top: auto; +} + +button.button--buttonPrimary { + background-color: var(--figma-color-bg-brand); + color: var(--figma-color-text-onbrand); + border-color: var(--figma-color-border-brand); +} + +button.button--buttonPrimary:disabled { + background-color: var(--figma-color-bg-disabled); + color: var(--figma-color-text-ondisabled); + border-color: var(--figma-color-border-disabled); +} + +.space-filler { + flex: 1 +} + +.view-wrapper { + display: flex; + height: 100%; + flex-direction: column; + overflow: scroll; +}`, "",{"version":3,"sources":["webpack://./src/ui/views/onboarding/Onboarding.css"],"names":[],"mappings":";;AAEA;IACI,WAAW;IACX,aAAa;IACb,mBAAmB;AACvB;;;AAGA;IACI,aAAa;AACjB;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,iBAAiB;AACrB;;AAEA;IACI,aAAa;IACb,kBAAkB;IAClB,aAAa;AACjB;;AAEA;GACG,iBAAiB;GACjB,gBAAgB;AACnB;;AAEA;IACI,6CAA6C;IAC7C,sCAAsC;IACtC,6CAA6C;AACjD;;AAEA;IACI,gDAAgD;IAChD,yCAAyC;IACzC,gDAAgD;AACpD;;AAEA;IACI;AACJ;;AAEA;IACI,aAAa;IACb,YAAY;IACZ,sBAAsB;IACtB,gBAAgB;AACpB","sourcesContent":["\n\n.setup-baselanguage-select {\n width: 100%;\n display: flex;\n align-items: center;\n}\n\n\n.available-language {\n display: flex;\n}\n\n.available-language .svg-container {\n align-self: center;\n}\n\n.available-language .language {\n align-self: center;\n padding-left: 8px;\n}\n\n.onboarding-buttonbar {\n display: flex;\n margin-right: 15px;\n height: 100px;\n}\n\n.onboarding-buttonbar .button {\n margin-left: auto;\n margin-top: auto;\n}\n\nbutton.button--buttonPrimary {\n background-color: var(--figma-color-bg-brand);\n color: var(--figma-color-text-onbrand);\n border-color: var(--figma-color-border-brand);\n}\n\nbutton.button--buttonPrimary:disabled {\n background-color: var(--figma-color-bg-disabled);\n color: var(--figma-color-text-ondisabled);\n border-color: var(--figma-color-border-disabled);\n}\n\n.space-filler {\n flex: 1\n}\n\n.view-wrapper {\n display: flex;\n height: 100%;\n flex-direction: column;\n overflow: scroll;\n}"],"sourceRoot":""}]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/runtime/api.js": +/*!*****************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/api.js ***! + \*****************************************************/ +/***/ ((module) => { + +"use strict"; + + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +module.exports = function (cssWithMappingToString) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = ""; + var needLayer = typeof item[5] !== "undefined"; + if (item[4]) { + content += "@supports (".concat(item[4], ") {"); + } + if (item[2]) { + content += "@media ".concat(item[2], " {"); + } + if (needLayer) { + content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {"); + } + content += cssWithMappingToString(item); + if (needLayer) { + content += "}"; + } + if (item[2]) { + content += "}"; + } + if (item[4]) { + content += "}"; + } + return content; + }).join(""); + }; + + // import a list of modules into the list + list.i = function i(modules, media, dedupe, supports, layer) { + if (typeof modules === "string") { + modules = [[null, modules, undefined]]; + } + var alreadyImportedModules = {}; + if (dedupe) { + for (var k = 0; k < this.length; k++) { + var id = this[k][0]; + if (id != null) { + alreadyImportedModules[id] = true; + } + } + } + for (var _k = 0; _k < modules.length; _k++) { + var item = [].concat(modules[_k]); + if (dedupe && alreadyImportedModules[item[0]]) { + continue; + } + if (typeof layer !== "undefined") { + if (typeof item[5] === "undefined") { + item[5] = layer; + } else { + item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}"); + item[5] = layer; + } + } + if (media) { + if (!item[2]) { + item[2] = media; + } else { + item[1] = "@media ".concat(item[2], " {").concat(item[1], "}"); + item[2] = media; + } + } + if (supports) { + if (!item[4]) { + item[4] = "".concat(supports); + } else { + item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}"); + item[4] = supports; + } + } + list.push(item); + } + }; + return list; +}; + +/***/ }), + +/***/ "./node_modules/css-loader/dist/runtime/getUrl.js": +/*!********************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/getUrl.js ***! + \********************************************************/ +/***/ ((module) => { + +"use strict"; + + +module.exports = function (url, options) { + if (!options) { + options = {}; + } + if (!url) { + return url; + } + url = String(url.__esModule ? url.default : url); + + // If url is already wrapped in quotes, remove them + if (/^['"].*['"]$/.test(url)) { + url = url.slice(1, -1); + } + if (options.hash) { + url += options.hash; + } + + // Should url be wrapped? + // See https://drafts.csswg.org/css-values-3/#urls + if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) { + return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\""); + } + return url; +}; + +/***/ }), + +/***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js": +/*!************************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***! + \************************************************************/ +/***/ ((module) => { + +"use strict"; + + +module.exports = function (item) { + var content = item[1]; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + if (typeof btoa === "function") { + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping)))); + var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); + var sourceMapping = "/*# ".concat(data, " */"); + return [content].concat([sourceMapping]).join("\n"); + } + return [content].join("\n"); +}; + +/***/ }), + +/***/ "./node_modules/define-data-property/index.js": +/*!****************************************************!*\ + !*** ./node_modules/define-data-property/index.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var hasPropertyDescriptors = __webpack_require__(/*! has-property-descriptors */ "./node_modules/has-property-descriptors/index.js")(); + +var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); + +var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var gopd = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); + +/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */ +module.exports = function defineDataProperty( + obj, + property, + value +) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new $TypeError('`obj` must be an object or a function`'); + } + if (typeof property !== 'string' && typeof property !== 'symbol') { + throw new $TypeError('`property` must be a string or a symbol`'); + } + if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { + throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); + } + if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { + throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); + } + if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { + throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); + } + if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { + throw new $TypeError('`loose`, if provided, must be a boolean'); + } + + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + + /* @type {false | TypedPropertyDescriptor} */ + var desc = !!gopd && gopd(obj, property); + + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value: value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { + // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable + obj[property] = value; // eslint-disable-line no-param-reassign + } else { + throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); + } +}; + + +/***/ }), + +/***/ "./node_modules/define-properties/index.js": +/*!*************************************************!*\ + !*** ./node_modules/define-properties/index.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var keys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js"); +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + +var toStr = Object.prototype.toString; +var concat = Array.prototype.concat; +var defineDataProperty = __webpack_require__(/*! define-data-property */ "./node_modules/define-data-property/index.js"); + +var isFunction = function (fn) { + return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; +}; + +var supportsDescriptors = __webpack_require__(/*! has-property-descriptors */ "./node_modules/has-property-descriptors/index.js")(); + +var defineProperty = function (object, name, value, predicate) { + if (name in object) { + if (predicate === true) { + if (object[name] === value) { + return; + } + } else if (!isFunction(predicate) || !predicate()) { + return; + } + } + + if (supportsDescriptors) { + defineDataProperty(object, name, value, true); + } else { + defineDataProperty(object, name, value); + } +}; + +var defineProperties = function (object, map) { + var predicates = arguments.length > 2 ? arguments[2] : {}; + var props = keys(map); + if (hasSymbols) { + props = concat.call(props, Object.getOwnPropertySymbols(map)); + } + for (var i = 0; i < props.length; i += 1) { + defineProperty(object, props[i], map[props[i]], predicates[props[i]]); + } +}; + +defineProperties.supportsDescriptors = !!supportsDescriptors; + +module.exports = defineProperties; + + +/***/ }), + +/***/ "./node_modules/document.contains/implementation.js": +/*!**********************************************************!*\ + !*** ./node_modules/document.contains/implementation.js ***! + \**********************************************************/ +/***/ ((module) => { + +"use strict"; + + +module.exports = function contains(other) { + if (arguments.length < 1) { + throw new TypeError('1 argument is required'); + } + if (typeof other !== 'object') { + throw new TypeError('Argument 1 (”other“) to Node.contains must be an instance of Node'); + } + + var node = other; + do { + if (this === node) { + return true; + } + if (node) { + node = node.parentNode; + } + } while (node); + + return false; +}; + + +/***/ }), + +/***/ "./node_modules/document.contains/index.js": +/*!*************************************************!*\ + !*** ./node_modules/document.contains/index.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/document.contains/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/document.contains/polyfill.js"); +var polyfill = getPolyfill(); +var shim = __webpack_require__(/*! ./shim */ "./node_modules/document.contains/shim.js"); + +var boundContains = function contains(node, other) { + return polyfill.apply(node, [other]); +}; + +define(boundContains, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = boundContains; + + +/***/ }), + +/***/ "./node_modules/document.contains/polyfill.js": +/*!****************************************************!*\ + !*** ./node_modules/document.contains/polyfill.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/document.contains/implementation.js"); + +module.exports = function getPolyfill() { + if (typeof document !== 'undefined') { + if (document.contains) { + return document.contains; + } + if (document.body && document.body.contains) { + try { + if (typeof document.body.contains.call(document, '') === 'boolean') { + return document.body.contains; + } + } catch (e) { /**/ } + } + } + return implementation; +}; + + +/***/ }), + +/***/ "./node_modules/document.contains/shim.js": +/*!************************************************!*\ + !*** ./node_modules/document.contains/shim.js ***! + \************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/document.contains/polyfill.js"); + +module.exports = function shimContains() { + var polyfill = getPolyfill(); + if (typeof document !== 'undefined') { + define( + document, + { contains: polyfill }, + { contains: function () { return document.contains !== polyfill; } } + ); + if (typeof Element !== 'undefined') { + define( + Element.prototype, + { contains: polyfill }, + { contains: function () { return Element.prototype.contains !== polyfill; } } + ); + } + } + return polyfill; +}; + + +/***/ }), + +/***/ "./node_modules/es-shim-unscopables/index.js": +/*!***************************************************!*\ + !*** ./node_modules/es-shim-unscopables/index.js ***! + \***************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); + +var hasUnscopables = typeof Symbol === 'function' && typeof Symbol.unscopables === 'symbol'; + +var map = hasUnscopables && Array.prototype[Symbol.unscopables]; + +var $TypeError = TypeError; + +module.exports = function shimUnscopables(method) { + if (typeof method !== 'string' || !method) { + throw new $TypeError('method must be a non-empty string'); + } + if (!has(Array.prototype, method)) { + throw new $TypeError('method must be on Array.prototype'); + } + if (hasUnscopables) { + map[method] = true; + } +}; + + +/***/ }), + +/***/ "./node_modules/es-to-primitive/es2015.js": +/*!************************************************!*\ + !*** ./node_modules/es-to-primitive/es2015.js ***! + \************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "./node_modules/es-to-primitive/helpers/isPrimitive.js"); +var isCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js"); +var isDate = __webpack_require__(/*! is-date-object */ "./node_modules/is-date-object/index.js"); +var isSymbol = __webpack_require__(/*! is-symbol */ "./node_modules/is-symbol/index.js"); + +var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { + if (typeof O === 'undefined' || O === null) { + throw new TypeError('Cannot call method on ' + O); + } + if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { + throw new TypeError('hint must be "string" or "number"'); + } + var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var method, result, i; + for (i = 0; i < methodNames.length; ++i) { + method = O[methodNames[i]]; + if (isCallable(method)) { + result = method.call(O); + if (isPrimitive(result)) { + return result; + } + } + } + throw new TypeError('No default value'); +}; + +var GetMethod = function GetMethod(O, P) { + var func = O[P]; + if (func !== null && typeof func !== 'undefined') { + if (!isCallable(func)) { + throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); + } + return func; + } + return void 0; +}; + +// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + var hint = 'default'; + if (arguments.length > 1) { + if (arguments[1] === String) { + hint = 'string'; + } else if (arguments[1] === Number) { + hint = 'number'; + } + } + + var exoticToPrim; + if (hasSymbols) { + if (Symbol.toPrimitive) { + exoticToPrim = GetMethod(input, Symbol.toPrimitive); + } else if (isSymbol(input)) { + exoticToPrim = Symbol.prototype.valueOf; + } + } + if (typeof exoticToPrim !== 'undefined') { + var result = exoticToPrim.call(input, hint); + if (isPrimitive(result)) { + return result; + } + throw new TypeError('unable to convert exotic object to primitive'); + } + if (hint === 'default' && (isDate(input) || isSymbol(input))) { + hint = 'string'; + } + return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); +}; + + +/***/ }), + +/***/ "./node_modules/es-to-primitive/helpers/isPrimitive.js": +/*!*************************************************************!*\ + !*** ./node_modules/es-to-primitive/helpers/isPrimitive.js ***! + \*************************************************************/ +/***/ ((module) => { + +"use strict"; + + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "./node_modules/eventemitter3/index.js": +/*!*********************************************!*\ + !*** ./node_modules/eventemitter3/index.js ***! + \*********************************************/ +/***/ ((module) => { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} + + +/***/ }), + +/***/ "./node_modules/fast-diff/diff.js": +/*!****************************************!*\ + !*** ./node_modules/fast-diff/diff.js ***! + \****************************************/ +/***/ ((module) => { + +/** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +var DIFF_INSERT = 1; +var DIFF_EQUAL = 0; + +/** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info + * @param {boolean} [cleanup] Apply semantic cleanup before returning. + * @return {Array} Array of diff tuples. + */ +function diff_main(text1, text2, cursor_pos, cleanup, _fix_unicode) { + // Check for equality + if (text1 === text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + if (cursor_pos != null) { + var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos); + if (editdiff) { + return editdiff; + } + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + commonlength = diff_commonSuffix(text1, text2); + var commonsuffix = text1.substring(text1.length - commonlength); + text1 = text1.substring(0, text1.length - commonlength); + text2 = text2.substring(0, text2.length - commonlength); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs, _fix_unicode); + if (cleanup) { + diff_cleanupSemantic(diffs); + } + return diffs; +} + +/** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ +function diff_compute_(text1, text2) { + var diffs; + + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i !== -1) { + // Shorter text is inside the longer text (speedup). + diffs = [ + [DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)], + ]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length === 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [ + [DIFF_DELETE, text1], + [DIFF_INSERT, text2], + ]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); +} + +/** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ +function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = delta % 2 !== 0; + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while ( + x1 < text1_length && + y1 < text2_length && + text1.charAt(x1) === text2.charAt(y1) + ) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while ( + x2 < text1_length && + y2 < text2_length && + text1.charAt(text1_length - x2 - 1) === + text2.charAt(text2_length - y2 - 1) + ) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + k2start += 2; + } else if (!front) { + var k1_offset = v_offset + delta - k2; + if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) { + var x1 = v1[k1_offset]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [ + [DIFF_DELETE, text1], + [DIFF_INSERT, text2], + ]; +} + +/** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ +function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); +} + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if ( + text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid) + ) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + + if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) { + pointermid--; + } + + return pointermid; +} + +/** + * Determine if the suffix of one string is the prefix of another. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of the first + * string and the start of the second string. + * @private + */ +function diff_commonOverlap_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + // Eliminate the null case. + if (text1_length == 0 || text2_length == 0) { + return 0; + } + // Truncate the longer string. + if (text1_length > text2_length) { + text1 = text1.substring(text1_length - text2_length); + } else if (text1_length < text2_length) { + text2 = text2.substring(0, text1_length); + } + var text_length = Math.min(text1_length, text2_length); + // Quick check for the worst case. + if (text1 == text2) { + return text_length; + } + + // Start by looking for a single character match + // and increase length until no match is found. + // Performance analysis: http://neil.fraser.name/news/2010/11/04/ + var best = 0; + var length = 1; + while (true) { + var pattern = text1.substring(text_length - length); + var found = text2.indexOf(pattern); + if (found == -1) { + return best; + } + length += found; + if ( + found == 0 || + text1.substring(text_length - length) == text2.substring(0, length) + ) { + best = length; + length++; + } + } +} + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if ( + text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend) + ) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + + if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) { + pointermid--; + } + + return pointermid; +} + +/** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ +function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ""; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) !== -1) { + var prefixLength = diff_commonPrefix( + longtext.substring(i), + shorttext.substring(j) + ); + var suffixLength = diff_commonSuffix( + longtext.substring(0, i), + shorttext.substring(0, j) + ); + if (best_common.length < suffixLength + prefixLength) { + best_common = + shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [ + best_longtext_a, + best_longtext_b, + best_shorttext_a, + best_shorttext_b, + best_common, + ]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_( + longtext, + shorttext, + Math.ceil(longtext.length / 4) + ); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_( + longtext, + shorttext, + Math.ceil(longtext.length / 2) + ); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + text2_a = hm[0]; + text2_b = hm[1]; + text1_a = hm[2]; + text1_b = hm[3]; + } + var mid_common = hm[4]; + return [text1_a, text1_b, text2_a, text2_b, mid_common]; +} + +/** + * Reduce the number of edits by eliminating semantically trivial equalities. + * @param {!Array.} diffs Array of diff tuples. + */ +function diff_cleanupSemantic(diffs) { + var changes = false; + var equalities = []; // Stack of indices where equalities are found. + var equalitiesLength = 0; // Keeping our own length var is faster in JS. + /** @type {?string} */ + var lastequality = null; + // Always equal to diffs[equalities[equalitiesLength - 1]][1] + var pointer = 0; // Index of current position. + // Number of characters that changed prior to the equality. + var length_insertions1 = 0; + var length_deletions1 = 0; + // Number of characters that changed after the equality. + var length_insertions2 = 0; + var length_deletions2 = 0; + while (pointer < diffs.length) { + if (diffs[pointer][0] == DIFF_EQUAL) { + // Equality found. + equalities[equalitiesLength++] = pointer; + length_insertions1 = length_insertions2; + length_deletions1 = length_deletions2; + length_insertions2 = 0; + length_deletions2 = 0; + lastequality = diffs[pointer][1]; + } else { + // An insertion or deletion. + if (diffs[pointer][0] == DIFF_INSERT) { + length_insertions2 += diffs[pointer][1].length; + } else { + length_deletions2 += diffs[pointer][1].length; + } + // Eliminate an equality that is smaller or equal to the edits on both + // sides of it. + if ( + lastequality && + lastequality.length <= + Math.max(length_insertions1, length_deletions1) && + lastequality.length <= Math.max(length_insertions2, length_deletions2) + ) { + // Duplicate record. + diffs.splice(equalities[equalitiesLength - 1], 0, [ + DIFF_DELETE, + lastequality, + ]); + // Change second copy to insert. + diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; + // Throw away the equality we just deleted. + equalitiesLength--; + // Throw away the previous equality (it needs to be reevaluated). + equalitiesLength--; + pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; + length_insertions1 = 0; // Reset the counters. + length_deletions1 = 0; + length_insertions2 = 0; + length_deletions2 = 0; + lastequality = null; + changes = true; + } + } + pointer++; + } + + // Normalize the diff. + if (changes) { + diff_cleanupMerge(diffs); + } + diff_cleanupSemanticLossless(diffs); + + // Find any overlaps between deletions and insertions. + // e.g: abcxxxxxxdef + // -> abcxxxdef + // e.g: xxxabcdefxxx + // -> defxxxabc + // Only extract an overlap if it is as big as the edit ahead or behind it. + pointer = 1; + while (pointer < diffs.length) { + if ( + diffs[pointer - 1][0] == DIFF_DELETE && + diffs[pointer][0] == DIFF_INSERT + ) { + var deletion = diffs[pointer - 1][1]; + var insertion = diffs[pointer][1]; + var overlap_length1 = diff_commonOverlap_(deletion, insertion); + var overlap_length2 = diff_commonOverlap_(insertion, deletion); + if (overlap_length1 >= overlap_length2) { + if ( + overlap_length1 >= deletion.length / 2 || + overlap_length1 >= insertion.length / 2 + ) { + // Overlap found. Insert an equality and trim the surrounding edits. + diffs.splice(pointer, 0, [ + DIFF_EQUAL, + insertion.substring(0, overlap_length1), + ]); + diffs[pointer - 1][1] = deletion.substring( + 0, + deletion.length - overlap_length1 + ); + diffs[pointer + 1][1] = insertion.substring(overlap_length1); + pointer++; + } + } else { + if ( + overlap_length2 >= deletion.length / 2 || + overlap_length2 >= insertion.length / 2 + ) { + // Reverse overlap found. + // Insert an equality and swap and trim the surrounding edits. + diffs.splice(pointer, 0, [ + DIFF_EQUAL, + deletion.substring(0, overlap_length2), + ]); + diffs[pointer - 1][0] = DIFF_INSERT; + diffs[pointer - 1][1] = insertion.substring( + 0, + insertion.length - overlap_length2 + ); + diffs[pointer + 1][0] = DIFF_DELETE; + diffs[pointer + 1][1] = deletion.substring(overlap_length2); + pointer++; + } + } + pointer++; + } + pointer++; + } +} + +var nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/; +var whitespaceRegex_ = /\s/; +var linebreakRegex_ = /[\r\n]/; +var blanklineEndRegex_ = /\n\r?\n$/; +var blanklineStartRegex_ = /^\r?\n\r?\n/; + +/** + * Look for single edits surrounded on both sides by equalities + * which can be shifted sideways to align the edit to a word boundary. + * e.g: The cat came. -> The cat came. + * @param {!Array.} diffs Array of diff tuples. + */ +function diff_cleanupSemanticLossless(diffs) { + /** + * Given two strings, compute a score representing whether the internal + * boundary falls on logical boundaries. + * Scores range from 6 (best) to 0 (worst). + * Closure, but does not reference any external variables. + * @param {string} one First string. + * @param {string} two Second string. + * @return {number} The score. + * @private + */ + function diff_cleanupSemanticScore_(one, two) { + if (!one || !two) { + // Edges are the best. + return 6; + } + + // Each port of this function behaves slightly differently due to + // subtle differences in each language's definition of things like + // 'whitespace'. Since this function's purpose is largely cosmetic, + // the choice has been made to use each language's native features + // rather than force total conformity. + var char1 = one.charAt(one.length - 1); + var char2 = two.charAt(0); + var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_); + var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_); + var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_); + var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_); + var lineBreak1 = whitespace1 && char1.match(linebreakRegex_); + var lineBreak2 = whitespace2 && char2.match(linebreakRegex_); + var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_); + var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_); + + if (blankLine1 || blankLine2) { + // Five points for blank lines. + return 5; + } else if (lineBreak1 || lineBreak2) { + // Four points for line breaks. + return 4; + } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) { + // Three points for end of sentences. + return 3; + } else if (whitespace1 || whitespace2) { + // Two points for whitespace. + return 2; + } else if (nonAlphaNumeric1 || nonAlphaNumeric2) { + // One point for non-alphanumeric. + return 1; + } + return 0; + } + + var pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if ( + diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL + ) { + // This is a single edit surrounded by equalities. + var equality1 = diffs[pointer - 1][1]; + var edit = diffs[pointer][1]; + var equality2 = diffs[pointer + 1][1]; + + // First, shift the edit as far left as possible. + var commonOffset = diff_commonSuffix(equality1, edit); + if (commonOffset) { + var commonString = edit.substring(edit.length - commonOffset); + equality1 = equality1.substring(0, equality1.length - commonOffset); + edit = commonString + edit.substring(0, edit.length - commonOffset); + equality2 = commonString + equality2; + } + + // Second, step character by character right, looking for the best fit. + var bestEquality1 = equality1; + var bestEdit = edit; + var bestEquality2 = equality2; + var bestScore = + diff_cleanupSemanticScore_(equality1, edit) + + diff_cleanupSemanticScore_(edit, equality2); + while (edit.charAt(0) === equality2.charAt(0)) { + equality1 += edit.charAt(0); + edit = edit.substring(1) + equality2.charAt(0); + equality2 = equality2.substring(1); + var score = + diff_cleanupSemanticScore_(equality1, edit) + + diff_cleanupSemanticScore_(edit, equality2); + // The >= encourages trailing rather than leading whitespace on edits. + if (score >= bestScore) { + bestScore = score; + bestEquality1 = equality1; + bestEdit = edit; + bestEquality2 = equality2; + } + } + + if (diffs[pointer - 1][1] != bestEquality1) { + // We have an improvement, save it back to the diff. + if (bestEquality1) { + diffs[pointer - 1][1] = bestEquality1; + } else { + diffs.splice(pointer - 1, 1); + pointer--; + } + diffs[pointer][1] = bestEdit; + if (bestEquality2) { + diffs[pointer + 1][1] = bestEquality2; + } else { + diffs.splice(pointer + 1, 1); + pointer--; + } + } + } + pointer++; + } +} + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff + */ +function diff_cleanupMerge(diffs, fix_unicode) { + diffs.push([DIFF_EQUAL, ""]); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ""; + var text_insert = ""; + var commonlength; + while (pointer < diffs.length) { + if (pointer < diffs.length - 1 && !diffs[pointer][1]) { + diffs.splice(pointer, 1); + continue; + } + switch (diffs[pointer][0]) { + case DIFF_INSERT: + count_insert++; + text_insert += diffs[pointer][1]; + pointer++; + break; + case DIFF_DELETE: + count_delete++; + text_delete += diffs[pointer][1]; + pointer++; + break; + case DIFF_EQUAL: + var previous_equality = pointer - count_insert - count_delete - 1; + if (fix_unicode) { + // prevent splitting of unicode surrogate pairs. when fix_unicode is true, + // we assume that the old and new text in the diff are complete and correct + // unicode-encoded JS strings, but the tuple boundaries may fall between + // surrogate pairs. we fix this by shaving off stray surrogates from the end + // of the previous equality and the beginning of this equality. this may create + // empty equalities or a common prefix or suffix. for example, if AB and AC are + // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and + // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this + // particular case, both equalities go away, we absorb any previous inequalities, + // and we keep scanning for the next equality before rewriting the tuples. + if ( + previous_equality >= 0 && + ends_with_pair_start(diffs[previous_equality][1]) + ) { + var stray = diffs[previous_equality][1].slice(-1); + diffs[previous_equality][1] = diffs[previous_equality][1].slice( + 0, + -1 + ); + text_delete = stray + text_delete; + text_insert = stray + text_insert; + if (!diffs[previous_equality][1]) { + // emptied out previous equality, so delete it and include previous delete/insert + diffs.splice(previous_equality, 1); + pointer--; + var k = previous_equality - 1; + if (diffs[k] && diffs[k][0] === DIFF_INSERT) { + count_insert++; + text_insert = diffs[k][1] + text_insert; + k--; + } + if (diffs[k] && diffs[k][0] === DIFF_DELETE) { + count_delete++; + text_delete = diffs[k][1] + text_delete; + k--; + } + previous_equality = k; + } + } + if (starts_with_pair_end(diffs[pointer][1])) { + var stray = diffs[pointer][1].charAt(0); + diffs[pointer][1] = diffs[pointer][1].slice(1); + text_delete += stray; + text_insert += stray; + } + } + if (pointer < diffs.length - 1 && !diffs[pointer][1]) { + // for empty equality not at end, wait for next equality + diffs.splice(pointer, 1); + break; + } + if (text_delete.length > 0 || text_insert.length > 0) { + // note that diff_commonPrefix and diff_commonSuffix are unicode-aware + if (text_delete.length > 0 && text_insert.length > 0) { + // Factor out any common prefixes. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if (previous_equality >= 0) { + diffs[previous_equality][1] += text_insert.substring( + 0, + commonlength + ); + } else { + diffs.splice(0, 0, [ + DIFF_EQUAL, + text_insert.substring(0, commonlength), + ]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixes. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (commonlength !== 0) { + diffs[pointer][1] = + text_insert.substring(text_insert.length - commonlength) + + diffs[pointer][1]; + text_insert = text_insert.substring( + 0, + text_insert.length - commonlength + ); + text_delete = text_delete.substring( + 0, + text_delete.length - commonlength + ); + } + } + // Delete the offending records and add the merged ones. + var n = count_insert + count_delete; + if (text_delete.length === 0 && text_insert.length === 0) { + diffs.splice(pointer - n, n); + pointer = pointer - n; + } else if (text_delete.length === 0) { + diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]); + pointer = pointer - n + 1; + } else if (text_insert.length === 0) { + diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]); + pointer = pointer - n + 1; + } else { + diffs.splice( + pointer - n, + n, + [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert] + ); + pointer = pointer - n + 2; + } + } + if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ""; + text_insert = ""; + break; + } + } + if (diffs[diffs.length - 1][1] === "") { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if ( + diffs[pointer - 1][0] === DIFF_EQUAL && + diffs[pointer + 1][0] === DIFF_EQUAL + ) { + // This is a single edit surrounded by equalities. + if ( + diffs[pointer][1].substring( + diffs[pointer][1].length - diffs[pointer - 1][1].length + ) === diffs[pointer - 1][1] + ) { + // Shift the edit over the previous equality. + diffs[pointer][1] = + diffs[pointer - 1][1] + + diffs[pointer][1].substring( + 0, + diffs[pointer][1].length - diffs[pointer - 1][1].length + ); + diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; + diffs.splice(pointer - 1, 1); + changes = true; + } else if ( + diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1] + ) { + // Shift the edit over the next equality. + diffs[pointer - 1][1] += diffs[pointer + 1][1]; + diffs[pointer][1] = + diffs[pointer][1].substring(diffs[pointer + 1][1].length) + + diffs[pointer + 1][1]; + diffs.splice(pointer + 1, 1); + changes = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs, fix_unicode); + } +} + +function is_surrogate_pair_start(charCode) { + return charCode >= 0xd800 && charCode <= 0xdbff; +} + +function is_surrogate_pair_end(charCode) { + return charCode >= 0xdc00 && charCode <= 0xdfff; +} + +function starts_with_pair_end(str) { + return is_surrogate_pair_end(str.charCodeAt(0)); +} + +function ends_with_pair_start(str) { + return is_surrogate_pair_start(str.charCodeAt(str.length - 1)); +} + +function remove_empty_tuples(tuples) { + var ret = []; + for (var i = 0; i < tuples.length; i++) { + if (tuples[i][1].length > 0) { + ret.push(tuples[i]); + } + } + return ret; +} + +function make_edit_splice(before, oldMiddle, newMiddle, after) { + if (ends_with_pair_start(before) || starts_with_pair_end(after)) { + return null; + } + return remove_empty_tuples([ + [DIFF_EQUAL, before], + [DIFF_DELETE, oldMiddle], + [DIFF_INSERT, newMiddle], + [DIFF_EQUAL, after], + ]); +} + +function find_cursor_edit_diff(oldText, newText, cursor_pos) { + // note: this runs after equality check has ruled out exact equality + var oldRange = + typeof cursor_pos === "number" + ? { index: cursor_pos, length: 0 } + : cursor_pos.oldRange; + var newRange = typeof cursor_pos === "number" ? null : cursor_pos.newRange; + // take into account the old and new selection to generate the best diff + // possible for a text edit. for example, a text change from "xxx" to "xx" + // could be a delete or forwards-delete of any one of the x's, or the + // result of selecting two of the x's and typing "x". + var oldLength = oldText.length; + var newLength = newText.length; + if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) { + // see if we have an insert or delete before or after cursor + var oldCursor = oldRange.index; + var oldBefore = oldText.slice(0, oldCursor); + var oldAfter = oldText.slice(oldCursor); + var maybeNewCursor = newRange ? newRange.index : null; + editBefore: { + // is this an insert or delete right before oldCursor? + var newCursor = oldCursor + newLength - oldLength; + if (maybeNewCursor !== null && maybeNewCursor !== newCursor) { + break editBefore; + } + if (newCursor < 0 || newCursor > newLength) { + break editBefore; + } + var newBefore = newText.slice(0, newCursor); + var newAfter = newText.slice(newCursor); + if (newAfter !== oldAfter) { + break editBefore; + } + var prefixLength = Math.min(oldCursor, newCursor); + var oldPrefix = oldBefore.slice(0, prefixLength); + var newPrefix = newBefore.slice(0, prefixLength); + if (oldPrefix !== newPrefix) { + break editBefore; + } + var oldMiddle = oldBefore.slice(prefixLength); + var newMiddle = newBefore.slice(prefixLength); + return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter); + } + editAfter: { + // is this an insert or delete right after oldCursor? + if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) { + break editAfter; + } + var cursor = oldCursor; + var newBefore = newText.slice(0, cursor); + var newAfter = newText.slice(cursor); + if (newBefore !== oldBefore) { + break editAfter; + } + var suffixLength = Math.min(oldLength - cursor, newLength - cursor); + var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength); + var newSuffix = newAfter.slice(newAfter.length - suffixLength); + if (oldSuffix !== newSuffix) { + break editAfter; + } + var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength); + var newMiddle = newAfter.slice(0, newAfter.length - suffixLength); + return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix); + } + } + if (oldRange.length > 0 && newRange && newRange.length === 0) { + replaceRange: { + // see if diff could be a splice of the old selection range + var oldPrefix = oldText.slice(0, oldRange.index); + var oldSuffix = oldText.slice(oldRange.index + oldRange.length); + var prefixLength = oldPrefix.length; + var suffixLength = oldSuffix.length; + if (newLength < prefixLength + suffixLength) { + break replaceRange; + } + var newPrefix = newText.slice(0, prefixLength); + var newSuffix = newText.slice(newLength - suffixLength); + if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) { + break replaceRange; + } + var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength); + var newMiddle = newText.slice(prefixLength, newLength - suffixLength); + return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix); + } + } + + return null; +} + +function diff(text1, text2, cursor_pos, cleanup) { + // only pass fix_unicode=true at the top level, not when diff_main is + // recursively invoked + return diff_main(text1, text2, cursor_pos, cleanup, true); +} + +diff.INSERT = DIFF_INSERT; +diff.DELETE = DIFF_DELETE; +diff.EQUAL = DIFF_EQUAL; + +module.exports = diff; + + +/***/ }), + +/***/ "./node_modules/function-bind/implementation.js": +/*!******************************************************!*\ + !*** ./node_modules/function-bind/implementation.js ***! + \******************************************************/ +/***/ ((module) => { + +"use strict"; + + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; + + +/***/ }), + +/***/ "./node_modules/function-bind/index.js": +/*!*********************************************!*\ + !*** ./node_modules/function-bind/index.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function-bind/implementation.js"); + +module.exports = Function.prototype.bind || implementation; + + +/***/ }), + +/***/ "./node_modules/function.prototype.name/implementation.js": +/*!****************************************************************!*\ + !*** ./node_modules/function.prototype.name/implementation.js ***! + \****************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var IsCallable = __webpack_require__(/*! es-abstract/2023/IsCallable */ "./node_modules/es-abstract/2023/IsCallable.js"); +var HasOwnProperty = __webpack_require__(/*! es-abstract/2023/HasOwnProperty */ "./node_modules/es-abstract/2023/HasOwnProperty.js"); +var functionsHaveNames = __webpack_require__(/*! functions-have-names */ "./node_modules/functions-have-names/index.js")(); +var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); +var $functionToString = callBound('Function.prototype.toString'); +var $stringMatch = callBound('String.prototype.match'); +var toStr = callBound('Object.prototype.toString'); + +var classRegex = /^class /; + +var isClass = function isClassConstructor(fn) { + if (IsCallable(fn)) { + return false; + } + if (typeof fn !== 'function') { + return false; + } + try { + var match = $stringMatch($functionToString(fn), classRegex); + return !!match; + } catch (e) {} + return false; +}; + +var regex = /\s*function\s+([^(\s]*)\s*/; + +var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing + +var objectClass = '[object Object]'; +var ddaClass = '[object HTMLAllCollection]'; + +var functionProto = Function.prototype; + +var isDDA = function isDocumentDotAll() { + return false; +}; +if (typeof document === 'object') { + // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly + var all = document.all; + if (toStr(all) === toStr(document.all)) { + isDDA = function isDocumentDotAll(value) { + /* globals document: false */ + // in IE 6-8, typeof document.all is "object" and it's truthy + if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { + try { + var str = toStr(value); + // IE 6-8 uses `objectClass` + return (str === ddaClass || str === objectClass) && value('') == null; // eslint-disable-line eqeqeq + } catch (e) { /**/ } + } + return false; + }; + } +} + +module.exports = function getName() { + if (isDDA(this) || (!isClass(this) && !IsCallable(this))) { + throw new TypeError('Function.prototype.name sham getter called on non-function'); + } + if (functionsHaveNames && HasOwnProperty(this, 'name')) { + return this.name; + } + if (this === functionProto) { + return ''; + } + var str = $functionToString(this); + var match = $stringMatch(str, regex); + var name = match && match[1]; + return name; +}; + + +/***/ }), + +/***/ "./node_modules/function.prototype.name/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/function.prototype.name/index.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function.prototype.name/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/function.prototype.name/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "./node_modules/function.prototype.name/shim.js"); + +var bound = callBind(implementation); + +define(bound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = bound; + + +/***/ }), + +/***/ "./node_modules/function.prototype.name/polyfill.js": +/*!**********************************************************!*\ + !*** ./node_modules/function.prototype.name/polyfill.js ***! + \**********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function.prototype.name/implementation.js"); + +module.exports = function getPolyfill() { + return implementation; +}; + + +/***/ }), + +/***/ "./node_modules/function.prototype.name/shim.js": +/*!******************************************************!*\ + !*** ./node_modules/function.prototype.name/shim.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var supportsDescriptors = (__webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js").supportsDescriptors); +var functionsHaveNames = __webpack_require__(/*! functions-have-names */ "./node_modules/functions-have-names/index.js")(); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/function.prototype.name/polyfill.js"); +var defineProperty = Object.defineProperty; +var TypeErr = TypeError; + +module.exports = function shimName() { + var polyfill = getPolyfill(); + if (functionsHaveNames) { + return polyfill; + } + if (!supportsDescriptors) { + throw new TypeErr('Shimming Function.prototype.name support requires ES5 property descriptor support.'); + } + var functionProto = Function.prototype; + defineProperty(functionProto, 'name', { + configurable: true, + enumerable: false, + get: function () { + var name = polyfill.call(this); + if (this !== functionProto) { + defineProperty(this, 'name', { + configurable: true, + enumerable: false, + value: name, + writable: false + }); + } + return name; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "./node_modules/functions-have-names/index.js": +/*!****************************************************!*\ + !*** ./node_modules/functions-have-names/index.js ***! + \****************************************************/ +/***/ ((module) => { + +"use strict"; + + +var functionsHaveNames = function functionsHaveNames() { + return typeof function f() {}.name === 'string'; +}; + +var gOPD = Object.getOwnPropertyDescriptor; +if (gOPD) { + try { + gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + gOPD = null; + } +} + +functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() { + if (!functionsHaveNames() || !gOPD) { + return false; + } + var desc = gOPD(function () {}, 'name'); + return !!desc && !!desc.configurable; +}; + +var $bind = Function.prototype.bind; + +functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() { + return functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== ''; +}; + +module.exports = functionsHaveNames; + + +/***/ }), + +/***/ "./node_modules/get-intrinsic/index.js": +/*!*********************************************!*\ + !*** ./node_modules/get-intrinsic/index.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var undefined; + +var $SyntaxError = SyntaxError; +var $Function = Function; +var $TypeError = TypeError; + +// eslint-disable-next-line consistent-return +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { + throw new $TypeError(); +}; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = __webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")(); +var hasProto = __webpack_require__(/*! has-proto */ "./node_modules/has-proto/index.js")(); + +var getProto = Object.getPrototypeOf || ( + hasProto + ? function (x) { return x.__proto__; } // eslint-disable-line no-proto + : null +); + +var needsEval = {}; + +var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': needsEval, + '%AsyncGenerator%': needsEval, + '%AsyncGeneratorFunction%': needsEval, + '%AsyncIteratorPrototype%': needsEval, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, + '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': needsEval, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': Object, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%ReferenceError%': ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet +}; + +if (getProto) { + try { + null.error; // eslint-disable-line no-unused-expressions + } catch (e) { + // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 + var errorProto = getProto(getProto(e)); + INTRINSICS['%Error.prototype%'] = errorProto; + } +} + +var doEval = function doEval(name) { + var value; + if (name === '%AsyncFunction%') { + value = getEvalledConstructor('async function () {}'); + } else if (name === '%GeneratorFunction%') { + value = getEvalledConstructor('function* () {}'); + } else if (name === '%AsyncGeneratorFunction%') { + value = getEvalledConstructor('async function* () {}'); + } else if (name === '%AsyncGenerator%') { + var fn = doEval('%AsyncGeneratorFunction%'); + if (fn) { + value = fn.prototype; + } + } else if (name === '%AsyncIteratorPrototype%') { + var gen = doEval('%AsyncGenerator%'); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + + INTRINSICS[name] = value; + + return value; +}; + +var LEGACY_ALIASES = { + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; + +var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); +var hasOwn = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); +var $concat = bind.call(Function.call, Array.prototype.concat); +var $spliceApply = bind.call(Function.apply, Array.prototype.splice); +var $replace = bind.call(Function.call, String.prototype.replace); +var $strSlice = bind.call(Function.call, String.prototype.slice); +var $exec = bind.call(Function.call, RegExp.prototype.exec); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === '%' && last !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); + } else if (last === '%' && first !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); + } + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } + + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ( + ( + (first === '"' || first === "'" || first === '`') + || (last === '"' || last === "'" || last === '`') + ) + && first !== last + ) { + throw new $SyntaxError('property names with quotes must have matching quotes'); + } + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } + + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; + + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + return void undefined; + } + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; +}; + + +/***/ }), + +/***/ "./node_modules/gopd/index.js": +/*!************************************!*\ + !*** ./node_modules/gopd/index.js ***! + \************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; + + +/***/ }), + +/***/ "./node_modules/has-property-descriptors/index.js": +/*!********************************************************!*\ + !*** ./node_modules/has-property-descriptors/index.js ***! + \********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +var hasPropertyDescriptors = function hasPropertyDescriptors() { + if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + return true; + } catch (e) { + // IE 8 has a broken defineProperty + return false; + } + } + return false; +}; + +hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + // node v0.6 has a bug where array lengths can be Set but not Defined + if (!hasPropertyDescriptors()) { + return null; + } + try { + return $defineProperty([], 'length', { value: 1 }).length !== 1; + } catch (e) { + // In Firefox 4-22, defining length on an array throws an exception. + return true; + } +}; + +module.exports = hasPropertyDescriptors; + + +/***/ }), + +/***/ "./node_modules/has-proto/index.js": +/*!*****************************************!*\ + !*** ./node_modules/has-proto/index.js ***! + \*****************************************/ +/***/ ((module) => { + +"use strict"; + + +var test = { + foo: {} +}; + +var $Object = Object; + +module.exports = function hasProto() { + return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object); +}; + + +/***/ }), + +/***/ "./node_modules/has-symbols/index.js": +/*!*******************************************!*\ + !*** ./node_modules/has-symbols/index.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var origSymbol = typeof Symbol !== 'undefined' && Symbol; +var hasSymbolSham = __webpack_require__(/*! ./shams */ "./node_modules/has-symbols/shams.js"); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; + + +/***/ }), + +/***/ "./node_modules/has-symbols/shams.js": +/*!*******************************************!*\ + !*** ./node_modules/has-symbols/shams.js ***! + \*******************************************/ +/***/ ((module) => { + +"use strict"; + + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + + +/***/ }), + +/***/ "./node_modules/has-tostringtag/shams.js": +/*!***********************************************!*\ + !*** ./node_modules/has-tostringtag/shams.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var hasSymbols = __webpack_require__(/*! has-symbols/shams */ "./node_modules/has-symbols/shams.js"); + +module.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; +}; + + +/***/ }), + +/***/ "./node_modules/has/src/index.js": +/*!***************************************!*\ + !*** ./node_modules/has/src/index.js ***! + \***************************************/ +/***/ ((module) => { + +"use strict"; + + +var hasOwnProperty = {}.hasOwnProperty; +var call = Function.prototype.call; + +module.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) { + return call.call(hasOwnProperty, O, P); +}; + + +/***/ }), + +/***/ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js ***! + \**********************************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var reactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); + +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true +}; +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; +var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; +var MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true +}; +var TYPE_STATICS = {}; +TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; +TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; + +function getStatics(component) { + // React v16.11 and below + if (reactIs.isMemo(component)) { + return MEMO_STATICS; + } // React v16.12 and above + + + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; +} + +var defineProperty = Object.defineProperty; +var getOwnPropertyNames = Object.getOwnPropertyNames; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var getPrototypeOf = Object.getPrototypeOf; +var objectPrototype = Object.prototype; +function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + } + + return targetComponent; +} + +module.exports = hoistNonReactStatics; + + +/***/ }), + +/***/ "./node_modules/html-parse-stringify/dist/html-parse-stringify.module.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/html-parse-stringify/dist/html-parse-stringify.module.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var void_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! void-elements */ "./node_modules/void-elements/index.js"); +/* harmony import */ var void_elements__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(void_elements__WEBPACK_IMPORTED_MODULE_0__); +var t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(n){var r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=n.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(r.name=i[1],((void_elements__WEBPACK_IMPORTED_MODULE_0___default())[i[1]]||"/"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith("!--"))){var s=n.indexOf("--\x3e");return{type:"comment",comment:-1!==s?n.slice(4,s):""}}for(var a=new RegExp(t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(a,"")+"";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf("<")){var u=e.indexOf("<");c.push({type:"text",content:-1===u?e:e.substring(0,u)})}return e.replace(r,function(r,s){if(m){if(r!=="")return;m=!1}var u,f="/"!==r.charAt(1),h=r.startsWith("\x3c!--"),p=s+r.length,d=e.charAt(p);if(h){var v=n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,"tag"===(a=n(r)).type&&t.components[a.name]&&(a.type="component",m=!0),a.voidElement||m||!d||"<"===d||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&"<"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf("<",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=" "),(x>-1&&l+u.length>=0||" "!==g)&&u.push({type:"text",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a("",t)},"")}};/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (c); +//# sourceMappingURL=html-parse-stringify.module.js.map + + +/***/ }), + +/***/ "./node_modules/is-callable/index.js": +/*!*******************************************!*\ + !*** ./node_modules/is-callable/index.js ***! + \*******************************************/ +/***/ ((module) => { + +"use strict"; + + +var fnToStr = Function.prototype.toString; +var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; +var badArrayLike; +var isCallableMarker; +if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { + try { + badArrayLike = Object.defineProperty({}, 'length', { + get: function () { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + // eslint-disable-next-line no-throw-literal + reflectApply(function () { throw 42; }, null, badArrayLike); + } catch (_) { + if (_ !== isCallableMarker) { + reflectApply = null; + } + } +} else { + reflectApply = null; +} + +var constructorRegex = /^\s*class\b/; +var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; // not a function + } +}; + +var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { return false; } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } +}; +var toStr = Object.prototype.toString; +var objectClass = '[object Object]'; +var fnClass = '[object Function]'; +var genClass = '[object GeneratorFunction]'; +var ddaClass = '[object HTMLAllCollection]'; // IE 11 +var ddaClass2 = '[object HTML document.all class]'; +var ddaClass3 = '[object HTMLCollection]'; // IE 9-10 +var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` + +var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing + +var isDDA = function isDocumentDotAll() { return false; }; +if (typeof document === 'object') { + // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly + var all = document.all; + if (toStr.call(all) === toStr.call(document.all)) { + isDDA = function isDocumentDotAll(value) { + /* globals document: false */ + // in IE 6-8, typeof document.all is "object" and it's truthy + if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { + try { + var str = toStr.call(value); + return ( + str === ddaClass + || str === ddaClass2 + || str === ddaClass3 // opera 12.16 + || str === objectClass // IE 6-8 + ) && value('') == null; // eslint-disable-line eqeqeq + } catch (e) { /**/ } + } + return false; + }; + } +} + +module.exports = reflectApply + ? function isCallable(value) { + if (isDDA(value)) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + try { + reflectApply(value, null, badArrayLike); + } catch (e) { + if (e !== isCallableMarker) { return false; } + } + return !isES6ClassFn(value) && tryFunctionObject(value); + } + : function isCallable(value) { + if (isDDA(value)) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (hasToStringTag) { return tryFunctionObject(value); } + if (isES6ClassFn(value)) { return false; } + var strClass = toStr.call(value); + if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; } + return tryFunctionObject(value); + }; + + +/***/ }), + +/***/ "./node_modules/is-date-object/index.js": +/*!**********************************************!*\ + !*** ./node_modules/is-date-object/index.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var getDay = Date.prototype.getDay; +var tryDateObject = function tryDateGetDayCall(value) { + try { + getDay.call(value); + return true; + } catch (e) { + return false; + } +}; + +var toStr = Object.prototype.toString; +var dateClass = '[object Date]'; +var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); + +module.exports = function isDateObject(value) { + if (typeof value !== 'object' || value === null) { + return false; + } + return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; +}; + + +/***/ }), + +/***/ "./node_modules/is-regex/index.js": +/*!****************************************!*\ + !*** ./node_modules/is-regex/index.js ***! + \****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); +var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); +var has; +var $exec; +var isRegexMarker; +var badStringifier; + +if (hasToStringTag) { + has = callBound('Object.prototype.hasOwnProperty'); + $exec = callBound('RegExp.prototype.exec'); + isRegexMarker = {}; + + var throwRegexMarker = function () { + throw isRegexMarker; + }; + badStringifier = { + toString: throwRegexMarker, + valueOf: throwRegexMarker + }; + + if (typeof Symbol.toPrimitive === 'symbol') { + badStringifier[Symbol.toPrimitive] = throwRegexMarker; + } +} + +var $toString = callBound('Object.prototype.toString'); +var gOPD = Object.getOwnPropertyDescriptor; +var regexClass = '[object RegExp]'; + +module.exports = hasToStringTag + // eslint-disable-next-line consistent-return + ? function isRegex(value) { + if (!value || typeof value !== 'object') { + return false; + } + + var descriptor = gOPD(value, 'lastIndex'); + var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); + if (!hasLastIndexDataProperty) { + return false; + } + + try { + $exec(value, badStringifier); + } catch (e) { + return e === isRegexMarker; + } + } + : function isRegex(value) { + // In older browsers, typeof regex incorrectly returns 'function' + if (!value || (typeof value !== 'object' && typeof value !== 'function')) { + return false; + } + + return $toString(value) === regexClass; + }; + + +/***/ }), + +/***/ "./node_modules/is-symbol/index.js": +/*!*****************************************!*\ + !*** ./node_modules/is-symbol/index.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var toStr = Object.prototype.toString; +var hasSymbols = __webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")(); + +if (hasSymbols) { + var symToStr = Symbol.prototype.toString; + var symStringRegex = /^Symbol\(.*\)$/; + var isSymbolObject = function isRealSymbolObject(value) { + if (typeof value.valueOf() !== 'symbol') { + return false; + } + return symStringRegex.test(symToStr.call(value)); + }; + + module.exports = function isSymbol(value) { + if (typeof value === 'symbol') { + return true; + } + if (toStr.call(value) !== '[object Symbol]') { + return false; + } + try { + return isSymbolObject(value); + } catch (e) { + return false; + } + }; +} else { + + module.exports = function isSymbol(value) { + // this environment does not support Symbols. + return false && 0; + }; +} + + +/***/ }), + +/***/ "./node_modules/lodash.clonedeep/index.js": +/*!************************************************!*\ + !*** ./node_modules/lodash.clonedeep/index.js ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = true && ({}).Object === Object && ({}); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; +} + +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array ? array.length : 0; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, true, true); +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = cloneDeep; + + +/***/ }), + +/***/ "./node_modules/lodash.isequal/index.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash.isequal/index.js ***! + \**********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = true && ({}).Object === Object && ({}); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = isEqual; + + +/***/ }), + +/***/ "./node_modules/lodash.merge/index.js": +/*!********************************************!*\ + !*** ./node_modules/lodash.merge/index.js ***! + \********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = true && ({}).Object === Object && ({}); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeMax = Math.max, + nativeNow = Date.now; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ +function toPlainObject(value) { + return copyObject(value, keysIn(value)); +} + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +/** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ +var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = merge; + + +/***/ }), + +/***/ "./node_modules/memoize-one/dist/memoize-one.esm.js": +/*!**********************************************************!*\ + !*** ./node_modules/memoize-one/dist/memoize-one.esm.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ memoizeOne) +/* harmony export */ }); +var safeIsNaN = Number.isNaN || + function ponyfill(value) { + return typeof value === 'number' && value !== value; + }; +function isEqual(first, second) { + if (first === second) { + return true; + } + if (safeIsNaN(first) && safeIsNaN(second)) { + return true; + } + return false; +} +function areInputsEqual(newInputs, lastInputs) { + if (newInputs.length !== lastInputs.length) { + return false; + } + for (var i = 0; i < newInputs.length; i++) { + if (!isEqual(newInputs[i], lastInputs[i])) { + return false; + } + } + return true; +} + +function memoizeOne(resultFn, isEqual) { + if (isEqual === void 0) { isEqual = areInputsEqual; } + var cache = null; + function memoized() { + var newArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + newArgs[_i] = arguments[_i]; + } + if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) { + return cache.lastResult; + } + var lastResult = resultFn.apply(this, newArgs); + cache = { + lastResult: lastResult, + lastArgs: newArgs, + lastThis: this, + }; + return lastResult; + } + memoized.clear = function clear() { + cache = null; + }; + return memoized; +} + + + + +/***/ }), + +/***/ "./node_modules/mixpanel-figma/mixpanel-patched.js": +/*!*********************************************************!*\ + !*** ./node_modules/mixpanel-figma/mixpanel-patched.js ***! + \*********************************************************/ +/***/ ((module) => { + +"use strict"; + + +var Config = { + DEBUG: false, + LIB_VERSION: '2.32.0' +}; + +// since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file +var window$1; +if (typeof(window) === 'undefined') { + var loc = { + hostname: '' + }; + window$1 = { + navigator: { userAgent: '' }, + document: { + location: loc, + referrer: '' + }, + screen: { width: 0, height: 0 }, + location: loc + }; +} else { + window$1 = window; +} + +/* + * Saved references to long variable names, so that closure compiler can + * minimize file size. + */ + +var ArrayProto = Array.prototype; +var ObjProto = Object.prototype; +var slice = ArrayProto.slice; +var toString = ObjProto.toString; +var hasOwnProperty = ObjProto.hasOwnProperty; +var windowConsole = window$1.console; +var navigator$1 = window$1.navigator; +var document$1 = window$1.document; +var windowOpera = window$1.opera; +var screen = window$1.screen; +var userAgent = navigator$1.userAgent; +var nativeForEach = ArrayProto.forEach; +var nativeIndexOf = ArrayProto.indexOf; +var nativeIsArray = Array.isArray; +var breaker = {}; + +// Console override +var console$1 = { + /** @type {function(...*)} */ + log: function() { + if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) { + try { + windowConsole.log.apply(windowConsole, arguments); + } catch (err) { + _.each(arguments, function(arg) { + windowConsole.log(arg); + }); + } + } + }, + /** @type {function(...*)} */ + error: function() { + if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) { + var args = ['Mixpanel error:'].concat(_.toArray(arguments)); + try { + windowConsole.error.apply(windowConsole, args); + } catch (err) { + _.each(args, function(arg) { + windowConsole.error(arg); + }); + } + } + }, + /** @type {function(...*)} */ + critical: function() { + if (!_.isUndefined(windowConsole) && windowConsole) { + var args = ['Mixpanel error:'].concat(_.toArray(arguments)); + try { + windowConsole.error.apply(windowConsole, args); + } catch (err) { + _.each(args, function(arg) { + windowConsole.error(arg); + }); + } + } + } +}; + + +// UNDERSCORE +// Embed part of the Underscore Library +var _ = { +}; + +/** + * @param {*=} obj + * @param {function(...*)=} iterator + * @param {Object=} context + */ +_.each = function(obj, iterator, context) { + if (obj === null || obj === undefined) { + return; + } + if (nativeForEach && obj.forEach === nativeForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i++) { + if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) { + return; + } + } + } else { + for (var key in obj) { + if (hasOwnProperty.call(obj, key)) { + if (iterator.call(context, obj[key], key, obj) === breaker) { + return; + } + } + } + } +}; + +_.extend = function(obj) { + _.each(slice.call(arguments, 1), function(source) { + for (var prop in source) { + if (source[prop] !== void 0) { + obj[prop] = source[prop]; + } + } + }); + return obj; +}; + +_.isArray = nativeIsArray || function(obj) { + return toString.call(obj) === '[object Array]'; +}; + +// from a comment on http://dbj.org/dbj/?p=286 +// fails on only one very rare and deliberate custom object: +// var bomb = { toString : undefined, valueOf: function(o) { return "function BOMBA!"; }}; +_.isFunction = function(f) { + try { + return /^\s*\bfunction\b/.test(f); + } catch (x) { + return false; + } +}; + +_.isArguments = function(obj) { + return !!(obj && hasOwnProperty.call(obj, 'callee')); +}; + +_.toArray = function(iterable) { + if (!iterable) { + return []; + } + if (iterable.toArray) { + return iterable.toArray(); + } + if (_.isArray(iterable)) { + return slice.call(iterable); + } + if (_.isArguments(iterable)) { + return slice.call(iterable); + } + return _.values(iterable); +}; + +_.keys = function(obj) { + var results = []; + if (obj === null) { + return results; + } + _.each(obj, function(value, key) { + results[results.length] = key; + }); + return results; +}; + +_.values = function(obj) { + var results = []; + if (obj === null) { + return results; + } + _.each(obj, function(value) { + results[results.length] = value; + }); + return results; +}; + +_.include = function(obj, target) { + var found = false; + if (obj === null) { + return found; + } + if (nativeIndexOf && obj.indexOf === nativeIndexOf) { + return obj.indexOf(target) != -1; + } + _.each(obj, function(value) { + if (found || (found = (value === target))) { + return breaker; + } + }); + return found; +}; + +_.includes = function(str, needle) { + return str.indexOf(needle) !== -1; +}; + +// Underscore Addons +_.isObject = function(obj) { + return (obj === Object(obj) && !_.isArray(obj)); +}; + +_.isEmptyObject = function(obj) { + if (_.isObject(obj)) { + for (var key in obj) { + if (hasOwnProperty.call(obj, key)) { + return false; + } + } + return true; + } + return false; +}; + +_.isUndefined = function(obj) { + return obj === void 0; +}; + +_.isString = function(obj) { + return toString.call(obj) == '[object String]'; +}; + +_.isDate = function(obj) { + return toString.call(obj) == '[object Date]'; +}; + +_.isNumber = function(obj) { + return toString.call(obj) == '[object Number]'; +}; + +_.encodeDates = function(obj) { + _.each(obj, function(v, k) { + if (_.isDate(v)) { + obj[k] = _.formatDate(v); + } else if (_.isObject(v)) { + obj[k] = _.encodeDates(v); // recurse + } + }); + return obj; +}; + +_.formatDate = function(d) { + // YYYY-MM-DDTHH:MM:SS in UTC + function pad(n) { + return n < 10 ? '0' + n : n; + } + return d.getUTCFullYear() + '-' + + pad(d.getUTCMonth() + 1) + '-' + + pad(d.getUTCDate()) + 'T' + + pad(d.getUTCHours()) + ':' + + pad(d.getUTCMinutes()) + ':' + + pad(d.getUTCSeconds()); +}; + +_.safewrap = function(f) { + return function() { + try { + return f.apply(this, arguments); + } catch (e) { + console$1.critical('Implementation error. Please turn on debug and contact support@mixpanel.com.'); + if (Config.DEBUG){ + console$1.critical(e); + } + } + }; +}; + +_.safewrap_class = function(klass, functions) { + for (var i = 0; i < functions.length; i++) { + klass.prototype[functions[i]] = _.safewrap(klass.prototype[functions[i]]); + } +}; + +_.strip_empty_properties = function(p) { + var ret = {}; + _.each(p, function(v, k) { + if (_.isString(v) && v.length > 0) { + ret[k] = v; + } + }); + return ret; +}; + +/* + * this function returns a copy of object after truncating it. If + * passed an Array or Object it will iterate through obj and + * truncate all the values recursively. + */ +_.truncate = function(obj, length) { + var ret; + + if (typeof(obj) === 'string') { + ret = obj.slice(0, length); + } else if (_.isArray(obj)) { + ret = []; + _.each(obj, function(val) { + ret.push(_.truncate(val, length)); + }); + } else if (_.isObject(obj)) { + ret = {}; + _.each(obj, function(val, key) { + ret[key] = _.truncate(val, length); + }); + } else { + ret = obj; + } + + return ret; +}; + +_.JSONEncode = (function() { + return function(mixed_val) { + var value = mixed_val; + var quote = function(string) { + var escapable = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; // eslint-disable-line no-control-regex + var meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"': '\\"', + '\\': '\\\\' + }; + + escapable.lastIndex = 0; + return escapable.test(string) ? + '"' + string.replace(escapable, function(a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : + '"' + string + '"'; + }; + + var str = function(key, holder) { + var gap = ''; + var indent = ' '; + var i = 0; // The loop counter. + var k = ''; // The member key. + var v = ''; // The member value. + var length = 0; + var mind = gap; + var partial = []; + var value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + + return String(value); + + case 'object': + // If the type is 'object', we might be dealing with an object or an array or + // null. + // Due to a specification blunder in ECMAScript, typeof null is 'object', + // so watch out for that case. + if (!value) { + return 'null'; + } + + // Make an array to hold the partial results of stringifying this object value. + gap += indent; + partial = []; + + // Is the value an array? + if (toString.apply(value) === '[object Array]') { + // The value is an array. Stringify every element. Use null as a placeholder + // for non-JSON values. + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and wrap them in + // brackets. + v = partial.length === 0 ? '[]' : + gap ? '[\n' + gap + + partial.join(',\n' + gap) + '\n' + + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // Iterate through all of the keys in the object. + for (k in value) { + if (hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + v = partial.length === 0 ? '{}' : + gap ? '{' + partial.join(',') + '' + + mind + '}' : '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + }; + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', { + '': value + }); + }; +})(); + +_.base64Encode = function(data) { + var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, + ac = 0, + enc = '', + tmp_arr = []; + + if (!data) { + return data; + } + + data = _.utf8Encode(data); + + do { // pack three octets into four hexets + o1 = data.charCodeAt(i++); + o2 = data.charCodeAt(i++); + o3 = data.charCodeAt(i++); + + bits = o1 << 16 | o2 << 8 | o3; + + h1 = bits >> 18 & 0x3f; + h2 = bits >> 12 & 0x3f; + h3 = bits >> 6 & 0x3f; + h4 = bits & 0x3f; + + // use hexets to index into b64, and append result to encoded string + tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); + } while (i < data.length); + + enc = tmp_arr.join(''); + + switch (data.length % 3) { + case 1: + enc = enc.slice(0, -2) + '=='; + break; + case 2: + enc = enc.slice(0, -1) + '='; + break; + } + + return enc; +}; + +_.utf8Encode = function(string) { + string = (string + '').replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + + var utftext = '', + start, + end; + var stringl = 0, + n; + + start = end = 0; + stringl = string.length; + + for (n = 0; n < stringl; n++) { + var c1 = string.charCodeAt(n); + var enc = null; + + if (c1 < 128) { + end++; + } else if ((c1 > 127) && (c1 < 2048)) { + enc = String.fromCharCode((c1 >> 6) | 192, (c1 & 63) | 128); + } else { + enc = String.fromCharCode((c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128); + } + if (enc !== null) { + if (end > start) { + utftext += string.substring(start, end); + } + utftext += enc; + start = end = n + 1; + } + } + + if (end > start) { + utftext += string.substring(start, string.length); + } + + return utftext; +}; + +_.UUID = (function() { + + // Time/ticks information + // 1*new Date() is a cross browser version of Date.now() + var T = function() { + var d = 1 * new Date(), + i = 0; + + // this while loop figures how many browser ticks go by + // before 1*new Date() returns a new number, ie the amount + // of ticks that go by per millisecond + while (d == 1 * new Date()) { + i++; + } + + return d.toString(16) + i.toString(16); + }; + + // Math.Random entropy + var R = function() { + return Math.random().toString(16).replace('.', ''); + }; + + // User agent entropy + // This function takes the user agent string, and then xors + // together each sequence of 8 bytes. This produces a final + // sequence of 8 bytes which it returns as hex. + var UA = function() { + var ua = userAgent, + i, ch, buffer = [], + ret = 0; + + function xor(result, byte_array) { + var j, tmp = 0; + for (j = 0; j < byte_array.length; j++) { + tmp |= (buffer[j] << j * 8); + } + return result ^ tmp; + } + + for (i = 0; i < ua.length; i++) { + ch = ua.charCodeAt(i); + buffer.unshift(ch & 0xFF); + if (buffer.length >= 4) { + ret = xor(ret, buffer); + buffer = []; + } + } + + if (buffer.length > 0) { + ret = xor(ret, buffer); + } + + return ret.toString(16); + }; + + return function() { + var se = (screen.height * screen.width).toString(16); + return (T() + '-' + R() + '-' + UA() + '-' + se + '-' + T()); + }; +})(); + +// _.isBlockedUA() +// This is to block various web spiders from executing our JS and +// sending false tracking data +_.isBlockedUA = function(ua) { + if (/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp)/i.test(ua)) { + return true; + } + return false; +}; + +/** + * @param {Object=} formdata + * @param {string=} arg_separator + */ +_.HTTPBuildQuery = function(formdata, arg_separator) { + var use_val, use_key, tmp_arr = []; + + if (_.isUndefined(arg_separator)) { + arg_separator = '&'; + } + + _.each(formdata, function(val, key) { + use_val = encodeURIComponent(val.toString()); + use_key = encodeURIComponent(key); + tmp_arr[tmp_arr.length] = use_key + '=' + use_val; + }); + + return tmp_arr.join(arg_separator); +}; + +_.getQueryParam = function(url, param) { + // Expects a raw URL + + param = param.replace(/[[]/, '\\[').replace(/[\]]/, '\\]'); + var regexS = '[\\?&]' + param + '=([^&#]*)', + regex = new RegExp(regexS), + results = regex.exec(url); + if (results === null || (results && typeof(results[1]) !== 'string' && results[1].length)) { + return ''; + } else { + var result = results[1]; + try { + result = decodeURIComponent(result); + } catch(err) { + console$1.error('Skipping decoding for malformed query param: ' + result); + } + return result.replace(/\+/g, ' '); + } +}; + +// _.cookie +// Methods partially borrowed from quirksmode.org/js/cookies.html +_.cookie = { + get: function (name) { + return + }, + + parse: function (name) { + return + }, + + set_seconds: function(name, value, seconds, cross_subdomain, is_secure) { + return + }, + + set: function (name, value, days, cross_subdomain, is_secure) { + return + }, + + remove: function(name, cross_subdomain) { + return + } +}; + +// _.localStorage +_.localStorage = { + is_supported: function () { + return false + }, + + error: function(msg) { + return + }, + + get: function(name) { + return null; + }, + + parse: function(name) { + return null; + }, + + set: function (name, value) { + return + }, + + remove: function(name) { + return + } +}; + +_.info = { + campaignParams: function() { + var campaign_keywords = 'utm_source utm_medium utm_campaign utm_content utm_term'.split(' '), + kw = '', + params = {}; + _.each(campaign_keywords, function(kwkey) { + kw = _.getQueryParam(document$1.URL, kwkey); + if (kw.length) { + params[kwkey] = kw; + } + }); + + return params; + }, + + /** + * This function detects which browser is running this script. + * The order of the checks are important since many user agents + * include key words used in later checks. + */ + browser: function(user_agent, vendor, opera) { + vendor = vendor || ''; // vendor is undefined for at least IE9 + if (_.includes(user_agent, 'Edge')) { + return 'Microsoft Edge'; + } else if (_.includes(user_agent, 'Chrome')) { + return 'Chrome'; + } else if (_.includes(user_agent, 'CriOS')) { + return 'Chrome iOS'; + } else if (_.includes(user_agent, 'FxiOS')) { + return 'Firefox iOS'; + } else if (_.includes(vendor, 'Apple')) { + if (_.includes(user_agent, 'Mobile')) { + return 'Mobile Safari'; + } + return 'Safari'; + } else if (_.includes(user_agent, 'Android')) { + return 'Android Mobile'; + } else if (_.includes(user_agent, 'Firefox')) { + return 'Firefox'; + } else if (_.includes(user_agent, 'MSIE') || _.includes(user_agent, 'Trident/')) { + return 'Internet Explorer'; + } else if (_.includes(user_agent, 'Gecko')) { + return 'Mozilla'; + } else { + return ''; + } + }, + + /** + * This function detects which browser version is running this script, + * parsing major and minor version (e.g., 42.1). User agent strings from: + * http://www.useragentstring.com/pages/useragentstring.php + */ + browserVersion: function(userAgent, vendor, opera) { + var browser = _.info.browser(userAgent, vendor, opera); + var versionRegexs = { + 'Microsoft Edge': /Edge\/(\d+(\.\d+)?)/, + 'Chrome': /Chrome\/(\d+(\.\d+)?)/, + 'Chrome iOS': /CriOS\/(\d+(\.\d+)?)/, + 'Safari': /Version\/(\d+(\.\d+)?)/, + 'Mobile Safari': /Version\/(\d+(\.\d+)?)/, + 'Firefox': /Firefox\/(\d+(\.\d+)?)/, + 'Firefox iOS': /FxiOS\/(\d+(\.\d+)?)/, + 'Android Mobile': /android\s(\d+(\.\d+)?)/, + 'Internet Explorer': /(rv:|MSIE )(\d+(\.\d+)?)/, + 'Mozilla': /rv:(\d+(\.\d+)?)/ + }; + var regex = versionRegexs[browser]; + if (regex === undefined) { + return null; + } + var matches = userAgent.match(regex); + if (!matches) { + return null; + } + return parseFloat(matches[matches.length - 2]); + }, + + os: function() { + var a = userAgent; + if (/Windows/i.test(a)) { + return 'Windows'; + } else if (/(iPhone|iPad|iPod)/.test(a)) { + return 'iOS'; + } else if (/Android/.test(a)) { + return 'Android'; + } else if (/(BlackBerry|PlayBook|BB10)/i.test(a)) { + return 'BlackBerry'; + } else if (/Mac/i.test(a)) { + return 'Mac OS X'; + } else if (/Linux/.test(a)) { + return 'Linux'; + } else if (/CrOS/.test(a)) { + return 'Chrome OS'; + } else { + return ''; + } + }, + + device: function(user_agent) { + if (/Windows Phone/i.test(user_agent) || /WPDesktop/.test(user_agent)) { + return 'Windows Phone'; + } else if (/iPad/.test(user_agent)) { + return 'iPad'; + } else if (/iPod/.test(user_agent)) { + return 'iPod Touch'; + } else if (/iPhone/.test(user_agent)) { + return 'iPhone'; + } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) { + return 'BlackBerry'; + } else if (/Android/.test(user_agent)) { + return 'Android'; + } else { + return ''; + } + }, + + referringDomain: function(referrer) { + var split = referrer.split('/'); + if (split.length >= 3) { + return split[2]; + } + return ''; + }, + + properties: function() { + return _.extend(_.strip_empty_properties({ + '$os': _.info.os(), + '$browser': _.info.browser(userAgent, navigator$1.vendor, windowOpera), + '$referrer': document$1.referrer, + '$referring_domain': _.info.referringDomain(document$1.referrer), + '$device': _.info.device(userAgent) + }), { + '$current_url': window$1.location.href, + '$browser_version': _.info.browserVersion(userAgent, navigator$1.vendor, windowOpera), + '$screen_height': screen.height, + '$screen_width': screen.width, + 'mp_lib': 'web', + '$lib_version': Config.LIB_VERSION, + '$insert_id': Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10), + 'time': Date.now() / 1000 // epoch time in seconds + }); + }, + + people_properties: function() { + return _.extend(_.strip_empty_properties({ + '$os': _.info.os(), + '$browser': _.info.browser(userAgent, navigator$1.vendor, windowOpera) + }), { + '$browser_version': _.info.browserVersion(userAgent, navigator$1.vendor, windowOpera) + }); + }, + + pageviewInfo: function(page) { + return _.strip_empty_properties({ + 'mp_page': page, + 'mp_referrer': document$1.referrer, + 'mp_browser': _.info.browser(userAgent, navigator$1.vendor, windowOpera), + 'mp_platform': _.info.os() + }); + } +}; + +// EXPORTS (for closure compiler) +_['toArray'] = _.toArray; +_['isObject'] = _.isObject; +_['JSONEncode'] = _.JSONEncode; +_['isBlockedUA'] = _.isBlockedUA; +_['isEmptyObject'] = _.isEmptyObject; +_['info'] = _.info; +_['info']['device'] = _.info.device; +_['info']['browser'] = _.info.browser; +_['info']['properties'] = _.info.properties; + +/** + * A function used to track a Mixpanel event (e.g. MixpanelLib.track) + * @callback trackFunction + * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc. + * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself. + * @param {Function} [callback] If provided, the callback function will be called after tracking the event. + */ + +/** Public **/ + +var GDPR_DEFAULT_PERSISTENCE_PREFIX = '__mp_opt_in_out_'; + +/** + * Opt the user in to data tracking and cookies/localstorage for the given token + * @param {string} token - Mixpanel project tracking token + * @param {Object} [options] + * @param {trackFunction} [options.track] - function used for tracking a Mixpanel event to record the opt-in action + * @param {string} [options.trackEventName] - event name to be used for tracking the opt-in action + * @param {Object} [options.trackProperties] - set of properties to be tracked along with the opt-in action + * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage + * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name + * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires + * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not + * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not + */ +function optIn(token, options) { + _optInOut(true, token, options); +} + +/** + * Opt the user out of data tracking and cookies/localstorage for the given token + * @param {string} token - Mixpanel project tracking token + * @param {Object} [options] + * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage + * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name + * @param {Number} [options.cookieExpiration] - number of days until the opt-out cookie expires + * @param {boolean} [options.crossSubdomainCookie] - whether the opt-out cookie is set as cross-subdomain or not + * @param {boolean} [options.secureCookie] - whether the opt-out cookie is set as secure or not + */ +function optOut(token, options) { + _optInOut(false, token, options); +} + +/** + * Check whether the user has opted in to data tracking and cookies/localstorage for the given token + * @param {string} token - Mixpanel project tracking token + * @param {Object} [options] + * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage + * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name + * @returns {boolean} whether the user has opted in to the given opt type + */ +function hasOptedIn(token, options) { + return _getStorageValue(token, options) === '1'; +} + +/** + * Check whether the user has opted out of data tracking and cookies/localstorage for the given token + * @param {string} token - Mixpanel project tracking token + * @param {Object} [options] + * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage + * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name + * @returns {boolean} whether the user has opted out of the given opt type + */ +function hasOptedOut(token, options) { + if (_hasDoNotTrackFlagOn(options)) { + return true; + } + return _getStorageValue(token, options) === '0'; +} + +/** + * Wrap a MixpanelLib method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token + * If the user has opted out, return early instead of executing the method. + * If a callback argument was provided, execute it passing the 0 error code. + * @param {function} method - wrapped method to be executed if the user has not opted out + * @returns {*} the result of executing method OR undefined if the user has opted out + */ +function addOptOutCheckMixpanelLib(method) { + return _addOptOutCheck(method, function(name) { + return this.get_config(name); + }); +} + +/** + * Wrap a MixpanelPeople method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token + * If the user has opted out, return early instead of executing the method. + * If a callback argument was provided, execute it passing the 0 error code. + * @param {function} method - wrapped method to be executed if the user has not opted out + * @returns {*} the result of executing method OR undefined if the user has opted out + */ +function addOptOutCheckMixpanelPeople(method) { + return _addOptOutCheck(method, function(name) { + return this._get_config(name); + }); +} + +/** + * Clear the user's opt in/out status of data tracking and cookies/localstorage for the given token + * @param {string} token - Mixpanel project tracking token + * @param {Object} [options] + * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage + * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name + * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires + * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not + * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not + */ +function clearOptInOut(token, options) { + options = options || {}; + _getStorage(options).remove(_getStorageKey(token, options), !!options.crossSubdomainCookie); +} + +/** Private **/ + +/** + * Get storage util + * @param {Object} [options] + * @param {string} [options.persistenceType] + * @returns {object} either _.cookie or _.localstorage + */ +function _getStorage(options) { + options = options || {}; + return options.persistenceType === 'localStorage' ? _.localStorage : _.cookie; +} + +/** + * Get the name of the cookie that is used for the given opt type (tracking, cookie, etc.) + * @param {string} token - Mixpanel project tracking token + * @param {Object} [options] + * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name + * @returns {string} the name of the cookie for the given opt type + */ +function _getStorageKey(token, options) { + options = options || {}; + return (options.persistencePrefix || GDPR_DEFAULT_PERSISTENCE_PREFIX) + token; +} + +/** + * Get the value of the cookie that is used for the given opt type (tracking, cookie, etc.) + * @param {string} token - Mixpanel project tracking token + * @param {Object} [options] + * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name + * @returns {string} the value of the cookie for the given opt type + */ +function _getStorageValue(token, options) { + return _getStorage(options).get(_getStorageKey(token, options)); +} + +/** + * Check whether the user has set the DNT/doNotTrack setting to true in their browser + * @param {Object} [options] + * @param {string} [options.window] - alternate window object to check; used to force various DNT settings in browser tests + * @returns {boolean} whether the DNT setting is true + */ +function _hasDoNotTrackFlagOn(options) { + var win = (options && options.window) || window$1; + var nav = win['navigator'] || {}; + var hasDntOn = false; + + _.each([ + nav['doNotTrack'], // standard + nav['msDoNotTrack'], + win['doNotTrack'] + ], function(dntValue) { + if (_.includes([true, 1, '1', 'yes'], dntValue)) { + hasDntOn = true; + } + }); + + return hasDntOn; +} + +/** + * Set cookie/localstorage for the user indicating that they are opted in or out for the given opt type + * @param {boolean} optValue - whether to opt the user in or out for the given opt type + * @param {string} token - Mixpanel project tracking token + * @param {Object} [options] + * @param {trackFunction} [options.track] - function used for tracking a Mixpanel event to record the opt-in action + * @param {string} [options.trackEventName] - event name to be used for tracking the opt-in action + * @param {Object} [options.trackProperties] - set of properties to be tracked along with the opt-in action + * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name + * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires + * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not + * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not + */ +function _optInOut(optValue, token, options) { + if (!_.isString(token) || !token.length) { + console.error('gdpr.' + (optValue ? 'optIn' : 'optOut') + ' called with an invalid token'); + return; + } + + options = options || {}; + + _getStorage(options).set( + _getStorageKey(token, options), + optValue ? 1 : 0, + _.isNumber(options.cookieExpiration) ? options.cookieExpiration : null, + !!options.crossSubdomainCookie, + !!options.secureCookie + ); + + if (options.track && optValue) { // only track event if opting in (optValue=true) + options.track(options.trackEventName || '$opt_in', options.trackProperties); + } +} + +/** + * Wrap a method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token + * If the user has opted out, return early instead of executing the method. + * If a callback argument was provided, execute it passing the 0 error code. + * @param {function} method - wrapped method to be executed if the user has not opted out + * @param {function} getConfigValue - getter function for the Mixpanel API token and other options to be used with opt-out check + * @returns {*} the result of executing method OR undefined if the user has opted out + */ +function _addOptOutCheck(method, getConfigValue) { + return function() { + var optedOut = false; + + try { + var token = getConfigValue.call(this, 'token'); + var persistenceType = getConfigValue.call(this, 'opt_out_tracking_persistence_type'); + var persistencePrefix = getConfigValue.call(this, 'opt_out_tracking_cookie_prefix'); + var win = getConfigValue.call(this, 'window'); // used to override window during browser tests + + if (token) { // if there was an issue getting the token, continue method execution as normal + optedOut = hasOptedOut(token, { + persistenceType: persistenceType, + persistencePrefix: persistencePrefix, + window: win + }); + } + } catch(err) { + console.error('Unexpected error when checking tracking opt-out status: ' + err); + } + + if (!optedOut) { + return method.apply(this, arguments); + } + + var callback = arguments[arguments.length - 1]; + if (typeof(callback) === 'function') { + callback(0); + } + + return; + }; +} + +/** @const */ var SET_ACTION = '$set'; +/** @const */ var SET_ONCE_ACTION = '$set_once'; +/** @const */ var UNSET_ACTION = '$unset'; +/** @const */ var ADD_ACTION = '$add'; +/** @const */ var APPEND_ACTION = '$append'; +/** @const */ var UNION_ACTION = '$union'; +/** @const */ var REMOVE_ACTION = '$remove'; +/** @const */ var DELETE_ACTION = '$delete'; + +// Common internal methods for mixpanel.people and mixpanel.group APIs. +// These methods shouldn't involve network I/O. +var apiActions = { + set_action: function(prop, to) { + var data = {}; + var $set = {}; + if (_.isObject(prop)) { + _.each(prop, function(v, k) { + if (!this._is_reserved_property(k)) { + $set[k] = v; + } + }, this); + } else { + $set[prop] = to; + } + + data[SET_ACTION] = $set; + return data; + }, + + unset_action: function(prop) { + var data = {}; + var $unset = []; + if (!_.isArray(prop)) { + prop = [prop]; + } + + _.each(prop, function(k) { + if (!this._is_reserved_property(k)) { + $unset.push(k); + } + }, this); + + data[UNSET_ACTION] = $unset; + return data; + }, + + set_once_action: function(prop, to) { + var data = {}; + var $set_once = {}; + if (_.isObject(prop)) { + _.each(prop, function(v, k) { + if (!this._is_reserved_property(k)) { + $set_once[k] = v; + } + }, this); + } else { + $set_once[prop] = to; + } + data[SET_ONCE_ACTION] = $set_once; + return data; + }, + + union_action: function(list_name, values) { + var data = {}; + var $union = {}; + if (_.isObject(list_name)) { + _.each(list_name, function(v, k) { + if (!this._is_reserved_property(k)) { + $union[k] = _.isArray(v) ? v : [v]; + } + }, this); + } else { + $union[list_name] = _.isArray(values) ? values : [values]; + } + data[UNION_ACTION] = $union; + return data; + }, + + append_action: function(list_name, value) { + var data = {}; + var $append = {}; + if (_.isObject(list_name)) { + _.each(list_name, function(v, k) { + if (!this._is_reserved_property(k)) { + $append[k] = v; + } + }, this); + } else { + $append[list_name] = value; + } + data[APPEND_ACTION] = $append; + return data; + }, + + remove_action: function(list_name, value) { + var data = {}; + var $remove = {}; + if (_.isObject(list_name)) { + _.each(list_name, function(v, k) { + if (!this._is_reserved_property(k)) { + $remove[k] = v; + } + }, this); + } else { + $remove[list_name] = value; + } + data[REMOVE_ACTION] = $remove; + return data; + }, + + delete_action: function() { + var data = {}; + data[DELETE_ACTION] = ''; + return data; + } +}; + +/* + * Constants + */ +/** @const */ var SET_QUEUE_KEY = '__mps'; +/** @const */ var SET_ONCE_QUEUE_KEY = '__mpso'; +/** @const */ var UNSET_QUEUE_KEY = '__mpus'; +/** @const */ var ADD_QUEUE_KEY = '__mpa'; +/** @const */ var APPEND_QUEUE_KEY = '__mpap'; +/** @const */ var REMOVE_QUEUE_KEY = '__mpr'; +/** @const */ var UNION_QUEUE_KEY = '__mpu'; +// This key is deprecated, but we want to check for it to see whether aliasing is allowed. +/** @const */ var PEOPLE_DISTINCT_ID_KEY = '$people_distinct_id'; +/** @const */ var ALIAS_ID_KEY = '__alias'; +/** @const */ var CAMPAIGN_IDS_KEY = '__cmpns'; +/** @const */ var EVENT_TIMERS_KEY = '__timers'; +/** @const */ var RESERVED_PROPERTIES = [ + SET_QUEUE_KEY, + SET_ONCE_QUEUE_KEY, + UNSET_QUEUE_KEY, + ADD_QUEUE_KEY, + APPEND_QUEUE_KEY, + REMOVE_QUEUE_KEY, + UNION_QUEUE_KEY, + PEOPLE_DISTINCT_ID_KEY, + ALIAS_ID_KEY, + CAMPAIGN_IDS_KEY, + EVENT_TIMERS_KEY +]; + +/** + * Mixpanel Persistence Object + * @constructor + */ +var MixpanelPersistence = function(config) { + this['props'] = {}; + this.campaign_params_saved = false; + + if (config['persistence_name']) { + this.name = 'mp_' + config['persistence_name']; + } else { + this.name = 'mp_' + config['token'] + '_mixpanel'; + } + + var storage_type = config['persistence']; + if (storage_type !== 'cookie' && storage_type !== 'localStorage') { + console$1.critical('Unknown persistence type ' + storage_type + '; falling back to cookie'); + storage_type = config['persistence'] = 'cookie'; + } + + if (storage_type === 'localStorage' && _.localStorage.is_supported()) { + this.storage = _.localStorage; + } else { + this.storage = _.cookie; + } + + this.load(); + this.update_config(config); + this.save(); +}; + +MixpanelPersistence.prototype.properties = function() { + var p = {}; + // Filter out reserved properties + _.each(this['props'], function(v, k) { + if (!_.include(RESERVED_PROPERTIES, k)) { + p[k] = v; + } + }); + return p; +}; + +MixpanelPersistence.prototype.load = function() { + if (this.disabled) { return; } + + var entry = this.storage.parse(this.name); + + if (entry) { + this['props'] = _.extend({}, entry); + } +}; + +MixpanelPersistence.prototype.save = function() { + if (this.disabled) { return; } + this.storage.set( + this.name, + this['props'], + this.expire_days, + this.cross_subdomain, + this.secure + ); +}; + +MixpanelPersistence.prototype.remove = function() { + // remove both domain and subdomain cookies + this.storage.remove(this.name, false); + this.storage.remove(this.name, true); +}; + +// removes the storage entry and deletes all loaded data +// forced name for tests +MixpanelPersistence.prototype.clear = function() { + this.remove(); + this['props'] = {}; +}; + +/** +* @param {Object} props +* @param {*=} default_value +* @param {number=} days +*/ +MixpanelPersistence.prototype.register_once = function(props, default_value, days) { + if (_.isObject(props)) { + if (typeof(default_value) === 'undefined') { default_value = 'None'; } + this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days; + + _.each(props, function(val, prop) { + if (!this['props'].hasOwnProperty(prop) || this['props'][prop] === default_value) { + this['props'][prop] = val; + } + }, this); + + this.save(); + + return true; + } + return false; +}; + +/** +* @param {Object} props +* @param {number=} days +*/ +MixpanelPersistence.prototype.register = function(props, days) { + if (_.isObject(props)) { + this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days; + + _.extend(this['props'], props); + + this.save(); + + return true; + } + return false; +}; + +MixpanelPersistence.prototype.unregister = function(prop) { + if (prop in this['props']) { + delete this['props'][prop]; + this.save(); + } +}; + +// safely fills the passed in object with stored properties, +// does not override any properties defined in both +// returns the passed in object +MixpanelPersistence.prototype.safe_merge = function(props) { + _.each(this['props'], function(val, prop) { + if (!(prop in props)) { + props[prop] = val; + } + }); + + return props; +}; + +MixpanelPersistence.prototype.update_config = function(config) { + this.default_expiry = this.expire_days = config['cookie_expiration']; + this.set_disabled(config['disable_persistence']); + this.set_cross_subdomain(config['cross_subdomain_cookie']); + this.set_secure(config['secure_cookie']); +}; + +MixpanelPersistence.prototype.set_disabled = function(disabled) { + this.disabled = disabled; + if (this.disabled) { + this.remove(); + } else { + this.save(); + } +}; + +MixpanelPersistence.prototype.set_cross_subdomain = function(cross_subdomain) { + if (cross_subdomain !== this.cross_subdomain) { + this.cross_subdomain = cross_subdomain; + this.remove(); + this.save(); + } +}; + +MixpanelPersistence.prototype.get_cross_subdomain = function() { + return this.cross_subdomain; +}; + +MixpanelPersistence.prototype.set_secure = function(secure) { + if (secure !== this.secure) { + this.secure = secure ? true : false; + this.remove(); + this.save(); + } +}; + +MixpanelPersistence.prototype._add_to_people_queue = function(queue, data) { + var q_key = this._get_queue_key(queue), + q_data = data[queue], + set_q = this._get_or_create_queue(SET_ACTION), + set_once_q = this._get_or_create_queue(SET_ONCE_ACTION), + unset_q = this._get_or_create_queue(UNSET_ACTION), + add_q = this._get_or_create_queue(ADD_ACTION), + union_q = this._get_or_create_queue(UNION_ACTION), + remove_q = this._get_or_create_queue(REMOVE_ACTION, []), + append_q = this._get_or_create_queue(APPEND_ACTION, []); + + if (q_key === SET_QUEUE_KEY) { + // Update the set queue - we can override any existing values + _.extend(set_q, q_data); + // if there was a pending increment, override it + // with the set. + this._pop_from_people_queue(ADD_ACTION, q_data); + // if there was a pending union, override it + // with the set. + this._pop_from_people_queue(UNION_ACTION, q_data); + this._pop_from_people_queue(UNSET_ACTION, q_data); + } else if (q_key === SET_ONCE_QUEUE_KEY) { + // only queue the data if there is not already a set_once call for it. + _.each(q_data, function(v, k) { + if (!(k in set_once_q)) { + set_once_q[k] = v; + } + }); + this._pop_from_people_queue(UNSET_ACTION, q_data); + } else if (q_key === UNSET_QUEUE_KEY) { + _.each(q_data, function(prop) { + + // undo previously-queued actions on this key + _.each([set_q, set_once_q, add_q, union_q], function(enqueued_obj) { + if (prop in enqueued_obj) { + delete enqueued_obj[prop]; + } + }); + _.each(append_q, function(append_obj) { + if (prop in append_obj) { + delete append_obj[prop]; + } + }); + + unset_q[prop] = true; + + }); + } else if (q_key === ADD_QUEUE_KEY) { + _.each(q_data, function(v, k) { + // If it exists in the set queue, increment + // the value + if (k in set_q) { + set_q[k] += v; + } else { + // If it doesn't exist, update the add + // queue + if (!(k in add_q)) { + add_q[k] = 0; + } + add_q[k] += v; + } + }, this); + this._pop_from_people_queue(UNSET_ACTION, q_data); + } else if (q_key === UNION_QUEUE_KEY) { + _.each(q_data, function(v, k) { + if (_.isArray(v)) { + if (!(k in union_q)) { + union_q[k] = []; + } + // We may send duplicates, the server will dedup them. + union_q[k] = union_q[k].concat(v); + } + }); + this._pop_from_people_queue(UNSET_ACTION, q_data); + } else if (q_key === REMOVE_QUEUE_KEY) { + remove_q.push(q_data); + this._pop_from_people_queue(APPEND_ACTION, q_data); + } else if (q_key === APPEND_QUEUE_KEY) { + append_q.push(q_data); + this._pop_from_people_queue(UNSET_ACTION, q_data); + } + + console$1.log('MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):'); + console$1.log(data); + + this.save(); +}; + +MixpanelPersistence.prototype._pop_from_people_queue = function(queue, data) { + var q = this._get_queue(queue); + if (!_.isUndefined(q)) { + _.each(data, function(v, k) { + if (queue === APPEND_ACTION || queue === REMOVE_ACTION) { + // list actions: only remove if both k+v match + // e.g. remove should not override append in a case like + // append({foo: 'bar'}); remove({foo: 'qux'}) + _.each(q, function(queued_action) { + if (queued_action[k] === v) { + delete queued_action[k]; + } + }); + } else { + delete q[k]; + } + }, this); + + this.save(); + } +}; + +MixpanelPersistence.prototype._get_queue_key = function(queue) { + if (queue === SET_ACTION) { + return SET_QUEUE_KEY; + } else if (queue === SET_ONCE_ACTION) { + return SET_ONCE_QUEUE_KEY; + } else if (queue === UNSET_ACTION) { + return UNSET_QUEUE_KEY; + } else if (queue === ADD_ACTION) { + return ADD_QUEUE_KEY; + } else if (queue === APPEND_ACTION) { + return APPEND_QUEUE_KEY; + } else if (queue === REMOVE_ACTION) { + return REMOVE_QUEUE_KEY; + } else if (queue === UNION_ACTION) { + return UNION_QUEUE_KEY; + } else { + console$1.error('Invalid queue:', queue); + } +}; + +MixpanelPersistence.prototype._get_queue = function(queue) { + return this['props'][this._get_queue_key(queue)]; +}; +MixpanelPersistence.prototype._get_or_create_queue = function(queue, default_val) { + var key = this._get_queue_key(queue); + default_val = _.isUndefined(default_val) ? {} : default_val; + + return this['props'][key] || (this['props'][key] = default_val); +}; + +/* + * This file is a js implementation for a subset in eval_node.c + */ + +/* + * Constants + */ +// Metadata keys +/** @const */ var OPERATOR_KEY = 'operator'; +/** @const */ var PROPERTY_KEY = 'property'; +/** @const */ var WINDOW_KEY = 'window'; +/** @const */ var UNIT_KEY = 'unit'; +/** @const */ var VALUE_KEY = 'value'; +/** @const */ var HOUR_KEY = 'hour'; +/** @const */ var DAY_KEY = 'day'; +/** @const */ var WEEK_KEY = 'week'; +/** @const */ var MONTH_KEY = 'month'; + +// Operands +/** @const */ var EVENT_PROPERTY = 'event'; +/** @const */ var LITERAL_PROPERTY = 'literal'; + +// Binary Operators +/** @const */ var AND_OPERATOR = 'and'; +/** @const */ var OR_OPERATOR = 'or'; +/** @const */ var IN_OPERATOR = 'in'; +/** @const */ var NOT_IN_OPERATOR = 'not in'; +/** @const */ var PLUS_OPERATOR = '+'; +/** @const */ var MINUS_OPERATOR = '-'; +/** @const */ var MUL_OPERATOR = '*'; +/** @const */ var DIV_OPERATOR = '/'; +/** @const */ var MOD_OPERATOR = '%'; +/** @const */ var EQUALS_OPERATOR = '=='; +/** @const */ var NOT_EQUALS_OPERATOR = '!='; +/** @const */ var GREATER_OPERATOR = '>'; +/** @const */ var LESS_OPERATOR = '<'; +/** @const */ var GREATER_EQUAL_OPERATOR = '>='; +/** @const */ var LESS_EQUAL_OPERATOR = '<='; + +// Typecast Operators +/** @const */ var BOOLEAN_OPERATOR = 'boolean'; +/** @const */ var DATETIME_OPERATOR = 'datetime'; +/** @const */ var LIST_OPERATOR = 'list'; +/** @const */ var NUMBER_OPERATOR = 'number'; +/** @const */ var STRING_OPERATOR = 'string'; + +// Unary Operators +/** @const */ var NOT_OPERATOR = 'not'; +/** @const */ var DEFINED_OPERATOR = 'defined'; +/** @const */ var NOT_DEFINED_OPERATOR = 'not defined'; + +// Special literals +/** @const */ var NOW_LITERAL = 'now'; + +// Type cast functions +function toNumber(value) { + if (value === null) { + return null; + } + + switch (typeof(value)) { + case 'object': + if (_.isDate(value) && value.getTime() >= 0) { + return value.getTime(); + } + return null; + case 'boolean': + return Number(value); + case 'number': + return value; + case 'string': + value = Number(value); + if (!isNaN(value)) { + return value; + } + return 0; + } + return null; +} + +function evaluateNumber(op, properties) { + if (!op['operator'] || op['operator'] !== NUMBER_OPERATOR || !op['children'] || op['children'].length !== 1) { + throw ('Invalid cast operator: number ' + op); + } + + return toNumber(evaluateSelector(op['children'][0], properties)); +} + +function toBoolean(value) { + if (value === null) { + return false; + } + + switch (typeof value) { + case 'boolean': + return value; + case 'number': + return value !== 0.0; + case 'string': + return value.length > 0; + case 'object': + if (_.isArray(value) && value.length > 0) { + return true; + } + if (_.isDate(value) && value.getTime() > 0) { + return true; + } + if (_.isObject(value) && !_.isEmptyObject(value)) { + return true; + } + return false; + } + return false; +} + +function evaluateBoolean(op, properties) { + if (!op['operator'] || op['operator'] !== BOOLEAN_OPERATOR || !op['children'] || op['children'].length !== 1) { + throw ('Invalid cast operator: boolean ' + op); + } + + return toBoolean(evaluateSelector(op['children'][0], properties)); +} + +function evaluateDateTime(op, properties) { + if (!op['operator'] || op['operator'] !== DATETIME_OPERATOR || !op['children'] || op['children'].length !== 1) { + throw ('Invalid cast operator: datetime ' + op); + } + + var v = evaluateSelector(op['children'][0], properties); + if (v === null) { + return null; + } + + switch (typeof(v)) { + case 'number': + case 'string': + var d = new Date(v); + if (isNaN(d.getTime())) { + return null; + } + return d; + case 'object': + if (_.isDate(v)) { + return v; + } + } + + return null; +} + +function evaluateList(op, properties) { + if (!op['operator'] || op['operator'] !== LIST_OPERATOR || !op['children'] || op['children'].length !== 1) { + throw ('Invalid cast operator: list ' + op); + } + + var v = evaluateSelector(op['children'][0], properties); + if (v === null) { + return null; + } + + if (_.isArray(v)) { + return v; + } + + return null; +} + +function evaluateString(op, properties) { + if (!op['operator'] || op['operator'] !== STRING_OPERATOR || !op['children'] || op['children'].length !== 1) { + throw ('Invalid cast operator: string ' + op); + } + + var v = evaluateSelector(op['children'][0], properties); + switch (typeof(v)) { + case 'object': + if (_.isDate(v)) { + return v.toJSON(); + } + return JSON.stringify(v); + } + return String(v); +} + +// Operators +function evaluateAnd(op, properties) { + if (!op['operator'] || op['operator'] !== AND_OPERATOR || !op['children'] || op['children'].length !== 2) { + throw ('Invalid operator: AND ' + op); + } + + return toBoolean(evaluateSelector(op['children'][0], properties)) && toBoolean(evaluateSelector(op['children'][1], properties)); +} + +function evaluateOr(op, properties) { + if (!op['operator'] || op['operator'] !== OR_OPERATOR || !op['children'] || op['children'].length !== 2) { + throw ('Invalid operator: OR ' + op); + } + + return toBoolean(evaluateSelector(op['children'][0], properties)) || toBoolean(evaluateSelector(op['children'][1], properties)); +} + +function evaluateIn(op, properties) { + if (!op['operator'] || [IN_OPERATOR, NOT_IN_OPERATOR].indexOf(op['operator']) === -1 || !op['children'] || op['children'].length !== 2) { + throw ('Invalid operator: IN/NOT IN ' + op); + } + var leftValue = evaluateSelector(op['children'][0], properties); + var rightValue = evaluateSelector(op['children'][1], properties); + + if (!_.isArray(rightValue) && !_.isString(rightValue)) { + throw ('Invalid operand for operator IN: invalid type' + rightValue); + } + + var v = rightValue.indexOf(leftValue) > -1; + if (op['operator'] === NOT_IN_OPERATOR) { + return !v; + } + return v; +} + +function evaluatePlus(op, properties) { + if (!op['operator'] || op['operator'] !== PLUS_OPERATOR || !op['children'] || op['children'].length < 2) { + throw ('Invalid operator: PLUS ' + op); + } + var l = evaluateSelector(op['children'][0], properties); + var r = evaluateSelector(op['children'][1], properties); + + if (typeof l === 'number' && typeof r === 'number') { + return l + r; + } + if (typeof l === 'string' && typeof r === 'string') { + return l + r; + } + return null; +} + +function evaluateArithmetic(op, properties) { + if (!op['operator'] || [MINUS_OPERATOR, MUL_OPERATOR, DIV_OPERATOR, MOD_OPERATOR].indexOf(op['operator']) === -1 || + !op['children'] || op['children'].length < 2) { + throw ('Invalid arithmetic operator ' + op); + } + + var l = evaluateSelector(op['children'][0], properties); + var r = evaluateSelector(op['children'][1], properties); + + if (typeof l === 'number' && typeof r === 'number') { + switch (op['operator']) { + case MINUS_OPERATOR: + return l - r; + case MUL_OPERATOR: + return l * r; + case DIV_OPERATOR: + if (r !== 0) { + return l / r; + } + return null; + case MOD_OPERATOR: + if (r === 0) { + return null; + } + if (l === 0) { + return 0; + } + if ((l < 0 && r > 0) || (l > 0 && r < 0)) { + /* Mimic python modulo - result takes sign of the divisor + * if one operand is negative. */ + return -(Math.floor(l / r) * r - l); + } + return l % r; + default: + throw('Unknown operator: ' + op['operator']); + } + } + + return null; +} + +function _isArrayEqual(l, r) { + if (l === r) return true; + if (l === null || r === null) return false; + if (l.length !== r.length) return false; + + for (var i = 0; i < l.length; i++) { + if (l[i] !== r[i]) { + return false; + } + } + + return true; +} + +function _isEqual(l, r) { + if ( l === null && l === r ) { + return true; + } + if (typeof l === typeof r) { + switch (typeof l) { + case 'number': + case 'string': + case 'boolean': + return l === r; + case 'object': + if (_.isArray(l) && _.isArray(r)) { + return _isArrayEqual(l, r); + } + if (_.isDate(l) && _.isDate(r)) { + return l.getTime() === r.getTime(); + } + if (_.isObject(l) && _.isObject(r)) { + return JSON.stringify(l) === JSON.stringify(r); + } + } + } + return false; +} + +function evaluateEquality(op, properties) { + if (!op['operator'] || [EQUALS_OPERATOR, NOT_EQUALS_OPERATOR].indexOf(op['operator']) === -1 || !op['children'] || op['children'].length !== 2) { + throw ('Invalid equality operator ' + op); + } + + var v = _isEqual(evaluateSelector(op['children'][0], properties), evaluateSelector(op['children'][1], properties)); + + switch (op['operator']) { + case EQUALS_OPERATOR: + return v; + case NOT_EQUALS_OPERATOR: + return !v; + } +} + +function evaluateComparison(op, properties) { + if (!op['operator'] || + [GREATER_OPERATOR, GREATER_EQUAL_OPERATOR, LESS_OPERATOR, LESS_EQUAL_OPERATOR].indexOf(op['operator']) === -1 || + !op['children'] || op['children'].length !== 2) { + throw ('Invalid comparison operator ' + op); + } + var l = evaluateSelector(op['children'][0], properties); + var r = evaluateSelector(op['children'][1], properties); + + if (typeof(l) === typeof(r)) { + if (typeof(r) === 'number' || _.isDate(r)) { + l = toNumber(l); + r = toNumber(r); + switch (op['operator']) { + case GREATER_OPERATOR: + return l > r; + case GREATER_EQUAL_OPERATOR: + return l >= r; + case LESS_OPERATOR: + return l < r; + case LESS_EQUAL_OPERATOR: + return l <= r; + } + } else if (typeof(r) === 'string') { + var compare = l.localeCompare(r); + switch (op['operator']) { + case GREATER_OPERATOR: + return compare > 0; + case GREATER_EQUAL_OPERATOR: + return compare >= 0; + case LESS_OPERATOR: + return compare < 0; + case LESS_EQUAL_OPERATOR: + return compare <= 0; + } + } + } + + return null; +} + +function evaluateDefined(op, properties) { + if (!op['operator'] || [DEFINED_OPERATOR, NOT_DEFINED_OPERATOR].indexOf(op['operator']) === -1 || + !op['children'] || op['children'].length !== 1) { + throw ('Invalid defined/not defined operator: ' + op); + } + + var b = evaluateSelector(op['children'][0], properties) !== null; + if (op['operator'] === NOT_DEFINED_OPERATOR) { + return !b; + } + + return b; +} + +function evaluateNot(op, properties) { + if (!op['operator'] || op['operator'] !== NOT_OPERATOR || !op['children'] || op['children'].length !== 1) { + throw ('Invalid not operator: ' + op); + } + + var v = evaluateSelector(op['children'][0], properties); + if (v === null) { + return true; + } + + if (typeof(v) === 'boolean') { + return !v; + } + + return null; +} + +function evaluateOperator(op, properties) { + if (!op['operator']) { + throw ('Invalid operator: operator key missing ' + op); + } + + switch (op['operator']) { + case AND_OPERATOR: + return evaluateAnd(op, properties); + case OR_OPERATOR: + return evaluateOr(op, properties); + case IN_OPERATOR: + case NOT_IN_OPERATOR: + return evaluateIn(op, properties); + case PLUS_OPERATOR: + return evaluatePlus(op, properties); + case MINUS_OPERATOR: + case MUL_OPERATOR: + case DIV_OPERATOR: + case MOD_OPERATOR: + return evaluateArithmetic(op, properties); + case EQUALS_OPERATOR: + case NOT_EQUALS_OPERATOR: + return evaluateEquality(op, properties); + case GREATER_OPERATOR: + case LESS_OPERATOR: + case GREATER_EQUAL_OPERATOR: + case LESS_EQUAL_OPERATOR: + return evaluateComparison(op, properties); + case BOOLEAN_OPERATOR: + return evaluateBoolean(op, properties); + case DATETIME_OPERATOR: + return evaluateDateTime(op, properties); + case LIST_OPERATOR: + return evaluateList(op, properties); + case NUMBER_OPERATOR: + return evaluateNumber(op, properties); + case STRING_OPERATOR: + return evaluateString(op, properties); + case DEFINED_OPERATOR: + case NOT_DEFINED_OPERATOR: + return evaluateDefined(op, properties); + case NOT_OPERATOR: + return evaluateNot(op, properties); + } +} + +function evaluateWindow(value) { + var win = value[WINDOW_KEY]; + if (!win || !win[UNIT_KEY] || !win[VALUE_KEY]) { + throw('Invalid window: missing required keys ' + JSON.stringify(value)); + } + var out = new Date(); + switch (win[UNIT_KEY]) { + case HOUR_KEY: + out.setTime(out.getTime() + (win[VALUE_KEY]*-1*60*60*1000)); + break; + case DAY_KEY: + out.setTime(out.getTime() + (win[VALUE_KEY]*-1*24*60*60*1000)); + break; + case WEEK_KEY: + out.setTime(out.getTime() + (win[VALUE_KEY]*-1*7*24*60*60*1000)); + break; + case MONTH_KEY: + out.setTime(out.getTime() + (win[VALUE_KEY]*-1*30*24*60*60*1000)); + break; + default: + throw('Invalid unit: ' + win[UNIT_KEY]); + } + + return out; +} + +function evaluateOperand(op, properties) { + if (!op['property'] || !op['value']) { + throw('Invalid operand: missing required keys ' + op); + } + switch (op['property']) { + case EVENT_PROPERTY: + if (properties[op['value']] !== undefined) { + return properties[op['value']]; + } + return null; + case LITERAL_PROPERTY: + if (op['value'] === NOW_LITERAL) { + return new Date(); + } + if (typeof(op['value']) === 'object') { + return evaluateWindow(op['value']); + } + return op['value']; + default: + throw('Invalid operand: Invalid property type ' + op['property']); + } +} + +function evaluateSelector(filters, properties) { + if (filters[PROPERTY_KEY]) { + return evaluateOperand(filters, properties); + } + if (filters[OPERATOR_KEY]) { + return evaluateOperator(filters, properties); + } +} + +/** + * Mixpanel People Object + * @constructor + */ +var MixpanelPeople = function() {}; + +_.extend(MixpanelPeople.prototype, apiActions); + +MixpanelPeople.prototype._init = function(mixpanel_instance) { + this._mixpanel = mixpanel_instance; +}; + +/* +* Set properties on a user record. +* +* ### Usage: +* +* mixpanel.people.set('gender', 'm'); +* +* // or set multiple properties at once +* mixpanel.people.set({ +* 'Company': 'Acme', +* 'Plan': 'Premium', +* 'Upgrade date': new Date() +* }); +* // properties can be strings, integers, dates, or lists +* +* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values. +* @param {*} [to] A value to set on the given property name +* @param {Function} [callback] If provided, the callback will be called after tracking the event. +*/ +MixpanelPeople.prototype.set = addOptOutCheckMixpanelPeople(function(prop, to, callback) { + var data = this.set_action(prop, to); + if (_.isObject(prop)) { + callback = to; + } + + // update $set object with default people properties + data[SET_ACTION] = _.extend( + {}, + _.info.people_properties(), + data[SET_ACTION] + ); + return this._send_request(data, callback); +}); + +/* +* Set properties on a user record, only if they do not yet exist. +* This will not overwrite previous people property values, unlike +* people.set(). +* +* ### Usage: +* +* mixpanel.people.set_once('First Login Date', new Date()); +* +* // or set multiple properties at once +* mixpanel.people.set_once({ +* 'First Login Date': new Date(), +* 'Starting Plan': 'Premium' +* }); +* +* // properties can be strings, integers or dates +* +* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values. +* @param {*} [to] A value to set on the given property name +* @param {Function} [callback] If provided, the callback will be called after tracking the event. +*/ +MixpanelPeople.prototype.set_once = addOptOutCheckMixpanelPeople(function(prop, to, callback) { + var data = this.set_once_action(prop, to); + if (_.isObject(prop)) { + callback = to; + } + return this._send_request(data, callback); +}); + +/* +* Unset properties on a user record (permanently removes the properties and their values from a profile). +* +* ### Usage: +* +* mixpanel.people.unset('gender'); +* +* // or unset multiple properties at once +* mixpanel.people.unset(['gender', 'Company']); +* +* @param {Array|String} prop If a string, this is the name of the property. If an array, this is a list of property names. +* @param {Function} [callback] If provided, the callback will be called after tracking the event. +*/ +MixpanelPeople.prototype.unset = addOptOutCheckMixpanelPeople(function(prop, callback) { + var data = this.unset_action(prop); + return this._send_request(data, callback); +}); + +/* +* Increment/decrement numeric people analytics properties. +* +* ### Usage: +* +* mixpanel.people.increment('page_views', 1); +* +* // or, for convenience, if you're just incrementing a counter by +* // 1, you can simply do +* mixpanel.people.increment('page_views'); +* +* // to decrement a counter, pass a negative number +* mixpanel.people.increment('credits_left', -1); +* +* // like mixpanel.people.set(), you can increment multiple +* // properties at once: +* mixpanel.people.increment({ +* counter1: 1, +* counter2: 6 +* }); +* +* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and numeric values. +* @param {Number} [by] An amount to increment the given property +* @param {Function} [callback] If provided, the callback will be called after tracking the event. +*/ +MixpanelPeople.prototype.increment = addOptOutCheckMixpanelPeople(function(prop, by, callback) { + var data = {}; + var $add = {}; + if (_.isObject(prop)) { + _.each(prop, function(v, k) { + if (!this._is_reserved_property(k)) { + if (isNaN(parseFloat(v))) { + console$1.error('Invalid increment value passed to mixpanel.people.increment - must be a number'); + return; + } else { + $add[k] = v; + } + } + }, this); + callback = by; + } else { + // convenience: mixpanel.people.increment('property'); will + // increment 'property' by 1 + if (_.isUndefined(by)) { + by = 1; + } + $add[prop] = by; + } + data[ADD_ACTION] = $add; + + return this._send_request(data, callback); +}); + +/* +* Append a value to a list-valued people analytics property. +* +* ### Usage: +* +* // append a value to a list, creating it if needed +* mixpanel.people.append('pages_visited', 'homepage'); +* +* // like mixpanel.people.set(), you can append multiple +* // properties at once: +* mixpanel.people.append({ +* list1: 'bob', +* list2: 123 +* }); +* +* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values. +* @param {*} [value] value An item to append to the list +* @param {Function} [callback] If provided, the callback will be called after tracking the event. +*/ +MixpanelPeople.prototype.append = addOptOutCheckMixpanelPeople(function(list_name, value, callback) { + if (_.isObject(list_name)) { + callback = value; + } + var data = this.append_action(list_name, value); + return this._send_request(data, callback); +}); + +/* +* Remove a value from a list-valued people analytics property. +* +* ### Usage: +* +* mixpanel.people.remove('School', 'UCB'); +* +* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values. +* @param {*} [value] value Item to remove from the list +* @param {Function} [callback] If provided, the callback will be called after tracking the event. +*/ +MixpanelPeople.prototype.remove = addOptOutCheckMixpanelPeople(function(list_name, value, callback) { + if (_.isObject(list_name)) { + callback = value; + } + var data = this.remove_action(list_name, value); + return this._send_request(data, callback); +}); + +/* +* Merge a given list with a list-valued people analytics property, +* excluding duplicate values. +* +* ### Usage: +* +* // merge a value to a list, creating it if needed +* mixpanel.people.union('pages_visited', 'homepage'); +* +* // like mixpanel.people.set(), you can append multiple +* // properties at once: +* mixpanel.people.union({ +* list1: 'bob', +* list2: 123 +* }); +* +* // like mixpanel.people.append(), you can append multiple +* // values to the same list: +* mixpanel.people.union({ +* list1: ['bob', 'billy'] +* }); +* +* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values. +* @param {*} [value] Value / values to merge with the given property +* @param {Function} [callback] If provided, the callback will be called after tracking the event. +*/ +MixpanelPeople.prototype.union = addOptOutCheckMixpanelPeople(function(list_name, values, callback) { + if (_.isObject(list_name)) { + callback = values; + } + var data = this.union_action(list_name, values); + return this._send_request(data, callback); +}); + +/* +* Record that you have charged the current user a certain amount +* of money. Charges recorded with track_charge() will appear in the +* Mixpanel revenue report. +* +* ### Usage: +* +* // charge a user $50 +* mixpanel.people.track_charge(50); +* +* // charge a user $30.50 on the 2nd of january +* mixpanel.people.track_charge(30.50, { +* '$time': new Date('jan 1 2012') +* }); +* +* @param {Number} amount The amount of money charged to the current user +* @param {Object} [properties] An associative array of properties associated with the charge +* @param {Function} [callback] If provided, the callback will be called when the server responds +*/ +MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(amount, properties, callback) { + if (!_.isNumber(amount)) { + amount = parseFloat(amount); + if (isNaN(amount)) { + console$1.error('Invalid value passed to mixpanel.people.track_charge - must be a number'); + return; + } + } + + return this.append('$transactions', _.extend({ + '$amount': amount + }, properties), callback); +}); + +/* +* Permanently clear all revenue report transactions from the +* current user's people analytics profile. +* +* ### Usage: +* +* mixpanel.people.clear_charges(); +* +* @param {Function} [callback] If provided, the callback will be called after tracking the event. +*/ +MixpanelPeople.prototype.clear_charges = function(callback) { + return this.set('$transactions', [], callback); +}; + +/* +* Permanently deletes the current people analytics profile from +* Mixpanel (using the current distinct_id). +* +* ### Usage: +* +* // remove the all data you have stored about the current user +* mixpanel.people.delete_user(); +* +*/ +MixpanelPeople.prototype.delete_user = function() { + if (!this._identify_called()) { + console$1.error('mixpanel.people.delete_user() requires you to call identify() first'); + return; + } + var data = {'$delete': this._mixpanel.get_distinct_id()}; + return this._send_request(data); +}; + +MixpanelPeople.prototype.toString = function() { + return this._mixpanel.toString() + '.people'; +}; + +MixpanelPeople.prototype._send_request = function(data, callback) { + data['$token'] = this._get_config('token'); + data['$distinct_id'] = this._mixpanel.get_distinct_id(); + var device_id = this._mixpanel.get_property('$device_id'); + var user_id = this._mixpanel.get_property('$user_id'); + var had_persisted_distinct_id = this._mixpanel.get_property('$had_persisted_distinct_id'); + if (device_id) { + data['$device_id'] = device_id; + } + if (user_id) { + data['$user_id'] = user_id; + } + if (had_persisted_distinct_id) { + data['$had_persisted_distinct_id'] = had_persisted_distinct_id; + } + + var date_encoded_data = _.encodeDates(data); + var truncated_data = _.truncate(date_encoded_data, 255); + var json_data = _.JSONEncode(date_encoded_data); + var encoded_data = _.base64Encode(json_data); + + if (!this._identify_called()) { + this._enqueue(data); + if (!_.isUndefined(callback)) { + if (this._get_config('verbose')) { + callback({status: -1, error: null}); + } else { + callback(-1); + } + } + return truncated_data; + } + + console$1.log('MIXPANEL PEOPLE REQUEST:'); + console$1.log(truncated_data); + + this._mixpanel._send_request( + this._get_config('api_host') + '/engage/', + {'data': encoded_data}, + this._mixpanel._prepare_callback(callback, truncated_data) + ); + + return truncated_data; +}; + +MixpanelPeople.prototype._get_config = function(conf_var) { + return this._mixpanel.get_config(conf_var); +}; + +MixpanelPeople.prototype._identify_called = function() { + return this._mixpanel._flags.identify_called === true; +}; + +// Queue up engage operations if identify hasn't been called yet. +MixpanelPeople.prototype._enqueue = function(data) { + if (SET_ACTION in data) { + this._mixpanel['persistence']._add_to_people_queue(SET_ACTION, data); + } else if (SET_ONCE_ACTION in data) { + this._mixpanel['persistence']._add_to_people_queue(SET_ONCE_ACTION, data); + } else if (UNSET_ACTION in data) { + this._mixpanel['persistence']._add_to_people_queue(UNSET_ACTION, data); + } else if (ADD_ACTION in data) { + this._mixpanel['persistence']._add_to_people_queue(ADD_ACTION, data); + } else if (APPEND_ACTION in data) { + this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, data); + } else if (REMOVE_ACTION in data) { + this._mixpanel['persistence']._add_to_people_queue(REMOVE_ACTION, data); + } else if (UNION_ACTION in data) { + this._mixpanel['persistence']._add_to_people_queue(UNION_ACTION, data); + } else { + console$1.error('Invalid call to _enqueue():', data); + } +}; + +MixpanelPeople.prototype._flush_one_queue = function(action, action_method, callback, queue_to_params_fn) { + var _this = this; + var queued_data = _.extend({}, this._mixpanel['persistence']._get_queue(action)); + var action_params = queued_data; + + if (!_.isUndefined(queued_data) && _.isObject(queued_data) && !_.isEmptyObject(queued_data)) { + _this._mixpanel['persistence']._pop_from_people_queue(action, queued_data); + if (queue_to_params_fn) { + action_params = queue_to_params_fn(queued_data); + } + action_method.call(_this, action_params, function(response, data) { + // on bad response, we want to add it back to the queue + if (response === 0) { + _this._mixpanel['persistence']._add_to_people_queue(action, queued_data); + } + if (!_.isUndefined(callback)) { + callback(response, data); + } + }); + } +}; + +// Flush queued engage operations - order does not matter, +// and there are network level race conditions anyway +MixpanelPeople.prototype._flush = function( + _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback +) { + var _this = this; + var $append_queue = this._mixpanel['persistence']._get_queue(APPEND_ACTION); + var $remove_queue = this._mixpanel['persistence']._get_queue(REMOVE_ACTION); + + this._flush_one_queue(SET_ACTION, this.set, _set_callback); + this._flush_one_queue(SET_ONCE_ACTION, this.set_once, _set_once_callback); + this._flush_one_queue(UNSET_ACTION, this.unset, _unset_callback, function(queue) { return _.keys(queue); }); + this._flush_one_queue(ADD_ACTION, this.increment, _add_callback); + this._flush_one_queue(UNION_ACTION, this.union, _union_callback); + + // we have to fire off each $append individually since there is + // no concat method server side + if (!_.isUndefined($append_queue) && _.isArray($append_queue) && $append_queue.length) { + var $append_item; + var append_callback = function(response, data) { + if (response === 0) { + _this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, $append_item); + } + if (!_.isUndefined(_append_callback)) { + _append_callback(response, data); + } + }; + for (var i = $append_queue.length - 1; i >= 0; i--) { + $append_item = $append_queue.pop(); + if (!_.isEmptyObject($append_item)) { + _this.append($append_item, append_callback); + } + } + // Save the shortened append queue + _this._mixpanel['persistence'].save(); + } + + // same for $remove + if (!_.isUndefined($remove_queue) && _.isArray($remove_queue) && $remove_queue.length) { + var $remove_item; + var remove_callback = function(response, data) { + if (response === 0) { + _this._mixpanel['persistence']._add_to_people_queue(REMOVE_ACTION, $remove_item); + } + if (!_.isUndefined(_remove_callback)) { + _remove_callback(response, data); + } + }; + for (var j = $remove_queue.length - 1; j >= 0; j--) { + $remove_item = $remove_queue.pop(); + if (!_.isEmptyObject($remove_item)) { + _this.remove($remove_item, remove_callback); + } + } + _this._mixpanel['persistence'].save(); + } +}; + +MixpanelPeople.prototype._is_reserved_property = function(prop) { + return prop === '$distinct_id' || prop === '$token' || prop === '$device_id' || prop === '$user_id' || prop === '$had_persisted_distinct_id'; +}; + +// MixpanelPeople Exports +MixpanelPeople.prototype['set'] = MixpanelPeople.prototype.set; +MixpanelPeople.prototype['set_once'] = MixpanelPeople.prototype.set_once; +MixpanelPeople.prototype['unset'] = MixpanelPeople.prototype.unset; +MixpanelPeople.prototype['increment'] = MixpanelPeople.prototype.increment; +MixpanelPeople.prototype['append'] = MixpanelPeople.prototype.append; +MixpanelPeople.prototype['remove'] = MixpanelPeople.prototype.remove; +MixpanelPeople.prototype['union'] = MixpanelPeople.prototype.union; +MixpanelPeople.prototype['track_charge'] = MixpanelPeople.prototype.track_charge; +MixpanelPeople.prototype['clear_charges'] = MixpanelPeople.prototype.clear_charges; +MixpanelPeople.prototype['delete_user'] = MixpanelPeople.prototype.delete_user; +MixpanelPeople.prototype['toString'] = MixpanelPeople.prototype.toString; + +/* + * Mixpanel JS Library + * + * Copyright 2012, Mixpanel, Inc. All Rights Reserved + * http://mixpanel.com/ + * + * Includes portions of Underscore.js + * http://documentcloud.github.com/underscore/ + * (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. + * Released under the MIT License. + */ + +// ==ClosureCompiler== +// @compilation_level ADVANCED_OPTIMIZATIONS +// @output_file_name mixpanel-2.8.min.js +// ==/ClosureCompiler== + +/* +SIMPLE STYLE GUIDE: + +this.x === public function +this._x === internal - only use within this file +this.__x === private - only use within the class + +Globals should be all caps +*/ + +var init_type; // MODULE or SNIPPET loader +var mixpanel_master; // main mixpanel instance / object +var INIT_MODULE = 0; +var INIT_SNIPPET = 1; + +/** @const */ var PRIMARY_INSTANCE_NAME = 'mixpanel'; + + +/* + * Dynamic... constants? Is that an oxymoron? + */ +// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ +// https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#withCredentials +var USE_XHR = (window$1.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()); + +// IE<10 does not support cross-origin XHR's but script tags +// with defer won't block window.onload; ENQUEUE_REQUESTS +// should only be true for Opera<12 +var ENQUEUE_REQUESTS = !USE_XHR && (userAgent.indexOf('MSIE') === -1) && (userAgent.indexOf('Mozilla') === -1); + +/* + * Module-level globals + */ +var DEFAULT_CONFIG = { + 'api_host': 'https://api-js.mixpanel.com', + 'api_method': 'POST', + 'cross_subdomain_cookie': true, + 'persistence': 'cookie', + 'persistence_name': '', + 'cookie_name': '', + 'loaded': function() {}, + 'test': false, + 'verbose': false, + 'img': false, + 'track_pageview': true, + 'debug': false, + 'cookie_expiration': 365, + 'disable_persistence': false, + 'disable_cookie': false, + 'secure_cookie': false, + 'ip': true, + 'opt_out_tracking_by_default': false, + 'opt_out_persistence_by_default': false, + 'opt_out_tracking_persistence_type': 'localStorage', + 'opt_out_tracking_cookie_prefix': null, + 'property_blacklist': [], + 'xhr_headers': {} // { header: value, header2: value } +}; + +var DOM_LOADED = false; + +/** + * Mixpanel Library Object + * @constructor + */ +var MixpanelLib = function() {}; + + +/** + * create_mplib(token:string, config:object, name:string) + * + * This function is used by the init method of MixpanelLib objects + * as well as the main initializer at the end of the JSLib (that + * initializes document.mixpanel as well as any additional instances + * declared before this file has loaded). + */ +var create_mplib = function(token, config, name) { + var instance, + target = (name === PRIMARY_INSTANCE_NAME) ? mixpanel_master : mixpanel_master[name]; + + if (target && init_type === INIT_MODULE) { + instance = target; + } else { + if (target && !_.isArray(target)) { + console$1.error('You have already initialized ' + name); + return; + } + instance = new MixpanelLib(); + } + + instance._init(token, config, name); + + instance['people'] = new MixpanelPeople(); + instance['people']._init(instance); + + // if any instance on the page has debug = true, we set the + // global debug to be true + Config.DEBUG = Config.DEBUG || instance.get_config('debug'); + + + // if target is not defined, we called init after the lib already + // loaded, so there won't be an array of things to execute + if (!_.isUndefined(target) && _.isArray(target)) { + // Crunch through the people queue first - we queue this data up & + // flush on identify, so it's better to do all these operations first + instance._execute_array.call(instance['people'], target['people']); + instance._execute_array(target); + } + + return instance; +}; + +// Initialization methods + +/** + * This function initializes a new instance of the Mixpanel tracking object. + * All new instances are added to the main mixpanel object as sub properties (such as + * mixpanel.library_name) and also returned by this function. To define a + * second instance on the page, you would call: + * + * mixpanel.init('new token', { your: 'config' }, 'library_name'); + * + * and use it like so: + * + * mixpanel.library_name.track(...); + * + * @param {String} token Your Mixpanel API token + * @param {Object} [config] A dictionary of config options to override. See a list of default config options. + * @param {String} [name] The name for the new mixpanel instance that you want created + */ +MixpanelLib.prototype.init = function (token, config, name) { + if (_.isUndefined(name)) { + console$1.error('You must name your new library: init(token, config, name)'); + return; + } + if (name === PRIMARY_INSTANCE_NAME) { + console$1.error('You must initialize the main mixpanel object right after you include the Mixpanel js snippet'); + return; + } + + var instance = create_mplib(token, config, name); + mixpanel_master[name] = instance; + instance._loaded(); + + return instance; +}; + +// mixpanel._init(token:string, config:object, name:string) +// +// This function sets up the current instance of the mixpanel +// library. The difference between this method and the init(...) +// method is this one initializes the actual instance, whereas the +// init(...) method sets up a new library and calls _init on it. +// +MixpanelLib.prototype._init = function(token, config, name) { + this['__loaded'] = true; + this['config'] = {}; + + this.set_config(_.extend({}, DEFAULT_CONFIG, config, { + 'name': name, + 'token': token, + 'callback_fn': ((name === PRIMARY_INSTANCE_NAME) ? name : PRIMARY_INSTANCE_NAME + '.' + name) + '._jsc' + })); + + this['_jsc'] = function() {}; + + this.__dom_loaded_queue = []; + this.__request_queue = []; + this.__disabled_events = []; + this._flags = { + 'disable_all_events': false, + 'identify_called': false + }; + + this['persistence'] = this['cookie'] = new MixpanelPersistence(this['config']); + this._gdpr_init(); + + var uuid = _.UUID(); + if (!this.get_distinct_id()) { + // There is no need to set the distinct id + // or the device id if something was already stored + // in the persitence + this.register_once({ + 'distinct_id': uuid, + '$device_id': uuid + }, ''); + } +}; + +// Private methods + +MixpanelLib.prototype._loaded = function() { + this.get_config('loaded')(this); + + // this happens after so a user can call identify/name_tag in + // the loaded callback + if (this.get_config('track_pageview')) { + this.track_pageview(); + } +}; + +MixpanelLib.prototype._dom_loaded = function() { + _.each(this.__dom_loaded_queue, function(item) { + this._track_dom.apply(this, item); + }, this); + + if (!this.has_opted_out_tracking()) { + _.each(this.__request_queue, function(item) { + this._send_request.apply(this, item); + }, this); + } + + delete this.__dom_loaded_queue; + delete this.__request_queue; +}; + +MixpanelLib.prototype._track_dom = function(DomClass, args) { + if (this.get_config('img')) { + console$1.error('You can\'t use DOM tracking functions with img = true.'); + return false; + } + + if (!DOM_LOADED) { + this.__dom_loaded_queue.push([DomClass, args]); + return false; + } + + var dt = new DomClass().init(this); + return dt.track.apply(dt, args); +}; + +/** + * _prepare_callback() should be called by callers of _send_request for use + * as the callback argument. + * + * If there is no callback, this returns null. + * If we are going to make XHR/XDR requests, this returns a function. + * If we are going to use script tags, this returns a string to use as the + * callback GET param. + */ +MixpanelLib.prototype._prepare_callback = function(callback, data) { + if (_.isUndefined(callback)) { + return null; + } + + if (USE_XHR) { + var callback_function = function(response) { + callback(response, data); + }; + return callback_function; + } else { + // if the user gives us a callback, we store as a random + // property on this instances jsc function and update our + // callback string to reflect that. + var jsc = this['_jsc']; + var randomized_cb = '' + Math.floor(Math.random() * 100000000); + var callback_string = this.get_config('callback_fn') + '[' + randomized_cb + ']'; + jsc[randomized_cb] = function(response) { + delete jsc[randomized_cb]; + callback(response, data); + }; + return callback_string; + } +}; + +MixpanelLib.prototype._send_request = function(url, data, options, callback) { + if (ENQUEUE_REQUESTS) { + this.__request_queue.push(arguments); + return; + } + + var DEFAULT_OPTIONS = {method: this.get_config('api_method')}; + var body_data = null; + + if (!callback && (_.isFunction(options) || typeof options === 'string')) { + callback = options; + options = null; + } + options = _.extend(DEFAULT_OPTIONS, options || {}); + if (!USE_XHR) { + options.method = 'GET'; + } + var use_post = options.method === 'POST'; + + // needed to correctly format responses + var verbose_mode = this.get_config('verbose'); + if (data['verbose']) { verbose_mode = true; } + + if (this.get_config('test')) { data['test'] = 1; } + if (verbose_mode) { data['verbose'] = 1; } + if (this.get_config('img')) { data['img'] = 1; } + if (!USE_XHR) { + if (callback) { + data['callback'] = callback; + } else if (verbose_mode || this.get_config('test')) { + // Verbose output (from verbose mode, or an error in test mode) is a json blob, + // which by itself is not valid javascript. Without a callback, this verbose output will + // cause an error when returned via jsonp, so we force a no-op callback param. + // See the ECMA script spec: http://www.ecma-international.org/ecma-262/5.1/#sec-12.4 + data['callback'] = '(function(){})'; + } + } + + data['ip'] = this.get_config('ip')?1:0; + data['_'] = new Date().getTime().toString(); + + if (use_post) { + body_data = 'data=' + data['data']; + delete data['data']; + } + + url += '?' + _.HTTPBuildQuery(data); + + if ('img' in data) { + var img = document$1.createElement('img'); + img.src = url; + document$1.body.appendChild(img); + } else if (USE_XHR) { + try { + var req = new XMLHttpRequest(); + req.open(options.method, url, true); + + var headers = this.get_config('xhr_headers'); + if (use_post) { + headers['Content-Type'] = 'application/x-www-form-urlencoded'; + } + _.each(headers, function(headerValue, headerName) { + req.setRequestHeader(headerName, headerValue); + }); + + // send the mp_optout cookie + // withCredentials cannot be modified until after calling .open on Android and Mobile Safari + req.withCredentials = true; + req.onreadystatechange = function () { + if (req.readyState === 4) { // XMLHttpRequest.DONE == 4, except in safari 4 + if (req.status === 200) { + if (callback) { + callback(Number(req.responseText)); + } + } else { + var error = 'Bad HTTP status: ' + req.status + ' ' + req.statusText; + console$1.error(error); + if (callback) { + if (verbose_mode) { + callback({status: 0, error: error}); + } else { + callback(0); + } + } + } + } + }; + req.send(body_data); + } catch (e) { + console$1.error(e); + } + } else { + var script = document$1.createElement('script'); + script.type = 'text/javascript'; + script.async = true; + script.defer = true; + script.src = url; + var s = document$1.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(script, s); + } +}; + +/** + * _execute_array() deals with processing any mixpanel function + * calls that were called before the Mixpanel library were loaded + * (and are thus stored in an array so they can be called later) + * + * Note: we fire off all the mixpanel function calls && user defined + * functions BEFORE we fire off mixpanel tracking calls. This is so + * identify/register/set_config calls can properly modify early + * tracking calls. + * + * @param {Array} array + */ +MixpanelLib.prototype._execute_array = function(array) { + var fn_name, alias_calls = [], other_calls = [], tracking_calls = []; + _.each(array, function(item) { + if (item) { + fn_name = item[0]; + if (_.isArray(fn_name)) { + tracking_calls.push(item); // chained call e.g. mixpanel.get_group().set() + } else if (typeof(item) === 'function') { + item.call(this); + } else if (_.isArray(item) && fn_name === 'alias') { + alias_calls.push(item); + } else if (_.isArray(item) && fn_name.indexOf('track') !== -1 && typeof(this[fn_name]) === 'function') { + tracking_calls.push(item); + } else { + other_calls.push(item); + } + } + }, this); + + var execute = function(calls, context) { + _.each(calls, function(item) { + if (_.isArray(item[0])) { + // chained call + var caller = context; + _.each(item, function(call) { + caller = caller[call[0]].apply(caller, call.slice(1)); + }); + } else { + this[item[0]].apply(this, item.slice(1)); + } + }, context); + }; + + execute(alias_calls, this); + execute(other_calls, this); + execute(tracking_calls, this); +}; + +/** + * push() keeps the standard async-array-push + * behavior around after the lib is loaded. + * This is only useful for external integrations that + * do not wish to rely on our convenience methods + * (created in the snippet). + * + * ### Usage: + * mixpanel.push(['register', { a: 'b' }]); + * + * @param {Array} item A [function_name, args...] array to be executed + */ +MixpanelLib.prototype.push = function(item) { + this._execute_array([item]); +}; + +/** + * Disable events on the Mixpanel object. If passed no arguments, + * this function disables tracking of any event. If passed an + * array of event names, those events will be disabled, but other + * events will continue to be tracked. + * + * Note: this function does not stop other mixpanel functions from + * firing, such as register() or people.set(). + * + * @param {Array} [events] An array of event names to disable + */ +MixpanelLib.prototype.disable = function(events) { + if (typeof(events) === 'undefined') { + this._flags.disable_all_events = true; + } else { + this.__disabled_events = this.__disabled_events.concat(events); + } +}; + +/** + * Track an event. This is the most important and + * frequently used Mixpanel function. + * + * ### Usage: + * + * // track an event named 'Registered' + * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}); + * + * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc. + * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself. + * @param {Function} [callback] If provided, the callback function will be called after tracking the event. + */ +MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, properties, callback) { + if (typeof(callback) !== 'function') { + callback = function() {}; + } + + if (_.isUndefined(event_name)) { + console$1.error('No event name provided to mixpanel.track'); + return; + } + + if (this._event_is_disabled(event_name)) { + callback(0); + return; + } + + // set defaults + properties = properties || {}; + properties['token'] = this.get_config('token'); + + // note: extend writes to the first object, so lets make sure we + // don't write to the persistence properties object and info + // properties object by passing in a new object + + // update properties with pageview info and super-properties + properties = _.extend( + {}, + _.info.properties(), + this['persistence'].properties(), + properties + ); + + var property_blacklist = this.get_config('property_blacklist'); + if (_.isArray(property_blacklist)) { + _.each(property_blacklist, function(blacklisted_prop) { + delete properties[blacklisted_prop]; + }); + } else { + console$1.error('Invalid value for property_blacklist config: ' + property_blacklist); + } + + var data = { + 'event': event_name, + 'properties': properties + }; + var truncated_data = _.truncate(data, 255); + var json_data = _.JSONEncode(truncated_data); + var encoded_data = _.base64Encode(json_data); + + console$1.log('MIXPANEL REQUEST:'); + console$1.log(truncated_data); + + this._send_request( + this.get_config('api_host') + '/track/', + { 'data': encoded_data }, + this._prepare_callback(callback, truncated_data) + ); + + return truncated_data; +}); + +/** + * Track a page view event, which is currently ignored by the server. + * This function is called by default on page load unless the + * track_pageview configuration variable is false. + * + * @param {String} [page] The url of the page to record. If you don't include this, it defaults to the current url. + * @api private + */ +MixpanelLib.prototype.track_pageview = function(page) { + if (_.isUndefined(page)) { + page = document$1.location.href; + } + this.track('mp_page_view', _.info.pageviewInfo(page)); +}; + +/** + * Register a set of super properties, which are included with all + * events. This will overwrite previous super property values. + * + * ### Usage: + * + * // register 'Gender' as a super property + * mixpanel.register({'Gender': 'Female'}); + * + * // register several super properties when a user signs up + * mixpanel.register({ + * 'Email': 'jdoe@example.com', + * 'Account Type': 'Free' + * }); + * + * @param {Object} properties An associative array of properties to store about the user + * @param {Number} [days] How many days since the user's last visit to store the super properties + */ +MixpanelLib.prototype.register = function(props, days) { + this['persistence'].register(props, days); +}; + +/** + * Register a set of super properties only once. This will not + * overwrite previous super property values, unlike register(). + * + * ### Usage: + * + * // register a super property for the first time only + * mixpanel.register_once({ + * 'First Login Date': new Date().toISOString() + * }); + * + * ### Notes: + * + * If default_value is specified, current super properties + * with that value will be overwritten. + * + * @param {Object} properties An associative array of properties to store about the user + * @param {*} [default_value] Value to override if already set in super properties (ex: 'False') Default: 'None' + * @param {Number} [days] How many days since the users last visit to store the super properties + */ +MixpanelLib.prototype.register_once = function(props, default_value, days) { + this['persistence'].register_once(props, default_value, days); +}; + +/** + * Delete a super property stored with the current user. + * + * @param {String} property The name of the super property to remove + */ +MixpanelLib.prototype.unregister = function(property) { + this['persistence'].unregister(property); +}; + +MixpanelLib.prototype._register_single = function(prop, value) { + var props = {}; + props[prop] = value; + this.register(props); +}; + +/** + * Identify a user with a unique ID instead of a Mixpanel + * randomly generated distinct_id. If the method is never called, + * then unique visitors will be identified by a UUID generated + * the first time they visit the site. + * + * ### Notes: + * + * You can call this function to overwrite a previously set + * unique ID for the current user. Mixpanel cannot translate + * between IDs at this time, so when you change a user's ID + * they will appear to be a new user. + * + * When used alone, mixpanel.identify will change the user's + * distinct_id to the unique ID provided. When used in tandem + * with mixpanel.alias, it will allow you to identify based on + * unique ID and map that back to the original, anonymous + * distinct_id given to the user upon her first arrival to your + * site (thus connecting anonymous pre-signup activity to + * post-signup activity). Though the two work together, do not + * call identify() at the same time as alias(). Calling the two + * at the same time can cause a race condition, so it is best + * practice to call identify on the original, anonymous ID + * right after you've aliased it. + * Learn more about how mixpanel.identify and mixpanel.alias can be used. + * + * @param {String} [unique_id] A string that uniquely identifies a user. If not provided, the distinct_id currently in the persistent store (cookie or localStorage) will be used. + */ +MixpanelLib.prototype.identify = function( + new_distinct_id, _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback +) { + // Optional Parameters + // _set_callback:function A callback to be run if and when the People set queue is flushed + // _add_callback:function A callback to be run if and when the People add queue is flushed + // _append_callback:function A callback to be run if and when the People append queue is flushed + // _set_once_callback:function A callback to be run if and when the People set_once queue is flushed + // _union_callback:function A callback to be run if and when the People union queue is flushed + // _unset_callback:function A callback to be run if and when the People unset queue is flushed + + var previous_distinct_id = this.get_distinct_id(); + this.register({'$user_id': new_distinct_id}); + + if (!this.get_property('$device_id')) { + // The persisted distinct id might not actually be a device id at all + // it might be a distinct id of the user from before + var device_id = previous_distinct_id; + this.register_once({ + '$had_persisted_distinct_id': true, + '$device_id': device_id + }, ''); + } + + // identify only changes the distinct id if it doesn't match either the existing or the alias; + // if it's new, blow away the alias as well. + if (new_distinct_id !== previous_distinct_id && new_distinct_id !== this.get_property(ALIAS_ID_KEY)) { + this.unregister(ALIAS_ID_KEY); + this.register({'distinct_id': new_distinct_id}); + } + this._flags.identify_called = true; + // Flush any queued up people requests + this['people']._flush(_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback); + + // send an $identify event any time the distinct_id is changing - logic on the server + // will determine whether or not to do anything with it. + if (new_distinct_id !== previous_distinct_id) { + this.track('$identify', { 'distinct_id': new_distinct_id, '$anon_distinct_id': previous_distinct_id }); + } +}; + +/** + * Clears super properties and generates a new random distinct_id for this instance. + * Useful for clearing data when a user logs out. + */ +MixpanelLib.prototype.reset = function() { + this['persistence'].clear(); + this._flags.identify_called = false; + var uuid = _.UUID(); + this.register_once({ + 'distinct_id': uuid, + '$device_id': uuid + }, ''); +}; + +/** + * Returns the current distinct id of the user. This is either the id automatically + * generated by the library or the id that has been passed by a call to identify(). + * + * ### Notes: + * + * get_distinct_id() can only be called after the Mixpanel library has finished loading. + * init() has a loaded function available to handle this automatically. For example: + * + * // set distinct_id after the mixpanel library has loaded + * mixpanel.init('YOUR PROJECT TOKEN', { + * loaded: function(mixpanel) { + * distinct_id = mixpanel.get_distinct_id(); + * } + * }); + */ +MixpanelLib.prototype.get_distinct_id = function() { + return this.get_property('distinct_id'); +}; + +/** + * Create an alias, which Mixpanel will use to link two distinct_ids going forward (not retroactively). + * Multiple aliases can map to the same original ID, but not vice-versa. Aliases can also be chained - the + * following is a valid scenario: + * + * mixpanel.alias('new_id', 'existing_id'); + * ... + * mixpanel.alias('newer_id', 'new_id'); + * + * If the original ID is not passed in, we will use the current distinct_id - probably the auto-generated GUID. + * + * ### Notes: + * + * The best practice is to call alias() when a unique ID is first created for a user + * (e.g., when a user first registers for an account and provides an email address). + * alias() should never be called more than once for a given user, except to + * chain a newer ID to a previously new ID, as described above. + * + * @param {String} alias A unique identifier that you want to use for this user in the future. + * @param {String} [original] The current identifier being used for this user. + */ +MixpanelLib.prototype.alias = function(alias, original) { + // If the $people_distinct_id key exists in persistence, there has been a previous + // mixpanel.people.identify() call made for this user. It is VERY BAD to make an alias with + // this ID, as it will duplicate users. + if (alias === this.get_property(PEOPLE_DISTINCT_ID_KEY)) { + console$1.critical('Attempting to create alias for existing People user - aborting.'); + return -2; + } + + var _this = this; + if (_.isUndefined(original)) { + original = this.get_distinct_id(); + } + if (alias !== original) { + this._register_single(ALIAS_ID_KEY, alias); + return this.track('$create_alias', { 'alias': alias, 'distinct_id': original }, function() { + // Flush the people queue + _this.identify(alias); + }); + } else { + console$1.error('alias matches current distinct_id - skipping api call.'); + this.identify(alias); + return -1; + } +}; + +/** + * Provide a string to recognize the user by. The string passed to + * this method will appear in the Mixpanel Streams product rather + * than an automatically generated name. Name tags do not have to + * be unique. + * + * This value will only be included in Streams data. + * + * @param {String} name_tag A human readable name for the user + * @api private + */ +MixpanelLib.prototype.name_tag = function(name_tag) { + this._register_single('mp_name_tag', name_tag); +}; + +/** + * Update the configuration of a mixpanel library instance. + * + * The default config is: + * + * { + * // super properties cookie expiration (in days) + * cookie_expiration: 365 + * + * // super properties span subdomains + * cross_subdomain_cookie: true + * + * // debug mode + * debug: false + * + * // if this is true, the mixpanel cookie or localStorage entry + * // will be deleted, and no user persistence will take place + * disable_persistence: false + * + * // if this is true, Mixpanel will automatically determine + * // City, Region and Country data using the IP address of + * //the client + * ip: true + * + * // opt users out of tracking by this Mixpanel instance by default + * opt_out_tracking_by_default: false + * + * // opt users out of browser data storage by this Mixpanel instance by default + * opt_out_persistence_by_default: false + * + * // persistence mechanism used by opt-in/opt-out methods - cookie + * // or localStorage - falls back to cookie if localStorage is unavailable + * opt_out_tracking_persistence_type: 'localStorage' + * + * // customize the name of cookie/localStorage set by opt-in/opt-out methods + * opt_out_tracking_cookie_prefix: null + * + * // type of persistent store for super properties (cookie/ + * // localStorage) if set to 'localStorage', any existing + * // mixpanel cookie value with the same persistence_name + * // will be transferred to localStorage and deleted + * persistence: 'cookie' + * + * // name for super properties persistent store + * persistence_name: '' + * + * // names of properties/superproperties which should never + * // be sent with track() calls + * property_blacklist: [] + * + * // if this is true, mixpanel cookies will be marked as + * // secure, meaning they will only be transmitted over https + * secure_cookie: false + * + * // should we track a page view on page load + * track_pageview: true + * + * // extra HTTP request headers to set for each API request, in + * // the format {'Header-Name': value} + * xhr_headers: {} + * } + * + * + * @param {Object} config A dictionary of new configuration values to update + */ +MixpanelLib.prototype.set_config = function(config) { + if (_.isObject(config)) { + _.extend(this['config'], config); + + if (!this.get_config('persistence_name')) { + this['config']['persistence_name'] = this['config']['cookie_name']; + } + if (!this.get_config('disable_persistence')) { + this['config']['disable_persistence'] = this['config']['disable_cookie']; + } + + if (this['persistence']) { + this['persistence'].update_config(this['config']); + } + Config.DEBUG = Config.DEBUG || this.get_config('debug'); + } +}; + +/** + * returns the current config object for the library. + */ +MixpanelLib.prototype.get_config = function(prop_name) { + return this['config'][prop_name]; +}; + +/** + * Returns the value of the super property named property_name. If no such + * property is set, get_property() will return the undefined value. + * + * ### Notes: + * + * get_property() can only be called after the Mixpanel library has finished loading. + * init() has a loaded function available to handle this automatically. For example: + * + * // grab value for 'user_id' after the mixpanel library has loaded + * mixpanel.init('YOUR PROJECT TOKEN', { + * loaded: function(mixpanel) { + * user_id = mixpanel.get_property('user_id'); + * } + * }); + * + * @param {String} property_name The name of the super property you want to retrieve + */ +MixpanelLib.prototype.get_property = function(property_name) { + return this['persistence']['props'][property_name]; +}; + +MixpanelLib.prototype.toString = function() { + var name = this.get_config('name'); + if (name !== PRIMARY_INSTANCE_NAME) { + name = PRIMARY_INSTANCE_NAME + '.' + name; + } + return name; +}; + +MixpanelLib.prototype._event_is_disabled = function(event_name) { + return _.isBlockedUA(userAgent) || + this._flags.disable_all_events || + _.include(this.__disabled_events, event_name); +}; + +// perform some housekeeping around GDPR opt-in/out state +MixpanelLib.prototype._gdpr_init = function() { + var is_localStorage_requested = this.get_config('opt_out_tracking_persistence_type') === 'localStorage'; + + // try to convert opt-in/out cookies to localStorage if possible + if (is_localStorage_requested && _.localStorage.is_supported()) { + if (!this.has_opted_in_tracking() && this.has_opted_in_tracking({'persistence_type': 'cookie'})) { + this.opt_in_tracking({'enable_persistence': false}); + } + if (!this.has_opted_out_tracking() && this.has_opted_out_tracking({'persistence_type': 'cookie'})) { + this.opt_out_tracking({'clear_persistence': false}); + } + this.clear_opt_in_out_tracking({ + 'persistence_type': 'cookie', + 'enable_persistence': false + }); + } + + // check whether the user has already opted out - if so, clear & disable persistence + if (this.has_opted_out_tracking()) { + this._gdpr_update_persistence({'clear_persistence': true}); + + // check whether we should opt out by default + // note: we don't clear persistence here by default since opt-out default state is often + // used as an initial state while GDPR information is being collected + } else if (!this.has_opted_in_tracking() && ( + this.get_config('opt_out_tracking_by_default') || _.cookie.get('mp_optout') + )) { + _.cookie.remove('mp_optout'); + this.opt_out_tracking({ + 'clear_persistence': this.get_config('opt_out_persistence_by_default') + }); + } +}; + +/** + * Enable or disable persistence based on options + * only enable/disable if persistence is not already in this state + * @param {boolean} [options.clear_persistence] If true, will delete all data stored by the sdk in persistence and disable it + * @param {boolean} [options.enable_persistence] If true, will re-enable sdk persistence + */ +MixpanelLib.prototype._gdpr_update_persistence = function(options) { + var disabled; + if (options && options['clear_persistence']) { + disabled = true; + } else if (options && options['enable_persistence']) { + disabled = false; + } else { + return; + } + + if (!this.get_config('disable_persistence') && this['persistence'].disabled !== disabled) { + this['persistence'].set_disabled(disabled); + } +}; + +// call a base gdpr function after constructing the appropriate token and options args +MixpanelLib.prototype._gdpr_call_func = function(func, options) { + options = _.extend({ + 'track': this.track.bind(this), + 'persistence_type': this.get_config('opt_out_tracking_persistence_type'), + 'cookie_prefix': this.get_config('opt_out_tracking_cookie_prefix'), + 'cookie_expiration': this.get_config('cookie_expiration'), + 'cross_subdomain_cookie': this.get_config('cross_subdomain_cookie'), + 'secure_cookie': this.get_config('secure_cookie') + }, options); + + // check if localStorage can be used for recording opt out status, fall back to cookie if not + if (!_.localStorage.is_supported()) { + options['persistence_type'] = 'cookie'; + } + + return func(this.get_config('token'), { + track: options['track'], + trackEventName: options['track_event_name'], + trackProperties: options['track_properties'], + persistenceType: options['persistence_type'], + persistencePrefix: options['cookie_prefix'], + cookieExpiration: options['cookie_expiration'], + crossSubdomainCookie: options['cross_subdomain_cookie'], + secureCookie: options['secure_cookie'] + }); +}; + +/** + * Opt the user in to data tracking and cookies/localstorage for this Mixpanel instance + * + * ### Usage + * + * // opt user in + * mixpanel.opt_in_tracking(); + * + * // opt user in with specific event name, properties, cookie configuration + * mixpanel.opt_in_tracking({ + * track_event_name: 'User opted in', + * track_event_properties: { + * 'Email': 'jdoe@example.com' + * }, + * cookie_expiration: 30, + * secure_cookie: true + * }); + * + * @param {Object} [options] A dictionary of config options to override + * @param {function} [options.track] Function used for tracking a Mixpanel event to record the opt-in action (default is this Mixpanel instance's track method) + * @param {string} [options.track_event_name=$opt_in] Event name to be used for tracking the opt-in action + * @param {Object} [options.track_properties] Set of properties to be tracked along with the opt-in action + * @param {boolean} [options.enable_persistence=true] If true, will re-enable sdk persistence + * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable + * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name + * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config) + * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config) + * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config) + */ +MixpanelLib.prototype.opt_in_tracking = function(options) { + options = _.extend({ + 'enable_persistence': true + }, options); + + this._gdpr_call_func(optIn, options); + this._gdpr_update_persistence(options); +}; + +/** + * Opt the user out of data tracking and cookies/localstorage for this Mixpanel instance + * + * ### Usage + * + * // opt user out + * mixpanel.opt_out_tracking(); + * + * // opt user out with different cookie configuration from Mixpanel instance + * mixpanel.opt_out_tracking({ + * cookie_expiration: 30, + * secure_cookie: true + * }); + * + * @param {Object} [options] A dictionary of config options to override + * @param {boolean} [options.delete_user=true] If true, will delete the currently identified user's profile and clear all charges after opting the user out + * @param {boolean} [options.clear_persistence=true] If true, will delete all data stored by the sdk in persistence + * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable + * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name + * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config) + * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config) + * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config) + */ +MixpanelLib.prototype.opt_out_tracking = function(options) { + options = _.extend({ + 'clear_persistence': true, + 'delete_user': true + }, options); + + // delete use and clear charges since these methods may be disabled by opt-out + if (options['delete_user'] && this['people'] && this['people']._identify_called()) { + this['people'].delete_user(); + this['people'].clear_charges(); + } + + this._gdpr_call_func(optOut, options); + this._gdpr_update_persistence(options); +}; + +/** + * Check whether the user has opted in to data tracking and cookies/localstorage for this Mixpanel instance + * + * ### Usage + * + * var has_opted_in = mixpanel.has_opted_in_tracking(); + * // use has_opted_in value + * + * @param {Object} [options] A dictionary of config options to override + * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable + * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name + * @returns {boolean} current opt-in status + */ +MixpanelLib.prototype.has_opted_in_tracking = function(options) { + return this._gdpr_call_func(hasOptedIn, options); +}; + +/** + * Check whether the user has opted out of data tracking and cookies/localstorage for this Mixpanel instance + * + * ### Usage + * + * var has_opted_out = mixpanel.has_opted_out_tracking(); + * // use has_opted_out value + * + * @param {Object} [options] A dictionary of config options to override + * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable + * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name + * @returns {boolean} current opt-out status + */ +MixpanelLib.prototype.has_opted_out_tracking = function(options) { + return this._gdpr_call_func(hasOptedOut, options); +}; + +/** + * Clear the user's opt in/out status of data tracking and cookies/localstorage for this Mixpanel instance + * + * ### Usage + * + * // clear user's opt-in/out status + * mixpanel.clear_opt_in_out_tracking(); + * + * // clear user's opt-in/out status with specific cookie configuration - should match + * // configuration used when opt_in_tracking/opt_out_tracking methods were called. + * mixpanel.clear_opt_in_out_tracking({ + * cookie_expiration: 30, + * secure_cookie: true + * }); + * + * @param {Object} [options] A dictionary of config options to override + * @param {boolean} [options.enable_persistence=true] If true, will re-enable sdk persistence + * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable + * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name + * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config) + * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config) + * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config) + */ +MixpanelLib.prototype.clear_opt_in_out_tracking = function(options) { + options = _.extend({ + 'enable_persistence': true + }, options); + + this._gdpr_call_func(clearOptInOut, options); + this._gdpr_update_persistence(options); +}; + +// EXPORTS (for closure compiler) + +// MixpanelLib Exports +MixpanelLib.prototype['init'] = MixpanelLib.prototype.init; +MixpanelLib.prototype['reset'] = MixpanelLib.prototype.reset; +MixpanelLib.prototype['disable'] = MixpanelLib.prototype.disable; +MixpanelLib.prototype['track'] = MixpanelLib.prototype.track; +MixpanelLib.prototype['track_pageview'] = MixpanelLib.prototype.track_pageview; +MixpanelLib.prototype['register'] = MixpanelLib.prototype.register; +MixpanelLib.prototype['register_once'] = MixpanelLib.prototype.register_once; +MixpanelLib.prototype['unregister'] = MixpanelLib.prototype.unregister; +MixpanelLib.prototype['identify'] = MixpanelLib.prototype.identify; +MixpanelLib.prototype['alias'] = MixpanelLib.prototype.alias; +MixpanelLib.prototype['name_tag'] = MixpanelLib.prototype.name_tag; +MixpanelLib.prototype['set_config'] = MixpanelLib.prototype.set_config; +MixpanelLib.prototype['get_config'] = MixpanelLib.prototype.get_config; +MixpanelLib.prototype['get_property'] = MixpanelLib.prototype.get_property; +MixpanelLib.prototype['get_distinct_id'] = MixpanelLib.prototype.get_distinct_id; +MixpanelLib.prototype['toString'] = MixpanelLib.prototype.toString; +MixpanelLib.prototype['opt_out_tracking'] = MixpanelLib.prototype.opt_out_tracking; +MixpanelLib.prototype['opt_in_tracking'] = MixpanelLib.prototype.opt_in_tracking; +MixpanelLib.prototype['has_opted_out_tracking'] = MixpanelLib.prototype.has_opted_out_tracking; +MixpanelLib.prototype['has_opted_in_tracking'] = MixpanelLib.prototype.has_opted_in_tracking; +MixpanelLib.prototype['clear_opt_in_out_tracking'] = MixpanelLib.prototype.clear_opt_in_out_tracking; + +// MixpanelPersistence Exports +MixpanelPersistence.prototype['properties'] = MixpanelPersistence.prototype.properties; +MixpanelPersistence.prototype['get_cross_subdomain'] = MixpanelPersistence.prototype.get_cross_subdomain; +MixpanelPersistence.prototype['clear'] = MixpanelPersistence.prototype.clear; + +_.safewrap_class(MixpanelLib, ['identify']); + + +var instances = {}; +var extend_mp = function() { + // add all the sub mixpanel instances + _.each(instances, function(instance, name) { + if (name !== PRIMARY_INSTANCE_NAME) { mixpanel_master[name] = instance; } + }); + + // add private functions as _ + mixpanel_master['_'] = _; +}; + +var override_mp_init_func = function() { + // we override the snippets init function to handle the case where a + // user initializes the mixpanel library after the script loads & runs + mixpanel_master['init'] = function(token, config, name) { + if (name) { + // initialize a sub library + if (!mixpanel_master[name]) { + mixpanel_master[name] = instances[name] = create_mplib(token, config, name); + mixpanel_master[name]._loaded(); + } + return mixpanel_master[name]; + } else { + var instance = mixpanel_master; + + if (instances[PRIMARY_INSTANCE_NAME]) { + // main mixpanel lib already initialized + instance = instances[PRIMARY_INSTANCE_NAME]; + } else if (token) { + // intialize the main mixpanel lib + instance = create_mplib(token, config, PRIMARY_INSTANCE_NAME); + instance._loaded(); + instances[PRIMARY_INSTANCE_NAME] = instance; + } + + mixpanel_master = instance; + if (init_type === INIT_SNIPPET) { + window$1[PRIMARY_INSTANCE_NAME] = mixpanel_master; + } + extend_mp(); + } + }; +}; + +var add_dom_loaded_handler = function() { + // Cross browser DOM Loaded support + function dom_loaded_handler() { + // function flag since we only want to execute this once + if (dom_loaded_handler.done) { return; } + dom_loaded_handler.done = true; + + DOM_LOADED = true; + ENQUEUE_REQUESTS = false; + + _.each(instances, function(inst) { + inst._dom_loaded(); + }); + } + + if (document$1.addEventListener) { + if (document$1.readyState === 'complete') { + // safari 4 can fire the DOMContentLoaded event before loading all + // external JS (including this file). you will see some copypasta + // on the internet that checks for 'complete' and 'loaded', but + // 'loaded' is an IE thing + dom_loaded_handler(); + } else { + document$1.addEventListener('DOMContentLoaded', dom_loaded_handler, false); + } + } +}; + +function init_as_module() { + init_type = INIT_MODULE; + mixpanel_master = new MixpanelLib(); + + override_mp_init_func(); + mixpanel_master['init'](); + add_dom_loaded_handler(); + + return mixpanel_master; +} + +var mixpanel = init_as_module(); + +module.exports = mixpanel; + + +/***/ }), + +/***/ "./node_modules/object-assign/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object-assign/index.js ***! + \*********************************************/ +/***/ ((module) => { + +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), + +/***/ "./node_modules/object-is/implementation.js": +/*!**************************************************!*\ + !*** ./node_modules/object-is/implementation.js ***! + \**************************************************/ +/***/ ((module) => { + +"use strict"; + + +var numberIsNaN = function (value) { + return value !== value; +}; + +module.exports = function is(a, b) { + if (a === 0 && b === 0) { + return 1 / a === 1 / b; + } + if (a === b) { + return true; + } + if (numberIsNaN(a) && numberIsNaN(b)) { + return true; + } + return false; +}; + + + +/***/ }), + +/***/ "./node_modules/object-is/index.js": +/*!*****************************************!*\ + !*** ./node_modules/object-is/index.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object-is/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object-is/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "./node_modules/object-is/shim.js"); + +var polyfill = callBind(getPolyfill(), Object); + +define(polyfill, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = polyfill; + + +/***/ }), + +/***/ "./node_modules/object-is/polyfill.js": +/*!********************************************!*\ + !*** ./node_modules/object-is/polyfill.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object-is/implementation.js"); + +module.exports = function getPolyfill() { + return typeof Object.is === 'function' ? Object.is : implementation; +}; + + +/***/ }), + +/***/ "./node_modules/object-is/shim.js": +/*!****************************************!*\ + !*** ./node_modules/object-is/shim.js ***! + \****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object-is/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); + +module.exports = function shimObjectIs() { + var polyfill = getPolyfill(); + define(Object, { is: polyfill }, { + is: function testObjectIs() { + return Object.is !== polyfill; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "./node_modules/object-keys/implementation.js": +/*!****************************************************!*\ + !*** ./node_modules/object-keys/implementation.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var keysShim; +if (!Object.keys) { + // modified from https://github.com/es-shims/es5-shim + var has = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var isArgs = __webpack_require__(/*! ./isArguments */ "./node_modules/object-keys/isArguments.js"); // eslint-disable-line global-require + var isEnumerable = Object.prototype.propertyIsEnumerable; + var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); + var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); + var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + var hasAutomationEqualityBug = (function () { + /* global window */ + if (typeof window === 'undefined') { return false; } + for (var k in window) { + try { + if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { + try { + equalsConstructorPrototype(window[k]); + } catch (e) { + return true; + } + } + } catch (e) { + return true; + } + } + return false; + }()); + var equalsConstructorPrototypeIfNotBuggy = function (o) { + /* global window */ + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o); + } + try { + return equalsConstructorPrototype(o); + } catch (e) { + return false; + } + }; + + keysShim = function keys(object) { + var isObject = object !== null && typeof object === 'object'; + var isFunction = toStr.call(object) === '[object Function]'; + var isArguments = isArgs(object); + var isString = isObject && toStr.call(object) === '[object String]'; + var theKeys = []; + + if (!isObject && !isFunction && !isArguments) { + throw new TypeError('Object.keys called on a non-object'); + } + + var skipProto = hasProtoEnumBug && isFunction; + if (isString && object.length > 0 && !has.call(object, 0)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)); + } + } + + if (isArguments && object.length > 0) { + for (var j = 0; j < object.length; ++j) { + theKeys.push(String(j)); + } + } else { + for (var name in object) { + if (!(skipProto && name === 'prototype') && has.call(object, name)) { + theKeys.push(String(name)); + } + } + } + + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + + for (var k = 0; k < dontEnums.length; ++k) { + if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { + theKeys.push(dontEnums[k]); + } + } + } + return theKeys; + }; +} +module.exports = keysShim; + + +/***/ }), + +/***/ "./node_modules/object-keys/index.js": +/*!*******************************************!*\ + !*** ./node_modules/object-keys/index.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var slice = Array.prototype.slice; +var isArgs = __webpack_require__(/*! ./isArguments */ "./node_modules/object-keys/isArguments.js"); + +var origKeys = Object.keys; +var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(/*! ./implementation */ "./node_modules/object-keys/implementation.js"); + +var originalKeys = Object.keys; + +keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = (function () { + // Safari 5.0 bug + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2)); + if (!keysWorksWithArguments) { + Object.keys = function keys(object) { // eslint-disable-line func-name-matching + if (isArgs(object)) { + return originalKeys(slice.call(object)); + } + return originalKeys(object); + }; + } + } else { + Object.keys = keysShim; + } + return Object.keys || keysShim; +}; + +module.exports = keysShim; + + +/***/ }), + +/***/ "./node_modules/object-keys/isArguments.js": +/*!*************************************************!*\ + !*** ./node_modules/object-keys/isArguments.js ***! + \*************************************************/ +/***/ ((module) => { + +"use strict"; + + +var toStr = Object.prototype.toString; + +module.exports = function isArguments(value) { + var str = toStr.call(value); + var isArgs = str === '[object Arguments]'; + if (!isArgs) { + isArgs = str !== '[object Array]' && + value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr.call(value.callee) === '[object Function]'; + } + return isArgs; +}; + + +/***/ }), + +/***/ "./node_modules/object.assign/implementation.js": +/*!******************************************************!*\ + !*** ./node_modules/object.assign/implementation.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +// modified from https://github.com/es-shims/es6-shim +var objectKeys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js"); +var hasSymbols = __webpack_require__(/*! has-symbols/shams */ "./node_modules/has-symbols/shams.js")(); +var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); +var toObject = Object; +var $push = callBound('Array.prototype.push'); +var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; + +// eslint-disable-next-line no-unused-vars +module.exports = function assign(target, source1) { + if (target == null) { throw new TypeError('target must be an object'); } + var to = toObject(target); // step 1 + if (arguments.length === 1) { + return to; // step 2 + } + for (var s = 1; s < arguments.length; ++s) { + var from = toObject(arguments[s]); // step 3.a.i + + // step 3.a.ii: + var keys = objectKeys(from); + var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); + if (getSymbols) { + var syms = getSymbols(from); + for (var j = 0; j < syms.length; ++j) { + var key = syms[j]; + if ($propIsEnumerable(from, key)) { + $push(keys, key); + } + } + } + + // step 3.a.iii: + for (var i = 0; i < keys.length; ++i) { + var nextKey = keys[i]; + if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2 + var propValue = from[nextKey]; // step 3.a.iii.2.a + to[nextKey] = propValue; // step 3.a.iii.2.b + } + } + } + + return to; // step 4 +}; + + +/***/ }), + +/***/ "./node_modules/object.assign/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object.assign/index.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var defineProperties = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.assign/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.assign/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "./node_modules/object.assign/shim.js"); + +var polyfill = callBind.apply(getPolyfill()); +// eslint-disable-next-line no-unused-vars +var bound = function assign(target, source1) { + return polyfill(Object, arguments); +}; + +defineProperties(bound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = bound; + + +/***/ }), + +/***/ "./node_modules/object.assign/polyfill.js": +/*!************************************************!*\ + !*** ./node_modules/object.assign/polyfill.js ***! + \************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.assign/implementation.js"); + +var lacksProperEnumerationOrder = function () { + if (!Object.assign) { + return false; + } + /* + * v8, specifically in node 4.x, has a bug with incorrect property enumeration order + * note: this does not detect the bug unless there's 20 characters + */ + var str = 'abcdefghijklmnopqrst'; + var letters = str.split(''); + var map = {}; + for (var i = 0; i < letters.length; ++i) { + map[letters[i]] = letters[i]; + } + var obj = Object.assign({}, map); + var actual = ''; + for (var k in obj) { + actual += k; + } + return str !== actual; +}; + +var assignHasPendingExceptions = function () { + if (!Object.assign || !Object.preventExtensions) { + return false; + } + /* + * Firefox 37 still has "pending exception" logic in its Object.assign implementation, + * which is 72% slower than our shim, and Firefox 40's native implementation. + */ + var thrower = Object.preventExtensions({ 1: 2 }); + try { + Object.assign(thrower, 'xy'); + } catch (e) { + return thrower[1] === 'y'; + } + return false; +}; + +module.exports = function getPolyfill() { + if (!Object.assign) { + return implementation; + } + if (lacksProperEnumerationOrder()) { + return implementation; + } + if (assignHasPendingExceptions()) { + return implementation; + } + return Object.assign; +}; + + +/***/ }), + +/***/ "./node_modules/object.assign/shim.js": +/*!********************************************!*\ + !*** ./node_modules/object.assign/shim.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.assign/polyfill.js"); + +module.exports = function shimAssign() { + var polyfill = getPolyfill(); + define( + Object, + { assign: polyfill }, + { assign: function () { return Object.assign !== polyfill; } } + ); + return polyfill; +}; + + +/***/ }), + +/***/ "./node_modules/object.entries/implementation.js": +/*!*******************************************************!*\ + !*** ./node_modules/object.entries/implementation.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var RequireObjectCoercible = __webpack_require__(/*! es-abstract/2023/RequireObjectCoercible */ "./node_modules/es-abstract/2023/RequireObjectCoercible.js"); +var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $push = callBound('Array.prototype.push'); + +module.exports = function entries(O) { + var obj = RequireObjectCoercible(O); + var entrys = []; + for (var key in obj) { + if ($isEnumerable(obj, key)) { // checks own-ness as well + $push(entrys, [key, obj[key]]); + } + } + return entrys; +}; + + +/***/ }), + +/***/ "./node_modules/object.entries/index.js": +/*!**********************************************!*\ + !*** ./node_modules/object.entries/index.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.entries/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.entries/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "./node_modules/object.entries/shim.js"); + +var polyfill = callBind(getPolyfill(), Object); + +define(polyfill, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = polyfill; + + +/***/ }), + +/***/ "./node_modules/object.entries/polyfill.js": +/*!*************************************************!*\ + !*** ./node_modules/object.entries/polyfill.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.entries/implementation.js"); + +module.exports = function getPolyfill() { + return typeof Object.entries === 'function' ? Object.entries : implementation; +}; + + +/***/ }), + +/***/ "./node_modules/object.entries/shim.js": +/*!*********************************************!*\ + !*** ./node_modules/object.entries/shim.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.entries/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); + +module.exports = function shimEntries() { + var polyfill = getPolyfill(); + define(Object, { entries: polyfill }, { + entries: function testEntries() { + return Object.entries !== polyfill; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "./node_modules/object.values/implementation.js": +/*!******************************************************!*\ + !*** ./node_modules/object.values/implementation.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var RequireObjectCoercible = __webpack_require__(/*! es-abstract/2023/RequireObjectCoercible */ "./node_modules/es-abstract/2023/RequireObjectCoercible.js"); +var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $push = callBound('Array.prototype.push'); + +module.exports = function values(O) { + var obj = RequireObjectCoercible(O); + var vals = []; + for (var key in obj) { + if ($isEnumerable(obj, key)) { // checks own-ness as well + $push(vals, obj[key]); + } + } + return vals; +}; + + +/***/ }), + +/***/ "./node_modules/object.values/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object.values/index.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); +var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.values/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.values/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "./node_modules/object.values/shim.js"); + +var polyfill = callBind(getPolyfill(), Object); + +define(polyfill, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = polyfill; + + +/***/ }), + +/***/ "./node_modules/object.values/polyfill.js": +/*!************************************************!*\ + !*** ./node_modules/object.values/polyfill.js ***! + \************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.values/implementation.js"); + +module.exports = function getPolyfill() { + return typeof Object.values === 'function' ? Object.values : implementation; +}; + + +/***/ }), + +/***/ "./node_modules/object.values/shim.js": +/*!********************************************!*\ + !*** ./node_modules/object.values/shim.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.values/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); + +module.exports = function shimValues() { + var polyfill = getPolyfill(); + define(Object, { values: polyfill }, { + values: function testValues() { + return Object.values !== polyfill; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "./node_modules/prop-types-exact/build/helpers/isPlainObject.js": +/*!**********************************************************************!*\ + !*** ./node_modules/prop-types-exact/build/helpers/isPlainObject.js ***! + \**********************************************************************/ +/***/ ((module, exports) => { + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +exports["default"] = isPlainObject; +function isPlainObject(x) { + return x && (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && !Array.isArray(x); +} +module.exports = exports['default']; +//# sourceMappingURL=isPlainObject.js.map + +/***/ }), + +/***/ "./node_modules/prop-types-exact/build/index.js": +/*!******************************************************!*\ + !*** ./node_modules/prop-types-exact/build/index.js ***! + \******************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = forbidExtraProps; + +var _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js"); + +var _object2 = _interopRequireDefault(_object); + +var _has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); + +var _has2 = _interopRequireDefault(_has); + +var _isPlainObject = __webpack_require__(/*! ./helpers/isPlainObject */ "./node_modules/prop-types-exact/build/helpers/isPlainObject.js"); + +var _isPlainObject2 = _interopRequireDefault(_isPlainObject); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +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; } + +var zeroWidthSpace = '\u200B'; +var specialProperty = 'prop-types-exact: ' + zeroWidthSpace; +var semaphore = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? Symbol['for'](specialProperty) : /* istanbul ignore next */specialProperty; + +function brand(fn) { + return (0, _object2['default'])(fn, _defineProperty({}, specialProperty, semaphore)); +} + +function isBranded(value) { + return value && value[specialProperty] === semaphore; +} + +function forbidExtraProps(propTypes) { + if (!(0, _isPlainObject2['default'])(propTypes)) { + throw new TypeError('given propTypes must be an object'); + } + if ((0, _has2['default'])(propTypes, specialProperty) && !isBranded(propTypes[specialProperty])) { + throw new TypeError('Against all odds, you created a propType for a prop that uses both the zero-width space and our custom string - which, sadly, conflicts with `prop-types-exact`'); + } + + return (0, _object2['default'])({}, propTypes, _defineProperty({}, specialProperty, brand(function () { + function forbidUnknownProps(props, _, componentName) { + var unknownProps = Object.keys(props).filter(function (prop) { + return !(0, _has2['default'])(propTypes, prop); + }); + if (unknownProps.length > 0) { + return new TypeError(String(componentName) + ': unknown props found: ' + String(unknownProps.join(', '))); + } + return null; + } + + return forbidUnknownProps; + }()))); +} +module.exports = exports['default']; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ "./node_modules/prop-types/checkPropTypes.js": +/*!***************************************************!*\ + !*** ./node_modules/prop-types/checkPropTypes.js ***! + \***************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +/** + * 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. + */ + + + +var printWarning = function() {}; + +if (true) { + var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); + var loggedTypeFailures = {}; + var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js"); + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) { /**/ } + }; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } +} + +/** + * Resets warning cache when testing. + * + * @private + */ +checkPropTypes.resetWarningCache = function() { + if (true) { + loggedTypeFailures = {}; + } +} + +module.exports = checkPropTypes; + + +/***/ }), + +/***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": +/*!************************************************************!*\ + !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! + \************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +/** + * 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. + */ + + + +var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); +var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); + +var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); +var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js"); +var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); + +var printWarning = function() {}; + +if (true) { + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +function emptyFunctionThatReturnsNull() { + return null; +} + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bigint: createPrimitiveTypeChecker('bigint'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message, data) { + this.message = message; + this.data = data && typeof data === 'object' ? data: {}; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if ( true && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), + {expectedType: expectedType} + ); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + var expectedTypes = []; + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); + if (checkerResult == null) { + return null; + } + if (checkerResult.data && has(checkerResult.data, 'expectedType')) { + expectedTypes.push(checkerResult.data.expectedType); + } + } + var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function invalidValidatorError(componentName, location, propFullName, key, type) { + return new PropTypeError( + (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' + ); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (typeof checker !== 'function') { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (has(shapeTypes, key) && typeof checker !== 'function') { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // falsy value can't be a Symbol + if (!propValue) { + return false; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + + +/***/ }), + +/***/ "./node_modules/prop-types/index.js": +/*!******************************************!*\ + !*** ./node_modules/prop-types/index.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * 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. + */ + +if (true) { + var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); +} else {} + + +/***/ }), + +/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": +/*!*************************************************************!*\ + !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! + \*************************************************************/ +/***/ ((module) => { + +"use strict"; +/** + * 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. + */ + + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + + +/***/ }), + +/***/ "./node_modules/prop-types/lib/has.js": +/*!********************************************!*\ + !*** ./node_modules/prop-types/lib/has.js ***! + \********************************************/ +/***/ ((module) => { + +module.exports = Function.call.bind(Object.prototype.hasOwnProperty); + + +/***/ }), + +/***/ "./node_modules/quill-delta/dist/AttributeMap.js": +/*!*******************************************************!*\ + !*** ./node_modules/quill-delta/dist/AttributeMap.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const cloneDeep = __webpack_require__(/*! lodash.clonedeep */ "./node_modules/lodash.clonedeep/index.js"); +const isEqual = __webpack_require__(/*! lodash.isequal */ "./node_modules/lodash.isequal/index.js"); +var AttributeMap; +(function (AttributeMap) { + function compose(a = {}, b = {}, keepNull = false) { + if (typeof a !== 'object') { + a = {}; + } + if (typeof b !== 'object') { + b = {}; + } + let attributes = cloneDeep(b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce((copy, key) => { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (const key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + AttributeMap.compose = compose; + function diff(a = {}, b = {}) { + if (typeof a !== 'object') { + a = {}; + } + if (typeof b !== 'object') { + b = {}; + } + const attributes = Object.keys(a) + .concat(Object.keys(b)) + .reduce((attrs, key) => { + if (!isEqual(a[key], b[key])) { + attrs[key] = b[key] === undefined ? null : b[key]; + } + return attrs; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + AttributeMap.diff = diff; + function invert(attr = {}, base = {}) { + attr = attr || {}; + const baseInverted = Object.keys(base).reduce((memo, key) => { + if (base[key] !== attr[key] && attr[key] !== undefined) { + memo[key] = base[key]; + } + return memo; + }, {}); + return Object.keys(attr).reduce((memo, key) => { + if (attr[key] !== base[key] && base[key] === undefined) { + memo[key] = null; + } + return memo; + }, baseInverted); + } + AttributeMap.invert = invert; + function transform(a, b, priority = false) { + if (typeof a !== 'object') { + return b; + } + if (typeof b !== 'object') { + return undefined; + } + if (!priority) { + return b; // b simply overwrites us without priority + } + const attributes = Object.keys(b).reduce((attrs, key) => { + if (a[key] === undefined) { + attrs[key] = b[key]; // null is a valid value + } + return attrs; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + AttributeMap.transform = transform; +})(AttributeMap || (AttributeMap = {})); +exports["default"] = AttributeMap; +//# sourceMappingURL=AttributeMap.js.map + +/***/ }), + +/***/ "./node_modules/quill-delta/dist/Delta.js": +/*!************************************************!*\ + !*** ./node_modules/quill-delta/dist/Delta.js ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeMap = exports.OpIterator = exports.Op = void 0; +const diff = __webpack_require__(/*! fast-diff */ "./node_modules/fast-diff/diff.js"); +const cloneDeep = __webpack_require__(/*! lodash.clonedeep */ "./node_modules/lodash.clonedeep/index.js"); +const isEqual = __webpack_require__(/*! lodash.isequal */ "./node_modules/lodash.isequal/index.js"); +const AttributeMap_1 = __webpack_require__(/*! ./AttributeMap */ "./node_modules/quill-delta/dist/AttributeMap.js"); +exports.AttributeMap = AttributeMap_1.default; +const Op_1 = __webpack_require__(/*! ./Op */ "./node_modules/quill-delta/dist/Op.js"); +exports.Op = Op_1.default; +const OpIterator_1 = __webpack_require__(/*! ./OpIterator */ "./node_modules/quill-delta/dist/OpIterator.js"); +exports.OpIterator = OpIterator_1.default; +const NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() +const getEmbedTypeAndData = (a, b) => { + if (typeof a !== 'object' || a === null) { + throw new Error(`cannot retain a ${typeof a}`); + } + if (typeof b !== 'object' || b === null) { + throw new Error(`cannot retain a ${typeof b}`); + } + const embedType = Object.keys(a)[0]; + if (!embedType || embedType !== Object.keys(b)[0]) { + throw new Error(`embed types not matched: ${embedType} != ${Object.keys(b)[0]}`); + } + return [embedType, a[embedType], b[embedType]]; +}; +class Delta { + constructor(ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } + else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } + else { + this.ops = []; + } + } + static registerEmbed(embedType, handler) { + this.handlers[embedType] = handler; + } + static unregisterEmbed(embedType) { + delete this.handlers[embedType]; + } + static getHandler(embedType) { + const handler = this.handlers[embedType]; + if (!handler) { + throw new Error(`no handlers for embed type "${embedType}"`); + } + return handler; + } + insert(arg, attributes) { + const newOp = {}; + if (typeof arg === 'string' && arg.length === 0) { + return this; + } + newOp.insert = arg; + if (attributes != null && + typeof attributes === 'object' && + Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); + } + delete(length) { + if (length <= 0) { + return this; + } + return this.push({ delete: length }); + } + retain(length, attributes) { + if (typeof length === 'number' && length <= 0) { + return this; + } + const newOp = { retain: length }; + if (attributes != null && + typeof attributes === 'object' && + Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); + } + push(newOp) { + let index = this.ops.length; + let lastOp = this.ops[index - 1]; + newOp = cloneDeep(newOp); + if (typeof lastOp === 'object') { + if (typeof newOp.delete === 'number' && + typeof lastOp.delete === 'number') { + this.ops[index - 1] = { delete: lastOp.delete + newOp.delete }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp.delete === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (isEqual(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && + typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') { + this.ops[index - 1].attributes = newOp.attributes; + } + return this; + } + else if (typeof newOp.retain === 'number' && + typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') { + this.ops[index - 1].attributes = newOp.attributes; + } + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } + else { + this.ops.splice(index, 0, newOp); + } + return this; + } + chop() { + const lastOp = this.ops[this.ops.length - 1]; + if (lastOp && typeof lastOp.retain === 'number' && !lastOp.attributes) { + this.ops.pop(); + } + return this; + } + filter(predicate) { + return this.ops.filter(predicate); + } + forEach(predicate) { + this.ops.forEach(predicate); + } + map(predicate) { + return this.ops.map(predicate); + } + partition(predicate) { + const passed = []; + const failed = []; + this.forEach((op) => { + const target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; + } + reduce(predicate, initialValue) { + return this.ops.reduce(predicate, initialValue); + } + changeLength() { + return this.reduce((length, elem) => { + if (elem.insert) { + return length + Op_1.default.length(elem); + } + else if (elem.delete) { + return length - elem.delete; + } + return length; + }, 0); + } + length() { + return this.reduce((length, elem) => { + return length + Op_1.default.length(elem); + }, 0); + } + slice(start = 0, end = Infinity) { + const ops = []; + const iter = new OpIterator_1.default(this.ops); + let index = 0; + while (index < end && iter.hasNext()) { + let nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } + else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += Op_1.default.length(nextOp); + } + return new Delta(ops); + } + compose(other) { + const thisIter = new OpIterator_1.default(this.ops); + const otherIter = new OpIterator_1.default(other.ops); + const ops = []; + const firstOther = otherIter.peek(); + if (firstOther != null && + typeof firstOther.retain === 'number' && + firstOther.attributes == null) { + let firstLeft = firstOther.retain; + while (thisIter.peekType() === 'insert' && + thisIter.peekLength() <= firstLeft) { + firstLeft -= thisIter.peekLength(); + ops.push(thisIter.next()); + } + if (firstOther.retain - firstLeft > 0) { + otherIter.next(firstOther.retain - firstLeft); + } + } + const delta = new Delta(ops); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } + else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } + else { + const length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + const thisOp = thisIter.next(length); + const otherOp = otherIter.next(length); + if (otherOp.retain) { + const newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = + typeof otherOp.retain === 'number' ? length : otherOp.retain; + } + else { + if (typeof otherOp.retain === 'number') { + if (thisOp.retain == null) { + newOp.insert = thisOp.insert; + } + else { + newOp.retain = thisOp.retain; + } + } + else { + const action = thisOp.retain == null ? 'insert' : 'retain'; + const [embedType, thisData, otherData] = getEmbedTypeAndData(thisOp[action], otherOp.retain); + const handler = Delta.getHandler(embedType); + newOp[action] = { + [embedType]: handler.compose(thisData, otherData, action === 'retain'), + }; + } + } + // Preserve null when composing with a retain, otherwise remove it for inserts + const attributes = AttributeMap_1.default.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) { + newOp.attributes = attributes; + } + delta.push(newOp); + // Optimization if rest of other is just retain + if (!otherIter.hasNext() && + isEqual(delta.ops[delta.ops.length - 1], newOp)) { + const rest = new Delta(thisIter.rest()); + return delta.concat(rest).chop(); + } + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } + else if (typeof otherOp.delete === 'number' && + (typeof thisOp.retain === 'number' || + (typeof thisOp.retain === 'object' && thisOp.retain !== null))) { + delta.push(otherOp); + } + } + } + return delta.chop(); + } + concat(other) { + const delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; + } + diff(other, cursor) { + if (this.ops === other.ops) { + return new Delta(); + } + const strings = [this, other].map((delta) => { + return delta + .map((op) => { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + const prep = delta === other ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }) + .join(''); + }); + const retDelta = new Delta(); + const diffResult = diff(strings[0], strings[1], cursor, true); + const thisIter = new OpIterator_1.default(this.ops); + const otherIter = new OpIterator_1.default(other.ops); + diffResult.forEach((component) => { + let length = component[1].length; + while (length > 0) { + let opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + retDelta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + retDelta.delete(opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + const thisOp = thisIter.next(opLength); + const otherOp = otherIter.next(opLength); + if (isEqual(thisOp.insert, otherOp.insert)) { + retDelta.retain(opLength, AttributeMap_1.default.diff(thisOp.attributes, otherOp.attributes)); + } + else { + retDelta.push(otherOp).delete(opLength); + } + break; + } + length -= opLength; + } + }); + return retDelta.chop(); + } + eachLine(predicate, newline = '\n') { + const iter = new OpIterator_1.default(this.ops); + let line = new Delta(); + let i = 0; + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') { + return; + } + const thisOp = iter.peek(); + const start = Op_1.default.length(thisOp) - iter.peekLength(); + const index = typeof thisOp.insert === 'string' + ? thisOp.insert.indexOf(newline, start) - start + : -1; + if (index < 0) { + line.push(iter.next()); + } + else if (index > 0) { + line.push(iter.next(index)); + } + else { + if (predicate(line, iter.next(1).attributes || {}, i) === false) { + return; + } + i += 1; + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}, i); + } + } + invert(base) { + const inverted = new Delta(); + this.reduce((baseIndex, op) => { + if (op.insert) { + inverted.delete(Op_1.default.length(op)); + } + else if (typeof op.retain === 'number' && op.attributes == null) { + inverted.retain(op.retain); + return baseIndex + op.retain; + } + else if (op.delete || typeof op.retain === 'number') { + const length = (op.delete || op.retain); + const slice = base.slice(baseIndex, baseIndex + length); + slice.forEach((baseOp) => { + if (op.delete) { + inverted.push(baseOp); + } + else if (op.retain && op.attributes) { + inverted.retain(Op_1.default.length(baseOp), AttributeMap_1.default.invert(op.attributes, baseOp.attributes)); + } + }); + return baseIndex + length; + } + else if (typeof op.retain === 'object' && op.retain !== null) { + const slice = base.slice(baseIndex, baseIndex + 1); + const baseOp = new OpIterator_1.default(slice.ops).next(); + const [embedType, opData, baseOpData] = getEmbedTypeAndData(op.retain, baseOp.insert); + const handler = Delta.getHandler(embedType); + inverted.retain({ [embedType]: handler.invert(opData, baseOpData) }, AttributeMap_1.default.invert(op.attributes, baseOp.attributes)); + return baseIndex + 1; + } + return baseIndex; + }, 0); + return inverted.chop(); + } + transform(arg, priority = false) { + priority = !!priority; + if (typeof arg === 'number') { + return this.transformPosition(arg, priority); + } + const other = arg; + const thisIter = new OpIterator_1.default(this.ops); + const otherIter = new OpIterator_1.default(other.ops); + const delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && + (priority || otherIter.peekType() !== 'insert')) { + delta.retain(Op_1.default.length(thisIter.next())); + } + else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } + else { + const length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + const thisOp = thisIter.next(length); + const otherOp = otherIter.next(length); + if (thisOp.delete) { + // Our delete either makes their delete redundant or removes their retain + continue; + } + else if (otherOp.delete) { + delta.push(otherOp); + } + else { + const thisData = thisOp.retain; + const otherData = otherOp.retain; + let transformedData = typeof otherData === 'object' && otherData !== null + ? otherData + : length; + if (typeof thisData === 'object' && + thisData !== null && + typeof otherData === 'object' && + otherData !== null) { + const embedType = Object.keys(thisData)[0]; + if (embedType === Object.keys(otherData)[0]) { + const handler = Delta.getHandler(embedType); + if (handler) { + transformedData = { + [embedType]: handler.transform(thisData[embedType], otherData[embedType], priority), + }; + } + } + } + // We retain either their retain or insert + delta.retain(transformedData, AttributeMap_1.default.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); + } + transformPosition(index, priority = false) { + priority = !!priority; + const thisIter = new OpIterator_1.default(this.ops); + let offset = 0; + while (thisIter.hasNext() && offset <= index) { + const length = thisIter.peekLength(); + const nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } + else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; + } +} +Delta.Op = Op_1.default; +Delta.OpIterator = OpIterator_1.default; +Delta.AttributeMap = AttributeMap_1.default; +Delta.handlers = {}; +exports["default"] = Delta; +if (true) { + module.exports = Delta; + module.exports["default"] = Delta; +} +//# sourceMappingURL=Delta.js.map + +/***/ }), + +/***/ "./node_modules/quill-delta/dist/Op.js": +/*!*********************************************!*\ + !*** ./node_modules/quill-delta/dist/Op.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var Op; +(function (Op) { + function length(op) { + if (typeof op.delete === 'number') { + return op.delete; + } + else if (typeof op.retain === 'number') { + return op.retain; + } + else if (typeof op.retain === 'object' && op.retain !== null) { + return 1; + } + else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } + Op.length = length; +})(Op || (Op = {})); +exports["default"] = Op; +//# sourceMappingURL=Op.js.map + +/***/ }), + +/***/ "./node_modules/quill-delta/dist/OpIterator.js": +/*!*****************************************************!*\ + !*** ./node_modules/quill-delta/dist/OpIterator.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const Op_1 = __webpack_require__(/*! ./Op */ "./node_modules/quill-delta/dist/Op.js"); +class Iterator { + constructor(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; + } + hasNext() { + return this.peekLength() < Infinity; + } + next(length) { + if (!length) { + length = Infinity; + } + const nextOp = this.ops[this.index]; + if (nextOp) { + const offset = this.offset; + const opLength = Op_1.default.length(nextOp); + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } + else { + this.offset += length; + } + if (typeof nextOp.delete === 'number') { + return { delete: length }; + } + else { + const retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } + else if (typeof nextOp.retain === 'object' && + nextOp.retain !== null) { + // offset should === 0, length should === 1 + retOp.retain = nextOp.retain; + } + else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } + else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } + else { + return { retain: Infinity }; + } + } + peek() { + return this.ops[this.index]; + } + peekLength() { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return Op_1.default.length(this.ops[this.index]) - this.offset; + } + else { + return Infinity; + } + } + peekType() { + const op = this.ops[this.index]; + if (op) { + if (typeof op.delete === 'number') { + return 'delete'; + } + else if (typeof op.retain === 'number' || + (typeof op.retain === 'object' && op.retain !== null)) { + return 'retain'; + } + else { + return 'insert'; + } + } + return 'retain'; + } + rest() { + if (!this.hasNext()) { + return []; + } + else if (this.offset === 0) { + return this.ops.slice(this.index); + } + else { + const offset = this.offset; + const index = this.index; + const next = this.next(); + const rest = this.ops.slice(this.index); + this.offset = offset; + this.index = index; + return [next].concat(rest); + } + } +} +exports["default"] = Iterator; +//# sourceMappingURL=OpIterator.js.map + +/***/ }), + +/***/ "./node_modules/quill/blots/block.js": +/*!*******************************************!*\ + !*** ./node_modules/quill/blots/block.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BlockEmbed: () => (/* binding */ BlockEmbed), +/* harmony export */ blockDelta: () => (/* binding */ blockDelta), +/* harmony export */ bubbleFormats: () => (/* binding */ bubbleFormats), +/* harmony export */ "default": () => (/* binding */ Block) +/* harmony export */ }); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); +/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! quill-delta */ "./node_modules/quill-delta/dist/Delta.js"); +/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./break */ "./node_modules/quill/blots/break.js"); +/* harmony import */ var _inline__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inline */ "./node_modules/quill/blots/inline.js"); +/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./text */ "./node_modules/quill/blots/text.js"); + + + + + +const NEWLINE_LENGTH = 1; +class Block extends parchment__WEBPACK_IMPORTED_MODULE_0__.BlockBlot { + constructor() { + super(...arguments); + this.cache = {}; + } + delta() { + if (this.cache.delta == null) { + this.cache.delta = blockDelta(this); + } + return this.cache.delta; + } + deleteAt(index, length) { + super.deleteAt(index, length); + this.cache = {}; + } + formatAt(index, length, name, value) { + if (length <= 0) + return; + if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } + else { + super.formatAt(index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + insertAt(index, value, def) { + if (def != null) { + super.insertAt(index, value, def); + this.cache = {}; + return; + } + if (value.length === 0) + return; + const lines = value.split('\n'); + const text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + super.insertAt(Math.min(index, this.length() - 1), text); + } + else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + // TODO: Fix this next time the file is edited. + // eslint-disable-next-line @typescript-eslint/no-this-alias + let block = this; + lines.reduce((lineIndex, line) => { + // @ts-expect-error Fix me later + block = block.split(lineIndex, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + insertBefore(blot, ref) { + const { head } = this.children; + super.insertBefore(blot, ref); + if (head instanceof _break__WEBPACK_IMPORTED_MODULE_2__["default"]) { + head.remove(); + } + this.cache = {}; + } + length() { + if (this.cache.length == null) { + this.cache.length = super.length() + NEWLINE_LENGTH; + } + return this.cache.length; + } + moveChildren(target, ref) { + // @ts-expect-error Parchment types are wrong + super.moveChildren(target, ref); + this.cache = {}; + } + optimize(context) { + super.optimize(context); + this.cache = {}; + } + path(index) { + return super.path(index, true); + } + removeChild(child) { + super.removeChild(child); + this.cache = {}; + } + split(index, force = false) { + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + const clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } + // @ts-expect-error Fix me later + this.parent.insertBefore(clone, this.next); + return clone; + } + const next = super.split(index, force); + this.cache = {}; + return next; + } +} +Block.blotName = 'block'; +Block.tagName = 'P'; +Block.defaultChild = _break__WEBPACK_IMPORTED_MODULE_2__["default"]; +Block.allowedChildren = [_break__WEBPACK_IMPORTED_MODULE_2__["default"], _inline__WEBPACK_IMPORTED_MODULE_3__["default"], parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot, _text__WEBPACK_IMPORTED_MODULE_4__["default"]]; +class BlockEmbed extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot { + attach() { + super.attach(); + this.attributes = new parchment__WEBPACK_IMPORTED_MODULE_0__.AttributorStore(this.domNode); + } + delta() { + return new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().insert(this.value(), Object.assign(Object.assign({}, this.formats()), this.attributes.values())); + } + format(name, value) { + const attribute = this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute + this.attributes.attribute(attribute, value); + } + } + formatAt(index, length, name, value) { + this.format(name, value); + } + insertAt(index, value, def) { + if (def != null) { + super.insertAt(index, value, def); + return; + } + const lines = value.split('\n'); + const text = lines.pop(); + const blocks = lines.map((line) => { + const block = this.scroll.create(Block.blotName); + block.insertAt(0, line); + return block; + }); + const ref = this.split(index); + blocks.forEach((block) => { + // @ts-expect-error Fix me later + this.parent.insertBefore(block, ref); + }); + if (text) { + // @ts-expect-error Fix me later + this.parent.insertBefore(this.scroll.create('text', text), ref); + } + } +} +BlockEmbed.scope = parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK_BLOT; +// It is important for cursor behavior BlockEmbeds use tags that are block level elements +function blockDelta(blot, filter = true) { + return blot + .descendants(parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot) + .reduce((delta, leaf) => { + if (leaf.length() === 0) { + return delta; + } + return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter)); + }, new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())()) + .insert('\n', bubbleFormats(blot)); +} +function bubbleFormats(blot, formats = {}, filter = true) { + if (blot == null) + return formats; + if ('formats' in blot && typeof blot.formats === 'function') { + formats = Object.assign(Object.assign({}, formats), blot.formats()); + if (filter) { + // exclude syntax highlighting from deltas and getFormat() + delete formats['code-token']; + } + } + if (blot.parent == null || + blot.parent.statics.blotName === 'scroll' || + blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats, filter); +} + +//# sourceMappingURL=block.js.map + +/***/ }), + +/***/ "./node_modules/quill/blots/break.js": +/*!*******************************************!*\ + !*** ./node_modules/quill/blots/break.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); + +class Break extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot { + static value() { + return undefined; + } + optimize() { + if (this.prev || this.next) { + this.remove(); + } + } + length() { + return 0; + } + value() { + return ''; + } +} +Break.blotName = 'break'; +Break.tagName = 'BR'; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Break); +//# sourceMappingURL=break.js.map + +/***/ }), + +/***/ "./node_modules/quill/blots/cursor.js": +/*!********************************************!*\ + !*** ./node_modules/quill/blots/cursor.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); +/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/quill/blots/text.js"); + + +class Cursor extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot { + static value() { + return undefined; + } + constructor(scroll, domNode, selection) { + super(scroll, domNode); + this.selection = selection; + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + this.savedLength = 0; + } + detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) + this.parent.removeChild(this); + } + format(name, value) { + if (this.savedLength !== 0) { + super.format(name, value); + return; + } + // TODO: Fix this next time the file is edited. + // eslint-disable-next-line @typescript-eslint/no-this-alias + let target = this; + let index = 0; + while (target != null && target.statics.scope !== parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this.savedLength = Cursor.CONTENTS.length; + // @ts-expect-error TODO: allow empty context in Parchment + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this.savedLength = 0; + } + } + index(node, offset) { + if (node === this.textNode) + return 0; + return super.index(node, offset); + } + length() { + return this.savedLength; + } + position() { + return [this.textNode, this.textNode.data.length]; + } + remove() { + super.remove(); + // @ts-expect-error Fix me later + this.parent = null; + } + restore() { + if (this.selection.composing || this.parent == null) + return null; + const range = this.selection.getNativeRange(); + // Browser may push down styles/nodes inside the cursor blot. + // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#push-down-values + while (this.domNode.lastChild != null && + this.domNode.lastChild !== this.textNode) { + // @ts-expect-error Fix me later + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + const prevTextBlot = this.prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ? this.prev : null; + const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0; + const nextTextBlot = this.next instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ? this.next : null; + // @ts-expect-error TODO: make TextBlot.text public + const nextText = nextTextBlot ? nextTextBlot.text : ''; + const { textNode } = this; + // take text from inside this blot and reset it + const newText = textNode.data.split(Cursor.CONTENTS).join(''); + textNode.data = Cursor.CONTENTS; + // proactively merge TextBlots around cursor so that optimization + // doesn't lose the cursor. the reason we are here in cursor.restore + // could be that the user clicked in prevTextBlot or nextTextBlot, or + // the user typed something. + let mergedTextBlot; + if (prevTextBlot) { + mergedTextBlot = prevTextBlot; + if (newText || nextTextBlot) { + prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText); + if (nextTextBlot) { + nextTextBlot.remove(); + } + } + } + else if (nextTextBlot) { + mergedTextBlot = nextTextBlot; + nextTextBlot.insertAt(0, newText); + } + else { + const newTextNode = document.createTextNode(newText); + mergedTextBlot = this.scroll.create(newTextNode); + this.parent.insertBefore(mergedTextBlot, this); + } + this.remove(); + if (range) { + // calculate selection to restore + const remapOffset = (node, offset) => { + if (prevTextBlot && node === prevTextBlot.domNode) { + return offset; + } + if (node === textNode) { + return prevTextLength + offset - 1; + } + if (nextTextBlot && node === nextTextBlot.domNode) { + return prevTextLength + newText.length + offset; + } + return null; + }; + const start = remapOffset(range.start.node, range.start.offset); + const end = remapOffset(range.end.node, range.end.offset); + if (start !== null && end !== null) { + return { + startNode: mergedTextBlot.domNode, + startOffset: start, + endNode: mergedTextBlot.domNode, + endOffset: end, + }; + } + } + return null; + } + update(mutations, context) { + if (mutations.some((mutation) => { + return (mutation.type === 'characterData' && mutation.target === this.textNode); + })) { + const range = this.restore(); + if (range) + context.range = range; + } + } + // Avoid .ql-cursor being a descendant of ``. + // The reason is Safari pushes down `` on text insertion. + // That will cause DOM nodes not sync with the model. + // + // For example ({I} is the caret), given the markup: + // \uFEFF{I} + // When typing a char "x", `` will be pushed down inside the `` first: + // \uFEFF{I} + // And then "x" will be inserted after ``: + // \uFEFFd{I} + optimize(context) { + // @ts-expect-error Fix me later + super.optimize(context); + let { parent } = this; + while (parent) { + if (parent.domNode.tagName === 'A') { + this.savedLength = Cursor.CONTENTS.length; + // @ts-expect-error TODO: make isolate generic + parent.isolate(this.offset(parent), this.length()).unwrap(); + this.savedLength = 0; + break; + } + parent = parent.parent; + } + } + value() { + return ''; + } +} +Cursor.blotName = 'cursor'; +Cursor.className = 'ql-cursor'; +Cursor.tagName = 'span'; +Cursor.CONTENTS = '\uFEFF'; // Zero width no break space +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Cursor); +//# sourceMappingURL=cursor.js.map + +/***/ }), + +/***/ "./node_modules/quill/blots/embed.js": +/*!*******************************************!*\ + !*** ./node_modules/quill/blots/embed.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); +/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/quill/blots/text.js"); + + +const GUARD_TEXT = '\uFEFF'; +class Embed extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot { + constructor(scroll, node) { + super(scroll, node); + this.contentNode = document.createElement('span'); + this.contentNode.setAttribute('contenteditable', 'false'); + Array.from(this.domNode.childNodes).forEach((childNode) => { + this.contentNode.appendChild(childNode); + }); + this.leftGuard = document.createTextNode(GUARD_TEXT); + this.rightGuard = document.createTextNode(GUARD_TEXT); + this.domNode.appendChild(this.leftGuard); + this.domNode.appendChild(this.contentNode); + this.domNode.appendChild(this.rightGuard); + } + index(node, offset) { + if (node === this.leftGuard) + return 0; + if (node === this.rightGuard) + return 1; + return super.index(node, offset); + } + restore(node) { + let range = null; + let textNode; + const text = node.data.split(GUARD_TEXT).join(''); + if (node === this.leftGuard) { + if (this.prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"]) { + const prevLength = this.prev.length(); + this.prev.insertAt(prevLength, text); + range = { + startNode: this.prev.domNode, + startOffset: prevLength + text.length, + }; + } + else { + textNode = document.createTextNode(text); + this.parent.insertBefore(this.scroll.create(textNode), this); + range = { + startNode: textNode, + startOffset: text.length, + }; + } + } + else if (node === this.rightGuard) { + if (this.next instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"]) { + this.next.insertAt(0, text); + range = { + startNode: this.next.domNode, + startOffset: text.length, + }; + } + else { + textNode = document.createTextNode(text); + // @ts-expect-error Fix me later + this.parent.insertBefore(this.scroll.create(textNode), this.next); + range = { + startNode: textNode, + startOffset: text.length, + }; + } + } + node.data = GUARD_TEXT; + return range; + } + update(mutations, context) { + mutations.forEach((mutation) => { + if (mutation.type === 'characterData' && + (mutation.target === this.leftGuard || + mutation.target === this.rightGuard)) { + const range = this.restore(mutation.target); + if (range) + context.range = range; + } + }); + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Embed); +//# sourceMappingURL=embed.js.map + +/***/ }), + +/***/ "./node_modules/quill/blots/inline.js": +/*!********************************************!*\ + !*** ./node_modules/quill/blots/inline.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); +/* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./break */ "./node_modules/quill/blots/break.js"); +/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/quill/blots/text.js"); + + + +class Inline extends parchment__WEBPACK_IMPORTED_MODULE_0__.InlineBlot { + static compare(self, other) { + const selfIndex = Inline.order.indexOf(self); + const otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } + if (self === other) { + return 0; + } + if (self < other) { + return -1; + } + return 1; + } + formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && + this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOT)) { + const blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } + else { + super.formatAt(index, length, name, value); + } + } + optimize(context) { + super.optimize(context); + if (this.parent instanceof Inline && + Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + const parent = this.parent.isolate(this.offset(), this.length()); + // @ts-expect-error TODO: make isolate generic + this.moveChildren(parent); + parent.wrap(this); + } + } +} +Inline.allowedChildren = [Inline, _break__WEBPACK_IMPORTED_MODULE_1__["default"], parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot, _text__WEBPACK_IMPORTED_MODULE_2__["default"]]; +// Lower index means deeper in the DOM tree, since not found (-1) is for embeds +Inline.order = [ + 'cursor', + 'inline', + 'link', + 'underline', + 'strike', + 'italic', + 'bold', + 'script', + 'code', // Must be higher +]; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Inline); +//# sourceMappingURL=inline.js.map + +/***/ }), + +/***/ "./node_modules/quill/blots/text.js": +/*!******************************************!*\ + !*** ./node_modules/quill/blots/text.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Text), +/* harmony export */ escapeText: () => (/* binding */ escapeText) +/* harmony export */ }); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); + +class Text extends parchment__WEBPACK_IMPORTED_MODULE_0__.TextBlot { +} +function escapeText(text) { + return text.replace(/[&<>"']/g, (s) => { + // https://lodash.com/docs#escape + const entityMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + }; + return entityMap[s]; + }); +} + +//# sourceMappingURL=text.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/composition.js": +/*!************************************************!*\ + !*** ./node_modules/quill/core/composition.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _blots_embed__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/embed */ "./node_modules/quill/blots/embed.js"); +/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./emitter */ "./node_modules/quill/core/emitter.js"); + + +class Composition { + constructor(scroll, emitter) { + this.scroll = scroll; + this.emitter = emitter; + this.isComposing = false; + this.setupListeners(); + } + setupListeners() { + this.scroll.domNode.addEventListener('compositionstart', (event) => { + if (!this.isComposing) { + this.handleCompositionStart(event); + } + }); + this.scroll.domNode.addEventListener('compositionend', (event) => { + if (this.isComposing) { + this.handleCompositionEnd(event); + } + }); + } + handleCompositionStart(event) { + const blot = event.target instanceof Node + ? this.scroll.find(event.target, true) + : null; + if (blot && !(blot instanceof _blots_embed__WEBPACK_IMPORTED_MODULE_0__["default"])) { + this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].events.COMPOSITION_BEFORE_START, event); + this.scroll.batchStart(); + this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].events.COMPOSITION_START, event); + this.isComposing = true; + } + } + handleCompositionEnd(event) { + this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].events.COMPOSITION_BEFORE_END, event); + this.scroll.batchEnd(); + this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].events.COMPOSITION_END, event); + this.isComposing = false; + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Composition); +//# sourceMappingURL=composition.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/editor.js": +/*!*******************************************!*\ + !*** ./node_modules/quill/core/editor.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.clonedeep */ "./node_modules/lodash.clonedeep/index.js"); +/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.isequal */ "./node_modules/lodash.isequal/index.js"); +/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isequal__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.merge */ "./node_modules/lodash.merge/index.js"); +/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); +/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! quill-delta */ "./node_modules/quill-delta/dist/Delta.js"); +/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../blots/block */ "./node_modules/quill/blots/block.js"); +/* harmony import */ var _blots_break__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../blots/break */ "./node_modules/quill/blots/break.js"); +/* harmony import */ var _blots_cursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../blots/cursor */ "./node_modules/quill/blots/cursor.js"); +/* harmony import */ var _blots_text__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../blots/text */ "./node_modules/quill/blots/text.js"); +/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./selection */ "./node_modules/quill/core/selection.js"); + + + + + + + + + + +const ASCII = /^[ -~]*$/; +class Editor { + constructor(scroll) { + this.scroll = scroll; + this.delta = this.getDelta(); + } + applyDelta(delta) { + this.scroll.update(); + let scrollLength = this.scroll.length(); + this.scroll.batchStart(); + const normalizedDelta = normalizeDelta(delta); + const deleteDelta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())(); + const normalizedOps = splitOpLines(normalizedDelta.ops.slice()); + normalizedOps.reduce((index, op) => { + const length = quill_delta__WEBPACK_IMPORTED_MODULE_4__.Op.length(op); + let attributes = op.attributes || {}; + let isImplicitNewlinePrepended = false; + let isImplicitNewlineAppended = false; + if (op.insert != null) { + deleteDelta.retain(length); + if (typeof op.insert === 'string') { + const text = op.insert; + isImplicitNewlineAppended = + !text.endsWith('\n') && + (scrollLength <= index || + !!this.scroll.descendant(_blots_block__WEBPACK_IMPORTED_MODULE_5__.BlockEmbed, index)[0]); + this.scroll.insertAt(index, text); + const [line, offset] = this.scroll.line(index); + let formats = lodash_merge__WEBPACK_IMPORTED_MODULE_2___default()({}, (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(line)); + if (line instanceof _blots_block__WEBPACK_IMPORTED_MODULE_5__["default"]) { + const [leaf] = line.descendant(parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot, offset); + if (leaf) { + formats = lodash_merge__WEBPACK_IMPORTED_MODULE_2___default()(formats, (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(leaf)); + } + } + attributes = quill_delta__WEBPACK_IMPORTED_MODULE_4__.AttributeMap.diff(formats, attributes) || {}; + } + else if (typeof op.insert === 'object') { + const key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) + return index; + const isInlineEmbed = this.scroll.query(key, parchment__WEBPACK_IMPORTED_MODULE_3__.Scope.INLINE) != null; + if (isInlineEmbed) { + if (scrollLength <= index || + !!this.scroll.descendant(_blots_block__WEBPACK_IMPORTED_MODULE_5__.BlockEmbed, index)[0]) { + isImplicitNewlineAppended = true; + } + } + else if (index > 0) { + const [leaf, offset] = this.scroll.descendant(parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot, index - 1); + if (leaf instanceof _blots_text__WEBPACK_IMPORTED_MODULE_8__["default"]) { + const text = leaf.value(); + if (text[offset] !== '\n') { + isImplicitNewlinePrepended = true; + } + } + else if (leaf instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.EmbedBlot && + leaf.statics.scope === parchment__WEBPACK_IMPORTED_MODULE_3__.Scope.INLINE_BLOT) { + isImplicitNewlinePrepended = true; + } + } + this.scroll.insertAt(index, key, op.insert[key]); + if (isInlineEmbed) { + const [leaf] = this.scroll.descendant(parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot, index); + if (leaf) { + const formats = lodash_merge__WEBPACK_IMPORTED_MODULE_2___default()({}, (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(leaf)); + attributes = quill_delta__WEBPACK_IMPORTED_MODULE_4__.AttributeMap.diff(formats, attributes) || {}; + } + } + } + scrollLength += length; + } + else { + deleteDelta.push(op); + if (op.retain !== null && typeof op.retain === 'object') { + const key = Object.keys(op.retain)[0]; + if (key == null) + return index; + this.scroll.updateEmbedAt(index, key, op.retain[key]); + } + } + Object.keys(attributes).forEach((name) => { + this.scroll.formatAt(index, length, name, attributes[name]); + }); + const prependedLength = isImplicitNewlinePrepended ? 1 : 0; + const addedLength = isImplicitNewlineAppended ? 1 : 0; + scrollLength += prependedLength + addedLength; + deleteDelta.retain(prependedLength); + deleteDelta.delete(addedLength); + return index + length + prependedLength + addedLength; + }, 0); + deleteDelta.reduce((index, op) => { + if (typeof op.delete === 'number') { + this.scroll.deleteAt(index, op.delete); + return index; + } + return index + quill_delta__WEBPACK_IMPORTED_MODULE_4__.Op.length(op); + }, 0); + this.scroll.batchEnd(); + this.scroll.optimize(); + return this.update(normalizedDelta); + } + deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).delete(length)); + } + formatLine(index, length, formats = {}) { + this.scroll.update(); + Object.keys(formats).forEach((format) => { + this.scroll.lines(index, Math.max(length, 1)).forEach((line) => { + line.format(format, formats[format]); + }); + }); + this.scroll.optimize(); + const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).retain(length, lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(formats)); + return this.update(delta); + } + formatText(index, length, formats = {}) { + Object.keys(formats).forEach((format) => { + this.scroll.formatAt(index, length, format, formats[format]); + }); + const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).retain(length, lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(formats)); + return this.update(delta); + } + getContents(index, length) { + return this.delta.slice(index, index + length); + } + getDelta() { + return this.scroll.lines().reduce((delta, line) => { + return delta.concat(line.delta()); + }, new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())()); + } + getFormat(index, length = 0) { + let lines = []; + let leaves = []; + if (length === 0) { + this.scroll.path(index).forEach((path) => { + const [blot] = path; + if (blot instanceof _blots_block__WEBPACK_IMPORTED_MODULE_5__["default"]) { + lines.push(blot); + } + else if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot) { + leaves.push(blot); + } + }); + } + else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot, index, length); + } + const [lineFormats, leafFormats] = [lines, leaves].map((blots) => { + const blot = blots.shift(); + if (blot == null) + return {}; + let formats = (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(blot); + while (Object.keys(formats).length > 0) { + const blot = blots.shift(); + if (blot == null) + return formats; + formats = combineFormats((0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(blot), formats); + } + return formats; + }); + return Object.assign(Object.assign({}, lineFormats), leafFormats); + } + getHTML(index, length) { + const [line, lineOffset] = this.scroll.line(index); + if (line) { + const lineLength = line.length(); + if (line.length() >= lineOffset + length) { + const excludeOuterTag = !(lineOffset === 0 && length === lineLength); + return convertHTML(line, lineOffset, length, excludeOuterTag); + } + return convertHTML(this.scroll, index, length, true); + } + return ''; + } + getText(index, length) { + return this.getContents(index, length) + .filter((op) => typeof op.insert === 'string') + .map((op) => op.insert) + .join(''); + } + insertContents(index, contents) { + const normalizedDelta = normalizeDelta(contents); + const change = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).concat(normalizedDelta); + this.scroll.insertContents(index, normalizedDelta); + return this.update(change); + } + insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).insert({ [embed]: value })); + } + insertText(index, text, formats = {}) { + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach((format) => { + this.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).insert(text, lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(formats))); + } + isBlank() { + if (this.scroll.children.length === 0) + return true; + if (this.scroll.children.length > 1) + return false; + const blot = this.scroll.children.head; + if ((blot === null || blot === void 0 ? void 0 : blot.statics.blotName) !== _blots_block__WEBPACK_IMPORTED_MODULE_5__["default"].blotName) + return false; + const block = blot; + if (block.children.length > 1) + return false; + return block.children.head instanceof _blots_break__WEBPACK_IMPORTED_MODULE_6__["default"]; + } + removeFormat(index, length) { + const text = this.getText(index, length); + const [line, offset] = this.scroll.line(index + length); + let suffixLength = 0; + let suffix = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())(); + if (line != null) { + suffixLength = line.length() - offset; + suffix = line + .delta() + .slice(offset, offset + suffixLength - 1) + .insert('\n'); + } + const contents = this.getContents(index, length + suffixLength); + const diff = contents.diff(new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().insert(text).concat(suffix)); + const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).concat(diff); + return this.applyDelta(delta); + } + update(change, mutations = [], selectionInfo = undefined) { + const oldDelta = this.delta; + if (mutations.length === 1 && + mutations[0].type === 'characterData' && + // @ts-expect-error Fix me later + mutations[0].target.data.match(ASCII) && + this.scroll.find(mutations[0].target)) { + // Optimization for character changes + const textBlot = this.scroll.find(mutations[0].target); + const formats = (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(textBlot); + const index = textBlot.offset(this.scroll); + // @ts-expect-error Fix me later + const oldValue = mutations[0].oldValue.replace(_blots_cursor__WEBPACK_IMPORTED_MODULE_7__["default"].CONTENTS, ''); + const oldText = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().insert(oldValue); + // @ts-expect-error + const newText = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().insert(textBlot.value()); + const relativeSelectionInfo = selectionInfo && { + oldRange: shiftRange(selectionInfo.oldRange, -index), + newRange: shiftRange(selectionInfo.newRange, -index), + }; + const diffDelta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())() + .retain(index) + .concat(oldText.diff(newText, relativeSelectionInfo)); + change = diffDelta.reduce((delta, op) => { + if (op.insert) { + return delta.insert(op.insert, formats); + } + return delta.push(op); + }, new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())()); + this.delta = oldDelta.compose(change); + } + else { + this.delta = this.getDelta(); + if (!change || !lodash_isequal__WEBPACK_IMPORTED_MODULE_1___default()(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, selectionInfo); + } + } + return change; + } +} +function convertListHTML(items, lastIndent, types) { + if (items.length === 0) { + const [endTag] = getListType(types.pop()); + if (lastIndent <= 0) { + return ``; + } + return `${convertListHTML([], lastIndent - 1, types)}`; + } + const [{ child, offset, length, indent, type }, ...rest] = items; + const [tag, attribute] = getListType(type); + if (indent > lastIndent) { + types.push(type); + if (indent === lastIndent + 1) { + return `<${tag}>${convertHTML(child, offset, length)}${convertListHTML(rest, indent, types)}`; + } + return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`; + } + const previousType = types[types.length - 1]; + if (indent === lastIndent && type === previousType) { + return `
  • ${convertHTML(child, offset, length)}${convertListHTML(rest, indent, types)}`; + } + const [endTag] = getListType(types.pop()); + return `${convertListHTML(items, lastIndent - 1, types)}`; +} +function convertHTML(blot, index, length, excludeOuterTag = false) { + if ('html' in blot && typeof blot.html === 'function') { + return blot.html(index, length); + } + if (blot instanceof _blots_text__WEBPACK_IMPORTED_MODULE_8__["default"]) { + return (0,_blots_text__WEBPACK_IMPORTED_MODULE_8__.escapeText)(blot.value().slice(index, index + length)); + } + if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.ParentBlot) { + // TODO fix API + if (blot.statics.blotName === 'list-container') { + const items = []; + blot.children.forEachAt(index, length, (child, offset, childLength) => { + const formats = 'formats' in child && typeof child.formats === 'function' + ? child.formats() + : {}; + items.push({ + child, + offset, + length: childLength, + indent: formats.indent || 0, + type: formats.list, + }); + }); + return convertListHTML(items, -1, []); + } + const parts = []; + blot.children.forEachAt(index, length, (child, offset, childLength) => { + parts.push(convertHTML(child, offset, childLength)); + }); + if (excludeOuterTag || blot.statics.blotName === 'list') { + return parts.join(''); + } + const { outerHTML, innerHTML } = blot.domNode; + const [start, end] = outerHTML.split(`>${innerHTML}<`); + // TODO cleanup + if (start === '${parts.join('')}<${end}`; + } + return `${start}>${parts.join('')}<${end}`; + } + return blot.domNode instanceof Element ? blot.domNode.outerHTML : ''; +} +function combineFormats(formats, combined) { + return Object.keys(combined).reduce((merged, name) => { + if (formats[name] == null) + return merged; + const combinedValue = combined[name]; + if (combinedValue === formats[name]) { + merged[name] = combinedValue; + } + else if (Array.isArray(combinedValue)) { + if (combinedValue.indexOf(formats[name]) < 0) { + merged[name] = combinedValue.concat([formats[name]]); + } + else { + // If style already exists, don't add to an array, but don't lose other styles + merged[name] = combinedValue; + } + } + else { + merged[name] = [combinedValue, formats[name]]; + } + return merged; + }, {}); +} +function getListType(type) { + const tag = type === 'ordered' ? 'ol' : 'ul'; + switch (type) { + case 'checked': + return [tag, ' data-list="checked"']; + case 'unchecked': + return [tag, ' data-list="unchecked"']; + default: + return [tag, '']; + } +} +function normalizeDelta(delta) { + return delta.reduce((normalizedDelta, op) => { + if (typeof op.insert === 'string') { + const text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return normalizedDelta.insert(text, op.attributes); + } + return normalizedDelta.push(op); + }, new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())()); +} +function shiftRange({ index, length }, amount) { + return new _selection__WEBPACK_IMPORTED_MODULE_9__.Range(index + amount, length); +} +function splitOpLines(ops) { + const split = []; + ops.forEach((op) => { + if (typeof op.insert === 'string') { + const lines = op.insert.split('\n'); + lines.forEach((line, index) => { + if (index) + split.push({ insert: '\n', attributes: op.attributes }); + if (line) + split.push({ insert: line, attributes: op.attributes }); + }); + } + else { + split.push(op); + } + }); + return split; +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Editor); +//# sourceMappingURL=editor.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/emitter.js": +/*!********************************************!*\ + !*** ./node_modules/quill/core/emitter.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! eventemitter3 */ "./node_modules/eventemitter3/index.js"); +/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(eventemitter3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instances */ "./node_modules/quill/core/instances.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ "./node_modules/quill/core/logger.js"); + + + +const debug = (0,_logger__WEBPACK_IMPORTED_MODULE_2__["default"])('quill:events'); +const EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; +EVENTS.forEach((eventName) => { + document.addEventListener(eventName, (...args) => { + Array.from(document.querySelectorAll('.ql-container')).forEach((node) => { + const quill = _instances__WEBPACK_IMPORTED_MODULE_1__["default"].get(node); + if (quill && quill.emitter) { + quill.emitter.handleDOM(...args); + } + }); + }); +}); +class Emitter extends (eventemitter3__WEBPACK_IMPORTED_MODULE_0___default()) { + constructor() { + super(); + this.listeners = {}; + this.on('error', debug.error); + } + emit(...args) { + debug.log.call(debug, ...args); + // @ts-expect-error + return super.emit(...args); + } + handleDOM(event, ...args) { + (this.listeners[event.type] || []).forEach(({ node, handler }) => { + if (event.target === node || node.contains(event.target)) { + handler(event, ...args); + } + }); + } + listenDOM(eventName, node, handler) { + if (!this.listeners[eventName]) { + this.listeners[eventName] = []; + } + this.listeners[eventName].push({ node, handler }); + } +} +Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_BLOT_MOUNT: 'scroll-blot-mount', + SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SCROLL_EMBED_UPDATE: 'scroll-embed-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change', + COMPOSITION_BEFORE_START: 'composition-before-start', + COMPOSITION_START: 'composition-start', + COMPOSITION_BEFORE_END: 'composition-before-end', + COMPOSITION_END: 'composition-end', +}; +Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user', +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Emitter); +//# sourceMappingURL=emitter.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/instances.js": +/*!**********************************************!*\ + !*** ./node_modules/quill/core/instances.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (new WeakMap()); +//# sourceMappingURL=instances.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/logger.js": +/*!*******************************************!*\ + !*** ./node_modules/quill/core/logger.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const levels = ['error', 'warn', 'log', 'info']; +let level = 'warn'; +function debug(method, ...args) { + if (level) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + console[method](...args); // eslint-disable-line no-console + } + } +} +function namespace(ns) { + return levels.reduce((logger, method) => { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); +} +namespace.level = (newLevel) => { + level = newLevel; +}; +debug.level = namespace.level; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (namespace); +//# sourceMappingURL=logger.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/module.js": +/*!*******************************************!*\ + !*** ./node_modules/quill/core/module.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +class Module { + constructor(quill, options = {}) { + this.quill = quill; + this.options = options; + } +} +Module.DEFAULTS = {}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Module); +//# sourceMappingURL=module.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/quill.js": +/*!******************************************!*\ + !*** ./node_modules/quill/core/quill.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ Quill), +/* harmony export */ expandConfig: () => (/* binding */ expandConfig), +/* harmony export */ globalRegistry: () => (/* binding */ globalRegistry), +/* harmony export */ overload: () => (/* binding */ overload) +/* harmony export */ }); +/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.clonedeep */ "./node_modules/lodash.clonedeep/index.js"); +/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.merge */ "./node_modules/lodash.merge/index.js"); +/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); +/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! quill-delta */ "./node_modules/quill-delta/dist/Delta.js"); +/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor */ "./node_modules/quill/core/editor.js"); +/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./emitter */ "./node_modules/quill/core/emitter.js"); +/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./instances */ "./node_modules/quill/core/instances.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./logger */ "./node_modules/quill/core/logger.js"); +/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./module */ "./node_modules/quill/core/module.js"); +/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./selection */ "./node_modules/quill/core/selection.js"); +/* harmony import */ var _composition__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./composition */ "./node_modules/quill/core/composition.js"); +/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./theme */ "./node_modules/quill/core/theme.js"); +/* harmony import */ var _utils_scrollRectIntoView__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/scrollRectIntoView */ "./node_modules/quill/core/utils/scrollRectIntoView.js"); + + + + + + + + + + + + + +const debug = (0,_logger__WEBPACK_IMPORTED_MODULE_7__["default"])('quill'); +const globalRegistry = new parchment__WEBPACK_IMPORTED_MODULE_2__.Registry(); +parchment__WEBPACK_IMPORTED_MODULE_2__.ParentBlot.uiClass = 'ql-ui'; +class Quill { + static debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger__WEBPACK_IMPORTED_MODULE_7__["default"].level(limit); + } + static find(node, bubble = false) { + return _instances__WEBPACK_IMPORTED_MODULE_6__["default"].get(node) || globalRegistry.find(node, bubble); + } + static import(name) { + if (this.imports[name] == null) { + debug.error(`Cannot import ${name}. Are you sure it was registered?`); + } + return this.imports[name]; + } + static register(path, target, overwrite = false) { + if (typeof path !== 'string') { + const name = 'attrName' in path ? path.attrName : path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + // @ts-expect-error + this.register(`formats/${name}`, path, target); + } + else { + Object.keys(path).forEach((key) => { + // @ts-expect-error + this.register(key, path[key], target); + }); + } + } + else { + if (this.imports[path] != null && !overwrite) { + debug.warn(`Overwriting ${path} with`, target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && + // @ts-expect-error + target.blotName !== 'abstract') { + globalRegistry.register(target); + } + // @ts-expect-error + if (typeof target.register === 'function') { + // @ts-expect-error + target.register(globalRegistry); + } + } + } + constructor(container, options = {}) { + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + debug.error('Invalid Quill container', container); + return; + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + const html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + _instances__WEBPACK_IMPORTED_MODULE_6__["default"].set(this.container, this); + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.emitter = new _emitter__WEBPACK_IMPORTED_MODULE_5__["default"](); + // @ts-expect-error TODO: fix BlotConstructor + const ScrollBlot = this.options.registry.query(parchment__WEBPACK_IMPORTED_MODULE_2__.ScrollBlot.blotName); + this.scroll = new ScrollBlot(this.options.registry, this.root, { + emitter: this.emitter, + }); + this.editor = new _editor__WEBPACK_IMPORTED_MODULE_4__["default"](this.scroll); + this.selection = new _selection__WEBPACK_IMPORTED_MODULE_9__["default"](this.scroll, this.emitter); + this.composition = new _composition__WEBPACK_IMPORTED_MODULE_10__["default"](this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.uploader = this.theme.addModule('uploader'); + this.theme.addModule('input'); + this.theme.init(); + this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_5__["default"].events.EDITOR_CHANGE, (type) => { + if (type === _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].events.TEXT_CHANGE) { + this.root.classList.toggle('ql-blank', this.editor.isBlank()); + } + }); + this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_5__["default"].events.SCROLL_UPDATE, (source, mutations) => { + const oldRange = this.selection.lastRange; + const [newRange] = this.selection.getRange(); + const selectionInfo = oldRange && newRange ? { oldRange, newRange } : undefined; + modify.call(this, () => this.editor.update(null, mutations, selectionInfo), source); + }); + this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_5__["default"].events.SCROLL_EMBED_UPDATE, (blot, delta) => { + const oldRange = this.selection.lastRange; + const [newRange] = this.selection.getRange(); + const selectionInfo = oldRange && newRange ? { oldRange, newRange } : undefined; + modify.call(this, () => { + const change = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())() + .retain(blot.offset(this)) + .retain({ [blot.statics.blotName]: delta }); + return this.editor.update(change, [], selectionInfo); + }, Quill.sources.USER); + }); + if (html) { + const contents = this.clipboard.convert({ + html: `${html}


    `, + text: '\n', + }); + this.setContents(contents); + } + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + this.allowReadOnlyEdits = false; + } + addContainer(container, refNode = null) { + if (typeof container === 'string') { + const className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + blur() { + this.selection.setRange(null); + } + deleteText(index, length, source) { + // @ts-expect-error + [index, length, , source] = overload(index, length, source); + return modify.call(this, () => { + // @ts-expect-error + return this.editor.deleteText(index, length); + }, source, index, -1 * length); + } + disable() { + this.enable(false); + } + editReadOnly(modifier) { + this.allowReadOnlyEdits = true; + const value = modifier(); + this.allowReadOnlyEdits = false; + return value; + } + enable(enabled = true) { + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + } + focus(options = {}) { + this.selection.focus(); + if (!options.preventScroll) { + this.scrollSelectionIntoView(); + } + } + format(name, value, source = _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.API) { + return modify.call(this, () => { + const range = this.getSelection(true); + let change = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())(); + if (range == null) + return change; + if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_2__.Scope.BLOCK)) { + change = this.editor.formatLine(range.index, range.length, { + [name]: value, + }); + } + else if (range.length === 0) { + this.selection.format(name, value); + return change; + } + else { + change = this.editor.formatText(range.index, range.length, { + [name]: value, + }); + } + this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.SILENT); + return change; + }, source); + } + formatLine(index, length, name, value, source) { + let formats; + // eslint-disable-next-line prefer-const + [index, length, formats, source] = overload(index, length, + // @ts-expect-error + name, value, source); + return modify.call(this, () => { + return this.editor.formatLine(index, length, formats); + }, source, index, 0); + } + formatText(index, length, name, value, source) { + let formats; + // eslint-disable-next-line prefer-const + [index, length, formats, source] = overload( + // @ts-expect-error + index, length, name, value, source); + return modify.call(this, () => { + // @ts-expect-error + return this.editor.formatText(index, length, formats); + }, source, index, 0); + } + getBounds(index, length = 0) { + let bounds = null; + if (typeof index === 'number') { + bounds = this.selection.getBounds(index, length); + } + else { + bounds = this.selection.getBounds(index.index, index.length); + } + if (!bounds) + return null; + const containerBounds = this.container.getBoundingClientRect(); + return { + bottom: bounds.bottom - containerBounds.top, + height: bounds.height, + left: bounds.left - containerBounds.left, + right: bounds.right - containerBounds.left, + top: bounds.top - containerBounds.top, + width: bounds.width, + }; + } + getContents(index = 0, length = this.getLength() - index) { + [index, length] = overload(index, length); + return this.editor.getContents(index, length); + } + getFormat(index = this.getSelection(true), length = 0) { + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } + return this.editor.getFormat(index.index, index.length); + } + getIndex(blot) { + return blot.offset(this.scroll); + } + getLength() { + return this.scroll.length(); + } + getLeaf(index) { + return this.scroll.leaf(index); + } + getLine(index) { + return this.scroll.line(index); + } + getLines(index = 0, length = Number.MAX_VALUE) { + if (typeof index !== 'number') { + return this.scroll.lines(index.index, index.length); + } + return this.scroll.lines(index, length); + } + getModule(name) { + return this.theme.modules[name]; + } + getSelection(focus = false) { + if (focus) + this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + getSemanticHTML(index = 0, length) { + if (typeof index === 'number') { + length = this.getLength() - index; + } + // @ts-expect-error + [index, length] = overload(index, length); + return this.editor.getHTML(index, length); + } + getText(index = 0, length) { + if (typeof index === 'number') { + length = this.getLength() - index; + } + // @ts-expect-error + [index, length] = overload(index, length); + return this.editor.getText(index, length); + } + hasFocus() { + return this.selection.hasFocus(); + } + insertEmbed(index, embed, value, source = Quill.sources.API) { + return modify.call(this, () => { + return this.editor.insertEmbed(index, embed, value); + }, source, index); + } + insertText(index, text, name, value, source) { + let formats; + // eslint-disable-next-line prefer-const + // @ts-expect-error + [index, , formats, source] = overload(index, 0, name, value, source); + return modify.call(this, () => { + return this.editor.insertText(index, text, formats); + }, source, index, text.length); + } + isEnabled() { + return this.scroll.isEnabled(); + } + off(...args) { + return this.emitter.off(...args); + } + on(...args) { + return this.emitter.on(...args); + } + once(...args) { + return this.emitter.once(...args); + } + removeFormat(...args) { + const [index, length, , source] = overload(...args); + return modify.call(this, () => { + return this.editor.removeFormat(index, length); + }, source, index); + } + scrollRectIntoView(rect) { + (0,_utils_scrollRectIntoView__WEBPACK_IMPORTED_MODULE_12__["default"])(this.root, rect); + } + /** + * @deprecated Use Quill#scrollSelectionIntoView() instead. + */ + scrollIntoView() { + console.warn('Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.'); + this.scrollSelectionIntoView(); + } + /** + * Scroll the current selection into the visible area. + * If the selection is already visible, no scrolling will occur. + */ + scrollSelectionIntoView() { + const range = this.selection.lastRange; + const bounds = range && this.selection.getBounds(range.index, range.length); + if (bounds) { + this.scrollRectIntoView(bounds); + } + } + setContents(delta, source = _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.API) { + return modify.call(this, () => { + delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())(delta); + const length = this.getLength(); + // Quill will set empty editor to \n + const delete1 = this.editor.deleteText(0, length); + const applied = this.editor.insertContents(0, delta); + // Remove extra \n from empty editor initialization + const delete2 = this.editor.deleteText(this.getLength() - 1, 1); + return delete1.compose(applied).compose(delete2); + }, source); + } + setSelection(index, length, source) { + if (index == null) { + // @ts-expect-error https://github.com/microsoft/TypeScript/issues/22609 + this.selection.setRange(null, length || Quill.sources.API); + } + else { + // @ts-expect-error + [index, length, , source] = overload(index, length, source); + this.selection.setRange(new _selection__WEBPACK_IMPORTED_MODULE_9__.Range(Math.max(0, index), length), source); + if (source !== _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.SILENT) { + this.scrollSelectionIntoView(); + } + } + } + setText(text, source = _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.API) { + const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())().insert(text); + return this.setContents(delta, source); + } + update(source = _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.USER) { + const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + // TODO this is usually undefined + return change; + } + updateContents(delta, source = _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.API) { + return modify.call(this, () => { + delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())(delta); + return this.editor.applyDelta(delta); + }, source, true); + } +} +Quill.DEFAULTS = { + bounds: null, + modules: {}, + placeholder: '', + readOnly: false, + registry: globalRegistry, + theme: 'default', +}; +Quill.events = _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].events; +Quill.sources = _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources; +// eslint-disable-next-line no-undef +// @ts-expect-error defined in webpack +Quill.version = typeof QUILL_VERSION === 'undefined' ? 'dev' : QUILL_VERSION; +Quill.imports = { + delta: (quill_delta__WEBPACK_IMPORTED_MODULE_3___default()), + parchment: parchment__WEBPACK_IMPORTED_MODULE_2__, + 'core/module': _module__WEBPACK_IMPORTED_MODULE_8__["default"], + 'core/theme': _theme__WEBPACK_IMPORTED_MODULE_11__["default"], +}; +function expandConfig(container, userConfig) { + // @ts-expect-error -- TODO fix this later + let expandedConfig = lodash_merge__WEBPACK_IMPORTED_MODULE_1___default()({ + container, + modules: { + clipboard: true, + keyboard: true, + history: true, + uploader: true, + }, + }, userConfig); + // @ts-expect-error -- TODO fix this later + if (!expandedConfig.theme || expandedConfig.theme === Quill.DEFAULTS.theme) { + expandedConfig.theme = _theme__WEBPACK_IMPORTED_MODULE_11__["default"]; + } + else { + expandedConfig.theme = Quill.import(`themes/${expandedConfig.theme}`); + if (expandedConfig.theme == null) { + throw new Error(`Invalid theme ${expandedConfig.theme}. Did you register it?`); + } + } + // @ts-expect-error -- TODO fix this later + const themeConfig = lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(expandedConfig.theme.DEFAULTS); + [themeConfig, expandedConfig].forEach((config) => { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach((module) => { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + const moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(expandedConfig.modules)); + const moduleConfig = moduleNames.reduce((config, name) => { + const moduleClass = Quill.import(`modules/${name}`); + if (moduleClass == null) { + debug.error(`Cannot load ${name} module. Are you sure you registered it?`); + } + else { + // @ts-expect-error + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (expandedConfig.modules != null && + expandedConfig.modules.toolbar && + expandedConfig.modules.toolbar.constructor !== Object) { + expandedConfig.modules.toolbar = { + container: expandedConfig.modules.toolbar, + }; + } + expandedConfig = lodash_merge__WEBPACK_IMPORTED_MODULE_1___default()({}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, expandedConfig); + ['bounds', 'container'].forEach((key) => { + const selector = expandedConfig[key]; + if (typeof selector === 'string') { + // @ts-expect-error Handle null case + expandedConfig[key] = document.querySelector(selector); + } + }); + expandedConfig.modules = Object.keys(expandedConfig.modules).reduce((config, name) => { + if (expandedConfig.modules[name]) { + config[name] = expandedConfig.modules[name]; + } + return config; + }, {}); + return expandedConfig; +} +// Handle selection preservation and TEXT_CHANGE emission +// common to modification APIs +function modify(modifier, source, index, shift) { + if (!this.isEnabled() && + source === _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.USER && + !this.allowReadOnlyEdits) { + return new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())(); + } + let range = index == null ? null : this.getSelection(); + const oldDelta = this.editor.delta; + const change = modifier(); + if (range != null) { + if (index === true) { + index = range.index; // eslint-disable-line prefer-destructuring + } + if (shift == null) { + range = shiftRange(range, change, source); + } + else if (shift !== 0) { + // @ts-expect-error index should always be number + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.SILENT); + } + if (change.length() > 0) { + const args = [_emitter__WEBPACK_IMPORTED_MODULE_5__["default"].events.TEXT_CHANGE, change, oldDelta, source]; + this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_5__["default"].events.EDITOR_CHANGE, ...args); + if (source !== _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.SILENT) { + this.emitter.emit(...args); + } + } + return change; +} +function overload(index, length, name, value, source) { + let formats = {}; + // @ts-expect-error + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + // @ts-expect-error + source = value; + value = name; + name = length; + // @ts-expect-error + length = index.length; // eslint-disable-line prefer-destructuring + // @ts-expect-error + index = index.index; // eslint-disable-line prefer-destructuring + } + else { + // @ts-expect-error + length = index.length; // eslint-disable-line prefer-destructuring + // @ts-expect-error + index = index.index; // eslint-disable-line prefer-destructuring + } + } + else if (typeof length !== 'number') { + // @ts-expect-error + source = value; + value = name; + name = length; + length = 0; + } + // Handle format being object, two format name/value strings or excluded + if (typeof name === 'object') { + // @ts-expect-error Fix me later + formats = name; + // @ts-expect-error + source = value; + } + else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } + else { + // @ts-expect-error + source = name; + } + } + // Handle optional source + source = source || _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.API; + // @ts-expect-error + return [index, length, formats, source]; +} +function shiftRange(range, index, lengthOrSource, source) { + const length = typeof lengthOrSource === 'number' ? lengthOrSource : 0; + if (range == null) + return null; + let start; + let end; + // @ts-expect-error -- TODO: add a better type guard around `index` + if (index && typeof index.transformPosition === 'function') { + [start, end] = [range.index, range.index + range.length].map((pos) => + // @ts-expect-error -- TODO: add a better type guard around `index` + index.transformPosition(pos, source !== _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.USER)); + } + else { + [start, end] = [range.index, range.index + range.length].map((pos) => { + // @ts-expect-error -- TODO: add a better type guard around `index` + if (pos < index || (pos === index && source === _emitter__WEBPACK_IMPORTED_MODULE_5__["default"].sources.USER)) + return pos; + if (length >= 0) { + return pos + length; + } + // @ts-expect-error -- TODO: add a better type guard around `index` + return Math.max(index, pos + length); + }); + } + return new _selection__WEBPACK_IMPORTED_MODULE_9__.Range(start, end - start); +} + +//# sourceMappingURL=quill.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/selection.js": +/*!**********************************************!*\ + !*** ./node_modules/quill/core/selection.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Range: () => (/* binding */ Range), +/* harmony export */ "default": () => (/* binding */ Selection) +/* harmony export */ }); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); +/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.clonedeep */ "./node_modules/lodash.clonedeep/index.js"); +/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.isequal */ "./node_modules/lodash.isequal/index.js"); +/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isequal__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emitter */ "./node_modules/quill/core/emitter.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./logger */ "./node_modules/quill/core/logger.js"); + + + + + +const debug = (0,_logger__WEBPACK_IMPORTED_MODULE_4__["default"])('quill:selection'); +class Range { + constructor(index, length = 0) { + this.index = index; + this.length = length; + } +} +class Selection { + constructor(scroll, emitter) { + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.mouseDown = false; + this.root = this.scroll.domNode; + // @ts-expect-error + this.cursor = this.scroll.create('cursor', this); + // savedRange is last non-null range + this.savedRange = new Range(0, 0); + this.lastRange = this.savedRange; + this.lastNative = null; + this.handleComposition(); + this.handleDragging(); + this.emitter.listenDOM('selectionchange', document, () => { + if (!this.mouseDown && !this.composing) { + setTimeout(this.update.bind(this, _emitter__WEBPACK_IMPORTED_MODULE_3__["default"].sources.USER), 1); + } + }); + this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].events.SCROLL_BEFORE_UPDATE, () => { + if (!this.hasFocus()) + return; + const native = this.getNativeRange(); + if (native == null) + return; + if (native.start.node === this.cursor.textNode) + return; // cursor.restore() will handle + this.emitter.once(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].events.SCROLL_UPDATE, (source, mutations) => { + try { + if (this.root.contains(native.start.node) && + this.root.contains(native.end.node)) { + this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } + const triggeredByTyping = mutations.some((mutation) => mutation.type === 'characterData' || + mutation.type === 'childList' || + (mutation.type === 'attributes' && + mutation.target === this.root)); + this.update(triggeredByTyping ? _emitter__WEBPACK_IMPORTED_MODULE_3__["default"].sources.SILENT : source); + } + catch (ignored) { + // ignore + } + }); + }); + this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].events.SCROLL_OPTIMIZE, (mutations, context) => { + if (context.range) { + const { startNode, startOffset, endNode, endOffset } = context.range; + this.setNativeRange(startNode, startOffset, endNode, endOffset); + this.update(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].sources.SILENT); + } + }); + this.update(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].sources.SILENT); + } + handleComposition() { + this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].events.COMPOSITION_BEFORE_START, () => { + this.composing = true; + }); + this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].events.COMPOSITION_END, () => { + this.composing = false; + if (this.cursor.parent) { + const range = this.cursor.restore(); + if (!range) + return; + setTimeout(() => { + this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + }, 1); + } + }); + } + handleDragging() { + this.emitter.listenDOM('mousedown', document.body, () => { + this.mouseDown = true; + }); + this.emitter.listenDOM('mouseup', document.body, () => { + this.mouseDown = false; + this.update(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].sources.USER); + }); + } + focus() { + if (this.hasFocus()) + return; + this.root.focus({ preventScroll: true }); + this.setRange(this.savedRange); + } + format(format, value) { + this.scroll.update(); + const nativeRange = this.getNativeRange(); + if (nativeRange == null || + !nativeRange.native.collapsed || + this.scroll.query(format, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK)) + return; + if (nativeRange.start.node !== this.cursor.textNode) { + const blot = this.scroll.find(nativeRange.start.node, false); + if (blot == null) + return; + // TODO Give blot ability to not split + if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot) { + const after = blot.split(nativeRange.start.offset); + // @ts-expect-error Fix me later + blot.parent.insertBefore(this.cursor, after); + } + else { + // @ts-expect-error TODO: nativeRange.start.node doesn't seem to match function signature + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + getBounds(index, length = 0) { + const scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + let node; + let [leaf, offset] = this.scroll.leaf(index); + if (leaf == null) + return null; + [node, offset] = leaf.position(offset, true); + const range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + [leaf, offset] = this.scroll.leaf(index + length); + if (leaf == null) + return null; + [node, offset] = leaf.position(offset, true); + range.setEnd(node, offset); + return range.getBoundingClientRect(); + } + let side = 'left'; + let rect; + if (node instanceof Text) { + // Return null if the text node is empty because it is + // not able to get a useful client rect: + // https://github.com/w3c/csswg-drafts/issues/2514. + // Empty text nodes are most likely caused by TextBlot#optimize() + // not getting called when editor content changes. + if (!node.data.length) { + return null; + } + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } + else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } + else { + if (!(leaf.domNode instanceof Element)) + return null; + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) + side = 'right'; + } + return { + bottom: rect.top + rect.height, + height: rect.height, + left: rect[side], + right: rect[side], + top: rect.top, + width: 0, + }; + } + getNativeRange() { + const selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) + return null; + const nativeRange = selection.getRangeAt(0); + if (nativeRange == null) + return null; + const range = this.normalizeNative(nativeRange); + debug.info('getNativeRange', range); + return range; + } + getRange() { + const root = this.scroll.domNode; + if ('isConnected' in root && !root.isConnected) { + // document.getSelection() forces layout on Blink, so we trend to + // not calling it. + return [null, null]; + } + const normalized = this.getNativeRange(); + if (normalized == null) + return [null, null]; + const range = this.normalizedToRange(normalized); + return [range, normalized]; + } + hasFocus() { + return (document.activeElement === this.root || + (document.activeElement != null && + contains(this.root, document.activeElement))); + } + normalizedToRange(range) { + const positions = [ + [range.start.node, range.start.offset], + ]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + const indexes = positions.map((position) => { + const [node, offset] = position; + const blot = this.scroll.find(node, true); + // @ts-expect-error Fix me later + const index = blot.offset(this.scroll); + if (offset === 0) { + return index; + } + if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot) { + return index + blot.index(node, offset); + } + // @ts-expect-error Fix me later + return index + blot.length(); + }); + const end = Math.min(Math.max(...indexes), this.scroll.length() - 1); + const start = Math.min(end, ...indexes); + return new Range(start, end - start); + } + normalizeNative(nativeRange) { + if (!contains(this.root, nativeRange.startContainer) || + (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))) { + return null; + } + const range = { + start: { + node: nativeRange.startContainer, + offset: nativeRange.startOffset, + }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange, + }; + [range.start, range.end].forEach((position) => { + let { node, offset } = position; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } + else if (node.childNodes.length === offset) { + // @ts-expect-error Fix me later + node = node.lastChild; + if (node instanceof Text) { + offset = node.data.length; + } + else if (node.childNodes.length > 0) { + // Container case + offset = node.childNodes.length; + } + else { + // Embed case + offset = node.childNodes.length + 1; + } + } + else { + break; + } + } + position.node = node; + position.offset = offset; + }); + return range; + } + rangeToNative(range) { + const scrollLength = this.scroll.length(); + const getPosition = (index, inclusive) => { + index = Math.min(scrollLength - 1, index); + const [leaf, leafOffset] = this.scroll.leaf(index); + return leaf ? leaf.position(leafOffset, inclusive) : [null, -1]; + }; + return [ + ...getPosition(range.index, false), + ...getPosition(range.index + range.length, true), + ]; + } + setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset, force = false) { + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && + (this.root.parentNode == null || + startNode.parentNode == null || + // @ts-expect-error Fix me later + endNode.parentNode == null)) { + return; + } + const selection = document.getSelection(); + if (selection == null) + return; + if (startNode != null) { + if (!this.hasFocus()) + this.root.focus({ preventScroll: true }); + const { native } = this.getNativeRange() || {}; + if (native == null || + force || + startNode !== native.startContainer || + startOffset !== native.startOffset || + endNode !== native.endContainer || + endOffset !== native.endOffset) { + if (startNode instanceof Element && startNode.tagName === 'BR') { + // @ts-expect-error Fix me later + startOffset = Array.from(startNode.parentNode.childNodes).indexOf(startNode); + startNode = startNode.parentNode; + } + if (endNode instanceof Element && endNode.tagName === 'BR') { + // @ts-expect-error Fix me later + endOffset = Array.from(endNode.parentNode.childNodes).indexOf(endNode); + endNode = endNode.parentNode; + } + const range = document.createRange(); + // @ts-expect-error Fix me later + range.setStart(startNode, startOffset); + // @ts-expect-error Fix me later + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } + else { + selection.removeAllRanges(); + this.root.blur(); + } + } + setRange(range, force = false, source = _emitter__WEBPACK_IMPORTED_MODULE_3__["default"].sources.API) { + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + const args = this.rangeToNative(range); + this.setNativeRange(...args, force); + } + else { + this.setNativeRange(null); + } + this.update(source); + } + update(source = _emitter__WEBPACK_IMPORTED_MODULE_3__["default"].sources.USER) { + const oldRange = this.lastRange; + const [lastRange, nativeRange] = this.getRange(); + this.lastRange = lastRange; + this.lastNative = nativeRange; + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!lodash_isequal__WEBPACK_IMPORTED_MODULE_2___default()(oldRange, this.lastRange)) { + if (!this.composing && + nativeRange != null && + nativeRange.native.collapsed && + nativeRange.start.node !== this.cursor.textNode) { + const range = this.cursor.restore(); + if (range) { + this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + } + } + const args = [ + _emitter__WEBPACK_IMPORTED_MODULE_3__["default"].events.SELECTION_CHANGE, + lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1___default()(this.lastRange), + lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1___default()(oldRange), + source, + ]; + this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_3__["default"].events.EDITOR_CHANGE, ...args); + if (source !== _emitter__WEBPACK_IMPORTED_MODULE_3__["default"].sources.SILENT) { + this.emitter.emit(...args); + } + } + } +} +function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; // eslint-disable-line @typescript-eslint/no-unused-expressions + } + catch (e) { + return false; + } + return parent.contains(descendant); +} + +//# sourceMappingURL=selection.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/theme.js": +/*!******************************************!*\ + !*** ./node_modules/quill/core/theme.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +class Theme { + constructor(quill, options) { + this.quill = quill; + this.options = options; + this.modules = {}; + } + init() { + Object.keys(this.options.modules).forEach((name) => { + if (this.modules[name] == null) { + this.addModule(name); + } + }); + } + addModule(name) { + // @ts-expect-error + const ModuleClass = this.quill.constructor.import(`modules/${name}`); + this.modules[name] = new ModuleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } +} +Theme.DEFAULTS = { + modules: {}, +}; +Theme.themes = { + default: Theme, +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Theme); +//# sourceMappingURL=theme.js.map + +/***/ }), + +/***/ "./node_modules/quill/core/utils/scrollRectIntoView.js": +/*!*************************************************************!*\ + !*** ./node_modules/quill/core/utils/scrollRectIntoView.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const getParentElement = (element) => element.parentElement || element.getRootNode().host || null; +const getElementRect = (element) => { + const rect = element.getBoundingClientRect(); + const scaleX = ('offsetWidth' in element && + Math.abs(rect.width) / element.offsetWidth) || + 1; + const scaleY = ('offsetHeight' in element && + Math.abs(rect.height) / element.offsetHeight) || + 1; + return { + top: rect.top, + right: rect.left + element.clientWidth * scaleX, + bottom: rect.top + element.clientHeight * scaleY, + left: rect.left, + }; +}; +const paddingValueToInt = (value) => { + const number = parseInt(value, 10); + return Number.isNaN(number) ? 0 : number; +}; +// Follow the steps described in https://www.w3.org/TR/cssom-view-1/#element-scrolling-members, +// assuming that the scroll option is set to 'nearest'. +const getScrollDistance = (targetStart, targetEnd, scrollStart, scrollEnd, scrollPaddingStart, scrollPaddingEnd) => { + if (targetStart < scrollStart && targetEnd > scrollEnd) { + return 0; + } + if (targetStart < scrollStart) { + return -(scrollStart - targetStart + scrollPaddingStart); + } + if (targetEnd > scrollEnd) { + return targetEnd - targetStart > scrollEnd - scrollStart + ? targetStart + scrollPaddingStart - scrollStart + : targetEnd - scrollEnd + scrollPaddingEnd; + } + return 0; +}; +const scrollRectIntoView = (root, targetRect) => { + var _a, _b, _c, _d, _e; + const document = root.ownerDocument; + let rect = targetRect; + let current = root; + while (current) { + const isDocumentBody = current === document.body; + const bounding = isDocumentBody + ? { + top: 0, + right: (_b = (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : document.documentElement.clientWidth, + bottom: (_d = (_c = window.visualViewport) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : document.documentElement.clientHeight, + left: 0, + } + : getElementRect(current); + const style = getComputedStyle(current); + const scrollDistanceX = getScrollDistance(rect.left, rect.right, bounding.left, bounding.right, paddingValueToInt(style.scrollPaddingLeft), paddingValueToInt(style.scrollPaddingRight)); + const scrollDistanceY = getScrollDistance(rect.top, rect.bottom, bounding.top, bounding.bottom, paddingValueToInt(style.scrollPaddingTop), paddingValueToInt(style.scrollPaddingBottom)); + if (scrollDistanceX || scrollDistanceY) { + if (isDocumentBody) { + (_e = document.defaultView) === null || _e === void 0 ? void 0 : _e.scrollBy(scrollDistanceX, scrollDistanceY); + } + else { + const { scrollLeft, scrollTop } = current; + if (scrollDistanceY) { + current.scrollTop += scrollDistanceY; + } + if (scrollDistanceX) { + current.scrollLeft += scrollDistanceX; + } + const scrolledLeft = current.scrollLeft - scrollLeft; + const scrolledTop = current.scrollTop - scrollTop; + rect = { + left: rect.left - scrolledLeft, + top: rect.top - scrolledTop, + right: rect.right - scrolledLeft, + bottom: rect.bottom - scrolledTop, + }; + } + } + current = + isDocumentBody || style.position === 'fixed' + ? null + : getParentElement(current); + } +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (scrollRectIntoView); +//# sourceMappingURL=scrollRectIntoView.js.map + +/***/ }), + +/***/ "./node_modules/quill/dist/quill.js": +/*!******************************************!*\ + !*** ./node_modules/quill/dist/quill.js ***! + \******************************************/ +/***/ ((module) => { + +/*! + * Quill Editor v2.0.0-dev.4 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +/* + * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(true) + module.exports = factory(); + else {} +})(self, function() { +return /******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./blots/block.js": +/*!************************!*\ + !*** ./blots/block.js ***! + \************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BlockEmbed: function() { return /* binding */ BlockEmbed; },\n/* harmony export */ blockDelta: function() { return /* binding */ blockDelta; },\n/* harmony export */ bubbleFormats: function() { return /* binding */ bubbleFormats; },\n/* harmony export */ \"default\": function() { return /* binding */ Block; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./break */ \"./blots/break.js\");\n/* harmony import */ var _inline__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inline */ \"./blots/inline.js\");\n/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./text */ \"./blots/text.js\");\n\n\n\n\n\nconst NEWLINE_LENGTH = 1;\nclass Block extends parchment__WEBPACK_IMPORTED_MODULE_0__.BlockBlot {\n constructor() {\n super(...arguments);\n this.cache = {};\n }\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n insertAt(index, value, def) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let block = this;\n lines.reduce((lineIndex, line) => {\n // @ts-expect-error Fix me later\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n insertBefore(blot, ref) {\n const {\n head\n } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof _break__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) {\n head.remove();\n }\n this.cache = {};\n }\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n moveChildren(target, ref) {\n // @ts-expect-error Parchment types are wrong\n super.moveChildren(target, ref);\n this.cache = {};\n }\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n path(index) {\n return super.path(index, true);\n }\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n split(index) {\n let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n // @ts-expect-error Fix me later\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = _break__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\nBlock.allowedChildren = [_break__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _inline__WEBPACK_IMPORTED_MODULE_3__[\"default\"], parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot, _text__WEBPACK_IMPORTED_MODULE_4__[\"default\"]];\nclass BlockEmbed extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot {\n attach() {\n super.attach();\n this.attributes = new parchment__WEBPACK_IMPORTED_MODULE_0__.AttributorStore(this.domNode);\n }\n delta() {\n return new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().insert(this.value(), Object.assign(Object.assign({}, this.formats()), this.attributes.values()));\n }\n format(name, value) {\n const attribute = this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute\n this.attributes.attribute(attribute, value);\n }\n }\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n insertAt(index, value, def) {\n if (def != null) {\n super.insertAt(index, value, def);\n return;\n }\n const lines = value.split('\\n');\n const text = lines.pop();\n const blocks = lines.map(line => {\n const block = this.scroll.create(Block.blotName);\n block.insertAt(0, line);\n return block;\n });\n const ref = this.split(index);\n blocks.forEach(block => {\n // @ts-expect-error Fix me later\n this.parent.insertBefore(block, ref);\n });\n if (text) {\n // @ts-expect-error Fix me later\n this.parent.insertBefore(this.scroll.create('text', text), ref);\n }\n }\n}\nBlockEmbed.scope = parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\nfunction blockDelta(blot) {\n let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return blot.descendants(parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())()).insert('\\n', bubbleFormats(blot));\n}\nfunction bubbleFormats(blot) {\n let formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n if (blot == null) return formats;\n if ('formats' in blot && typeof blot.formats === 'function') {\n formats = Object.assign(Object.assign({}, formats), blot.formats());\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (blot.parent == null || blot.parent.statics.blotName === 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\n\n//# sourceURL=webpack://Quill/./blots/block.js?"); + +/***/ }), + +/***/ "./blots/break.js": +/*!************************!*\ + !*** ./blots/break.js ***! + \************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nclass Break extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot {\n static value() {\n return undefined;\n }\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n length() {\n return 0;\n }\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Break);\n\n//# sourceURL=webpack://Quill/./blots/break.js?"); + +/***/ }), + +/***/ "./blots/container.js": +/*!****************************!*\ + !*** ./blots/container.js ***! + \****************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nclass Container extends parchment__WEBPACK_IMPORTED_MODULE_0__.ContainerBlot {}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Container);\n\n//# sourceURL=webpack://Quill/./blots/container.js?"); + +/***/ }), + +/***/ "./blots/cursor.js": +/*!*************************!*\ + !*** ./blots/cursor.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ \"./blots/text.js\");\n\n\nclass Cursor extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot {\n static value() {\n return undefined;\n }\n constructor(scroll, domNode, selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n format(name, value) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let target = this;\n let index = 0;\n while (target != null && target.statics.scope !== parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: allow empty context in Parchment\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n length() {\n return this.savedLength;\n }\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n remove() {\n super.remove();\n // @ts-expect-error Fix me later\n this.parent = null;\n }\n restore() {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange();\n // Browser may push down styles/nodes inside the cursor blot.\n // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#push-down-values\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n // @ts-expect-error Fix me later\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n const prevTextBlot = this.prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__[\"default\"] ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof _text__WEBPACK_IMPORTED_MODULE_1__[\"default\"] ? this.next : null;\n // @ts-expect-error TODO: make TextBlot.text public\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const {\n textNode\n } = this;\n // take text from inside this blot and reset it\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS;\n // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n let mergedTextBlot;\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n this.remove();\n if (range) {\n // calculate selection to restore\n const remapOffset = (node, offset) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n return null;\n };\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end\n };\n }\n }\n return null;\n }\n update(mutations, context) {\n if (mutations.some(mutation => {\n return mutation.type === 'characterData' && mutation.target === this.textNode;\n })) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n // Avoid .ql-cursor being a descendant of ``.\n // The reason is Safari pushes down `` on text insertion.\n // That will cause DOM nodes not sync with the model.\n //\n // For example ({I} is the caret), given the markup:\n // \\uFEFF{I}\n // When typing a char \"x\", `` will be pushed down inside the `` first:\n // \\uFEFF{I}\n // And then \"x\" will be inserted after ``:\n // \\uFEFFd{I}\n optimize(context) {\n // @ts-expect-error Fix me later\n super.optimize(context);\n let {\n parent\n } = this;\n while (parent) {\n if (parent.domNode.tagName === 'A') {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: make isolate generic\n parent.isolate(this.offset(parent), this.length()).unwrap();\n this.savedLength = 0;\n break;\n }\n parent = parent.parent;\n }\n }\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n/* harmony default export */ __webpack_exports__[\"default\"] = (Cursor);\n\n//# sourceURL=webpack://Quill/./blots/cursor.js?"); + +/***/ }), + +/***/ "./blots/embed.js": +/*!************************!*\ + !*** ./blots/embed.js ***! + \************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ \"./blots/text.js\");\n\n\nconst GUARD_TEXT = '\\uFEFF';\nclass Embed extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot {\n constructor(scroll, node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', 'false');\n Array.from(this.domNode.childNodes).forEach(childNode => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n restore(node) {\n let range = null;\n let textNode;\n const text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof _text__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n };\n } else {\n textNode = document.createTextNode(text);\n // @ts-expect-error Fix me later\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n update(mutations, context) {\n mutations.forEach(mutation => {\n if (mutation.type === 'characterData' && (mutation.target === this.leftGuard || mutation.target === this.rightGuard)) {\n const range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Embed);\n\n//# sourceURL=webpack://Quill/./blots/embed.js?"); + +/***/ }), + +/***/ "./blots/inline.js": +/*!*************************!*\ + !*** ./blots/inline.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./break */ \"./blots/break.js\");\n/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ \"./blots/text.js\");\n\n\n\nclass Inline extends parchment__WEBPACK_IMPORTED_MODULE_0__.InlineBlot {\n static compare(self, other) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n if (self === other) {\n return 0;\n }\n if (self < other) {\n return -1;\n }\n return 1;\n }\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOT)) {\n const blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n optimize(context) {\n super.optimize(context);\n if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n const parent = this.parent.isolate(this.offset(), this.length());\n // @ts-expect-error TODO: make isolate generic\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, _break__WEBPACK_IMPORTED_MODULE_1__[\"default\"], parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot, _text__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = ['cursor', 'inline', 'link', 'underline', 'strike', 'italic', 'bold', 'script', 'code' // Must be higher\n];\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Inline);\n\n//# sourceURL=webpack://Quill/./blots/inline.js?"); + +/***/ }), + +/***/ "./blots/scroll.js": +/*!*************************!*\ + !*** ./blots/scroll.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _core_emitter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/emitter */ \"./core/emitter.js\");\n/* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block */ \"./blots/block.js\");\n/* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./break */ \"./blots/break.js\");\n/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./container */ \"./blots/container.js\");\n\n\n\n\n\n\n\nfunction isLine(blot) {\n return blot instanceof _block__WEBPACK_IMPORTED_MODULE_3__[\"default\"] || blot instanceof _block__WEBPACK_IMPORTED_MODULE_3__.BlockEmbed;\n}\nfunction isUpdatable(blot) {\n return typeof blot.updateContent === 'function';\n}\nclass Scroll extends parchment__WEBPACK_IMPORTED_MODULE_0__.ScrollBlot {\n constructor(registry, domNode, _ref) {\n let {\n emitter\n } = _ref;\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', e => this.handleDragStart(e));\n }\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n batchEnd() {\n if (!this.batch) return;\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n emitMount(blot) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SCROLL_BLOT_MOUNT, blot);\n }\n emitUnmount(blot) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SCROLL_BLOT_UNMOUNT, blot);\n }\n emitEmbedUpdate(blot, change) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SCROLL_EMBED_UPDATE, blot, change);\n }\n deleteAt(index, length) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof _block__WEBPACK_IMPORTED_MODULE_3__.BlockEmbed || last instanceof _block__WEBPACK_IMPORTED_MODULE_3__.BlockEmbed) {\n this.optimize();\n return;\n }\n const ref = last.children.head instanceof _break__WEBPACK_IMPORTED_MODULE_4__[\"default\"] ? null : last.children.head;\n // @ts-expect-error\n first.moveChildren(last, ref);\n // @ts-expect-error\n first.remove();\n }\n this.optimize();\n }\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.domNode.setAttribute('contenteditable', enabled ? 'true' : 'false');\n }\n formatAt(index, length, format, value) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n insertAt(index, value, def) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n insertBefore(blot, ref) {\n if (blot.statics.scope === parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE_BLOT) {\n const wrapper = this.scroll.create(this.statics.defaultChild.blotName);\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n insertContents(index, delta) {\n const renderBlocks = this.deltaToRenderBlocks(delta.concat(new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().insert('\\n')));\n const last = renderBlocks.pop();\n if (last == null) return;\n this.batchStart();\n const first = renderBlocks.shift();\n if (first) {\n const shouldInsertNewlineChar = first.type === 'block' && (first.delta.length() === 0 || !this.descendant(_block__WEBPACK_IMPORTED_MODULE_3__.BlockEmbed, index)[0] && index < this.length());\n const delta = first.type === 'block' ? first.delta : new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().insert({\n [first.key]: first.value\n });\n insertInlineContents(this, index, delta);\n const newlineCharLength = first.type === 'block' ? 1 : 0;\n const lineEndIndex = index + delta.length() + newlineCharLength;\n if (shouldInsertNewlineChar) {\n this.insertAt(lineEndIndex - 1, '\\n');\n }\n const formats = (0,_block__WEBPACK_IMPORTED_MODULE_3__.bubbleFormats)(this.line(index)[0]);\n const attributes = quill_delta__WEBPACK_IMPORTED_MODULE_1__.AttributeMap.diff(formats, first.attributes) || {};\n Object.keys(attributes).forEach(name => {\n this.formatAt(lineEndIndex - 1, 1, name, attributes[name]);\n });\n index = lineEndIndex;\n }\n let [refBlot, refBlotOffset] = this.children.find(index);\n if (renderBlocks.length) {\n if (refBlot) {\n refBlot = refBlot.split(refBlotOffset);\n refBlotOffset = 0;\n }\n renderBlocks.forEach(renderBlock => {\n if (renderBlock.type === 'block') {\n const block = this.createBlock(renderBlock.attributes, refBlot || undefined);\n insertInlineContents(block, 0, renderBlock.delta);\n } else {\n const blockEmbed = this.create(renderBlock.key, renderBlock.value);\n this.insertBefore(blockEmbed, refBlot || undefined);\n Object.keys(renderBlock.attributes).forEach(name => {\n blockEmbed.format(name, renderBlock.attributes[name]);\n });\n }\n });\n }\n if (last.type === 'block' && last.delta.length()) {\n const offset = refBlot ? refBlot.offset(refBlot.scroll) + refBlotOffset : this.length();\n insertInlineContents(this, offset, last.delta);\n }\n this.batchEnd();\n this.optimize();\n }\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n leaf(index) {\n const last = this.path(index).pop();\n if (!last) {\n return [null, -1];\n }\n const [blot, offset] = last;\n return blot instanceof parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot ? [blot, offset] : [null, -1];\n }\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n // @ts-expect-error TODO: make descendant() generic\n return this.descendant(isLine, index);\n }\n lines() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n const getLines = (blot, blotIndex, blotLength) => {\n let lines = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(blotIndex, blotLength, (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof parchment__WEBPACK_IMPORTED_MODULE_0__.ContainerBlot) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n lengthLeft -= childLength;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n optimize() {\n let mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.batch) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {\n // Never remove self\n }\n update(mutations) {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n return;\n }\n let source = _core_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n mutations = mutations.filter(_ref2 => {\n let {\n target\n } = _ref2;\n const blot = this.find(target, true);\n return blot && !isUpdatable(blot);\n });\n if (mutations.length > 0) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SCROLL_UPDATE, source, mutations);\n }\n }\n updateEmbedAt(index, key, change) {\n // Currently it only supports top-level embeds (BlockEmbed).\n // We can update `ParentBlot` in parchment to support inline embeds.\n const [blot] = this.descendant(b => b instanceof _block__WEBPACK_IMPORTED_MODULE_3__.BlockEmbed, index);\n if (blot && blot.statics.blotName === key && isUpdatable(blot)) {\n blot.updateContent(change);\n }\n }\n handleDragStart(event) {\n event.preventDefault();\n }\n deltaToRenderBlocks(delta) {\n const renderBlocks = [];\n let currentBlockDelta = new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())();\n delta.forEach(op => {\n var _a;\n const insert = op === null || op === void 0 ? void 0 : op.insert;\n if (!insert) return;\n if (typeof insert === 'string') {\n const splitted = insert.split('\\n');\n splitted.slice(0, -1).forEach(text => {\n var _a;\n currentBlockDelta.insert(text, op.attributes);\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: (_a = op.attributes) !== null && _a !== void 0 ? _a : {}\n });\n currentBlockDelta = new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())();\n });\n const last = splitted[splitted.length - 1];\n if (last) {\n currentBlockDelta.insert(last, op.attributes);\n }\n } else {\n const key = Object.keys(insert)[0];\n if (!key) return;\n if (this.query(key, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE)) {\n currentBlockDelta.push(op);\n } else {\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {}\n });\n }\n currentBlockDelta = new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())();\n renderBlocks.push({\n type: 'blockEmbed',\n key,\n value: insert[key],\n attributes: (_a = op.attributes) !== null && _a !== void 0 ? _a : {}\n });\n }\n }\n });\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {}\n });\n }\n return renderBlocks;\n }\n createBlock(attributes, refBlot) {\n let blotName;\n const formats = {};\n Object.entries(attributes).forEach(_ref3 => {\n let [key, value] = _ref3;\n const isBlockBlot = this.query(key, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK & parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOT) != null;\n if (isBlockBlot) {\n blotName = key;\n } else {\n formats[key] = value;\n }\n });\n const block = this.create(blotName || this.statics.defaultChild.blotName, blotName ? attributes[blotName] : undefined);\n this.insertBefore(block, refBlot || undefined);\n const length = block.length();\n Object.entries(formats).forEach(_ref4 => {\n let [key, value] = _ref4;\n block.formatAt(0, length, key, value);\n });\n return block;\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = _block__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\nScroll.allowedChildren = [_block__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _block__WEBPACK_IMPORTED_MODULE_3__.BlockEmbed, _container__WEBPACK_IMPORTED_MODULE_5__[\"default\"]];\nfunction insertInlineContents(parent, index, inlineContents) {\n inlineContents.reduce((index, op) => {\n const length = quill_delta__WEBPACK_IMPORTED_MODULE_1__.Op.length(op);\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n const text = op.insert;\n parent.insertAt(index, text);\n const [leaf] = parent.descendant(parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot, index);\n const formats = (0,_block__WEBPACK_IMPORTED_MODULE_3__.bubbleFormats)(leaf);\n attributes = quill_delta__WEBPACK_IMPORTED_MODULE_1__.AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n parent.insertAt(index, key, op.insert[key]);\n const isInlineEmbed = parent.scroll.query(key, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE) != null;\n if (isInlineEmbed) {\n const [leaf] = parent.descendant(parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot, index);\n const formats = (0,_block__WEBPACK_IMPORTED_MODULE_3__.bubbleFormats)(leaf);\n attributes = quill_delta__WEBPACK_IMPORTED_MODULE_1__.AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n Object.keys(attributes).forEach(key => {\n parent.formatAt(index, length, key, attributes[key]);\n });\n return index + length;\n }, index);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Scroll);\n\n//# sourceURL=webpack://Quill/./blots/scroll.js?"); + +/***/ }), + +/***/ "./blots/text.js": +/*!***********************!*\ + !*** ./blots/text.js ***! + \***********************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Text; },\n/* harmony export */ escapeText: function() { return /* binding */ escapeText; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nclass Text extends parchment__WEBPACK_IMPORTED_MODULE_0__.TextBlot {}\nfunction escapeText(text) {\n return text.replace(/[&<>\"']/g, s => {\n // https://lodash.com/docs#escape\n const entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n return entityMap[s];\n });\n}\n\n\n//# sourceURL=webpack://Quill/./blots/text.js?"); + +/***/ }), + +/***/ "./core.js": +/*!*****************!*\ + !*** ./core.js ***! + \*****************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AttributeMap: function() { return /* reexport safe */ quill_delta__WEBPACK_IMPORTED_MODULE_13__.AttributeMap; },\n/* harmony export */ Delta: function() { return /* reexport default from dynamic */ quill_delta__WEBPACK_IMPORTED_MODULE_13___default.a; },\n/* harmony export */ Op: function() { return /* reexport safe */ quill_delta__WEBPACK_IMPORTED_MODULE_13__.Op; },\n/* harmony export */ OpIterator: function() { return /* reexport safe */ quill_delta__WEBPACK_IMPORTED_MODULE_13__.OpIterator; }\n/* harmony export */ });\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/quill */ \"./core/quill.js\");\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blots/block */ \"./blots/block.js\");\n/* harmony import */ var _blots_break__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blots/break */ \"./blots/break.js\");\n/* harmony import */ var _blots_container__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./blots/container */ \"./blots/container.js\");\n/* harmony import */ var _blots_cursor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./blots/cursor */ \"./blots/cursor.js\");\n/* harmony import */ var _blots_embed__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./blots/embed */ \"./blots/embed.js\");\n/* harmony import */ var _blots_inline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./blots/inline */ \"./blots/inline.js\");\n/* harmony import */ var _blots_scroll__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./blots/scroll */ \"./blots/scroll.js\");\n/* harmony import */ var _blots_text__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./blots/text */ \"./blots/text.js\");\n/* harmony import */ var _modules_clipboard__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modules/clipboard */ \"./modules/clipboard.js\");\n/* harmony import */ var _modules_history__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modules/history */ \"./modules/history.js\");\n/* harmony import */ var _modules_keyboard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./modules/keyboard */ \"./modules/keyboard.js\");\n/* harmony import */ var _modules_uploader__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modules/uploader */ \"./modules/uploader.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _modules_input__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./modules/input */ \"./modules/input.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n_core_quill__WEBPACK_IMPORTED_MODULE_0__[\"default\"].register({\n 'blots/block': _blots_block__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n 'blots/block/embed': _blots_block__WEBPACK_IMPORTED_MODULE_1__.BlockEmbed,\n 'blots/break': _blots_break__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n 'blots/container': _blots_container__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n 'blots/cursor': _blots_cursor__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n 'blots/embed': _blots_embed__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'blots/inline': _blots_inline__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n 'blots/scroll': _blots_scroll__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n 'blots/text': _blots_text__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n 'modules/clipboard': _modules_clipboard__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n 'modules/history': _modules_history__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n 'modules/keyboard': _modules_keyboard__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n 'modules/uploader': _modules_uploader__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n 'modules/input': _modules_input__WEBPACK_IMPORTED_MODULE_14__[\"default\"]\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (_core_quill__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack://Quill/./core.js?"); + +/***/ }), + +/***/ "./core/composition.js": +/*!*****************************!*\ + !*** ./core/composition.js ***! + \*****************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blots_embed__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/embed */ \"./blots/embed.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n\n\nclass Composition {\n constructor(scroll, emitter) {\n this.scroll = scroll;\n this.emitter = emitter;\n this.isComposing = false;\n this.setupListeners();\n }\n setupListeners() {\n this.scroll.domNode.addEventListener('compositionstart', event => {\n if (!this.isComposing) {\n this.handleCompositionStart(event);\n }\n });\n this.scroll.domNode.addEventListener('compositionend', event => {\n if (this.isComposing) {\n this.handleCompositionEnd(event);\n }\n });\n }\n handleCompositionStart(event) {\n const blot = event.target instanceof Node ? this.scroll.find(event.target, true) : null;\n if (blot && !(blot instanceof _blots_embed__WEBPACK_IMPORTED_MODULE_0__[\"default\"])) {\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.COMPOSITION_BEFORE_START, event);\n this.scroll.batchStart();\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.COMPOSITION_START, event);\n this.isComposing = true;\n }\n }\n handleCompositionEnd(event) {\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.COMPOSITION_BEFORE_END, event);\n this.scroll.batchEnd();\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.COMPOSITION_END, event);\n this.isComposing = false;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Composition);\n\n//# sourceURL=webpack://Quill/./core/composition.js?"); + +/***/ }), + +/***/ "./core/editor.js": +/*!************************!*\ + !*** ./core/editor.js ***! + \************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.clonedeep */ \"./node_modules/lodash.clonedeep/index.js\");\n/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.isequal */ \"./node_modules/lodash.isequal/index.js\");\n/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isequal__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.merge */ \"./node_modules/lodash.merge/index.js\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n/* harmony import */ var _blots_break__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../blots/break */ \"./blots/break.js\");\n/* harmony import */ var _blots_cursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../blots/cursor */ \"./blots/cursor.js\");\n/* harmony import */ var _blots_text__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../blots/text */ \"./blots/text.js\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n\n\n\n\n\n\n\n\n\n\nconst ASCII = /^[ -~]*$/;\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n applyDelta(delta) {\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n const deleteDelta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())();\n const normalizedOps = splitOpLines(normalizedDelta.ops.slice());\n normalizedOps.reduce((index, op) => {\n const length = quill_delta__WEBPACK_IMPORTED_MODULE_4__.Op.length(op);\n let attributes = op.attributes || {};\n let isImplicitNewlinePrepended = false;\n let isImplicitNewlineAppended = false;\n if (op.insert != null) {\n deleteDelta.retain(length);\n if (typeof op.insert === 'string') {\n const text = op.insert;\n isImplicitNewlineAppended = !text.endsWith('\\n') && (scrollLength <= index || !!this.scroll.descendant(_blots_block__WEBPACK_IMPORTED_MODULE_5__.BlockEmbed, index)[0]);\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = lodash_merge__WEBPACK_IMPORTED_MODULE_2___default()({}, (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(line));\n if (line instanceof _blots_block__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n const [leaf] = line.descendant(parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot, offset);\n if (leaf) {\n formats = lodash_merge__WEBPACK_IMPORTED_MODULE_2___default()(formats, (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(leaf));\n }\n }\n attributes = quill_delta__WEBPACK_IMPORTED_MODULE_4__.AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n const isInlineEmbed = this.scroll.query(key, parchment__WEBPACK_IMPORTED_MODULE_3__.Scope.INLINE) != null;\n if (isInlineEmbed) {\n if (scrollLength <= index || !!this.scroll.descendant(_blots_block__WEBPACK_IMPORTED_MODULE_5__.BlockEmbed, index)[0]) {\n isImplicitNewlineAppended = true;\n }\n } else if (index > 0) {\n const [leaf, offset] = this.scroll.descendant(parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot, index - 1);\n if (leaf instanceof _blots_text__WEBPACK_IMPORTED_MODULE_8__[\"default\"]) {\n const text = leaf.value();\n if (text[offset] !== '\\n') {\n isImplicitNewlinePrepended = true;\n }\n } else if (leaf instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.EmbedBlot && leaf.statics.scope === parchment__WEBPACK_IMPORTED_MODULE_3__.Scope.INLINE_BLOT) {\n isImplicitNewlinePrepended = true;\n }\n }\n this.scroll.insertAt(index, key, op.insert[key]);\n if (isInlineEmbed) {\n const [leaf] = this.scroll.descendant(parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot, index);\n if (leaf) {\n const formats = lodash_merge__WEBPACK_IMPORTED_MODULE_2___default()({}, (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(leaf));\n attributes = quill_delta__WEBPACK_IMPORTED_MODULE_4__.AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n scrollLength += length;\n } else {\n deleteDelta.push(op);\n if (op.retain !== null && typeof op.retain === 'object') {\n const key = Object.keys(op.retain)[0];\n if (key == null) return index;\n this.scroll.updateEmbedAt(index, key, op.retain[key]);\n }\n }\n Object.keys(attributes).forEach(name => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n const prependedLength = isImplicitNewlinePrepended ? 1 : 0;\n const addedLength = isImplicitNewlineAppended ? 1 : 0;\n scrollLength += prependedLength + addedLength;\n deleteDelta.retain(prependedLength);\n deleteDelta.delete(addedLength);\n return index + length + prependedLength + addedLength;\n }, 0);\n deleteDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + quill_delta__WEBPACK_IMPORTED_MODULE_4__.Op.length(op);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).delete(length));\n }\n formatLine(index, length) {\n let formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n this.scroll.update();\n Object.keys(formats).forEach(format => {\n this.scroll.lines(index, Math.max(length, 1)).forEach(line => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).retain(length, lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(formats));\n return this.update(delta);\n }\n formatText(index, length) {\n let formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.keys(formats).forEach(format => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).retain(length, lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(formats));\n return this.update(delta);\n }\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())());\n }\n getFormat(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let lines = [];\n let leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(path => {\n const [blot] = path;\n if (blot instanceof _blots_block__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n lines.push(blot);\n } else if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(parchment__WEBPACK_IMPORTED_MODULE_3__.LeafBlot, index, length);\n }\n const [lineFormats, leafFormats] = [lines, leaves].map(blots => {\n const blot = blots.shift();\n if (blot == null) return {};\n let formats = (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(blot);\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats((0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(blot), formats);\n }\n return formats;\n });\n return Object.assign(Object.assign({}, lineFormats), leafFormats);\n }\n getHTML(index, length) {\n const [line, lineOffset] = this.scroll.line(index);\n if (line) {\n const lineLength = line.length();\n if (line.length() >= lineOffset + length) {\n const excludeOuterTag = !(lineOffset === 0 && length === lineLength);\n return convertHTML(line, lineOffset, length, excludeOuterTag);\n }\n return convertHTML(this.scroll, index, length, true);\n }\n return '';\n }\n getText(index, length) {\n return this.getContents(index, length).filter(op => typeof op.insert === 'string').map(op => op.insert).join('');\n }\n insertContents(index, contents) {\n const normalizedDelta = normalizeDelta(contents);\n const change = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).concat(normalizedDelta);\n this.scroll.insertContents(index, normalizedDelta);\n return this.update(change);\n }\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).insert({\n [embed]: value\n }));\n }\n insertText(index, text) {\n let formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach(format => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).insert(text, lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(formats)));\n }\n isBlank() {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const blot = this.scroll.children.head;\n if ((blot === null || blot === void 0 ? void 0 : blot.statics.blotName) !== _blots_block__WEBPACK_IMPORTED_MODULE_5__[\"default\"].blotName) return false;\n const block = blot;\n if (block.children.length > 1) return false;\n return block.children.head instanceof _blots_break__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n }\n removeFormat(index, length) {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())();\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().insert(text).concat(suffix));\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n update(change) {\n let mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n let selectionInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n const oldDelta = this.delta;\n if (mutations.length === 1 && mutations[0].type === 'characterData' &&\n // @ts-expect-error Fix me later\n mutations[0].target.data.match(ASCII) && this.scroll.find(mutations[0].target)) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target);\n const formats = (0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.bubbleFormats)(textBlot);\n const index = textBlot.offset(this.scroll);\n // @ts-expect-error Fix me later\n const oldValue = mutations[0].oldValue.replace(_blots_cursor__WEBPACK_IMPORTED_MODULE_7__[\"default\"].CONTENTS, '');\n const oldText = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().insert(oldValue);\n // @ts-expect-error\n const newText = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index)\n };\n const diffDelta = new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())().retain(index).concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n return delta.push(op);\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !lodash_isequal__WEBPACK_IMPORTED_MODULE_1___default()(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n return change;\n }\n}\nfunction convertListHTML(items, lastIndent, types) {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n if (lastIndent <= 0) {\n return ``;\n }\n return `${convertListHTML([], lastIndent - 1, types)}`;\n }\n const [{\n child,\n offset,\n length,\n indent,\n type\n }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n if (indent > lastIndent) {\n types.push(type);\n if (indent === lastIndent + 1) {\n return `<${tag}>${convertHTML(child, offset, length)}${convertListHTML(rest, indent, types)}`;\n }\n return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`;\n }\n const previousType = types[types.length - 1];\n if (indent === lastIndent && type === previousType) {\n return `
  • ${convertHTML(child, offset, length)}${convertListHTML(rest, indent, types)}`;\n }\n const [endTag] = getListType(types.pop());\n return `${convertListHTML(items, lastIndent - 1, types)}`;\n}\nfunction convertHTML(blot, index, length) {\n let excludeOuterTag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n if ('html' in blot && typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n if (blot instanceof _blots_text__WEBPACK_IMPORTED_MODULE_8__[\"default\"]) {\n return (0,_blots_text__WEBPACK_IMPORTED_MODULE_8__.escapeText)(blot.value().slice(index, index + length));\n }\n if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.ParentBlot) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats = 'formats' in child && typeof child.formats === 'function' ? child.formats() : {};\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list\n });\n });\n return convertListHTML(items, -1, []);\n }\n const parts = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n if (excludeOuterTag || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n const {\n outerHTML,\n innerHTML\n } = blot.domNode;\n const [start, end] = outerHTML.split(`>${innerHTML}<`);\n // TODO cleanup\n if (start === '${parts.join('')}<${end}`;\n }\n return `${start}>${parts.join('')}<${end}`;\n }\n return blot.domNode instanceof Element ? blot.domNode.outerHTML : '';\n}\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce((merged, name) => {\n if (formats[name] == null) return merged;\n const combinedValue = combined[name];\n if (combinedValue === formats[name]) {\n merged[name] = combinedValue;\n } else if (Array.isArray(combinedValue)) {\n if (combinedValue.indexOf(formats[name]) < 0) {\n merged[name] = combinedValue.concat([formats[name]]);\n } else {\n // If style already exists, don't add to an array, but don't lose other styles\n merged[name] = combinedValue;\n }\n } else {\n merged[name] = [combinedValue, formats[name]];\n }\n return merged;\n }, {});\n}\nfunction getListType(type) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n case 'unchecked':\n return [tag, ' data-list=\"unchecked\"'];\n default:\n return [tag, ''];\n }\n}\nfunction normalizeDelta(delta) {\n return delta.reduce((normalizedDelta, op) => {\n if (typeof op.insert === 'string') {\n const text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return normalizedDelta.insert(text, op.attributes);\n }\n return normalizedDelta.push(op);\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_4___default())());\n}\nfunction shiftRange(_ref, amount) {\n let {\n index,\n length\n } = _ref;\n return new _selection__WEBPACK_IMPORTED_MODULE_9__.Range(index + amount, length);\n}\nfunction splitOpLines(ops) {\n const split = [];\n ops.forEach(op => {\n if (typeof op.insert === 'string') {\n const lines = op.insert.split('\\n');\n lines.forEach((line, index) => {\n if (index) split.push({\n insert: '\\n',\n attributes: op.attributes\n });\n if (line) split.push({\n insert: line,\n attributes: op.attributes\n });\n });\n } else {\n split.push(op);\n }\n });\n return split;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Editor);\n\n//# sourceURL=webpack://Quill/./core/editor.js?"); + +/***/ }), + +/***/ "./core/emitter.js": +/*!*************************!*\ + !*** ./core/emitter.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\n/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(eventemitter3__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instances */ \"./core/instances.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n\n\n\nconst debug = (0,_logger__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\nEVENTS.forEach(eventName => {\n document.addEventListener(eventName, function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n Array.from(document.querySelectorAll('.ql-container')).forEach(node => {\n const quill = _instances__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(node);\n if (quill && quill.emitter) {\n quill.emitter.handleDOM(...args);\n }\n });\n });\n});\nclass Emitter extends (eventemitter3__WEBPACK_IMPORTED_MODULE_0___default()) {\n constructor() {\n super();\n this.listeners = {};\n this.on('error', debug.error);\n }\n emit() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n debug.log.call(debug, ...args);\n // @ts-expect-error\n return super.emit(...args);\n }\n handleDOM(event) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n (this.listeners[event.type] || []).forEach(_ref => {\n let {\n node,\n handler\n } = _ref;\n if (event.target === node || node.contains(event.target)) {\n handler(event, ...args);\n }\n });\n }\n listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({\n node,\n handler\n });\n }\n}\nEmitter.events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_BLOT_MOUNT: 'scroll-blot-mount',\n SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SCROLL_EMBED_UPDATE: 'scroll-embed-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change',\n COMPOSITION_BEFORE_START: 'composition-before-start',\n COMPOSITION_START: 'composition-start',\n COMPOSITION_BEFORE_END: 'composition-before-end',\n COMPOSITION_END: 'composition-end'\n};\nEmitter.sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user'\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Emitter);\n\n//# sourceURL=webpack://Quill/./core/emitter.js?"); + +/***/ }), + +/***/ "./core/instances.js": +/*!***************************!*\ + !*** ./core/instances.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (new WeakMap());\n\n//# sourceURL=webpack://Quill/./core/instances.js?"); + +/***/ }), + +/***/ "./core/logger.js": +/*!************************!*\ + !*** ./core/logger.js ***! + \************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nconst levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\nfunction debug(method) {\n if (level) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n console[method](...args); // eslint-disable-line no-console\n }\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce((logger, method) => {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\nnamespace.level = newLevel => {\n level = newLevel;\n};\ndebug.level = namespace.level;\n/* harmony default export */ __webpack_exports__[\"default\"] = (namespace);\n\n//# sourceURL=webpack://Quill/./core/logger.js?"); + +/***/ }), + +/***/ "./core/module.js": +/*!************************!*\ + !*** ./core/module.js ***! + \************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nclass Module {\n constructor(quill) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Module);\n\n//# sourceURL=webpack://Quill/./core/module.js?"); + +/***/ }), + +/***/ "./core/quill.js": +/*!***********************!*\ + !*** ./core/quill.js ***! + \***********************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Quill; },\n/* harmony export */ expandConfig: function() { return /* binding */ expandConfig; },\n/* harmony export */ globalRegistry: function() { return /* binding */ globalRegistry; },\n/* harmony export */ overload: function() { return /* binding */ overload; }\n/* harmony export */ });\n/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.clonedeep */ \"./node_modules/lodash.clonedeep/index.js\");\n/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.merge */ \"./node_modules/lodash.merge/index.js\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor */ \"./core/editor.js\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n/* harmony import */ var _instances__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./instances */ \"./core/instances.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./module */ \"./core/module.js\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n/* harmony import */ var _composition__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./composition */ \"./core/composition.js\");\n/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./theme */ \"./core/theme.js\");\n/* harmony import */ var _utils_scrollRectIntoView__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/scrollRectIntoView */ \"./core/utils/scrollRectIntoView.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst debug = (0,_logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"])('quill');\nconst globalRegistry = new parchment__WEBPACK_IMPORTED_MODULE_2__.Registry();\nparchment__WEBPACK_IMPORTED_MODULE_2__.ParentBlot.uiClass = 'ql-ui';\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n _logger__WEBPACK_IMPORTED_MODULE_7__[\"default\"].level(limit);\n }\n static find(node) {\n let bubble = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n return _instances__WEBPACK_IMPORTED_MODULE_6__[\"default\"].get(node) || globalRegistry.find(node, bubble);\n }\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n static register(path, target) {\n let overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n if (typeof path !== 'string') {\n const name = 'attrName' in path ? path.attrName : path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n // @ts-expect-error\n this.register(`formats/${name}`, path, target);\n } else {\n Object.keys(path).forEach(key => {\n // @ts-expect-error\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) &&\n // @ts-expect-error\n target.blotName !== 'abstract') {\n globalRegistry.register(target);\n }\n // @ts-expect-error\n if (typeof target.register === 'function') {\n // @ts-expect-error\n target.register(globalRegistry);\n }\n }\n }\n constructor(container) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n debug.error('Invalid Quill container', container);\n return;\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n _instances__WEBPACK_IMPORTED_MODULE_6__[\"default\"].set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.emitter = new _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n // @ts-expect-error TODO: fix BlotConstructor\n const ScrollBlot = this.options.registry.query(parchment__WEBPACK_IMPORTED_MODULE_2__.ScrollBlot.blotName);\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter\n });\n this.editor = new _editor__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.scroll);\n this.selection = new _selection__WEBPACK_IMPORTED_MODULE_9__[\"default\"](this.scroll, this.emitter);\n this.composition = new _composition__WEBPACK_IMPORTED_MODULE_10__[\"default\"](this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.addModule('input');\n this.theme.init();\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].events.EDITOR_CHANGE, type => {\n if (type === _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo = oldRange && newRange ? {\n oldRange,\n newRange\n } : undefined;\n modify.call(this, () => this.editor.update(null, mutations, selectionInfo), source);\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].events.SCROLL_EMBED_UPDATE, (blot, delta) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo = oldRange && newRange ? {\n oldRange,\n newRange\n } : undefined;\n modify.call(this, () => {\n const change = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())().retain(blot.offset(this)).retain({\n [blot.statics.blotName]: delta\n });\n return this.editor.update(change, [], selectionInfo);\n }, Quill.sources.USER);\n });\n if (html) {\n const contents = this.clipboard.convert({\n html: `${html}


    `,\n text: '\\n'\n });\n this.setContents(contents);\n }\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n this.allowReadOnlyEdits = false;\n }\n addContainer(container) {\n let refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n blur() {\n this.selection.setRange(null);\n }\n deleteText(index, length, source) {\n // @ts-expect-error\n [index, length,, source] = overload(index, length, source);\n return modify.call(this, () => {\n // @ts-expect-error\n return this.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n disable() {\n this.enable(false);\n }\n editReadOnly(modifier) {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n enable() {\n let enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n focus() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.selection.focus();\n if (!options.preventScroll) {\n this.scrollSelectionIntoView();\n }\n }\n format(name, value) {\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.API;\n return modify.call(this, () => {\n const range = this.getSelection(true);\n let change = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())();\n if (range == null) return change;\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_2__.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value\n });\n }\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.SILENT);\n return change;\n }, source);\n }\n formatLine(index, length, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(index, length,\n // @ts-expect-error\n name, value, source);\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n formatText(index, length, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n // @ts-expect-error\n index, length, name, value, source);\n return modify.call(this, () => {\n // @ts-expect-error\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n getBounds(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n let bounds = null;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n if (!bounds) return null;\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n getContents() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n getFormat() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n return this.editor.getFormat(index.index, index.length);\n }\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n getLength() {\n return this.scroll.length();\n }\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n getLine(index) {\n return this.scroll.line(index);\n }\n getLines() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n return this.scroll.lines(index, length);\n }\n getModule(name) {\n return this.theme.modules[name];\n }\n getSelection() {\n let focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n getSemanticHTML() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 ? arguments[1] : undefined;\n if (typeof index === 'number') {\n length = this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getHTML(index, length);\n }\n getText() {\n let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n let length = arguments.length > 1 ? arguments[1] : undefined;\n if (typeof index === 'number') {\n length = this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n hasFocus() {\n return this.selection.hasFocus();\n }\n insertEmbed(index, embed, value) {\n let source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n insertText(index, text, name, value, source) {\n let formats;\n // eslint-disable-next-line prefer-const\n // @ts-expect-error\n [index,, formats, source] = overload(index, 0, name, value, source);\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n isEnabled() {\n return this.scroll.isEnabled();\n }\n off() {\n return this.emitter.off(...arguments);\n }\n on() {\n return this.emitter.on(...arguments);\n }\n once() {\n return this.emitter.once(...arguments);\n }\n removeFormat() {\n const [index, length,, source] = overload(...arguments);\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n scrollRectIntoView(rect) {\n (0,_utils_scrollRectIntoView__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(this.root, rect);\n }\n /**\n * @deprecated Use Quill#scrollSelectionIntoView() instead.\n */\n scrollIntoView() {\n console.warn('Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.');\n this.scrollSelectionIntoView();\n }\n /**\n * Scroll the current selection into the visible area.\n * If the selection is already visible, no scrolling will occur.\n */\n scrollSelectionIntoView() {\n const range = this.selection.lastRange;\n const bounds = range && this.selection.getBounds(range.index, range.length);\n if (bounds) {\n this.scrollRectIntoView(bounds);\n }\n }\n setContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())(delta);\n const length = this.getLength();\n // Quill will set empty editor to \\n\n const delete1 = this.editor.deleteText(0, length);\n const applied = this.editor.insertContents(0, delta);\n // Remove extra \\n from empty editor initialization\n const delete2 = this.editor.deleteText(this.getLength() - 1, 1);\n return delete1.compose(applied).compose(delete2);\n }, source);\n }\n setSelection(index, length, source) {\n if (index == null) {\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/22609\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n // @ts-expect-error\n [index, length,, source] = overload(index, length, source);\n this.selection.setRange(new _selection__WEBPACK_IMPORTED_MODULE_9__.Range(Math.max(0, index), length), source);\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.SILENT) {\n this.scrollSelectionIntoView();\n }\n }\n }\n setText(text) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.API;\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())().insert(text);\n return this.setContents(delta, source);\n }\n update() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.USER;\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n // TODO this is usually undefined\n return change;\n }\n updateContents(delta) {\n let source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.API;\n return modify.call(this, () => {\n delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())(delta);\n return this.editor.applyDelta(delta);\n }, source, true);\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n theme: 'default'\n};\nQuill.events = _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].events;\nQuill.sources = _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources;\n// eslint-disable-next-line no-undef\n// @ts-expect-error defined in webpack\nQuill.version = false ? 0 : \"2.0.0-dev.4\";\nQuill.imports = {\n delta: (quill_delta__WEBPACK_IMPORTED_MODULE_3___default()),\n parchment: parchment__WEBPACK_IMPORTED_MODULE_2__,\n 'core/module': _module__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n 'core/theme': _theme__WEBPACK_IMPORTED_MODULE_11__[\"default\"]\n};\nfunction expandConfig(container, userConfig) {\n // @ts-expect-error -- TODO fix this later\n let expandedConfig = lodash_merge__WEBPACK_IMPORTED_MODULE_1___default()({\n container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true\n }\n }, userConfig);\n // @ts-expect-error -- TODO fix this later\n if (!expandedConfig.theme || expandedConfig.theme === Quill.DEFAULTS.theme) {\n expandedConfig.theme = _theme__WEBPACK_IMPORTED_MODULE_11__[\"default\"];\n } else {\n expandedConfig.theme = Quill.import(`themes/${expandedConfig.theme}`);\n if (expandedConfig.theme == null) {\n throw new Error(`Invalid theme ${expandedConfig.theme}. Did you register it?`);\n }\n }\n // @ts-expect-error -- TODO fix this later\n const themeConfig = lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(expandedConfig.theme.DEFAULTS);\n [themeConfig, expandedConfig].forEach(config => {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(module => {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n const moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(expandedConfig.modules));\n const moduleConfig = moduleNames.reduce((config, name) => {\n const moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(`Cannot load ${name} module. Are you sure you registered it?`);\n } else {\n // @ts-expect-error\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (expandedConfig.modules != null && expandedConfig.modules.toolbar && expandedConfig.modules.toolbar.constructor !== Object) {\n expandedConfig.modules.toolbar = {\n container: expandedConfig.modules.toolbar\n };\n }\n expandedConfig = lodash_merge__WEBPACK_IMPORTED_MODULE_1___default()({}, Quill.DEFAULTS, {\n modules: moduleConfig\n }, themeConfig, expandedConfig);\n ['bounds', 'container'].forEach(key => {\n const selector = expandedConfig[key];\n if (typeof selector === 'string') {\n // @ts-expect-error Handle null case\n expandedConfig[key] = document.querySelector(selector);\n }\n });\n expandedConfig.modules = Object.keys(expandedConfig.modules).reduce((config, name) => {\n if (expandedConfig.modules[name]) {\n config[name] = expandedConfig.modules[name];\n }\n return config;\n }, {});\n return expandedConfig;\n}\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (!this.isEnabled() && source === _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.USER && !this.allowReadOnlyEdits) {\n return new (quill_delta__WEBPACK_IMPORTED_MODULE_3___default())();\n }\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n // @ts-expect-error index should always be number\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.SILENT);\n }\n if (change.length() > 0) {\n const args = [_emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].events.EDITOR_CHANGE, ...args);\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\nfunction overload(index, length, name, value, source) {\n let formats = {};\n // @ts-expect-error\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n // @ts-expect-error Fix me later\n formats = name;\n // @ts-expect-error\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n // @ts-expect-error\n source = name;\n }\n }\n // Handle optional source\n source = source || _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.API;\n // @ts-expect-error\n return [index, length, formats, source];\n}\nfunction shiftRange(range, index, lengthOrSource, source) {\n const length = typeof lengthOrSource === 'number' ? lengthOrSource : 0;\n if (range == null) return null;\n let start;\n let end;\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (index && typeof index.transformPosition === 'function') {\n [start, end] = [range.index, range.index + range.length].map(pos =>\n // @ts-expect-error -- TODO: add a better type guard around `index`\n index.transformPosition(pos, source !== _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.USER));\n } else {\n [start, end] = [range.index, range.index + range.length].map(pos => {\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (pos < index || pos === index && source === _emitter__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.USER) return pos;\n if (length >= 0) {\n return pos + length;\n }\n // @ts-expect-error -- TODO: add a better type guard around `index`\n return Math.max(index, pos + length);\n });\n }\n return new _selection__WEBPACK_IMPORTED_MODULE_9__.Range(start, end - start);\n}\n\n\n//# sourceURL=webpack://Quill/./core/quill.js?"); + +/***/ }), + +/***/ "./core/selection.js": +/*!***************************!*\ + !*** ./core/selection.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Range: function() { return /* binding */ Range; },\n/* harmony export */ \"default\": function() { return /* binding */ Selection; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.clonedeep */ \"./node_modules/lodash.clonedeep/index.js\");\n/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash.isequal */ \"./node_modules/lodash.isequal/index.js\");\n/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isequal__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emitter */ \"./core/emitter.js\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./logger */ \"./core/logger.js\");\n\n\n\n\n\nconst debug = (0,_logger__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('quill:selection');\nclass Range {\n constructor(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n this.index = index;\n this.length = length;\n }\n}\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n // @ts-expect-error\n this.cursor = this.scroll.create('cursor', this);\n // savedRange is last non-null range\n this.savedRange = new Range(0, 0);\n this.lastRange = this.savedRange;\n this.lastNative = null;\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.USER), 1);\n }\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n this.emitter.once(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.SCROLL_UPDATE, (source, mutations) => {\n try {\n if (this.root.contains(native.start.node) && this.root.contains(native.end.node)) {\n this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n }\n const triggeredByTyping = mutations.some(mutation => mutation.type === 'characterData' || mutation.type === 'childList' || mutation.type === 'attributes' && mutation.target === this.root);\n this.update(triggeredByTyping ? _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.SILENT : source);\n } catch (ignored) {\n // ignore\n }\n });\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const {\n startNode,\n startOffset,\n endNode,\n endOffset\n } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n this.update(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.SILENT);\n }\n });\n this.update(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.SILENT);\n }\n handleComposition() {\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.COMPOSITION_BEFORE_START, () => {\n this.composing = true;\n });\n this.emitter.on(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.COMPOSITION_END, () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.USER);\n });\n }\n focus() {\n if (this.hasFocus()) return;\n this.root.focus({\n preventScroll: true\n });\n this.setRange(this.savedRange);\n }\n format(format, value) {\n this.scroll.update();\n const nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || this.scroll.query(format, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n const blot = this.scroll.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot) {\n const after = blot.split(nativeRange.start.offset);\n // @ts-expect-error Fix me later\n blot.parent.insertBefore(this.cursor, after);\n } else {\n // @ts-expect-error TODO: nativeRange.start.node doesn't seem to match function signature\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n getBounds(index) {\n let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n const scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node;\n let [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n const range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n }\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n // Return null if the text node is empty because it is\n // not able to get a useful client rect:\n // https://github.com/w3c/csswg-drafts/issues/2514.\n // Empty text nodes are most likely caused by TextBlot#optimize()\n // not getting called when editor content changes.\n if (!node.data.length) {\n return null;\n }\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n if (!(leaf.domNode instanceof Element)) return null;\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n getNativeRange() {\n const selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n const range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n getRange() {\n const root = this.scroll.domNode;\n if ('isConnected' in root && !root.isConnected) {\n // document.getSelection() forces layout on Blink, so we trend to\n // not calling it.\n return [null, null];\n }\n const normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n const range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n hasFocus() {\n return document.activeElement === this.root || document.activeElement != null && contains(this.root, document.activeElement);\n }\n normalizedToRange(range) {\n const positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n const indexes = positions.map(position => {\n const [node, offset] = position;\n const blot = this.scroll.find(node, true);\n // @ts-expect-error Fix me later\n const index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n }\n if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_0__.LeafBlot) {\n return index + blot.index(node, offset);\n }\n // @ts-expect-error Fix me later\n return index + blot.length();\n });\n const end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n const start = Math.min(end, ...indexes);\n return new Range(start, end - start);\n }\n normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {\n return null;\n }\n const range = {\n start: {\n node: nativeRange.startContainer,\n offset: nativeRange.startOffset\n },\n end: {\n node: nativeRange.endContainer,\n offset: nativeRange.endOffset\n },\n native: nativeRange\n };\n [range.start, range.end].forEach(position => {\n let {\n node,\n offset\n } = position;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n // @ts-expect-error Fix me later\n node = node.lastChild;\n if (node instanceof Text) {\n offset = node.data.length;\n } else if (node.childNodes.length > 0) {\n // Container case\n offset = node.childNodes.length;\n } else {\n // Embed case\n offset = node.childNodes.length + 1;\n }\n } else {\n break;\n }\n }\n position.node = node;\n position.offset = offset;\n });\n return range;\n }\n rangeToNative(range) {\n const scrollLength = this.scroll.length();\n const getPosition = (index, inclusive) => {\n index = Math.min(scrollLength - 1, index);\n const [leaf, leafOffset] = this.scroll.leaf(index);\n return leaf ? leaf.position(leafOffset, inclusive) : [null, -1];\n };\n return [...getPosition(range.index, false), ...getPosition(range.index + range.length, true)];\n }\n setNativeRange(startNode, startOffset) {\n let endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;\n let endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;\n let force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null ||\n // @ts-expect-error Fix me later\n endNode.parentNode == null)) {\n return;\n }\n const selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus({\n preventScroll: true\n });\n const {\n native\n } = this.getNativeRange() || {};\n if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {\n if (startNode instanceof Element && startNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n startOffset = Array.from(startNode.parentNode.childNodes).indexOf(startNode);\n startNode = startNode.parentNode;\n }\n if (endNode instanceof Element && endNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n endOffset = Array.from(endNode.parentNode.childNodes).indexOf(endNode);\n endNode = endNode.parentNode;\n }\n const range = document.createRange();\n // @ts-expect-error Fix me later\n range.setStart(startNode, startOffset);\n // @ts-expect-error Fix me later\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n }\n }\n setRange(range) {\n let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.API;\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n const args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n update() {\n let source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.USER;\n const oldRange = this.lastRange;\n const [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n this.lastNative = nativeRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!lodash_isequal__WEBPACK_IMPORTED_MODULE_2___default()(oldRange, this.lastRange)) {\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n const range = this.cursor.restore();\n if (range) {\n this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }\n }\n const args = [_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.SELECTION_CHANGE, lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1___default()(this.lastRange), lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1___default()(oldRange), source];\n this.emitter.emit(_emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.EDITOR_CHANGE, ...args);\n if (source !== _emitter__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode; // eslint-disable-line @typescript-eslint/no-unused-expressions\n } catch (e) {\n return false;\n }\n return parent.contains(descendant);\n}\n\n\n//# sourceURL=webpack://Quill/./core/selection.js?"); + +/***/ }), + +/***/ "./core/theme.js": +/*!***********************!*\ + !*** ./core/theme.js ***! + \***********************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nclass Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n init() {\n Object.keys(this.options.modules).forEach(name => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n addModule(name) {\n // @ts-expect-error\n const ModuleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new ModuleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n default: Theme\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Theme);\n\n//# sourceURL=webpack://Quill/./core/theme.js?"); + +/***/ }), + +/***/ "./core/utils/scrollRectIntoView.js": +/*!******************************************!*\ + !*** ./core/utils/scrollRectIntoView.js ***! + \******************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nconst getParentElement = element => element.parentElement || element.getRootNode().host || null;\nconst getElementRect = element => {\n const rect = element.getBoundingClientRect();\n const scaleX = 'offsetWidth' in element && Math.abs(rect.width) / element.offsetWidth || 1;\n const scaleY = 'offsetHeight' in element && Math.abs(rect.height) / element.offsetHeight || 1;\n return {\n top: rect.top,\n right: rect.left + element.clientWidth * scaleX,\n bottom: rect.top + element.clientHeight * scaleY,\n left: rect.left\n };\n};\nconst paddingValueToInt = value => {\n const number = parseInt(value, 10);\n return Number.isNaN(number) ? 0 : number;\n};\n// Follow the steps described in https://www.w3.org/TR/cssom-view-1/#element-scrolling-members,\n// assuming that the scroll option is set to 'nearest'.\nconst getScrollDistance = (targetStart, targetEnd, scrollStart, scrollEnd, scrollPaddingStart, scrollPaddingEnd) => {\n if (targetStart < scrollStart && targetEnd > scrollEnd) {\n return 0;\n }\n if (targetStart < scrollStart) {\n return -(scrollStart - targetStart + scrollPaddingStart);\n }\n if (targetEnd > scrollEnd) {\n return targetEnd - targetStart > scrollEnd - scrollStart ? targetStart + scrollPaddingStart - scrollStart : targetEnd - scrollEnd + scrollPaddingEnd;\n }\n return 0;\n};\nconst scrollRectIntoView = (root, targetRect) => {\n var _a, _b, _c, _d, _e;\n const document = root.ownerDocument;\n let rect = targetRect;\n let current = root;\n while (current) {\n const isDocumentBody = current === document.body;\n const bounding = isDocumentBody ? {\n top: 0,\n right: (_b = (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : document.documentElement.clientWidth,\n bottom: (_d = (_c = window.visualViewport) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : document.documentElement.clientHeight,\n left: 0\n } : getElementRect(current);\n const style = getComputedStyle(current);\n const scrollDistanceX = getScrollDistance(rect.left, rect.right, bounding.left, bounding.right, paddingValueToInt(style.scrollPaddingLeft), paddingValueToInt(style.scrollPaddingRight));\n const scrollDistanceY = getScrollDistance(rect.top, rect.bottom, bounding.top, bounding.bottom, paddingValueToInt(style.scrollPaddingTop), paddingValueToInt(style.scrollPaddingBottom));\n if (scrollDistanceX || scrollDistanceY) {\n if (isDocumentBody) {\n (_e = document.defaultView) === null || _e === void 0 ? void 0 : _e.scrollBy(scrollDistanceX, scrollDistanceY);\n } else {\n const {\n scrollLeft,\n scrollTop\n } = current;\n if (scrollDistanceY) {\n current.scrollTop += scrollDistanceY;\n }\n if (scrollDistanceX) {\n current.scrollLeft += scrollDistanceX;\n }\n const scrolledLeft = current.scrollLeft - scrollLeft;\n const scrolledTop = current.scrollTop - scrollTop;\n rect = {\n left: rect.left - scrolledLeft,\n top: rect.top - scrolledTop,\n right: rect.right - scrolledLeft,\n bottom: rect.bottom - scrolledTop\n };\n }\n }\n current = isDocumentBody || style.position === 'fixed' ? null : getParentElement(current);\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (scrollRectIntoView);\n\n//# sourceURL=webpack://Quill/./core/utils/scrollRectIntoView.js?"); + +/***/ }), + +/***/ "./formats/align.js": +/*!**************************!*\ + !*** ./formats/align.js ***! + \**************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AlignAttribute: function() { return /* binding */ AlignAttribute; },\n/* harmony export */ AlignClass: function() { return /* binding */ AlignClass; },\n/* harmony export */ AlignStyle: function() { return /* binding */ AlignStyle; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nconst config = {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\nconst AlignAttribute = new parchment__WEBPACK_IMPORTED_MODULE_0__.Attributor('align', 'align', config);\nconst AlignClass = new parchment__WEBPACK_IMPORTED_MODULE_0__.ClassAttributor('align', 'ql-align', config);\nconst AlignStyle = new parchment__WEBPACK_IMPORTED_MODULE_0__.StyleAttributor('align', 'text-align', config);\n\n\n//# sourceURL=webpack://Quill/./formats/align.js?"); + +/***/ }), + +/***/ "./formats/background.js": +/*!*******************************!*\ + !*** ./formats/background.js ***! + \*******************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BackgroundClass: function() { return /* binding */ BackgroundClass; },\n/* harmony export */ BackgroundStyle: function() { return /* binding */ BackgroundStyle; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color */ \"./formats/color.js\");\n\n\nconst BackgroundClass = new parchment__WEBPACK_IMPORTED_MODULE_0__.ClassAttributor('background', 'ql-bg', {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE\n});\nconst BackgroundStyle = new _color__WEBPACK_IMPORTED_MODULE_1__.ColorAttributor('background', 'background-color', {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE\n});\n\n\n//# sourceURL=webpack://Quill/./formats/background.js?"); + +/***/ }), + +/***/ "./formats/blockquote.js": +/*!*******************************!*\ + !*** ./formats/blockquote.js ***! + \*******************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n\nclass Blockquote extends _blots_block__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Blockquote);\n\n//# sourceURL=webpack://Quill/./formats/blockquote.js?"); + +/***/ }), + +/***/ "./formats/bold.js": +/*!*************************!*\ + !*** ./formats/bold.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blots_inline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/inline */ \"./blots/inline.js\");\n\nclass Bold extends _blots_inline__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static create() {\n // @ts-expect-error\n return super.create();\n }\n static formats() {\n return true;\n }\n optimize(context) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bold);\n\n//# sourceURL=webpack://Quill/./formats/bold.js?"); + +/***/ }), + +/***/ "./formats/code.js": +/*!*************************!*\ + !*** ./formats/code.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Code: function() { return /* binding */ Code; },\n/* harmony export */ CodeBlockContainer: function() { return /* binding */ CodeBlockContainer; },\n/* harmony export */ \"default\": function() { return /* binding */ CodeBlock; }\n/* harmony export */ });\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n/* harmony import */ var _blots_break__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../blots/break */ \"./blots/break.js\");\n/* harmony import */ var _blots_cursor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../blots/cursor */ \"./blots/cursor.js\");\n/* harmony import */ var _blots_inline__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../blots/inline */ \"./blots/inline.js\");\n/* harmony import */ var _blots_text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../blots/text */ \"./blots/text.js\");\n/* harmony import */ var _blots_container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../blots/container */ \"./blots/container.js\");\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n\n\n\n\n\n\n\nclass CodeBlockContainer extends _blots_container__WEBPACK_IMPORTED_MODULE_5__[\"default\"] {\n static create(value) {\n const domNode = super.create(value);\n domNode.setAttribute('spellcheck', 'false');\n return domNode;\n }\n code(index, length) {\n return this.children\n // @ts-expect-error\n .map(child => child.length() <= 1 ? '' : child.domNode.innerText).join('\\n').slice(index, index + length);\n }\n html(index, length) {\n // `\\n`s are needed in order to support empty lines at the beginning and the end.\n // https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions\n return `
    \\n${(0,_blots_text__WEBPACK_IMPORTED_MODULE_4__.escapeText)(this.code(index, length))}\\n
    `;\n }\n}\nclass CodeBlock extends _blots_block__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static register() {\n _core_quill__WEBPACK_IMPORTED_MODULE_6__[\"default\"].register(CodeBlockContainer);\n }\n}\nCodeBlock.TAB = ' ';\nclass Code extends _blots_inline__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\nCodeBlock.blotName = 'code-block';\nCodeBlock.className = 'ql-code-block';\nCodeBlock.tagName = 'DIV';\nCodeBlockContainer.blotName = 'code-block-container';\nCodeBlockContainer.className = 'ql-code-block-container';\nCodeBlockContainer.tagName = 'DIV';\nCodeBlockContainer.allowedChildren = [CodeBlock];\nCodeBlock.allowedChildren = [_blots_text__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _blots_break__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _blots_cursor__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\nCodeBlock.requiredContainer = CodeBlockContainer;\n\n\n//# sourceURL=webpack://Quill/./formats/code.js?"); + +/***/ }), + +/***/ "./formats/color.js": +/*!**************************!*\ + !*** ./formats/color.js ***! + \**************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ColorAttributor: function() { return /* binding */ ColorAttributor; },\n/* harmony export */ ColorClass: function() { return /* binding */ ColorClass; },\n/* harmony export */ ColorStyle: function() { return /* binding */ ColorStyle; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nclass ColorAttributor extends parchment__WEBPACK_IMPORTED_MODULE_0__.StyleAttributor {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n const hex = value.split(',').map(component => `00${parseInt(component, 10).toString(16)}`.slice(-2)).join('');\n return `#${hex}`;\n }\n}\nconst ColorClass = new parchment__WEBPACK_IMPORTED_MODULE_0__.ClassAttributor('color', 'ql-color', {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE\n});\nconst ColorStyle = new ColorAttributor('color', 'color', {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE\n});\n\n\n//# sourceURL=webpack://Quill/./formats/color.js?"); + +/***/ }), + +/***/ "./formats/direction.js": +/*!******************************!*\ + !*** ./formats/direction.js ***! + \******************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DirectionAttribute: function() { return /* binding */ DirectionAttribute; },\n/* harmony export */ DirectionClass: function() { return /* binding */ DirectionClass; },\n/* harmony export */ DirectionStyle: function() { return /* binding */ DirectionStyle; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nconst config = {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK,\n whitelist: ['rtl']\n};\nconst DirectionAttribute = new parchment__WEBPACK_IMPORTED_MODULE_0__.Attributor('direction', 'dir', config);\nconst DirectionClass = new parchment__WEBPACK_IMPORTED_MODULE_0__.ClassAttributor('direction', 'ql-direction', config);\nconst DirectionStyle = new parchment__WEBPACK_IMPORTED_MODULE_0__.StyleAttributor('direction', 'direction', config);\n\n\n//# sourceURL=webpack://Quill/./formats/direction.js?"); + +/***/ }), + +/***/ "./formats/font.js": +/*!*************************!*\ + !*** ./formats/font.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FontClass: function() { return /* binding */ FontClass; },\n/* harmony export */ FontStyle: function() { return /* binding */ FontStyle; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nconst config = {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\nconst FontClass = new parchment__WEBPACK_IMPORTED_MODULE_0__.ClassAttributor('font', 'ql-font', config);\nclass FontStyleAttributor extends parchment__WEBPACK_IMPORTED_MODULE_0__.StyleAttributor {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\nconst FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\n\n//# sourceURL=webpack://Quill/./formats/font.js?"); + +/***/ }), + +/***/ "./formats/formula.js": +/*!****************************!*\ + !*** ./formats/formula.js ***! + \****************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blots_embed__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/embed */ \"./blots/embed.js\");\n\nclass Formula extends _blots_embed__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static create(value) {\n // @ts-expect-error\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n const node = super.create(value);\n if (typeof value === 'string') {\n // @ts-expect-error\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00'\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n static value(domNode) {\n return domNode.getAttribute('data-value');\n }\n html() {\n const {\n formula\n } = this.value();\n return `${formula}`;\n }\n}\nFormula.blotName = 'formula';\nFormula.className = 'ql-formula';\nFormula.tagName = 'SPAN';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Formula);\n\n//# sourceURL=webpack://Quill/./formats/formula.js?"); + +/***/ }), + +/***/ "./formats/header.js": +/*!***************************!*\ + !*** ./formats/header.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n\nclass Header extends _blots_block__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n/* harmony default export */ __webpack_exports__[\"default\"] = (Header);\n\n//# sourceURL=webpack://Quill/./formats/header.js?"); + +/***/ }), + +/***/ "./formats/image.js": +/*!**************************!*\ + !*** ./formats/image.js ***! + \**************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./link */ \"./formats/link.js\");\n\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\nclass Image extends parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot {\n static create(value) {\n const node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n static register() {\n if (/Firefox/i.test(navigator.userAgent)) {\n setTimeout(() => {\n // Disable image resizing in Firefox\n // @ts-expect-error\n document.execCommand('enableObjectResizing', false, false);\n }, 1);\n }\n }\n static sanitize(url) {\n return (0,_link__WEBPACK_IMPORTED_MODULE_1__.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Image);\n\n//# sourceURL=webpack://Quill/./formats/image.js?"); + +/***/ }), + +/***/ "./formats/indent.js": +/*!***************************!*\ + !*** ./formats/indent.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nclass IndentAttributor extends parchment__WEBPACK_IMPORTED_MODULE_0__.ClassAttributor {\n add(node, value) {\n let normalizedValue = 0;\n if (value === '+1' || value === '-1') {\n const indent = this.value(node) || 0;\n normalizedValue = value === '+1' ? indent + 1 : indent - 1;\n }\n if (normalizedValue === 0) {\n this.remove(node);\n return true;\n }\n return super.add(node, normalizedValue.toString());\n }\n canAdd(node, value) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));\n }\n // @ts-expect-error TODO: ClassAttributor may support numbers\n value(node) {\n return parseInt(super.value(node), 10) || undefined; // Don't return NaN\n }\n}\n\nconst IndentClass = new IndentAttributor('indent', 'ql-indent', {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK,\n // @ts-expect-error\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (IndentClass);\n\n//# sourceURL=webpack://Quill/./formats/indent.js?"); + +/***/ }), + +/***/ "./formats/italic.js": +/*!***************************!*\ + !*** ./formats/italic.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bold__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bold */ \"./formats/bold.js\");\n\nclass Italic extends _bold__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n/* harmony default export */ __webpack_exports__[\"default\"] = (Italic);\n\n//# sourceURL=webpack://Quill/./formats/italic.js?"); + +/***/ }), + +/***/ "./formats/link.js": +/*!*************************!*\ + !*** ./formats/link.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Link; },\n/* harmony export */ sanitize: function() { return /* binding */ sanitize; }\n/* harmony export */ });\n/* harmony import */ var _blots_inline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/inline */ \"./blots/inline.js\");\n\nclass Link extends _blots_inline__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static create(value) {\n const node = super.create(value);\n node.setAttribute('href', this.sanitize(value));\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n static sanitize(url) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n format(name, value) {\n if (name !== this.statics.blotName || !value) {\n super.format(name, value);\n } else {\n // @ts-expect-error\n this.domNode.setAttribute('href', this.constructor.sanitize(value));\n }\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel', 'sms'];\nfunction sanitize(url, protocols) {\n const anchor = document.createElement('a');\n anchor.href = url;\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\n\n//# sourceURL=webpack://Quill/./formats/link.js?"); + +/***/ }), + +/***/ "./formats/list.js": +/*!*************************!*\ + !*** ./formats/list.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ListContainer: function() { return /* binding */ ListContainer; },\n/* harmony export */ \"default\": function() { return /* binding */ ListItem; }\n/* harmony export */ });\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n/* harmony import */ var _blots_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../blots/container */ \"./blots/container.js\");\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n\n\n\nclass ListContainer extends _blots_container__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {}\nListContainer.blotName = 'list-container';\nListContainer.tagName = 'OL';\nclass ListItem extends _blots_block__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static create(value) {\n // @ts-expect-error\n const node = super.create();\n node.setAttribute('data-list', value);\n return node;\n }\n static formats(domNode) {\n return domNode.getAttribute('data-list') || undefined;\n }\n static register() {\n _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].register(ListContainer);\n }\n constructor(scroll, domNode) {\n super(scroll, domNode);\n const ui = domNode.ownerDocument.createElement('span');\n const listEventHandler = e => {\n if (!scroll.isEnabled()) return;\n const format = this.statics.formats(domNode, scroll);\n if (format === 'checked') {\n this.format('list', 'unchecked');\n e.preventDefault();\n } else if (format === 'unchecked') {\n this.format('list', 'checked');\n e.preventDefault();\n }\n };\n ui.addEventListener('mousedown', listEventHandler);\n ui.addEventListener('touchstart', listEventHandler);\n this.attachUI(ui);\n }\n format(name, value) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-list', value);\n } else {\n super.format(name, value);\n }\n }\n}\nListItem.blotName = 'list';\nListItem.tagName = 'LI';\nListContainer.allowedChildren = [ListItem];\nListItem.requiredContainer = ListContainer;\n\n\n//# sourceURL=webpack://Quill/./formats/list.js?"); + +/***/ }), + +/***/ "./formats/script.js": +/*!***************************!*\ + !*** ./formats/script.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blots_inline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/inline */ \"./blots/inline.js\");\n\nclass Script extends _blots_inline__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n }\n if (value === 'sub') {\n return document.createElement('sub');\n }\n return super.create(value);\n }\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n/* harmony default export */ __webpack_exports__[\"default\"] = (Script);\n\n//# sourceURL=webpack://Quill/./formats/script.js?"); + +/***/ }), + +/***/ "./formats/size.js": +/*!*************************!*\ + !*** ./formats/size.js ***! + \*************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SizeClass: function() { return /* binding */ SizeClass; },\n/* harmony export */ SizeStyle: function() { return /* binding */ SizeStyle; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n\nconst SizeClass = new parchment__WEBPACK_IMPORTED_MODULE_0__.ClassAttributor('size', 'ql-size', {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nconst SizeStyle = new parchment__WEBPACK_IMPORTED_MODULE_0__.StyleAttributor('size', 'font-size', {\n scope: parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\n\n//# sourceURL=webpack://Quill/./formats/size.js?"); + +/***/ }), + +/***/ "./formats/strike.js": +/*!***************************!*\ + !*** ./formats/strike.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bold__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bold */ \"./formats/bold.js\");\n\nclass Strike extends _bold__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\nStrike.blotName = 'strike';\nStrike.tagName = ['S', 'STRIKE'];\n/* harmony default export */ __webpack_exports__[\"default\"] = (Strike);\n\n//# sourceURL=webpack://Quill/./formats/strike.js?"); + +/***/ }), + +/***/ "./formats/table.js": +/*!**************************!*\ + !*** ./formats/table.js ***! + \**************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TableBody: function() { return /* binding */ TableBody; },\n/* harmony export */ TableCell: function() { return /* binding */ TableCell; },\n/* harmony export */ TableContainer: function() { return /* binding */ TableContainer; },\n/* harmony export */ TableRow: function() { return /* binding */ TableRow; },\n/* harmony export */ tableId: function() { return /* binding */ tableId; }\n/* harmony export */ });\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n/* harmony import */ var _blots_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../blots/container */ \"./blots/container.js\");\n\n\nclass TableCell extends _blots_block__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n static create(value) {\n // @ts-expect-error\n const node = super.create();\n if (value) {\n node.setAttribute('data-row', value);\n } else {\n node.setAttribute('data-row', tableId());\n }\n return node;\n }\n static formats(domNode) {\n if (domNode.hasAttribute('data-row')) {\n return domNode.getAttribute('data-row');\n }\n return undefined;\n }\n cellOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n format(name, value) {\n if (name === TableCell.blotName && value) {\n this.domNode.setAttribute('data-row', value);\n } else {\n super.format(name, value);\n }\n }\n row() {\n return this.parent;\n }\n rowOffset() {\n if (this.row()) {\n return this.row().rowOffset();\n }\n return -1;\n }\n table() {\n return this.row() && this.row().table();\n }\n}\nTableCell.blotName = 'table';\nTableCell.tagName = 'TD';\nclass TableRow extends _blots_container__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n checkMerge() {\n // @ts-expect-error\n if (super.checkMerge() && this.next.children.head != null) {\n // @ts-expect-error\n const thisHead = this.children.head.formats();\n // @ts-expect-error\n const thisTail = this.children.tail.formats();\n // @ts-expect-error\n const nextHead = this.next.children.head.formats();\n // @ts-expect-error\n const nextTail = this.next.children.tail.formats();\n return thisHead.table === thisTail.table && thisHead.table === nextHead.table && thisHead.table === nextTail.table;\n }\n return false;\n }\n optimize(context) {\n super.optimize(context);\n this.children.forEach(child => {\n if (child.next == null) return;\n const childFormats = child.formats();\n const nextFormats = child.next.formats();\n if (childFormats.table !== nextFormats.table) {\n const next = this.splitAfter(child);\n if (next) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n next.optimize();\n }\n // We might be able to merge with prev now\n if (this.prev) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n this.prev.optimize();\n }\n }\n });\n }\n rowOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n table() {\n return this.parent && this.parent.parent;\n }\n}\nTableRow.blotName = 'table-row';\nTableRow.tagName = 'TR';\nclass TableBody extends _blots_container__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {}\nTableBody.blotName = 'table-body';\nTableBody.tagName = 'TBODY';\nclass TableContainer extends _blots_container__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n balanceCells() {\n const rows = this.descendants(TableRow);\n const maxColumns = rows.reduce((max, row) => {\n return Math.max(row.children.length, max);\n }, 0);\n rows.forEach(row => {\n new Array(maxColumns - row.children.length).fill(0).forEach(() => {\n let value;\n if (row.children.head != null) {\n value = TableCell.formats(row.children.head.domNode);\n }\n const blot = this.scroll.create(TableCell.blotName, value);\n row.appendChild(blot);\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n blot.optimize(); // Add break blot\n });\n });\n }\n\n cells(column) {\n return this.rows().map(row => row.children.at(column));\n }\n deleteColumn(index) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n body.children.forEach(row => {\n const cell = row.children.at(index);\n if (cell != null) {\n cell.remove();\n }\n });\n }\n insertColumn(index) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n body.children.forEach(row => {\n const ref = row.children.at(index);\n // @ts-expect-error\n const value = TableCell.formats(row.children.head.domNode);\n const cell = this.scroll.create(TableCell.blotName, value);\n row.insertBefore(cell, ref);\n });\n }\n insertRow(index) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody);\n if (body == null || body.children.head == null) return;\n const id = tableId();\n const row = this.scroll.create(TableRow.blotName);\n body.children.head.children.forEach(() => {\n const cell = this.scroll.create(TableCell.blotName, id);\n row.appendChild(cell);\n });\n const ref = body.children.at(index);\n body.insertBefore(row, ref);\n }\n rows() {\n const body = this.children.head;\n if (body == null) return [];\n return body.children.map(row => row);\n }\n}\nTableContainer.blotName = 'table-container';\nTableContainer.tagName = 'TABLE';\nTableContainer.allowedChildren = [TableBody];\nTableBody.requiredContainer = TableContainer;\nTableBody.allowedChildren = [TableRow];\nTableRow.requiredContainer = TableBody;\nTableRow.allowedChildren = [TableCell];\nTableCell.requiredContainer = TableRow;\nfunction tableId() {\n const id = Math.random().toString(36).slice(2, 6);\n return `row-${id}`;\n}\n\n\n//# sourceURL=webpack://Quill/./formats/table.js?"); + +/***/ }), + +/***/ "./formats/underline.js": +/*!******************************!*\ + !*** ./formats/underline.js ***! + \******************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blots_inline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/inline */ \"./blots/inline.js\");\n\nclass Underline extends _blots_inline__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Underline);\n\n//# sourceURL=webpack://Quill/./formats/underline.js?"); + +/***/ }), + +/***/ "./formats/video.js": +/*!**************************!*\ + !*** ./formats/video.js ***! + \**************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./link */ \"./formats/link.js\");\n\n\nconst ATTRIBUTES = ['height', 'width'];\nclass Video extends _blots_block__WEBPACK_IMPORTED_MODULE_0__.BlockEmbed {\n static create(value) {\n const node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', 'true');\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n static formats(domNode) {\n return ATTRIBUTES.reduce((formats, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n static sanitize(url) {\n return _link__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sanitize(url);\n }\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n html() {\n const {\n video\n } = this.value();\n return `${video}`;\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Video);\n\n//# sourceURL=webpack://Quill/./formats/video.js?"); + +/***/ }), + +/***/ "./modules/clipboard.js": +/*!******************************!*\ + !*** ./modules/clipboard.js ***! + \******************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Clipboard; },\n/* harmony export */ matchAttributor: function() { return /* binding */ matchAttributor; },\n/* harmony export */ matchBlot: function() { return /* binding */ matchBlot; },\n/* harmony export */ matchNewline: function() { return /* binding */ matchNewline; },\n/* harmony export */ matchText: function() { return /* binding */ matchText; },\n/* harmony export */ traverse: function() { return /* binding */ traverse; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n/* harmony import */ var _core_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/logger */ \"./core/logger.js\");\n/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/module */ \"./core/module.js\");\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n/* harmony import */ var _formats_align__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../formats/align */ \"./formats/align.js\");\n/* harmony import */ var _formats_background__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../formats/background */ \"./formats/background.js\");\n/* harmony import */ var _formats_code__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../formats/code */ \"./formats/code.js\");\n/* harmony import */ var _formats_color__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../formats/color */ \"./formats/color.js\");\n/* harmony import */ var _formats_direction__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../formats/direction */ \"./formats/direction.js\");\n/* harmony import */ var _formats_font__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../formats/font */ \"./formats/font.js\");\n/* harmony import */ var _formats_size__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../formats/size */ \"./formats/size.js\");\n/* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./keyboard */ \"./modules/keyboard.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst debug = (0,_core_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"])('quill:clipboard');\nconst CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['ol, ul', matchList], ['pre', matchCodeBlock], ['tr', matchTable], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['strike', matchAlias.bind(matchAlias, 'strike')], ['style', matchIgnore]];\nconst ATTRIBUTE_ATTRIBUTORS = [_formats_align__WEBPACK_IMPORTED_MODULE_6__.AlignAttribute, _formats_direction__WEBPACK_IMPORTED_MODULE_10__.DirectionAttribute].reduce((memo, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\nconst STYLE_ATTRIBUTORS = [_formats_align__WEBPACK_IMPORTED_MODULE_6__.AlignStyle, _formats_background__WEBPACK_IMPORTED_MODULE_7__.BackgroundStyle, _formats_color__WEBPACK_IMPORTED_MODULE_9__.ColorStyle, _formats_direction__WEBPACK_IMPORTED_MODULE_10__.DirectionStyle, _formats_font__WEBPACK_IMPORTED_MODULE_11__.FontStyle, _formats_size__WEBPACK_IMPORTED_MODULE_12__.SizeStyle].reduce((memo, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\nclass Clipboard extends _core_module__WEBPACK_IMPORTED_MODULE_4__[\"default\"] {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('copy', e => this.onCaptureCopy(e, false));\n this.quill.root.addEventListener('cut', e => this.onCaptureCopy(e, true));\n this.quill.root.addEventListener('paste', this.onCapturePaste.bind(this));\n this.matchers = [];\n // @ts-expect-error Fix me later\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(_ref => {\n let [selector, matcher] = _ref;\n this.addMatcher(selector, matcher);\n });\n }\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n convert(_ref2) {\n let {\n html,\n text\n } = _ref2;\n let formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (formats[_formats_code__WEBPACK_IMPORTED_MODULE_8__[\"default\"].blotName]) {\n return new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().insert(text || '', {\n [_formats_code__WEBPACK_IMPORTED_MODULE_8__[\"default\"].blotName]: formats[_formats_code__WEBPACK_IMPORTED_MODULE_8__[\"default\"].blotName]\n });\n }\n if (!html) {\n return new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().insert(text || '');\n }\n const delta = this.convertHTML(html);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && (delta.ops[delta.ops.length - 1].attributes == null || formats.table)) {\n return delta.compose(new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().retain(delta.length() - 1).delete(1));\n }\n return delta;\n }\n convertHTML(html) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n const container = doc.body;\n const nodeMatches = new WeakMap();\n const [elementMatchers, textMatchers] = this.prepareMatching(container, nodeMatches);\n return traverse(this.quill.scroll, container, elementMatchers, textMatchers, nodeMatches);\n }\n dangerouslyPasteHTML(index, html) {\n let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _core_quill__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.API;\n if (typeof index === 'string') {\n const delta = this.convert({\n html: index,\n text: ''\n });\n // @ts-expect-error\n this.quill.setContents(delta, html);\n this.quill.setSelection(0, _core_quill__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.SILENT);\n } else {\n const paste = this.convert({\n html,\n text: ''\n });\n this.quill.updateContents(new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), _core_quill__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.SILENT);\n }\n }\n onCaptureCopy(e) {\n let isCut = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var _a, _b;\n if (e.defaultPrevented) return;\n e.preventDefault();\n const [range] = this.quill.selection.getRange();\n if (range == null) return;\n const {\n html,\n text\n } = this.onCopy(range, isCut);\n (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.setData('text/plain', text);\n (_b = e.clipboardData) === null || _b === void 0 ? void 0 : _b.setData('text/html', html);\n if (isCut) {\n (0,_keyboard__WEBPACK_IMPORTED_MODULE_13__.deleteRange)({\n range,\n quill: this.quill\n });\n }\n }\n onCapturePaste(e) {\n var _a, _b, _c, _d;\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n e.preventDefault();\n const range = this.quill.getSelection(true);\n if (range == null) return;\n const html = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/html');\n const text = (_b = e.clipboardData) === null || _b === void 0 ? void 0 : _b.getData('text/plain');\n const files = Array.from(((_c = e.clipboardData) === null || _c === void 0 ? void 0 : _c.files) || []);\n if (!html && files.length > 0) {\n this.quill.uploader.upload(range, files);\n return;\n }\n if (html && files.length > 0) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n if (doc.body.childElementCount === 1 && ((_d = doc.body.firstElementChild) === null || _d === void 0 ? void 0 : _d.tagName) === 'IMG') {\n this.quill.uploader.upload(range, files);\n return;\n }\n }\n this.onPaste(range, {\n html,\n text\n });\n }\n onCopy(range) {\n const text = this.quill.getText(range);\n const html = this.quill.getSemanticHTML(range);\n return {\n html,\n text\n };\n }\n onPaste(range, _ref3) {\n let {\n text,\n html\n } = _ref3;\n const formats = this.quill.getFormat(range.index);\n const pastedDelta = this.convert({\n text,\n html\n }, formats);\n debug.log('onPaste', pastedDelta, {\n text,\n html\n });\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().retain(range.index).delete(range.length).concat(pastedDelta);\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(delta.length() - range.length, _core_quill__WEBPACK_IMPORTED_MODULE_5__[\"default\"].sources.SILENT);\n this.quill.scrollSelectionIntoView();\n }\n prepareMatching(container, nodeMatches) {\n const elementMatchers = [];\n const textMatchers = [];\n this.matchers.forEach(pair => {\n const [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n Array.from(container.querySelectorAll(selector)).forEach(node => {\n if (nodeMatches.has(node)) {\n const matches = nodeMatches.get(node);\n matches === null || matches === void 0 ? void 0 : matches.push(matcher);\n } else {\n nodeMatches.set(node, [matcher]);\n }\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: []\n};\nfunction applyFormat(delta, format, value) {\n if (typeof format === 'object') {\n return Object.keys(format).reduce((newDelta, key) => {\n return applyFormat(newDelta, key, format[key]);\n }, delta);\n }\n return delta.reduce((newDelta, op) => {\n if (op.attributes && op.attributes[format]) {\n return newDelta.push(op);\n }\n const formats = value ? {\n [format]: value\n } : {};\n // @ts-expect-error Fix me later\n return newDelta.insert(op.insert, Object.assign(Object.assign({}, formats), op.attributes));\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())());\n}\nfunction deltaEndsWith(delta, text) {\n let endText = '';\n for (let i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i // eslint-disable-line no-plusplus\n ) {\n const op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n return ['address', 'article', 'blockquote', 'canvas', 'dd', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'iframe', 'li', 'main', 'nav', 'ol', 'output', 'p', 'pre', 'section', 'table', 'td', 'tr', 'ul', 'video'].includes(node.tagName.toLowerCase());\n}\nconst preNodes = new WeakMap();\nfunction isPre(node) {\n if (node == null) return false;\n if (!preNodes.has(node)) {\n // @ts-expect-error\n if (node.tagName === 'PRE') {\n preNodes.set(node, true);\n } else {\n preNodes.set(node, isPre(node.parentNode));\n }\n }\n return preNodes.get(node);\n}\nfunction traverse(scroll, node, elementMatchers, textMatchers, nodeMatches) {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce((delta, matcher) => {\n return matcher(node, delta, scroll);\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())());\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n return Array.from(node.childNodes || []).reduce((delta, childNode) => {\n let childrenDelta = traverse(scroll, childNode, elementMatchers, textMatchers, nodeMatches);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n }, childrenDelta);\n childrenDelta = (nodeMatches.get(childNode) || []).reduce((reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())());\n }\n return new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())();\n}\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\nfunction matchAttributor(node, delta, scroll) {\n const attributes = parchment__WEBPACK_IMPORTED_MODULE_0__.Attributor.keys(node);\n const classes = parchment__WEBPACK_IMPORTED_MODULE_0__.ClassAttributor.keys(node);\n const styles = parchment__WEBPACK_IMPORTED_MODULE_0__.StyleAttributor.keys(node);\n const formats = {};\n attributes.concat(classes).concat(styles).forEach(name => {\n let attr = scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n return applyFormat(delta, formats);\n }\n return delta;\n}\nfunction matchBlot(node, delta, scroll) {\n const match = scroll.query(node);\n if (match == null) return delta;\n // @ts-expect-error\n if (match.prototype instanceof parchment__WEBPACK_IMPORTED_MODULE_0__.EmbedBlot) {\n const embed = {};\n // @ts-expect-error\n const value = match.value(node);\n if (value != null) {\n // @ts-expect-error\n embed[match.blotName] = value;\n // @ts-expect-error\n return new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().insert(embed, match.formats(node, scroll));\n }\n } else {\n // @ts-expect-error\n if (match.prototype instanceof parchment__WEBPACK_IMPORTED_MODULE_0__.BlockBlot && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n // @ts-expect-error\n if (typeof match.formats === 'function') {\n // @ts-expect-error\n return applyFormat(delta, match.blotName, match.formats(node, scroll));\n }\n }\n return delta;\n}\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\nfunction matchCodeBlock(node, delta, scroll) {\n const match = scroll.query('code-block');\n // @ts-expect-error\n const language = match ? match.formats(node, scroll) : true;\n return applyFormat(delta, 'code-block', language);\n}\nfunction matchIgnore() {\n return new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())();\n}\nfunction matchIndent(node, delta, scroll) {\n const match = scroll.query(node);\n if (match == null ||\n // @ts-expect-error\n match.blotName !== 'list' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n let indent = -1;\n let parent = node.parentNode;\n while (parent != null) {\n // @ts-expect-error\n if (['OL', 'UL'].includes(parent.tagName)) {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.reduce((composed, op) => {\n if (op.attributes && typeof op.attributes.indent === 'number') {\n return composed.push(op);\n }\n // @ts-expect-error Fix me later\n return composed.insert(op.insert, Object.assign({\n indent\n }, op.attributes || {}));\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())());\n}\nfunction matchList(node, delta) {\n // @ts-expect-error\n const list = node.tagName === 'OL' ? 'ordered' : 'bullet';\n return applyFormat(delta, 'list', list);\n}\nfunction matchNewline(node, delta, scroll) {\n if (!deltaEndsWith(delta, '\\n')) {\n // @ts-expect-error\n if (isLine(node)) {\n return delta.insert('\\n');\n }\n if (delta.length() > 0 && node.nextSibling) {\n let nextSibling = node.nextSibling;\n while (nextSibling != null) {\n // @ts-expect-error\n if (isLine(nextSibling)) {\n return delta.insert('\\n');\n }\n const match = scroll.query(nextSibling);\n // @ts-expect-error\n if (match && match.prototype instanceof _blots_block__WEBPACK_IMPORTED_MODULE_2__.BlockEmbed) {\n return delta.insert('\\n');\n }\n nextSibling = nextSibling.firstChild;\n }\n }\n }\n return delta;\n}\nfunction matchStyles(node, delta) {\n var _a;\n const formats = {};\n const style = node.style || {};\n if (style.fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.textDecoration === 'underline') {\n formats.underline = true;\n }\n if (style.textDecoration === 'line-through') {\n formats.strike = true;\n }\n if (((_a = style.fontWeight) === null || _a === void 0 ? void 0 : _a.startsWith('bold')) ||\n // @ts-expect-error Fix me later\n parseInt(style.fontWeight, 10) >= 700) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n // @ts-expect-error\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n return new (quill_delta__WEBPACK_IMPORTED_MODULE_1___default())().insert('\\t').concat(delta);\n }\n return delta;\n}\nfunction matchTable(node, delta) {\n var _a, _b;\n const table = ((_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) === 'TABLE' ? node.parentElement : (_b = node.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement;\n if (table != null) {\n const rows = Array.from(table.querySelectorAll('tr'));\n const row = rows.indexOf(node) + 1;\n return applyFormat(delta, 'table', row);\n }\n}\nfunction matchText(node, delta) {\n var _a;\n // @ts-expect-error\n let text = node.data;\n // Word represents empty line with  \n if (((_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) === 'O:P') {\n return delta.insert(text.trim());\n }\n if (!isPre(node)) {\n if (text.trim().length === 0 && text.includes('\\n')) {\n return delta;\n }\n const replacer = (collapse, match) => {\n const replaced = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return replaced.length < 1 && collapse ? ' ' : replaced;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (node.previousSibling == null && node.parentElement != null && isLine(node.parentElement) || node.previousSibling instanceof Element && isLine(node.previousSibling)) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (node.nextSibling == null && node.parentElement != null && isLine(node.parentElement) || node.nextSibling instanceof Element && isLine(node.nextSibling)) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\n\n//# sourceURL=webpack://Quill/./modules/clipboard.js?"); + +/***/ }), + +/***/ "./modules/history.js": +/*!****************************!*\ + !*** ./modules/history.js ***! + \****************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ History; },\n/* harmony export */ getLastChangeIndex: function() { return /* binding */ getLastChangeIndex; }\n/* harmony export */ });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/module */ \"./core/module.js\");\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n\n\n\nclass History extends _core_module__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.stack = {\n undo: [],\n redo: []\n };\n this.currentRange = null;\n this.quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.EDITOR_CHANGE, (eventName, value, oldValue, source) => {\n if (eventName === _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SELECTION_CHANGE) {\n if (value && source !== _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.SILENT) {\n this.currentRange = value;\n }\n } else if (eventName === _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.TEXT_CHANGE) {\n if (!this.ignoreChange) {\n if (!this.options.userOnly || source === _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER) {\n this.record(value, oldValue);\n } else {\n this.transform(value);\n }\n }\n this.currentRange = transformRange(this.currentRange, value);\n }\n });\n this.quill.keyboard.addBinding({\n key: 'z',\n shortKey: true\n }, this.undo.bind(this));\n this.quill.keyboard.addBinding({\n key: 'z',\n shortKey: true,\n shiftKey: true\n }, this.redo.bind(this));\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding({\n key: 'y',\n shortKey: true\n }, this.redo.bind(this));\n }\n this.quill.root.addEventListener('beforeinput', event => {\n if (event.inputType === 'historyUndo') {\n this.undo();\n event.preventDefault();\n } else if (event.inputType === 'historyRedo') {\n this.redo();\n event.preventDefault();\n }\n });\n }\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n const item = this.stack[source].pop();\n if (!item) return;\n const base = this.quill.getContents();\n const inverseDelta = item.delta.invert(base);\n this.stack[dest].push({\n delta: inverseDelta,\n range: transformRange(item.range, inverseDelta)\n });\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(item.delta, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n this.ignoreChange = false;\n this.restoreSelection(item);\n }\n clear() {\n this.stack = {\n undo: [],\n redo: []\n };\n }\n cutoff() {\n this.lastRecorded = 0;\n }\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n let undoRange = this.currentRange;\n const timestamp = Date.now();\n if (\n // @ts-expect-error Fix me later\n this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n const item = this.stack.undo.pop();\n if (item) {\n undoDelta = undoDelta.compose(item.delta);\n undoRange = item.range;\n }\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push({\n delta: undoDelta,\n range: undoRange\n });\n // @ts-expect-error Fix me later\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n redo() {\n this.change('redo', 'undo');\n }\n transform(delta) {\n transformStack(this.stack.undo, delta);\n transformStack(this.stack.redo, delta);\n }\n undo() {\n this.change('undo', 'redo');\n }\n restoreSelection(stackItem) {\n if (stackItem.range) {\n this.quill.setSelection(stackItem.range, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n } else {\n const index = getLastChangeIndex(this.quill.scroll, stackItem.delta);\n this.quill.setSelection(index, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n }\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\nfunction transformStack(stack, delta) {\n let remoteDelta = delta;\n for (let i = stack.length - 1; i >= 0; i -= 1) {\n const oldItem = stack[i];\n stack[i] = {\n delta: remoteDelta.transform(oldItem.delta, true),\n range: oldItem.range && transformRange(oldItem.range, remoteDelta)\n };\n remoteDelta = oldItem.delta.transform(remoteDelta);\n if (stack[i].delta.length() === 0) {\n stack.splice(i, 1);\n }\n }\n}\nfunction endsWithNewlineChange(scroll, delta) {\n const lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(attr => {\n return scroll.query(attr, parchment__WEBPACK_IMPORTED_MODULE_0__.Scope.BLOCK) != null;\n });\n }\n return false;\n}\nfunction getLastChangeIndex(scroll, delta) {\n const deleteLength = delta.reduce((length, op) => {\n return length + (op.delete || 0);\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(scroll, delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\nfunction transformRange(range, delta) {\n if (!range) return range;\n const start = delta.transformPosition(range.index);\n const end = delta.transformPosition(range.index + range.length);\n return {\n index: start,\n length: end - start\n };\n}\n\n\n//# sourceURL=webpack://Quill/./modules/history.js?"); + +/***/ }), + +/***/ "./modules/input.js": +/*!**************************!*\ + !*** ./modules/input.js ***! + \**************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/module */ \"./core/module.js\");\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n/* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./keyboard */ \"./modules/keyboard.js\");\n\n\n\n\nconst INSERT_TYPES = ['insertText', 'insertReplacementText'];\nclass Input extends _core_module__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(quill, options) {\n super(quill, options);\n quill.root.addEventListener('beforeinput', event => {\n this.handleBeforeInput(event);\n });\n // Gboard with English input on Android triggers `compositionstart` sometimes even\n // users are not going to type anything.\n if (!/Android/i.test(navigator.userAgent)) {\n quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.COMPOSITION_BEFORE_START, () => {\n this.handleCompositionStart();\n });\n }\n }\n deleteRange(range) {\n (0,_keyboard__WEBPACK_IMPORTED_MODULE_3__.deleteRange)({\n range,\n quill: this.quill\n });\n }\n replaceText(range) {\n let text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n if (range.length === 0) return false;\n if (text) {\n // Follow the native behavior that inherits the formats of the first character\n const formats = this.quill.getFormat(range.index, 1);\n this.deleteRange(range);\n this.quill.updateContents(new (quill_delta__WEBPACK_IMPORTED_MODULE_0___default())().retain(range.index).insert(text, formats), _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n } else {\n this.deleteRange(range);\n }\n this.quill.setSelection(range.index + text.length, 0, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.SILENT);\n return true;\n }\n handleBeforeInput(event) {\n if (this.quill.composition.isComposing || event.defaultPrevented || !INSERT_TYPES.includes(event.inputType)) {\n return;\n }\n const staticRange = event.getTargetRanges ? event.getTargetRanges()[0] : null;\n if (!staticRange || staticRange.collapsed === true) {\n return;\n }\n const text = getPlainTextFromInputEvent(event);\n if (text == null) {\n return;\n }\n const normalized = this.quill.selection.normalizeNative(staticRange);\n const range = normalized ? this.quill.selection.normalizedToRange(normalized) : null;\n if (range && this.replaceText(range, text)) {\n event.preventDefault();\n }\n }\n handleCompositionStart() {\n const range = this.quill.getSelection();\n if (range) {\n this.replaceText(range);\n }\n }\n}\nfunction getPlainTextFromInputEvent(event) {\n // When `inputType` is \"insertText\":\n // - `event.data` should be string (Safari uses `event.dataTransfer`).\n // - `event.dataTransfer` should be null.\n // When `inputType` is \"insertReplacementText\":\n // - `event.data` should be null.\n // - `event.dataTransfer` should contain \"text/plain\" data.\n var _a;\n if (typeof event.data === 'string') {\n return event.data;\n }\n if ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types.includes('text/plain')) {\n return event.dataTransfer.getData('text/plain');\n }\n return null;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Input);\n\n//# sourceURL=webpack://Quill/./modules/input.js?"); + +/***/ }), + +/***/ "./modules/keyboard.js": +/*!*****************************!*\ + !*** ./modules/keyboard.js ***! + \*****************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SHORTKEY: function() { return /* binding */ SHORTKEY; },\n/* harmony export */ \"default\": function() { return /* binding */ Keyboard; },\n/* harmony export */ deleteRange: function() { return /* binding */ deleteRange; },\n/* harmony export */ normalize: function() { return /* binding */ normalize; }\n/* harmony export */ });\n/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.clonedeep */ \"./node_modules/lodash.clonedeep/index.js\");\n/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.isequal */ \"./node_modules/lodash.isequal/index.js\");\n/* harmony import */ var lodash_isequal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isequal__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n/* harmony import */ var _core_logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/logger */ \"./core/logger.js\");\n/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/module */ \"./core/module.js\");\n\n\n\n\n\n\n\nconst debug = (0,_core_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('quill:keyboard');\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\nclass Keyboard extends _core_module__WEBPACK_IMPORTED_MODULE_6__[\"default\"] {\n static match(evt, binding) {\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(key => {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })) {\n return false;\n }\n return binding.key === evt.key || binding.key === evt.which;\n }\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n // @ts-expect-error Fix me later\n Object.keys(this.options.bindings).forEach(name => {\n // @ts-expect-error Fix me later\n if (this.options.bindings[name]) {\n // @ts-expect-error Fix me later\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({\n key: 'Enter',\n shiftKey: null\n }, this.handleEnter);\n this.addBinding({\n key: 'Enter',\n metaKey: null,\n ctrlKey: null,\n altKey: null\n }, () => {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding({\n key: 'Backspace'\n }, {\n collapsed: true\n }, this.handleBackspace);\n this.addBinding({\n key: 'Delete'\n }, {\n collapsed: true\n }, this.handleDelete);\n } else {\n this.addBinding({\n key: 'Backspace'\n }, {\n collapsed: true,\n prefix: /^.?$/\n }, this.handleBackspace);\n this.addBinding({\n key: 'Delete'\n }, {\n collapsed: true,\n suffix: /^.?$/\n }, this.handleDelete);\n }\n this.addBinding({\n key: 'Backspace'\n }, {\n collapsed: false\n }, this.handleDeleteRange);\n this.addBinding({\n key: 'Delete'\n }, {\n collapsed: false\n }, this.handleDeleteRange);\n this.addBinding({\n key: 'Backspace',\n altKey: null,\n ctrlKey: null,\n metaKey: null,\n shiftKey: null\n }, {\n collapsed: true,\n offset: 0\n }, this.handleBackspace);\n this.listen();\n }\n addBinding(keyBinding) {\n let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const binding = normalize(keyBinding);\n if (binding == null) {\n debug.warn('Attempted to add invalid keyboard binding', binding);\n return;\n }\n if (typeof context === 'function') {\n context = {\n handler: context\n };\n }\n if (typeof handler === 'function') {\n handler = {\n handler\n };\n }\n const keys = Array.isArray(binding.key) ? binding.key : [binding.key];\n keys.forEach(key => {\n const singleBinding = Object.assign(Object.assign(Object.assign(Object.assign({}, binding), {\n key\n }), context), handler);\n this.bindings[singleBinding.key] = this.bindings[singleBinding.key] || [];\n this.bindings[singleBinding.key].push(singleBinding);\n });\n }\n listen() {\n this.quill.root.addEventListener('keydown', evt => {\n if (evt.defaultPrevented || evt.isComposing) return;\n const bindings = (this.bindings[evt.key] || []).concat(this.bindings[evt.which] || []);\n const matches = bindings.filter(binding => Keyboard.match(evt, binding));\n if (matches.length === 0) return;\n // @ts-expect-error\n const blot = _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].find(evt.target, true);\n if (blot && blot.scroll !== this.quill.scroll) return;\n const range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n const [line, offset] = this.quill.getLine(range.index);\n const [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n const [leafEnd, offsetEnd] = range.length === 0 ? [leafStart, offsetStart] : this.quill.getLeaf(range.index + range.length);\n const prefixText = leafStart instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.TextBlot ? leafStart.value().slice(0, offsetStart) : '';\n const suffixText = leafEnd instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.TextBlot ? leafEnd.value().slice(offsetEnd) : '';\n const curContext = {\n collapsed: range.length === 0,\n // @ts-expect-error Fix me later\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n line,\n offset,\n prefix: prefixText,\n suffix: suffixText,\n event: evt\n };\n const prevented = matches.some(binding => {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) {\n return false;\n }\n if (binding.empty != null && binding.empty !== curContext.empty) {\n return false;\n }\n if (binding.offset != null && binding.offset !== curContext.offset) {\n return false;\n }\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(name => curContext.format[name] == null)) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(name => {\n // @ts-expect-error Fix me later\n if (binding.format[name] === true) return curContext.format[name] != null;\n // @ts-expect-error Fix me later\n if (binding.format[name] === false) return curContext.format[name] == null;\n // @ts-expect-error Fix me later\n return lodash_isequal__WEBPACK_IMPORTED_MODULE_1___default()(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) {\n return false;\n }\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) {\n return false;\n }\n // @ts-expect-error Fix me later\n return binding.handler.call(this, range, curContext, binding) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n handleBackspace(range, context) {\n // Check for astral symbols\n const length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(range.index - length).delete(length);\n if (context.offset === 0) {\n // Always deleting newline here, length always 1\n const [prev] = this.quill.getLine(range.index - 1);\n if (prev) {\n const isPrevLineEmpty = prev.statics.blotName === 'block' && prev.length() <= 1;\n if (!isPrevLineEmpty) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = quill_delta__WEBPACK_IMPORTED_MODULE_2__.AttributeMap.diff(curFormats, prevFormats) || {};\n if (Object.keys(formats).length > 0) {\n // line.length() - 1 targets \\n in line, another -1 for newline being deleted\n const formatDelta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - 2).retain(1, formats);\n delta = delta.compose(formatDelta);\n }\n }\n }\n }\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.focus();\n }\n handleDelete(range, context) {\n // Check for astral symbols\n const length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(range.index).delete(length);\n // @ts-expect-error Fix me later\n if (context.offset >= line.length() - 1) {\n const [next] = this.quill.getLine(range.index + 1);\n if (next) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const nextFormats = this.quill.getFormat(range.index, 1);\n formats = quill_delta__WEBPACK_IMPORTED_MODULE_2__.AttributeMap.diff(curFormats, nextFormats) || {};\n if (Object.keys(formats).length > 0) {\n delta = delta.retain(next.length() - 1).retain(1, formats);\n }\n }\n }\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.focus();\n }\n handleDeleteRange(range) {\n deleteRange({\n range,\n quill: this.quill\n });\n this.quill.focus();\n }\n handleEnter(range, context) {\n const lineFormats = Object.keys(context.format).reduce((formats, format) => {\n if (this.quill.scroll.query(format, parchment__WEBPACK_IMPORTED_MODULE_3__.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n formats[format] = context.format[format];\n }\n return formats;\n }, {});\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(range.index).delete(range.length).insert('\\n', lineFormats);\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.setSelection(range.index + 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n this.quill.focus();\n }\n}\nconst defaultOptions = {\n bindings: {\n bold: makeFormatHandler('bold'),\n italic: makeFormatHandler('italic'),\n underline: makeFormatHandler('underline'),\n indent: {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: 'Tab',\n format: ['blockquote', 'indent', 'list'],\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n return false;\n }\n },\n outdent: {\n key: 'Tab',\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n return false;\n }\n },\n 'outdent backspace': {\n key: 'Backspace',\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: 'Tab',\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler(range) {\n this.quill.deleteText(range.index - 1, 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n },\n tab: {\n key: 'Tab',\n handler(range, context) {\n if (context.format.table) return true;\n this.quill.history.cutoff();\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(range.index).delete(range.length).insert('\\t');\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return false;\n }\n },\n 'blockquote empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['blockquote'],\n empty: true,\n handler() {\n this.quill.format('blockquote', false, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n },\n 'list empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['list'],\n empty: true,\n handler(range, context) {\n const formats = {\n list: false\n };\n if (context.format.indent) {\n formats.indent = false;\n }\n this.quill.formatLine(range.index, range.length, formats, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n },\n 'checklist enter': {\n key: 'Enter',\n collapsed: true,\n format: {\n list: 'checked'\n },\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const formats = Object.assign(Object.assign({}, line.formats()), {\n list: 'checked'\n });\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(range.index).insert('\\n', formats)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1).retain(1, {\n list: 'unchecked'\n });\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.setSelection(range.index + 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n this.quill.scrollSelectionIntoView();\n }\n },\n 'header enter': {\n key: 'Enter',\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler(range, context) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(range.index).insert('\\n', context.format)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1).retain(1, {\n header: null\n });\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.setSelection(range.index + 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n this.quill.scrollSelectionIntoView();\n }\n },\n 'table backspace': {\n key: 'Backspace',\n format: ['table'],\n collapsed: true,\n offset: 0,\n handler() {}\n },\n 'table delete': {\n key: 'Delete',\n format: ['table'],\n collapsed: true,\n suffix: /^$/,\n handler() {}\n },\n 'table enter': {\n key: 'Enter',\n shiftKey: null,\n format: ['table'],\n handler(range) {\n const module = this.quill.getModule('table');\n if (module) {\n // @ts-expect-error\n const [table, row, cell, offset] = module.getTable(range);\n const shift = tableSide(table, row, cell, offset);\n if (shift == null) return;\n let index = table.offset();\n if (shift < 0) {\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(index).insert('\\n');\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.setSelection(range.index + 1, range.length, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n } else if (shift > 0) {\n index += table.length();\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(index).insert('\\n');\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.setSelection(index, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n }\n }\n },\n 'table tab': {\n key: 'Tab',\n shiftKey: null,\n format: ['table'],\n handler(range, context) {\n const {\n event,\n line: cell\n } = context;\n const offset = cell.offset(this.quill.scroll);\n if (event.shiftKey) {\n this.quill.setSelection(offset - 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n } else {\n this.quill.setSelection(offset + cell.length(), _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n }\n },\n 'list autofill': {\n key: ' ',\n shiftKey: null,\n collapsed: true,\n format: {\n 'code-block': false,\n blockquote: false,\n table: false\n },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler(range, context) {\n if (this.quill.scroll.query('list') == null) return true;\n const {\n length\n } = context.prefix;\n const [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]':\n case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':\n case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.history.cutoff();\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())().retain(range.index - offset).delete(length + 1)\n // @ts-expect-error Fix me later\n .retain(line.length() - 2 - offset).retain(1, {\n list: value\n });\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return false;\n }\n },\n 'code exit': {\n key: 'Enter',\n collapsed: true,\n format: ['code-block'],\n prefix: /^$/,\n suffix: /^\\s*$/,\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n let numLines = 2;\n let cur = line;\n while (cur != null && cur.length() <= 1 && cur.formats()['code-block']) {\n // @ts-expect-error\n cur = cur.prev;\n numLines -= 1;\n // Requisite prev lines are empty\n if (numLines <= 0) {\n const delta = new (quill_delta__WEBPACK_IMPORTED_MODULE_2___default())()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - offset - 2).retain(1, {\n 'code-block': null\n }).delete(1);\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.setSelection(range.index - 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return false;\n }\n }\n return true;\n }\n },\n 'embed left': makeEmbedArrowHandler('ArrowLeft', false),\n 'embed left shift': makeEmbedArrowHandler('ArrowLeft', true),\n 'embed right': makeEmbedArrowHandler('ArrowRight', false),\n 'embed right shift': makeEmbedArrowHandler('ArrowRight', true),\n 'table down': makeTableArrowHandler(false),\n 'table up': makeTableArrowHandler(true)\n }\n};\nKeyboard.DEFAULTS = defaultOptions;\nfunction makeCodeBlockHandler(indent) {\n return {\n key: 'Tab',\n shiftKey: !indent,\n format: {\n 'code-block': true\n },\n handler(range, _ref) {\n let {\n event\n } = _ref;\n const CodeBlock = this.quill.scroll.query('code-block');\n // @ts-expect-error\n const {\n TAB\n } = CodeBlock;\n if (range.length === 0 && !event.shiftKey) {\n this.quill.insertText(range.index, TAB, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.setSelection(range.index + TAB.length, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n return;\n }\n const lines = range.length === 0 ? this.quill.getLines(range.index, 1) : this.quill.getLines(range);\n let {\n index,\n length\n } = range;\n lines.forEach((line, i) => {\n if (indent) {\n line.insertAt(0, TAB);\n if (i === 0) {\n index += TAB.length;\n } else {\n length += TAB.length;\n }\n // @ts-expect-error Fix me later\n } else if (line.domNode.textContent.startsWith(TAB)) {\n line.deleteAt(0, TAB.length);\n if (i === 0) {\n index -= TAB.length;\n } else {\n length -= TAB.length;\n }\n }\n });\n this.quill.update(_core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n this.quill.setSelection(index, length, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n }\n };\n}\nfunction makeEmbedArrowHandler(key, shiftKey) {\n const where = key === 'ArrowLeft' ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler(range) {\n let {\n index\n } = range;\n if (key === 'ArrowRight') {\n index += range.length + 1;\n }\n const [leaf] = this.quill.getLeaf(index);\n if (!(leaf instanceof parchment__WEBPACK_IMPORTED_MODULE_3__.EmbedBlot)) return true;\n if (key === 'ArrowLeft') {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n } else if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n return false;\n }\n };\n}\nfunction makeFormatHandler(format) {\n return {\n key: format[0],\n shortKey: true,\n handler(range, context) {\n this.quill.format(format, !context.format[format], _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n };\n}\nfunction makeTableArrowHandler(up) {\n return {\n key: up ? 'ArrowUp' : 'ArrowDown',\n collapsed: true,\n format: ['table'],\n handler(range, context) {\n // TODO move to table module\n const key = up ? 'prev' : 'next';\n const cell = context.line;\n const targetRow = cell.parent[key];\n if (targetRow != null) {\n if (targetRow.statics.blotName === 'table-row') {\n // @ts-expect-error\n let targetCell = targetRow.children.head;\n let cur = cell;\n while (cur.prev != null) {\n // @ts-expect-error\n cur = cur.prev;\n targetCell = targetCell.next;\n }\n const index = targetCell.offset(this.quill.scroll) + Math.min(context.offset, targetCell.length() - 1);\n this.quill.setSelection(index, 0, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n } else {\n // @ts-expect-error\n const targetLine = cell.table()[key];\n if (targetLine != null) {\n if (up) {\n this.quill.setSelection(targetLine.offset(this.quill.scroll) + targetLine.length() - 1, 0, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n } else {\n this.quill.setSelection(targetLine.offset(this.quill.scroll), 0, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n }\n }\n return false;\n }\n };\n}\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n binding = {\n key: binding\n };\n } else if (typeof binding === 'object') {\n binding = lodash_clonedeep__WEBPACK_IMPORTED_MODULE_0___default()(binding);\n } else {\n return null;\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n// TODO: Move into quill.ts or editor.ts\nfunction deleteRange(_ref2) {\n let {\n quill,\n range\n } = _ref2;\n const lines = quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n const firstFormats = lines[0].formats();\n const lastFormats = lines[lines.length - 1].formats();\n formats = quill_delta__WEBPACK_IMPORTED_MODULE_2__.AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n quill.deleteText(range, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n if (Object.keys(formats).length > 0) {\n quill.formatLine(range.index, 1, formats, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.USER);\n }\n quill.setSelection(range.index, _core_quill__WEBPACK_IMPORTED_MODULE_4__[\"default\"].sources.SILENT);\n}\nfunction tableSide(_table, row, cell, offset) {\n if (row.prev == null && row.next == null) {\n if (cell.prev == null && cell.next == null) {\n return offset === 0 ? -1 : 1;\n }\n return cell.prev == null ? -1 : 1;\n }\n if (row.prev == null) {\n return -1;\n }\n if (row.next == null) {\n return 1;\n }\n return null;\n}\n\n\n//# sourceURL=webpack://Quill/./modules/keyboard.js?"); + +/***/ }), + +/***/ "./modules/syntax.js": +/*!***************************!*\ + !*** ./modules/syntax.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CodeBlock: function() { return /* binding */ SyntaxCodeBlock; },\n/* harmony export */ CodeToken: function() { return /* binding */ CodeToken; },\n/* harmony export */ \"default\": function() { return /* binding */ Syntax; }\n/* harmony export */ });\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _blots_inline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../blots/inline */ \"./blots/inline.js\");\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/module */ \"./core/module.js\");\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n/* harmony import */ var _blots_break__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../blots/break */ \"./blots/break.js\");\n/* harmony import */ var _blots_cursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../blots/cursor */ \"./blots/cursor.js\");\n/* harmony import */ var _blots_text__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../blots/text */ \"./blots/text.js\");\n/* harmony import */ var _formats_code__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../formats/code */ \"./formats/code.js\");\n/* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./clipboard */ \"./modules/clipboard.js\");\n\n\n\n\n\n\n\n\n\n\n\nconst TokenAttributor = new parchment__WEBPACK_IMPORTED_MODULE_1__.ClassAttributor('code-token', 'hljs', {\n scope: parchment__WEBPACK_IMPORTED_MODULE_1__.Scope.INLINE\n});\nclass CodeToken extends _blots_inline__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n static formats(node, scroll) {\n while (node != null && node !== scroll.domNode) {\n if (node.classList && node.classList.contains(_formats_code__WEBPACK_IMPORTED_MODULE_9__[\"default\"].className)) {\n // @ts-expect-error\n return super.formats(node, scroll);\n }\n // @ts-expect-error\n node = node.parentNode;\n }\n return undefined;\n }\n constructor(scroll, domNode, value) {\n // @ts-expect-error\n super(scroll, domNode, value);\n // @ts-expect-error\n TokenAttributor.add(this.domNode, value);\n }\n format(format, value) {\n if (format !== CodeToken.blotName) {\n super.format(format, value);\n } else if (value) {\n // @ts-expect-error\n TokenAttributor.add(this.domNode, value);\n } else {\n TokenAttributor.remove(this.domNode);\n this.domNode.classList.remove(this.statics.className);\n }\n }\n optimize() {\n // @ts-expect-error\n super.optimize(...arguments);\n if (!TokenAttributor.value(this.domNode)) {\n this.unwrap();\n }\n }\n}\nCodeToken.blotName = 'code-token';\nCodeToken.className = 'ql-token';\nclass SyntaxCodeBlock extends _formats_code__WEBPACK_IMPORTED_MODULE_9__[\"default\"] {\n static create(value) {\n const domNode = super.create(value);\n if (typeof value === 'string') {\n // @ts-expect-error\n domNode.setAttribute('data-language', value);\n }\n return domNode;\n }\n static formats(domNode) {\n // @ts-expect-error\n return domNode.getAttribute('data-language') || 'plain';\n }\n static register() {} // Syntax module will register\n format(name, value) {\n if (name === this.statics.blotName && value) {\n // @ts-expect-error\n this.domNode.setAttribute('data-language', value);\n } else {\n super.format(name, value);\n }\n }\n replaceWith(name, value) {\n this.formatAt(0, this.length(), CodeToken.blotName, false);\n return super.replaceWith(name, value);\n }\n}\nclass SyntaxCodeBlockContainer extends _formats_code__WEBPACK_IMPORTED_MODULE_9__.CodeBlockContainer {\n attach() {\n super.attach();\n this.forceNext = false;\n // @ts-expect-error\n this.scroll.emitMount(this);\n }\n format(name, value) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n this.children.forEach(child => {\n // @ts-expect-error\n child.format(name, value);\n });\n }\n }\n formatAt(index, length, name, value) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n }\n super.formatAt(index, length, name, value);\n }\n highlight(highlight) {\n let forced = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (this.children.head == null) return;\n const nodes = Array.from(this.domNode.childNodes).filter(node => node !== this.uiNode);\n const text = `${nodes.map(node => node.textContent).join('\\n')}\\n`;\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (forced || this.forceNext || this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n const oldDelta = this.children.reduce((delta, child) => {\n // @ts-expect-error\n return delta.concat((0,_blots_block__WEBPACK_IMPORTED_MODULE_5__.blockDelta)(child, false));\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_0___default())());\n const delta = highlight(text, language);\n oldDelta.diff(delta).reduce((index, _ref) => {\n let {\n retain,\n attributes\n } = _ref;\n // Should be all retains\n if (!retain) return index;\n if (attributes) {\n Object.keys(attributes).forEach(format => {\n if ([SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)) {\n // @ts-expect-error\n this.formatAt(index, retain, format, attributes[format]);\n }\n });\n }\n // @ts-expect-error\n return index + retain;\n }, 0);\n }\n this.cachedText = text;\n this.forceNext = false;\n }\n }\n html(index, length) {\n const [codeBlock] = this.children.find(index);\n const language = codeBlock ? SyntaxCodeBlock.formats(codeBlock.domNode) : 'plain';\n return `
    \\n${(0,_blots_text__WEBPACK_IMPORTED_MODULE_8__.escapeText)(this.code(index, length))}\\n
    `;\n }\n optimize(context) {\n super.optimize(context);\n if (this.parent != null && this.children.head != null && this.uiNode != null) {\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n // @ts-expect-error\n if (language !== this.uiNode.value) {\n // @ts-expect-error\n this.uiNode.value = language;\n }\n }\n }\n}\n// @ts-expect-error\nSyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];\nSyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;\nSyntaxCodeBlock.allowedChildren = [CodeToken, _blots_cursor__WEBPACK_IMPORTED_MODULE_7__[\"default\"], _blots_text__WEBPACK_IMPORTED_MODULE_8__[\"default\"], _blots_break__WEBPACK_IMPORTED_MODULE_6__[\"default\"]];\nclass Syntax extends _core_module__WEBPACK_IMPORTED_MODULE_4__[\"default\"] {\n static register() {\n _core_quill__WEBPACK_IMPORTED_MODULE_3__[\"default\"].register(CodeToken, true);\n // @ts-expect-error\n _core_quill__WEBPACK_IMPORTED_MODULE_3__[\"default\"].register(SyntaxCodeBlock, true);\n _core_quill__WEBPACK_IMPORTED_MODULE_3__[\"default\"].register(SyntaxCodeBlockContainer, true);\n }\n constructor(quill, options) {\n super(quill, options);\n // @ts-expect-error\n if (this.options.hljs == null) {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n // @ts-expect-error Fix me later\n this.languages = this.options.languages.reduce((memo, _ref2) => {\n let {\n key\n } = _ref2;\n memo[key] = true;\n return memo;\n }, {});\n this.highlightBlot = this.highlightBlot.bind(this);\n this.initListener();\n this.initTimer();\n }\n initListener() {\n this.quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.SCROLL_BLOT_MOUNT, blot => {\n if (!(blot instanceof SyntaxCodeBlockContainer)) return;\n const select = this.quill.root.ownerDocument.createElement('select');\n // @ts-expect-error Fix me later\n this.options.languages.forEach(_ref3 => {\n let {\n key,\n label\n } = _ref3;\n const option = select.ownerDocument.createElement('option');\n option.textContent = label;\n option.setAttribute('value', key);\n select.appendChild(option);\n });\n select.addEventListener('change', () => {\n blot.format(SyntaxCodeBlock.blotName, select.value);\n this.quill.root.focus(); // Prevent scrolling\n this.highlight(blot, true);\n });\n if (blot.uiNode == null) {\n blot.attachUI(select);\n if (blot.children.head) {\n select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);\n }\n }\n });\n }\n initTimer() {\n let timer = null;\n this.quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_3__[\"default\"].events.SCROLL_OPTIMIZE, () => {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n }\n highlight() {\n let blot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (this.quill.selection.composing) return;\n this.quill.update(_core_quill__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.USER);\n const range = this.quill.getSelection();\n const blots = blot == null ? this.quill.scroll.descendants(SyntaxCodeBlockContainer) : [blot];\n blots.forEach(container => {\n container.highlight(this.highlightBlot, force);\n });\n this.quill.update(_core_quill__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, _core_quill__WEBPACK_IMPORTED_MODULE_3__[\"default\"].sources.SILENT);\n }\n }\n highlightBlot(text) {\n let language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'plain';\n language = this.languages[language] ? language : 'plain';\n if (language === 'plain') {\n return (0,_blots_text__WEBPACK_IMPORTED_MODULE_8__.escapeText)(text).split('\\n').reduce((delta, line, i) => {\n if (i !== 0) {\n delta.insert('\\n', {\n [_formats_code__WEBPACK_IMPORTED_MODULE_9__[\"default\"].blotName]: language\n });\n }\n return delta.insert(line);\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_0___default())());\n }\n const container = this.quill.root.ownerDocument.createElement('div');\n container.classList.add(_formats_code__WEBPACK_IMPORTED_MODULE_9__[\"default\"].className);\n // @ts-expect-error\n container.innerHTML = this.options.hljs.highlight(language, text).value;\n return (0,_clipboard__WEBPACK_IMPORTED_MODULE_10__.traverse)(this.quill.scroll, container, [(node, delta) => {\n // @ts-expect-error\n const value = TokenAttributor.value(node);\n if (value) {\n return delta.compose(new (quill_delta__WEBPACK_IMPORTED_MODULE_0___default())().retain(delta.length(), {\n [CodeToken.blotName]: value\n }));\n }\n return delta;\n }], [(node, delta) => {\n // @ts-expect-error\n return node.data.split('\\n').reduce((memo, nodeText, i) => {\n if (i !== 0) memo.insert('\\n', {\n [_formats_code__WEBPACK_IMPORTED_MODULE_9__[\"default\"].blotName]: language\n });\n return memo.insert(nodeText);\n }, delta);\n }], new WeakMap());\n }\n}\nSyntax.DEFAULTS = {\n hljs: (() => {\n // @ts-expect-error\n return window.hljs;\n })(),\n interval: 1000,\n languages: [{\n key: 'plain',\n label: 'Plain'\n }, {\n key: 'bash',\n label: 'Bash'\n }, {\n key: 'cpp',\n label: 'C++'\n }, {\n key: 'cs',\n label: 'C#'\n }, {\n key: 'css',\n label: 'CSS'\n }, {\n key: 'diff',\n label: 'Diff'\n }, {\n key: 'xml',\n label: 'HTML/XML'\n }, {\n key: 'java',\n label: 'Java'\n }, {\n key: 'javascript',\n label: 'Javascript'\n }, {\n key: 'markdown',\n label: 'Markdown'\n }, {\n key: 'php',\n label: 'PHP'\n }, {\n key: 'python',\n label: 'Python'\n }, {\n key: 'ruby',\n label: 'Ruby'\n }, {\n key: 'sql',\n label: 'SQL'\n }]\n};\n\n\n//# sourceURL=webpack://Quill/./modules/syntax.js?"); + +/***/ }), + +/***/ "./modules/table.js": +/*!**************************!*\ + !*** ./modules/table.js ***! + \**************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/module */ \"./core/module.js\");\n/* harmony import */ var _formats_table__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../formats/table */ \"./formats/table.js\");\n\n\n\n\nclass Table extends _core_module__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n static register() {\n _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].register(_formats_table__WEBPACK_IMPORTED_MODULE_3__.TableCell);\n _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].register(_formats_table__WEBPACK_IMPORTED_MODULE_3__.TableRow);\n _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].register(_formats_table__WEBPACK_IMPORTED_MODULE_3__.TableBody);\n _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].register(_formats_table__WEBPACK_IMPORTED_MODULE_3__.TableContainer);\n }\n constructor() {\n super(...arguments);\n this.listenBalanceCells();\n }\n balanceTables() {\n this.quill.scroll.descendants(_formats_table__WEBPACK_IMPORTED_MODULE_3__.TableContainer).forEach(table => {\n table.balanceCells();\n });\n }\n deleteColumn() {\n const [table,, cell] = this.getTable();\n if (cell == null) return;\n // @ts-expect-error\n table.deleteColumn(cell.cellOffset());\n this.quill.update(_core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n }\n deleteRow() {\n const [, row] = this.getTable();\n if (row == null) return;\n row.remove();\n this.quill.update(_core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n }\n deleteTable() {\n const [table] = this.getTable();\n if (table == null) return;\n // @ts-expect-error\n const offset = table.offset();\n // @ts-expect-error\n table.remove();\n this.quill.update(_core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n this.quill.setSelection(offset, _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.SILENT);\n }\n getTable() {\n let range = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.quill.getSelection();\n if (range == null) return [null, null, null, -1];\n const [cell, offset] = this.quill.getLine(range.index);\n if (cell == null || cell.statics.blotName !== _formats_table__WEBPACK_IMPORTED_MODULE_3__.TableCell.blotName) {\n return [null, null, null, -1];\n }\n const row = cell.parent;\n const table = row.parent.parent;\n // @ts-expect-error\n return [table, row, cell, offset];\n }\n insertColumn(offset) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const column = cell.cellOffset();\n table.insertColumn(column + offset);\n this.quill.update(_core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n let shift = row.rowOffset();\n if (offset === 0) {\n shift += 1;\n }\n this.quill.setSelection(range.index + shift, range.length, _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.SILENT);\n }\n insertColumnLeft() {\n this.insertColumn(0);\n }\n insertColumnRight() {\n this.insertColumn(1);\n }\n insertRow(offset) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const index = row.rowOffset();\n table.insertRow(index + offset);\n this.quill.update(_core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n if (offset > 0) {\n this.quill.setSelection(range, _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.SILENT);\n } else {\n this.quill.setSelection(range.index + row.children.length, range.length, _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.SILENT);\n }\n }\n insertRowAbove() {\n this.insertRow(0);\n }\n insertRowBelow() {\n this.insertRow(1);\n }\n insertTable(rows, columns) {\n const range = this.quill.getSelection();\n if (range == null) return;\n const delta = new Array(rows).fill(0).reduce(memo => {\n const text = new Array(columns).fill('\\n').join('');\n return memo.insert(text, {\n table: (0,_formats_table__WEBPACK_IMPORTED_MODULE_3__.tableId)()\n });\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_0___default())().retain(range.index));\n this.quill.updateContents(delta, _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n this.quill.setSelection(range.index, _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.SILENT);\n this.balanceTables();\n }\n listenBalanceCells() {\n this.quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SCROLL_OPTIMIZE, mutations => {\n mutations.some(mutation => {\n if (['TD', 'TR', 'TBODY', 'TABLE'].includes(mutation.target.tagName)) {\n this.quill.once(_core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.TEXT_CHANGE, (delta, old, source) => {\n if (source !== _core_quill__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER) return;\n this.balanceTables();\n });\n return true;\n }\n return false;\n });\n });\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Table);\n\n//# sourceURL=webpack://Quill/./modules/table.js?"); + +/***/ }), + +/***/ "./modules/toolbar.js": +/*!****************************!*\ + !*** ./modules/toolbar.js ***! + \****************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addControls: function() { return /* binding */ addControls; },\n/* harmony export */ \"default\": function() { return /* binding */ Toolbar; }\n/* harmony export */ });\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/dist/parchment.mjs\");\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/quill */ \"./core/quill.js\");\n/* harmony import */ var _core_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/logger */ \"./core/logger.js\");\n/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/module */ \"./core/module.js\");\n\n\n\n\n\nconst debug = (0,_core_logger__WEBPACK_IMPORTED_MODULE_3__[\"default\"])('quill:toolbar');\nclass Toolbar extends _core_module__WEBPACK_IMPORTED_MODULE_4__[\"default\"] {\n constructor(quill, options) {\n var _a, _b;\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n const container = document.createElement('div');\n container.setAttribute('role', 'toolbar');\n addControls(container, this.options.container);\n (_b = (_a = quill.container) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n debug.error('Container required for toolbar', this.options);\n return;\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n if (this.options.handlers) {\n Object.keys(this.options.handlers).forEach(format => {\n var _a;\n const handler = (_a = this.options.handlers) === null || _a === void 0 ? void 0 : _a[format];\n if (handler) {\n this.addHandler(format, handler);\n }\n });\n }\n Array.from(this.container.querySelectorAll('button, select')).forEach(input => {\n // @ts-expect-error\n this.attach(input);\n });\n this.quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.EDITOR_CHANGE, (type, range) => {\n if (type === _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].events.SCROLL_OPTIMIZE, () => {\n const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n attach(input) {\n let format = Array.from(input.classList).find(className => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null && this.quill.scroll.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, e => {\n let value;\n if (input.tagName === 'SELECT') {\n // @ts-expect-error\n if (input.selectedIndex < 0) return;\n // @ts-expect-error\n const selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n // @ts-expect-error\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n const [range] = this.quill.selection.getRange();\n // @ts-expect-error Fix me later\n if (this.handlers[format] != null) {\n // @ts-expect-error Fix me later\n this.handlers[format].call(this, value);\n } else if (\n // @ts-expect-error\n this.quill.scroll.query(format).prototype instanceof parchment__WEBPACK_IMPORTED_MODULE_1__.EmbedBlot) {\n value = prompt(`Enter ${format}`); // eslint-disable-line no-alert\n if (!value) return;\n this.quill.updateContents(new (quill_delta__WEBPACK_IMPORTED_MODULE_0___default())()\n // @ts-expect-error Fix me later\n .retain(range.index)\n // @ts-expect-error Fix me later\n .delete(range.length)\n // @ts-expect-error Fix me later\n .insert({\n [format]: value\n }), _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n } else {\n // @ts-expect-error Fix me later\n this.quill.format(format, value, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n }\n this.update(range);\n });\n this.controls.push([format, input]);\n }\n update(range) {\n const formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(pair => {\n const [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option = null;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n // @ts-expect-error TODO fix me later\n input.value = ''; // TODO make configurable?\n // @ts-expect-error TODO fix me later\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else if (range == null) {\n input.classList.remove('ql-active');\n input.setAttribute('aria-pressed', 'false');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n const value = formats[format];\n const isActive = value === input.getAttribute('value') || value != null && value.toString() === input.getAttribute('value') || value == null && !input.getAttribute('value');\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n } else {\n const isActive = formats[format] != null;\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\nfunction addButton(container, format, value) {\n const input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add(`ql-${format}`);\n input.setAttribute('aria-pressed', 'false');\n if (value != null) {\n input.value = value;\n input.setAttribute('aria-label', `${format}: ${value}`);\n } else {\n input.setAttribute('aria-label', format);\n }\n container.appendChild(input);\n}\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n // @ts-expect-error\n groups = [groups];\n }\n groups.forEach(controls => {\n const group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(control => {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n const format = Object.keys(control)[0];\n const value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\nfunction addSelect(container, format, values) {\n const input = document.createElement('select');\n input.classList.add(`ql-${format}`);\n values.forEach(value => {\n const option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', String(value));\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean() {\n const range = this.quill.getSelection();\n if (range == null) return;\n if (range.length === 0) {\n const formats = this.quill.getFormat();\n Object.keys(formats).forEach(name => {\n // Clean functionality in existing apps only clean inline formats\n if (this.quill.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_1__.Scope.INLINE) != null) {\n this.quill.format(name, false, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n }\n });\n } else {\n this.quill.removeFormat(range, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n }\n },\n direction(value) {\n const {\n align\n } = this.quill.getFormat();\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n }\n this.quill.format('direction', value, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n },\n indent(value) {\n const range = this.quill.getSelection();\n const formats = this.quill.getFormat(range);\n const indent = parseInt(formats.indent || 0, 10);\n if (value === '+1' || value === '-1') {\n let modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n }\n },\n link(value) {\n if (value === true) {\n value = prompt('Enter link URL:'); // eslint-disable-line no-alert\n }\n\n this.quill.format('link', value, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n },\n list(value) {\n const range = this.quill.getSelection();\n const formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats.list === 'checked' || formats.list === 'unchecked') {\n this.quill.format('list', false, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n } else {\n this.quill.format('list', 'unchecked', _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n }\n } else {\n this.quill.format('list', value, _core_quill__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sources.USER);\n }\n }\n }\n};\n\n\n//# sourceURL=webpack://Quill/./modules/toolbar.js?"); + +/***/ }), + +/***/ "./modules/uploader.js": +/*!*****************************!*\ + !*** ./modules/uploader.js ***! + \*****************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _core_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/emitter */ \"./core/emitter.js\");\n/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/module */ \"./core/module.js\");\n\n\n\nclass Uploader extends _core_module__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n constructor(quill, options) {\n super(quill, options);\n quill.root.addEventListener('drop', e => {\n var _a;\n e.preventDefault();\n let native = null;\n if (document.caretRangeFromPoint) {\n native = document.caretRangeFromPoint(e.clientX, e.clientY);\n // @ts-expect-error\n } else if (document.caretPositionFromPoint) {\n // @ts-expect-error\n const position = document.caretPositionFromPoint(e.clientX, e.clientY);\n native = document.createRange();\n native.setStart(position.offsetNode, position.offset);\n native.setEnd(position.offsetNode, position.offset);\n }\n const normalized = native && quill.selection.normalizeNative(native);\n if (normalized) {\n const range = quill.selection.normalizedToRange(normalized);\n if ((_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {\n this.upload(range, e.dataTransfer.files);\n }\n }\n });\n }\n upload(range, files) {\n const uploads = [];\n Array.from(files).forEach(file => {\n var _a;\n if (file && ((_a = this.options.mimetypes) === null || _a === void 0 ? void 0 : _a.includes(file.type))) {\n uploads.push(file);\n }\n });\n if (uploads.length > 0) {\n // @ts-expect-error Fix me later\n this.options.handler.call(this, range, uploads);\n }\n }\n}\nUploader.DEFAULTS = {\n mimetypes: ['image/png', 'image/jpeg'],\n handler(range, files) {\n const promises = files.map(file => {\n return new Promise(resolve => {\n const reader = new FileReader();\n reader.onload = e => {\n // @ts-expect-error Fix me later\n resolve(e.target.result);\n };\n reader.readAsDataURL(file);\n });\n });\n Promise.all(promises).then(images => {\n const update = images.reduce((delta, image) => {\n return delta.insert({\n image\n });\n }, new (quill_delta__WEBPACK_IMPORTED_MODULE_0___default())().retain(range.index).delete(range.length));\n this.quill.updateContents(update, _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n this.quill.setSelection(range.index + images.length, _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.SILENT);\n });\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Uploader);\n\n//# sourceURL=webpack://Quill/./modules/uploader.js?"); + +/***/ }), + +/***/ "./quill.ts": +/*!******************!*\ + !*** ./quill.ts ***! + \******************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ \"./core.js\");\n/* harmony import */ var _formats_align__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./formats/align */ \"./formats/align.js\");\n/* harmony import */ var _formats_direction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./formats/direction */ \"./formats/direction.js\");\n/* harmony import */ var _formats_indent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./formats/indent */ \"./formats/indent.js\");\n/* harmony import */ var _formats_blockquote__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./formats/blockquote */ \"./formats/blockquote.js\");\n/* harmony import */ var _formats_header__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./formats/header */ \"./formats/header.js\");\n/* harmony import */ var _formats_list__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./formats/list */ \"./formats/list.js\");\n/* harmony import */ var _formats_background__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./formats/background */ \"./formats/background.js\");\n/* harmony import */ var _formats_color__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./formats/color */ \"./formats/color.js\");\n/* harmony import */ var _formats_font__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./formats/font */ \"./formats/font.js\");\n/* harmony import */ var _formats_size__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./formats/size */ \"./formats/size.js\");\n/* harmony import */ var _formats_bold__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./formats/bold */ \"./formats/bold.js\");\n/* harmony import */ var _formats_italic__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./formats/italic */ \"./formats/italic.js\");\n/* harmony import */ var _formats_link__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./formats/link */ \"./formats/link.js\");\n/* harmony import */ var _formats_script__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./formats/script */ \"./formats/script.js\");\n/* harmony import */ var _formats_strike__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formats/strike */ \"./formats/strike.js\");\n/* harmony import */ var _formats_underline__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./formats/underline */ \"./formats/underline.js\");\n/* harmony import */ var _formats_formula__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./formats/formula */ \"./formats/formula.js\");\n/* harmony import */ var _formats_image__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./formats/image */ \"./formats/image.js\");\n/* harmony import */ var _formats_video__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./formats/video */ \"./formats/video.js\");\n/* harmony import */ var _formats_code__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./formats/code */ \"./formats/code.js\");\n/* harmony import */ var _modules_syntax__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./modules/syntax */ \"./modules/syntax.js\");\n/* harmony import */ var _modules_table__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./modules/table */ \"./modules/table.js\");\n/* harmony import */ var _modules_toolbar__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./modules/toolbar */ \"./modules/toolbar.js\");\n/* harmony import */ var _ui_icons__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./ui/icons */ \"./ui/icons.js\");\n/* harmony import */ var _ui_picker__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./ui/picker */ \"./ui/picker.js\");\n/* harmony import */ var _ui_color_picker__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./ui/color-picker */ \"./ui/color-picker.js\");\n/* harmony import */ var _ui_icon_picker__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./ui/icon-picker */ \"./ui/icon-picker.js\");\n/* harmony import */ var _ui_tooltip__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./ui/tooltip */ \"./ui/tooltip.js\");\n/* harmony import */ var _themes_bubble__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./themes/bubble */ \"./themes/bubble.js\");\n/* harmony import */ var _themes_snow__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./themes/snow */ \"./themes/snow.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].register({\n 'attributors/attribute/direction': _formats_direction__WEBPACK_IMPORTED_MODULE_2__.DirectionAttribute,\n 'attributors/class/align': _formats_align__WEBPACK_IMPORTED_MODULE_1__.AlignClass,\n 'attributors/class/background': _formats_background__WEBPACK_IMPORTED_MODULE_7__.BackgroundClass,\n 'attributors/class/color': _formats_color__WEBPACK_IMPORTED_MODULE_8__.ColorClass,\n 'attributors/class/direction': _formats_direction__WEBPACK_IMPORTED_MODULE_2__.DirectionClass,\n 'attributors/class/font': _formats_font__WEBPACK_IMPORTED_MODULE_9__.FontClass,\n 'attributors/class/size': _formats_size__WEBPACK_IMPORTED_MODULE_10__.SizeClass,\n 'attributors/style/align': _formats_align__WEBPACK_IMPORTED_MODULE_1__.AlignStyle,\n 'attributors/style/background': _formats_background__WEBPACK_IMPORTED_MODULE_7__.BackgroundStyle,\n 'attributors/style/color': _formats_color__WEBPACK_IMPORTED_MODULE_8__.ColorStyle,\n 'attributors/style/direction': _formats_direction__WEBPACK_IMPORTED_MODULE_2__.DirectionStyle,\n 'attributors/style/font': _formats_font__WEBPACK_IMPORTED_MODULE_9__.FontStyle,\n 'attributors/style/size': _formats_size__WEBPACK_IMPORTED_MODULE_10__.SizeStyle\n}, true);\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].register({\n 'formats/align': _formats_align__WEBPACK_IMPORTED_MODULE_1__.AlignClass,\n 'formats/direction': _formats_direction__WEBPACK_IMPORTED_MODULE_2__.DirectionClass,\n 'formats/indent': _formats_indent__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n 'formats/background': _formats_background__WEBPACK_IMPORTED_MODULE_7__.BackgroundStyle,\n 'formats/color': _formats_color__WEBPACK_IMPORTED_MODULE_8__.ColorStyle,\n 'formats/font': _formats_font__WEBPACK_IMPORTED_MODULE_9__.FontClass,\n 'formats/size': _formats_size__WEBPACK_IMPORTED_MODULE_10__.SizeClass,\n 'formats/blockquote': _formats_blockquote__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n 'formats/code-block': _formats_code__WEBPACK_IMPORTED_MODULE_20__[\"default\"],\n 'formats/header': _formats_header__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'formats/list': _formats_list__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n 'formats/bold': _formats_bold__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n 'formats/code': _formats_code__WEBPACK_IMPORTED_MODULE_20__.Code,\n 'formats/italic': _formats_italic__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n 'formats/link': _formats_link__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n 'formats/script': _formats_script__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n 'formats/strike': _formats_strike__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n 'formats/underline': _formats_underline__WEBPACK_IMPORTED_MODULE_16__[\"default\"],\n 'formats/formula': _formats_formula__WEBPACK_IMPORTED_MODULE_17__[\"default\"],\n 'formats/image': _formats_image__WEBPACK_IMPORTED_MODULE_18__[\"default\"],\n 'formats/video': _formats_video__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n 'modules/syntax': _modules_syntax__WEBPACK_IMPORTED_MODULE_21__[\"default\"],\n 'modules/table': _modules_table__WEBPACK_IMPORTED_MODULE_22__[\"default\"],\n 'modules/toolbar': _modules_toolbar__WEBPACK_IMPORTED_MODULE_23__[\"default\"],\n 'themes/bubble': _themes_bubble__WEBPACK_IMPORTED_MODULE_29__[\"default\"],\n 'themes/snow': _themes_snow__WEBPACK_IMPORTED_MODULE_30__[\"default\"],\n 'ui/icons': _ui_icons__WEBPACK_IMPORTED_MODULE_24__[\"default\"],\n 'ui/picker': _ui_picker__WEBPACK_IMPORTED_MODULE_25__[\"default\"],\n 'ui/icon-picker': _ui_icon_picker__WEBPACK_IMPORTED_MODULE_27__[\"default\"],\n 'ui/color-picker': _ui_color_picker__WEBPACK_IMPORTED_MODULE_26__[\"default\"],\n 'ui/tooltip': _ui_tooltip__WEBPACK_IMPORTED_MODULE_28__[\"default\"]\n}, true);\n/* harmony default export */ __webpack_exports__[\"default\"] = (_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack://Quill/./quill.ts?"); + +/***/ }), + +/***/ "./themes/base.js": +/*!************************!*\ + !*** ./themes/base.js ***! + \************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseTooltip: function() { return /* binding */ BaseTooltip; },\n/* harmony export */ \"default\": function() { return /* binding */ BaseTheme; }\n/* harmony export */ });\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.merge */ \"./node_modules/lodash.merge/index.js\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _core_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/emitter */ \"./core/emitter.js\");\n/* harmony import */ var _core_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/theme */ \"./core/theme.js\");\n/* harmony import */ var _ui_color_picker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ui/color-picker */ \"./ui/color-picker.js\");\n/* harmony import */ var _ui_icon_picker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ui/icon-picker */ \"./ui/icon-picker.js\");\n/* harmony import */ var _ui_picker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/picker */ \"./ui/picker.js\");\n/* harmony import */ var _ui_tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ui/tooltip */ \"./ui/tooltip.js\");\n\n\n\n\n\n\n\nconst ALIGNS = [false, 'center', 'right', 'justify'];\nconst COLORS = ['#000000', '#e60000', '#ff9900', '#ffff00', '#008a00', '#0066cc', '#9933ff', '#ffffff', '#facccc', '#ffebcc', '#ffffcc', '#cce8cc', '#cce0f5', '#ebd6ff', '#bbbbbb', '#f06666', '#ffc266', '#ffff66', '#66b966', '#66a3e0', '#c285ff', '#888888', '#a10000', '#b26b00', '#b2b200', '#006100', '#0047b2', '#6b24b2', '#444444', '#5c0000', '#663d00', '#666600', '#003700', '#002966', '#3d1466'];\nconst FONTS = [false, 'serif', 'monospace'];\nconst HEADERS = ['1', '2', '3', false];\nconst SIZES = ['small', false, 'large', 'huge'];\nclass BaseTheme extends _core_theme__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n constructor(quill, options) {\n super(quill, options);\n const listener = e => {\n if (!document.body.contains(quill.root)) {\n document.body.removeEventListener('click', listener);\n return;\n }\n if (this.tooltip != null &&\n // @ts-expect-error\n !this.tooltip.root.contains(e.target) &&\n // @ts-expect-error\n document.activeElement !== this.tooltip.textbox && !this.quill.hasFocus()) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach(picker => {\n // @ts-expect-error\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n addModule(name) {\n const module = super.addModule(name);\n if (name === 'toolbar') {\n // @ts-expect-error\n this.extendToolbar(module);\n }\n return module;\n }\n buildButtons(buttons, icons) {\n Array.from(buttons).forEach(button => {\n const className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach(name => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name].rtl;\n } else if (typeof icons[name] === 'string') {\n // @ts-expect-error\n button.innerHTML = icons[name];\n } else {\n // @ts-expect-error\n const value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n buildPickers(selects, icons) {\n this.pickers = Array.from(selects).map(select => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n if (typeof icons.align === 'object') {\n return new _ui_icon_picker__WEBPACK_IMPORTED_MODULE_4__[\"default\"](select, icons.align);\n }\n }\n if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n const format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new _ui_color_picker__WEBPACK_IMPORTED_MODULE_3__[\"default\"](select, icons[format]);\n }\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new _ui_picker__WEBPACK_IMPORTED_MODULE_5__[\"default\"](select);\n });\n const update = () => {\n this.pickers.forEach(picker => {\n picker.update();\n });\n };\n this.quill.on(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = lodash_merge__WEBPACK_IMPORTED_MODULE_0___default()({}, _core_theme__WEBPACK_IMPORTED_MODULE_2__[\"default\"].DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image() {\n let fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', this.quill.uploader.options.mimetypes.join(', '));\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n const range = this.quill.getSelection(true);\n this.quill.uploader.upload(range, fileInput.files);\n fileInput.value = '';\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\nclass BaseTooltip extends _ui_tooltip__WEBPACK_IMPORTED_MODULE_6__[\"default\"] {\n constructor(quill, boundsContainer) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n listen() {\n // @ts-expect-error Fix me later\n this.textbox.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n this.save();\n event.preventDefault();\n } else if (event.key === 'Escape') {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n cancel() {\n this.hide();\n this.restoreFocus();\n }\n edit() {\n let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';\n let preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (this.textbox == null) return;\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n const bounds = this.quill.getBounds(this.quill.selection.savedRange);\n if (bounds != null) {\n this.position(bounds);\n }\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute(`data-${mode}`) || '');\n this.root.setAttribute('data-mode', mode);\n }\n restoreFocus() {\n this.quill.focus({\n preventScroll: true\n });\n }\n save() {\n // @ts-expect-error Fix me later\n let {\n value\n } = this.textbox;\n switch (this.root.getAttribute('data-mode')) {\n case 'link':\n {\n const {\n scrollTop\n } = this.quill.root;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video':\n {\n value = extractVideoUrl(value);\n }\n // eslint-disable-next-line no-fallthrough\n case 'formula':\n {\n if (!value) break;\n const range = this.quill.getSelection(true);\n if (range != null) {\n const index = range.index + range.length;\n this.quill.insertEmbed(index,\n // @ts-expect-error Fix me later\n this.root.getAttribute('data-mode'), value, _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n }\n this.quill.setSelection(index + 2, _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n }\n break;\n }\n default:\n }\n // @ts-expect-error Fix me later\n this.textbox.value = '';\n this.hide();\n }\n}\nfunction extractVideoUrl(url) {\n let match = url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return `${match[1] || 'https'}://www.youtube.com/embed/${match[2]}?showinfo=0`;\n }\n // eslint-disable-next-line no-cond-assign\n if (match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/)) {\n return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`;\n }\n return url;\n}\nfunction fillSelect(select, values) {\n let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n values.forEach(value => {\n const option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', String(value));\n }\n select.appendChild(option);\n });\n}\n\n\n//# sourceURL=webpack://Quill/./themes/base.js?"); + +/***/ }), + +/***/ "./themes/bubble.js": +/*!**************************!*\ + !*** ./themes/bubble.js ***! + \**************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BubbleTooltip: function() { return /* binding */ BubbleTooltip; },\n/* harmony export */ \"default\": function() { return /* binding */ BubbleTheme; }\n/* harmony export */ });\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.merge */ \"./node_modules/lodash.merge/index.js\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _core_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/emitter */ \"./core/emitter.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./themes/base.js\");\n/* harmony import */ var _core_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/selection */ \"./core/selection.js\");\n/* harmony import */ var _ui_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ui/icons */ \"./ui/icons.js\");\n\n\n\n\n\nconst TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{\n header: 1\n}, {\n header: 2\n}, 'blockquote']];\nclass BubbleTooltip extends _base__WEBPACK_IMPORTED_MODULE_2__.BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.quill.on(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.EDITOR_CHANGE, (type, range, oldRange, source) => {\n if (type !== _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0 && source === _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = `${this.root.offsetWidth}px`;\n const lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n } else {\n const lastLine = lines[lines.length - 1];\n const index = this.quill.getIndex(lastLine);\n const length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n const indexBounds = this.quill.getBounds(new _core_selection__WEBPACK_IMPORTED_MODULE_3__.Range(index, length));\n if (indexBounds != null) {\n this.position(indexBounds);\n }\n }\n } else if (document.activeElement !== this.textbox && this.quill.hasFocus()) {\n this.hide();\n }\n });\n }\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n const range = this.quill.getSelection();\n if (range != null) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n }\n }, 1);\n });\n }\n cancel() {\n this.show();\n }\n position(reference) {\n const shift = super.position(reference);\n const arrow = this.root.querySelector('.ql-tooltip-arrow');\n // @ts-expect-error\n arrow.style.marginLeft = '';\n if (shift !== 0) {\n // @ts-expect-error\n arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;\n }\n return shift;\n }\n}\nBubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join('');\nclass BubbleTheme extends _base__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n extendToolbar(toolbar) {\n // @ts-expect-error\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n if (toolbar.container != null) {\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons(toolbar.container.querySelectorAll('button'), _ui_icons__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n this.buildPickers(toolbar.container.querySelectorAll('select'), _ui_icons__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n }\n }\n}\nBubbleTheme.DEFAULTS = lodash_merge__WEBPACK_IMPORTED_MODULE_0___default()({}, _base__WEBPACK_IMPORTED_MODULE_2__[\"default\"].DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\n\n//# sourceURL=webpack://Quill/./themes/bubble.js?"); + +/***/ }), + +/***/ "./themes/snow.js": +/*!************************!*\ + !*** ./themes/snow.js ***! + \************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.merge */ \"./node_modules/lodash.merge/index.js\");\n/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _core_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/emitter */ \"./core/emitter.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./themes/base.js\");\n/* harmony import */ var _formats_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../formats/link */ \"./formats/link.js\");\n/* harmony import */ var _core_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/selection */ \"./core/selection.js\");\n/* harmony import */ var _ui_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/icons */ \"./ui/icons.js\");\n\n\n\n\n\n\nconst TOOLBAR_CONFIG = [[{\n header: ['1', '2', '3', false]\n}], ['bold', 'italic', 'underline', 'link'], [{\n list: 'ordered'\n}, {\n list: 'bullet'\n}], ['clean']];\nclass SnowTooltip extends _base__WEBPACK_IMPORTED_MODULE_2__.BaseTooltip {\n constructor() {\n super(...arguments);\n this.preview = this.root.querySelector('a.ql-preview');\n }\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root.querySelector('a.ql-action').addEventListener('click', event => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n // @ts-expect-error Fix me later\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n // @ts-expect-error Fix me later\n this.root.querySelector('a.ql-remove').addEventListener('click', event => {\n if (this.linkRange != null) {\n const range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SELECTION_CHANGE, (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(_formats_link__WEBPACK_IMPORTED_MODULE_3__[\"default\"], range.index);\n if (link != null) {\n this.linkRange = new _core_selection__WEBPACK_IMPORTED_MODULE_4__.Range(range.index - offset, link.length());\n const preview = _formats_link__WEBPACK_IMPORTED_MODULE_3__[\"default\"].formats(link.domNode);\n // @ts-expect-error Fix me later\n this.preview.textContent = preview;\n // @ts-expect-error Fix me later\n this.preview.setAttribute('href', preview);\n this.show();\n const bounds = this.quill.getBounds(this.linkRange);\n if (bounds != null) {\n this.position(bounds);\n }\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n });\n }\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\nSnowTooltip.TEMPLATE = ['', '', '', ''].join('');\nclass SnowTheme extends _base__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n extendToolbar(toolbar) {\n if (toolbar.container != null) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons(toolbar.container.querySelectorAll('button'), _ui_icons__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n this.buildPickers(toolbar.container.querySelectorAll('select'), _ui_icons__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n // @ts-expect-error\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({\n key: 'k',\n shortKey: true\n }, (_range, context) => {\n toolbar.handlers.link.call(toolbar, !context.format.link);\n });\n }\n }\n }\n}\nSnowTheme.DEFAULTS = lodash_merge__WEBPACK_IMPORTED_MODULE_0___default()({}, _base__WEBPACK_IMPORTED_MODULE_2__[\"default\"].DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value) {\n if (value) {\n const range = this.quill.getSelection();\n if (range == null || range.length === 0) return;\n let preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = `mailto:${preview}`;\n }\n const {\n tooltip\n } = this.quill.theme;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (SnowTheme);\n\n//# sourceURL=webpack://Quill/./themes/snow.js?"); + +/***/ }), + +/***/ "./ui/color-picker.js": +/*!****************************!*\ + !*** ./ui/color-picker.js ***! + \****************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _picker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./picker */ \"./ui/picker.js\");\n\nclass ColorPicker extends _picker__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(select, label) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).slice(0, 7).forEach(item => {\n item.classList.add('ql-primary');\n });\n }\n buildItem(option) {\n const item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n const colorLabel = this.label.querySelector('.ql-color-label');\n const value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (ColorPicker);\n\n//# sourceURL=webpack://Quill/./ui/color-picker.js?"); + +/***/ }), + +/***/ "./ui/icon-picker.js": +/*!***************************!*\ + !*** ./ui/icon-picker.js ***! + \***************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _picker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./picker */ \"./ui/picker.js\");\n\nclass IconPicker extends _picker__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(select, icons) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(item => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n selectItem(target, trigger) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (item != null) {\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (IconPicker);\n\n//# sourceURL=webpack://Quill/./ui/icon-picker.js?"); + +/***/ }), + +/***/ "./ui/icons.js": +/*!*********************!*\ + !*** ./ui/icons.js ***! + \*********************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _assets_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../assets/icons/align-left.svg */ \"./assets/icons/align-left.svg\");\n/* harmony import */ var _assets_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../assets/icons/align-center.svg */ \"./assets/icons/align-center.svg\");\n/* harmony import */ var _assets_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assets/icons/align-right.svg */ \"./assets/icons/align-right.svg\");\n/* harmony import */ var _assets_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../assets/icons/align-justify.svg */ \"./assets/icons/align-justify.svg\");\n/* harmony import */ var _assets_icons_background_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../assets/icons/background.svg */ \"./assets/icons/background.svg\");\n/* harmony import */ var _assets_icons_blockquote_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../assets/icons/blockquote.svg */ \"./assets/icons/blockquote.svg\");\n/* harmony import */ var _assets_icons_bold_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../assets/icons/bold.svg */ \"./assets/icons/bold.svg\");\n/* harmony import */ var _assets_icons_clean_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../assets/icons/clean.svg */ \"./assets/icons/clean.svg\");\n/* harmony import */ var _assets_icons_code_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../assets/icons/code.svg */ \"./assets/icons/code.svg\");\n/* harmony import */ var _assets_icons_color_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../assets/icons/color.svg */ \"./assets/icons/color.svg\");\n/* harmony import */ var _assets_icons_direction_ltr_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../assets/icons/direction-ltr.svg */ \"./assets/icons/direction-ltr.svg\");\n/* harmony import */ var _assets_icons_direction_rtl_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../assets/icons/direction-rtl.svg */ \"./assets/icons/direction-rtl.svg\");\n/* harmony import */ var _assets_icons_formula_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assets/icons/formula.svg */ \"./assets/icons/formula.svg\");\n/* harmony import */ var _assets_icons_header_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../assets/icons/header.svg */ \"./assets/icons/header.svg\");\n/* harmony import */ var _assets_icons_header_2_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../assets/icons/header-2.svg */ \"./assets/icons/header-2.svg\");\n/* harmony import */ var _assets_icons_italic_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../assets/icons/italic.svg */ \"./assets/icons/italic.svg\");\n/* harmony import */ var _assets_icons_image_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../assets/icons/image.svg */ \"./assets/icons/image.svg\");\n/* harmony import */ var _assets_icons_indent_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../assets/icons/indent.svg */ \"./assets/icons/indent.svg\");\n/* harmony import */ var _assets_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../assets/icons/outdent.svg */ \"./assets/icons/outdent.svg\");\n/* harmony import */ var _assets_icons_link_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../assets/icons/link.svg */ \"./assets/icons/link.svg\");\n/* harmony import */ var _assets_icons_list_bullet_svg__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../assets/icons/list-bullet.svg */ \"./assets/icons/list-bullet.svg\");\n/* harmony import */ var _assets_icons_list_check_svg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../assets/icons/list-check.svg */ \"./assets/icons/list-check.svg\");\n/* harmony import */ var _assets_icons_list_ordered_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../assets/icons/list-ordered.svg */ \"./assets/icons/list-ordered.svg\");\n/* harmony import */ var _assets_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../assets/icons/subscript.svg */ \"./assets/icons/subscript.svg\");\n/* harmony import */ var _assets_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../assets/icons/superscript.svg */ \"./assets/icons/superscript.svg\");\n/* harmony import */ var _assets_icons_strike_svg__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../assets/icons/strike.svg */ \"./assets/icons/strike.svg\");\n/* harmony import */ var _assets_icons_table_svg__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../assets/icons/table.svg */ \"./assets/icons/table.svg\");\n/* harmony import */ var _assets_icons_underline_svg__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../assets/icons/underline.svg */ \"./assets/icons/underline.svg\");\n/* harmony import */ var _assets_icons_video_svg__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../assets/icons/video.svg */ \"./assets/icons/video.svg\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n align: {\n '': _assets_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n center: _assets_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n right: _assets_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n justify: _assets_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n background: _assets_icons_background_svg__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n blockquote: _assets_icons_blockquote_svg__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n bold: _assets_icons_bold_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n clean: _assets_icons_clean_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n code: _assets_icons_code_svg__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n 'code-block': _assets_icons_code_svg__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n color: _assets_icons_color_svg__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n direction: {\n '': _assets_icons_direction_ltr_svg__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n rtl: _assets_icons_direction_rtl_svg__WEBPACK_IMPORTED_MODULE_11__[\"default\"]\n },\n formula: _assets_icons_formula_svg__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n header: {\n '1': _assets_icons_header_svg__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n '2': _assets_icons_header_2_svg__WEBPACK_IMPORTED_MODULE_14__[\"default\"]\n },\n italic: _assets_icons_italic_svg__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n image: _assets_icons_image_svg__WEBPACK_IMPORTED_MODULE_16__[\"default\"],\n indent: {\n '+1': _assets_icons_indent_svg__WEBPACK_IMPORTED_MODULE_17__[\"default\"],\n '-1': _assets_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_18__[\"default\"]\n },\n link: _assets_icons_link_svg__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n list: {\n bullet: _assets_icons_list_bullet_svg__WEBPACK_IMPORTED_MODULE_20__[\"default\"],\n check: _assets_icons_list_check_svg__WEBPACK_IMPORTED_MODULE_21__[\"default\"],\n ordered: _assets_icons_list_ordered_svg__WEBPACK_IMPORTED_MODULE_22__[\"default\"]\n },\n script: {\n sub: _assets_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_23__[\"default\"],\n super: _assets_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_24__[\"default\"]\n },\n strike: _assets_icons_strike_svg__WEBPACK_IMPORTED_MODULE_25__[\"default\"],\n table: _assets_icons_table_svg__WEBPACK_IMPORTED_MODULE_26__[\"default\"],\n underline: _assets_icons_underline_svg__WEBPACK_IMPORTED_MODULE_27__[\"default\"],\n video: _assets_icons_video_svg__WEBPACK_IMPORTED_MODULE_28__[\"default\"]\n});\n\n//# sourceURL=webpack://Quill/./ui/icons.js?"); + +/***/ }), + +/***/ "./ui/picker.js": +/*!**********************!*\ + !*** ./ui/picker.js ***! + \**********************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _assets_icons_dropdown_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../assets/icons/dropdown.svg */ \"./assets/icons/dropdown.svg\");\n\nlet optionsCounter = 0;\nfunction toggleAriaAttribute(element, attribute) {\n element.setAttribute(attribute, `${!(element.getAttribute(attribute) === 'true')}`);\n}\nclass Picker {\n constructor(select) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n // @ts-expect-error Fix me later\n this.select.parentNode.insertBefore(this.container, this.select);\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', event => {\n switch (event.key) {\n case 'Enter':\n this.togglePicker();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n // @ts-expect-error\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n buildItem(option) {\n const item = document.createElement('span');\n // @ts-expect-error\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n item.classList.add('ql-picker-item');\n const value = option.getAttribute('value');\n if (value) {\n item.setAttribute('data-value', value);\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', event => {\n switch (event.key) {\n case 'Enter':\n this.selectItem(item, true);\n event.preventDefault();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n return item;\n }\n buildLabel() {\n const label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = _assets_icons_dropdown_svg__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n // @ts-expect-error\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n buildOptions() {\n const options = document.createElement('span');\n options.classList.add('ql-picker-options');\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n // @ts-expect-error\n options.tabIndex = '-1';\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n // @ts-expect-error\n this.options = options;\n Array.from(this.select.options).forEach(option => {\n const item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n buildPicker() {\n Array.from(this.select.attributes).forEach(item => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n // @ts-expect-error\n this.options.setAttribute('aria-hidden', 'true');\n }\n selectItem(item) {\n let trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n const selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n // @ts-expect-error Fix me later\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(item);\n if (item.hasAttribute('data-value')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n this.select.dispatchEvent(new Event('change'));\n this.close();\n }\n }\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n const item =\n // @ts-expect-error Fix me later\n this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n // @ts-expect-error\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n const isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Picker);\n\n//# sourceURL=webpack://Quill/./ui/picker.js?"); + +/***/ }), + +/***/ "./ui/tooltip.js": +/*!***********************!*\ + !*** ./ui/tooltip.js ***! + \***********************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nconst isScrollable = el => {\n const {\n overflowY\n } = getComputedStyle(el, null);\n return overflowY !== 'visible' && overflowY !== 'clip';\n};\nclass Tooltip {\n constructor(quill, boundsContainer) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n // @ts-expect-error\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (isScrollable(this.quill.root)) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`;\n });\n }\n this.hide();\n }\n hide() {\n this.root.classList.add('ql-hidden');\n }\n position(reference) {\n const left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n const top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.classList.remove('ql-flip');\n const containerBounds = this.boundsContainer.getBoundingClientRect();\n const rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top;\n const verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = `${top - verticalShift}px`;\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tooltip);\n\n//# sourceURL=webpack://Quill/./ui/tooltip.js?"); + +/***/ }), + +/***/ "./node_modules/eventemitter3/index.js": +/*!*********************************************!*\ + !*** ./node_modules/eventemitter3/index.js ***! + \*********************************************/ +/***/ (function(module, exports) { + +eval("'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n//# sourceURL=webpack://Quill/./node_modules/eventemitter3/index.js?"); + +/***/ }), + +/***/ "./node_modules/fast-diff/diff.js": +/*!****************************************!*\ + !*** ./node_modules/fast-diff/diff.js ***! + \****************************************/ +/***/ (function(module) { + +eval("/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @param {boolean} [cleanup] Apply semantic cleanup before returning.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, cleanup, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n if (cleanup) {\n diff_cleanupSemantic(diffs);\n }\n return diffs;\n}\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)],\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n}\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = delta % 2 !== 0;\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length &&\n y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length &&\n y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ===\n text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n}\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n}\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\nfunction diff_commonOverlap_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: http://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (\n found == 0 ||\n text1.substring(text_length - length) == text2.substring(0, length)\n ) {\n best = length;\n length++;\n }\n }\n}\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = \"\";\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i),\n shorttext.substring(j)\n );\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i),\n shorttext.substring(0, j)\n );\n if (best_common.length < suffixLength + prefixLength) {\n best_common =\n shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a,\n best_longtext_b,\n best_shorttext_a,\n best_shorttext_b,\n best_common,\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 4)\n );\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 2)\n );\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n}\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemantic(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastequality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) {\n // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = diffs[pointer][1];\n } else {\n // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (\n lastequality &&\n lastequality.length <=\n Math.max(length_insertions1, length_deletions1) &&\n lastequality.length <= Math.max(length_insertions2, length_deletions2)\n ) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0, [\n DIFF_DELETE,\n lastequality,\n ]);\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (\n diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT\n ) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (\n overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2\n ) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n insertion.substring(0, overlap_length1),\n ]);\n diffs[pointer - 1][1] = deletion.substring(\n 0,\n deletion.length - overlap_length1\n );\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (\n overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2\n ) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n deletion.substring(0, overlap_length2),\n ]);\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] = insertion.substring(\n 0,\n insertion.length - overlap_length2\n );\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] = deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n}\n\nvar nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\nvar whitespaceRegex_ = /\\s/;\nvar linebreakRegex_ = /[\\r\\n]/;\nvar blanklineEndRegex_ = /\\n\\r?\\n$/;\nvar blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemanticLossless(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);\n var lineBreak1 = whitespace1 && char1.match(linebreakRegex_);\n var lineBreak2 = whitespace2 && char2.match(linebreakRegex_);\n var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);\n var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n}\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, \"\"]); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = \"\";\n var text_insert = \"\";\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (\n previous_equality >= 0 &&\n ends_with_pair_start(diffs[previous_equality][1])\n ) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(\n 0,\n -1\n );\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(\n 0,\n commonlength\n );\n } else {\n diffs.splice(0, 0, [\n DIFF_EQUAL,\n text_insert.substring(0, commonlength),\n ]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) +\n diffs[pointer][1];\n text_insert = text_insert.substring(\n 0,\n text_insert.length - commonlength\n );\n text_delete = text_delete.substring(\n 0,\n text_delete.length - commonlength\n );\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(\n pointer - n,\n n,\n [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]\n );\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = \"\";\n text_insert = \"\";\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === \"\") {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n if (\n diffs[pointer][1].substring(\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n ) === diffs[pointer - 1][1]\n ) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] =\n diffs[pointer - 1][1] +\n diffs[pointer][1].substring(\n 0,\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n );\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (\n diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]\n ) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n}\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xd800 && charCode <= 0xdbff;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xdc00 && charCode <= 0xdfff;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after],\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange =\n typeof cursor_pos === \"number\"\n ? { index: cursor_pos, length: 0 }\n : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === \"number\" ? null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos, cleanup) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, cleanup, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n\n//# sourceURL=webpack://Quill/./node_modules/fast-diff/diff.js?"); + +/***/ }), + +/***/ "./assets/icons/align-center.svg": +/*!***************************************!*\ + !*** ./assets/icons/align-center.svg ***! + \***************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/align-center.svg?"); + +/***/ }), + +/***/ "./assets/icons/align-justify.svg": +/*!****************************************!*\ + !*** ./assets/icons/align-justify.svg ***! + \****************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/align-justify.svg?"); + +/***/ }), + +/***/ "./assets/icons/align-left.svg": +/*!*************************************!*\ + !*** ./assets/icons/align-left.svg ***! + \*************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/align-left.svg?"); + +/***/ }), + +/***/ "./assets/icons/align-right.svg": +/*!**************************************!*\ + !*** ./assets/icons/align-right.svg ***! + \**************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/align-right.svg?"); + +/***/ }), + +/***/ "./assets/icons/background.svg": +/*!*************************************!*\ + !*** ./assets/icons/background.svg ***! + \*************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/background.svg?"); + +/***/ }), + +/***/ "./assets/icons/blockquote.svg": +/*!*************************************!*\ + !*** ./assets/icons/blockquote.svg ***! + \*************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/blockquote.svg?"); + +/***/ }), + +/***/ "./assets/icons/bold.svg": +/*!*******************************!*\ + !*** ./assets/icons/bold.svg ***! + \*******************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/bold.svg?"); + +/***/ }), + +/***/ "./assets/icons/clean.svg": +/*!********************************!*\ + !*** ./assets/icons/clean.svg ***! + \********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/clean.svg?"); + +/***/ }), + +/***/ "./assets/icons/code.svg": +/*!*******************************!*\ + !*** ./assets/icons/code.svg ***! + \*******************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/code.svg?"); + +/***/ }), + +/***/ "./assets/icons/color.svg": +/*!********************************!*\ + !*** ./assets/icons/color.svg ***! + \********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/color.svg?"); + +/***/ }), + +/***/ "./assets/icons/direction-ltr.svg": +/*!****************************************!*\ + !*** ./assets/icons/direction-ltr.svg ***! + \****************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/direction-ltr.svg?"); + +/***/ }), + +/***/ "./assets/icons/direction-rtl.svg": +/*!****************************************!*\ + !*** ./assets/icons/direction-rtl.svg ***! + \****************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/direction-rtl.svg?"); + +/***/ }), + +/***/ "./assets/icons/dropdown.svg": +/*!***********************************!*\ + !*** ./assets/icons/dropdown.svg ***! + \***********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/dropdown.svg?"); + +/***/ }), + +/***/ "./assets/icons/formula.svg": +/*!**********************************!*\ + !*** ./assets/icons/formula.svg ***! + \**********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/formula.svg?"); + +/***/ }), + +/***/ "./assets/icons/header-2.svg": +/*!***********************************!*\ + !*** ./assets/icons/header-2.svg ***! + \***********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/header-2.svg?"); + +/***/ }), + +/***/ "./assets/icons/header.svg": +/*!*********************************!*\ + !*** ./assets/icons/header.svg ***! + \*********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/header.svg?"); + +/***/ }), + +/***/ "./assets/icons/image.svg": +/*!********************************!*\ + !*** ./assets/icons/image.svg ***! + \********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/image.svg?"); + +/***/ }), + +/***/ "./assets/icons/indent.svg": +/*!*********************************!*\ + !*** ./assets/icons/indent.svg ***! + \*********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/indent.svg?"); + +/***/ }), + +/***/ "./assets/icons/italic.svg": +/*!*********************************!*\ + !*** ./assets/icons/italic.svg ***! + \*********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/italic.svg?"); + +/***/ }), + +/***/ "./assets/icons/link.svg": +/*!*******************************!*\ + !*** ./assets/icons/link.svg ***! + \*******************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/link.svg?"); + +/***/ }), + +/***/ "./assets/icons/list-bullet.svg": +/*!**************************************!*\ + !*** ./assets/icons/list-bullet.svg ***! + \**************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/list-bullet.svg?"); + +/***/ }), + +/***/ "./assets/icons/list-check.svg": +/*!*************************************!*\ + !*** ./assets/icons/list-check.svg ***! + \*************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/list-check.svg?"); + +/***/ }), + +/***/ "./assets/icons/list-ordered.svg": +/*!***************************************!*\ + !*** ./assets/icons/list-ordered.svg ***! + \***************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/list-ordered.svg?"); + +/***/ }), + +/***/ "./assets/icons/outdent.svg": +/*!**********************************!*\ + !*** ./assets/icons/outdent.svg ***! + \**********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/outdent.svg?"); + +/***/ }), + +/***/ "./assets/icons/strike.svg": +/*!*********************************!*\ + !*** ./assets/icons/strike.svg ***! + \*********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/strike.svg?"); + +/***/ }), + +/***/ "./assets/icons/subscript.svg": +/*!************************************!*\ + !*** ./assets/icons/subscript.svg ***! + \************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/subscript.svg?"); + +/***/ }), + +/***/ "./assets/icons/superscript.svg": +/*!**************************************!*\ + !*** ./assets/icons/superscript.svg ***! + \**************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/superscript.svg?"); + +/***/ }), + +/***/ "./assets/icons/table.svg": +/*!********************************!*\ + !*** ./assets/icons/table.svg ***! + \********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/table.svg?"); + +/***/ }), + +/***/ "./assets/icons/underline.svg": +/*!************************************!*\ + !*** ./assets/icons/underline.svg ***! + \************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/underline.svg?"); + +/***/ }), + +/***/ "./assets/icons/video.svg": +/*!********************************!*\ + !*** ./assets/icons/video.svg ***! + \********************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Module\nvar code = \" \";\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (code);\n\n//# sourceURL=webpack://Quill/./assets/icons/video.svg?"); + +/***/ }), + +/***/ "./node_modules/lodash.clonedeep/index.js": +/*!************************************************!*\ + !*** ./node_modules/lodash.clonedeep/index.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* module decorator */ module = __webpack_require__.nmd(module);\n/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && \"object\" == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n\n\n//# sourceURL=webpack://Quill/./node_modules/lodash.clonedeep/index.js?"); + +/***/ }), + +/***/ "./node_modules/lodash.isequal/index.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash.isequal/index.js ***! + \**********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* module decorator */ module = __webpack_require__.nmd(module);\n/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && \"object\" == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n\n\n//# sourceURL=webpack://Quill/./node_modules/lodash.isequal/index.js?"); + +/***/ }), + +/***/ "./node_modules/lodash.merge/index.js": +/*!********************************************!*\ + !*** ./node_modules/lodash.merge/index.js ***! + \********************************************/ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* module decorator */ module = __webpack_require__.nmd(module);\n/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && \"object\" == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n\n\n//# sourceURL=webpack://Quill/./node_modules/lodash.merge/index.js?"); + +/***/ }), + +/***/ "./node_modules/quill-delta/dist/AttributeMap.js": +/*!*******************************************************!*\ + !*** ./node_modules/quill-delta/dist/AttributeMap.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst cloneDeep = __webpack_require__(/*! lodash.clonedeep */ \"./node_modules/lodash.clonedeep/index.js\");\nconst isEqual = __webpack_require__(/*! lodash.isequal */ \"./node_modules/lodash.isequal/index.js\");\nvar AttributeMap;\n(function (AttributeMap) {\n function compose(a = {}, b = {}, keepNull = false) {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n let attributes = cloneDeep(b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce((copy, key) => {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (const key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.compose = compose;\n function diff(a = {}, b = {}) {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n const attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce((attrs, key) => {\n if (!isEqual(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.diff = diff;\n function invert(attr = {}, base = {}) {\n attr = attr || {};\n const baseInverted = Object.keys(base).reduce((memo, key) => {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce((memo, key) => {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n AttributeMap.invert = invert;\n function transform(a, b, priority = false) {\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n const attributes = Object.keys(b).reduce((attrs, key) => {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n AttributeMap.transform = transform;\n})(AttributeMap || (AttributeMap = {}));\nexports[\"default\"] = AttributeMap;\n//# sourceMappingURL=AttributeMap.js.map\n\n//# sourceURL=webpack://Quill/./node_modules/quill-delta/dist/AttributeMap.js?"); + +/***/ }), + +/***/ "./node_modules/quill-delta/dist/Delta.js": +/*!************************************************!*\ + !*** ./node_modules/quill-delta/dist/Delta.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AttributeMap = exports.OpIterator = exports.Op = void 0;\nconst diff = __webpack_require__(/*! fast-diff */ \"./node_modules/fast-diff/diff.js\");\nconst cloneDeep = __webpack_require__(/*! lodash.clonedeep */ \"./node_modules/lodash.clonedeep/index.js\");\nconst isEqual = __webpack_require__(/*! lodash.isequal */ \"./node_modules/lodash.isequal/index.js\");\nconst AttributeMap_1 = __webpack_require__(/*! ./AttributeMap */ \"./node_modules/quill-delta/dist/AttributeMap.js\");\nexports.AttributeMap = AttributeMap_1.default;\nconst Op_1 = __webpack_require__(/*! ./Op */ \"./node_modules/quill-delta/dist/Op.js\");\nexports.Op = Op_1.default;\nconst OpIterator_1 = __webpack_require__(/*! ./OpIterator */ \"./node_modules/quill-delta/dist/OpIterator.js\");\nexports.OpIterator = OpIterator_1.default;\nconst NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\nconst getEmbedTypeAndData = (a, b) => {\n if (typeof a !== 'object' || a === null) {\n throw new Error(`cannot retain a ${typeof a}`);\n }\n if (typeof b !== 'object' || b === null) {\n throw new Error(`cannot retain a ${typeof b}`);\n }\n const embedType = Object.keys(a)[0];\n if (!embedType || embedType !== Object.keys(b)[0]) {\n throw new Error(`embed types not matched: ${embedType} != ${Object.keys(b)[0]}`);\n }\n return [embedType, a[embedType], b[embedType]];\n};\nclass Delta {\n constructor(ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n }\n else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n }\n else {\n this.ops = [];\n }\n }\n static registerEmbed(embedType, handler) {\n this.handlers[embedType] = handler;\n }\n static unregisterEmbed(embedType) {\n delete this.handlers[embedType];\n }\n static getHandler(embedType) {\n const handler = this.handlers[embedType];\n if (!handler) {\n throw new Error(`no handlers for embed type \"${embedType}\"`);\n }\n return handler;\n }\n insert(arg, attributes) {\n const newOp = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n delete(length) {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n }\n retain(length, attributes) {\n if (typeof length === 'number' && length <= 0) {\n return this;\n }\n const newOp = { retain: length };\n if (attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n push(newOp) {\n let index = this.ops.length;\n let lastOp = this.ops[index - 1];\n newOp = cloneDeep(newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number') {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (isEqual(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n else if (typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n }\n else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n }\n chop() {\n const lastOp = this.ops[this.ops.length - 1];\n if (lastOp && typeof lastOp.retain === 'number' && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n }\n filter(predicate) {\n return this.ops.filter(predicate);\n }\n forEach(predicate) {\n this.ops.forEach(predicate);\n }\n map(predicate) {\n return this.ops.map(predicate);\n }\n partition(predicate) {\n const passed = [];\n const failed = [];\n this.forEach((op) => {\n const target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n }\n reduce(predicate, initialValue) {\n return this.ops.reduce(predicate, initialValue);\n }\n changeLength() {\n return this.reduce((length, elem) => {\n if (elem.insert) {\n return length + Op_1.default.length(elem);\n }\n else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n }\n length() {\n return this.reduce((length, elem) => {\n return length + Op_1.default.length(elem);\n }, 0);\n }\n slice(start = 0, end = Infinity) {\n const ops = [];\n const iter = new OpIterator_1.default(this.ops);\n let index = 0;\n while (index < end && iter.hasNext()) {\n let nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n }\n else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op_1.default.length(nextOp);\n }\n return new Delta(ops);\n }\n compose(other) {\n const thisIter = new OpIterator_1.default(this.ops);\n const otherIter = new OpIterator_1.default(other.ops);\n const ops = [];\n const firstOther = otherIter.peek();\n if (firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null) {\n let firstLeft = firstOther.retain;\n while (thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n const delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n }\n else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n }\n else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (otherOp.retain) {\n const newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain =\n typeof otherOp.retain === 'number' ? length : otherOp.retain;\n }\n else {\n if (typeof otherOp.retain === 'number') {\n if (thisOp.retain == null) {\n newOp.insert = thisOp.insert;\n }\n else {\n newOp.retain = thisOp.retain;\n }\n }\n else {\n const action = thisOp.retain == null ? 'insert' : 'retain';\n const [embedType, thisData, otherData] = getEmbedTypeAndData(thisOp[action], otherOp.retain);\n const handler = Delta.getHandler(embedType);\n newOp[action] = {\n [embedType]: handler.compose(thisData, otherData, action === 'retain'),\n };\n }\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n const attributes = AttributeMap_1.default.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n // Optimization if rest of other is just retain\n if (!otherIter.hasNext() &&\n isEqual(delta.ops[delta.ops.length - 1], newOp)) {\n const rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n }\n else if (typeof otherOp.delete === 'number' &&\n (typeof thisOp.retain === 'number' ||\n (typeof thisOp.retain === 'object' && thisOp.retain !== null))) {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n }\n concat(other) {\n const delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n }\n diff(other, cursor) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n const strings = [this, other].map((delta) => {\n return delta\n .map((op) => {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n const prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n const retDelta = new Delta();\n const diffResult = diff(strings[0], strings[1], cursor, true);\n const thisIter = new OpIterator_1.default(this.ops);\n const otherIter = new OpIterator_1.default(other.ops);\n diffResult.forEach((component) => {\n let length = component[1].length;\n while (length > 0) {\n let opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n const thisOp = thisIter.next(opLength);\n const otherOp = otherIter.next(opLength);\n if (isEqual(thisOp.insert, otherOp.insert)) {\n retDelta.retain(opLength, AttributeMap_1.default.diff(thisOp.attributes, otherOp.attributes));\n }\n else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n }\n eachLine(predicate, newline = '\\n') {\n const iter = new OpIterator_1.default(this.ops);\n let line = new Delta();\n let i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n const thisOp = iter.peek();\n const start = Op_1.default.length(thisOp) - iter.peekLength();\n const index = typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n }\n else if (index > 0) {\n line.push(iter.next(index));\n }\n else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n }\n invert(base) {\n const inverted = new Delta();\n this.reduce((baseIndex, op) => {\n if (op.insert) {\n inverted.delete(Op_1.default.length(op));\n }\n else if (typeof op.retain === 'number' && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n }\n else if (op.delete || typeof op.retain === 'number') {\n const length = (op.delete || op.retain);\n const slice = base.slice(baseIndex, baseIndex + length);\n slice.forEach((baseOp) => {\n if (op.delete) {\n inverted.push(baseOp);\n }\n else if (op.retain && op.attributes) {\n inverted.retain(Op_1.default.length(baseOp), AttributeMap_1.default.invert(op.attributes, baseOp.attributes));\n }\n });\n return baseIndex + length;\n }\n else if (typeof op.retain === 'object' && op.retain !== null) {\n const slice = base.slice(baseIndex, baseIndex + 1);\n const baseOp = new OpIterator_1.default(slice.ops).next();\n const [embedType, opData, baseOpData] = getEmbedTypeAndData(op.retain, baseOp.insert);\n const handler = Delta.getHandler(embedType);\n inverted.retain({ [embedType]: handler.invert(opData, baseOpData) }, AttributeMap_1.default.invert(op.attributes, baseOp.attributes));\n return baseIndex + 1;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n }\n transform(arg, priority = false) {\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n const other = arg;\n const thisIter = new OpIterator_1.default(this.ops);\n const otherIter = new OpIterator_1.default(other.ops);\n const delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(Op_1.default.length(thisIter.next()));\n }\n else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n }\n else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n }\n else if (otherOp.delete) {\n delta.push(otherOp);\n }\n else {\n const thisData = thisOp.retain;\n const otherData = otherOp.retain;\n let transformedData = typeof otherData === 'object' && otherData !== null\n ? otherData\n : length;\n if (typeof thisData === 'object' &&\n thisData !== null &&\n typeof otherData === 'object' &&\n otherData !== null) {\n const embedType = Object.keys(thisData)[0];\n if (embedType === Object.keys(otherData)[0]) {\n const handler = Delta.getHandler(embedType);\n if (handler) {\n transformedData = {\n [embedType]: handler.transform(thisData[embedType], otherData[embedType], priority),\n };\n }\n }\n }\n // We retain either their retain or insert\n delta.retain(transformedData, AttributeMap_1.default.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n }\n transformPosition(index, priority = false) {\n priority = !!priority;\n const thisIter = new OpIterator_1.default(this.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n }\n else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n }\n}\nDelta.Op = Op_1.default;\nDelta.OpIterator = OpIterator_1.default;\nDelta.AttributeMap = AttributeMap_1.default;\nDelta.handlers = {};\nexports[\"default\"] = Delta;\nif (true) {\n module.exports = Delta;\n module.exports[\"default\"] = Delta;\n}\n//# sourceMappingURL=Delta.js.map\n\n//# sourceURL=webpack://Quill/./node_modules/quill-delta/dist/Delta.js?"); + +/***/ }), + +/***/ "./node_modules/quill-delta/dist/Op.js": +/*!*********************************************!*\ + !*** ./node_modules/quill-delta/dist/Op.js ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar Op;\n(function (Op) {\n function length(op) {\n if (typeof op.delete === 'number') {\n return op.delete;\n }\n else if (typeof op.retain === 'number') {\n return op.retain;\n }\n else if (typeof op.retain === 'object' && op.retain !== null) {\n return 1;\n }\n else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n Op.length = length;\n})(Op || (Op = {}));\nexports[\"default\"] = Op;\n//# sourceMappingURL=Op.js.map\n\n//# sourceURL=webpack://Quill/./node_modules/quill-delta/dist/Op.js?"); + +/***/ }), + +/***/ "./node_modules/quill-delta/dist/OpIterator.js": +/*!*****************************************************!*\ + !*** ./node_modules/quill-delta/dist/OpIterator.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Op_1 = __webpack_require__(/*! ./Op */ \"./node_modules/quill-delta/dist/Op.js\");\nclass Iterator {\n constructor(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n hasNext() {\n return this.peekLength() < Infinity;\n }\n next(length) {\n if (!length) {\n length = Infinity;\n }\n const nextOp = this.ops[this.index];\n if (nextOp) {\n const offset = this.offset;\n const opLength = Op_1.default.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n }\n else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n }\n else {\n const retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n }\n else if (typeof nextOp.retain === 'object' &&\n nextOp.retain !== null) {\n // offset should === 0, length should === 1\n retOp.retain = nextOp.retain;\n }\n else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n }\n else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n }\n else {\n return { retain: Infinity };\n }\n }\n peek() {\n return this.ops[this.index];\n }\n peekLength() {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op_1.default.length(this.ops[this.index]) - this.offset;\n }\n else {\n return Infinity;\n }\n }\n peekType() {\n const op = this.ops[this.index];\n if (op) {\n if (typeof op.delete === 'number') {\n return 'delete';\n }\n else if (typeof op.retain === 'number' ||\n (typeof op.retain === 'object' && op.retain !== null)) {\n return 'retain';\n }\n else {\n return 'insert';\n }\n }\n return 'retain';\n }\n rest() {\n if (!this.hasNext()) {\n return [];\n }\n else if (this.offset === 0) {\n return this.ops.slice(this.index);\n }\n else {\n const offset = this.offset;\n const index = this.index;\n const next = this.next();\n const rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n }\n}\nexports[\"default\"] = Iterator;\n//# sourceMappingURL=OpIterator.js.map\n\n//# sourceURL=webpack://Quill/./node_modules/quill-delta/dist/OpIterator.js?"); + +/***/ }), + +/***/ "./node_modules/parchment/dist/parchment.mjs": +/*!***************************************************!*\ + !*** ./node_modules/parchment/dist/parchment.mjs ***! + \***************************************************/ +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Attributor: function() { return /* binding */ p; },\n/* harmony export */ AttributorStore: function() { return /* binding */ O; },\n/* harmony export */ BlockBlot: function() { return /* binding */ N; },\n/* harmony export */ ClassAttributor: function() { return /* binding */ P; },\n/* harmony export */ ContainerBlot: function() { return /* binding */ L; },\n/* harmony export */ EmbedBlot: function() { return /* binding */ V; },\n/* harmony export */ InlineBlot: function() { return /* binding */ g; },\n/* harmony export */ LeafBlot: function() { return /* binding */ b; },\n/* harmony export */ ParentBlot: function() { return /* binding */ d; },\n/* harmony export */ Registry: function() { return /* binding */ E; },\n/* harmony export */ Scope: function() { return /* binding */ o; },\n/* harmony export */ ScrollBlot: function() { return /* binding */ A; },\n/* harmony export */ StyleAttributor: function() { return /* binding */ z; },\n/* harmony export */ TextBlot: function() { return /* binding */ k; }\n/* harmony export */ });\nvar o = /* @__PURE__ */ ((s) => (s[s.TYPE = 3] = \"TYPE\", s[s.LEVEL = 12] = \"LEVEL\", s[s.ATTRIBUTE = 13] = \"ATTRIBUTE\", s[s.BLOT = 14] = \"BLOT\", s[s.INLINE = 7] = \"INLINE\", s[s.BLOCK = 11] = \"BLOCK\", s[s.BLOCK_BLOT = 10] = \"BLOCK_BLOT\", s[s.INLINE_BLOT = 6] = \"INLINE_BLOT\", s[s.BLOCK_ATTRIBUTE = 9] = \"BLOCK_ATTRIBUTE\", s[s.INLINE_ATTRIBUTE = 5] = \"INLINE_ATTRIBUTE\", s[s.ANY = 15] = \"ANY\", s))(o || {});\nclass R {\n constructor() {\n this.head = null, this.tail = null, this.length = 0;\n }\n append(...t) {\n if (this.insertBefore(t[0], null), t.length > 1) {\n const e = t.slice(1);\n this.append(...e);\n }\n }\n at(t) {\n const e = this.iterator();\n let i = e();\n for (; i && t > 0; )\n t -= 1, i = e();\n return i;\n }\n contains(t) {\n const e = this.iterator();\n let i = e();\n for (; i; ) {\n if (i === t)\n return !0;\n i = e();\n }\n return !1;\n }\n indexOf(t) {\n const e = this.iterator();\n let i = e(), r = 0;\n for (; i; ) {\n if (i === t)\n return r;\n r += 1, i = e();\n }\n return -1;\n }\n insertBefore(t, e) {\n t != null && (this.remove(t), t.next = e, e != null ? (t.prev = e.prev, e.prev != null && (e.prev.next = t), e.prev = t, e === this.head && (this.head = t)) : this.tail != null ? (this.tail.next = t, t.prev = this.tail, this.tail = t) : (t.prev = null, this.head = this.tail = t), this.length += 1);\n }\n offset(t) {\n let e = 0, i = this.head;\n for (; i != null; ) {\n if (i === t)\n return e;\n e += i.length(), i = i.next;\n }\n return -1;\n }\n remove(t) {\n this.contains(t) && (t.prev != null && (t.prev.next = t.next), t.next != null && (t.next.prev = t.prev), t === this.head && (this.head = t.next), t === this.tail && (this.tail = t.prev), this.length -= 1);\n }\n iterator(t = this.head) {\n return () => {\n const e = t;\n return t != null && (t = t.next), e;\n };\n }\n find(t, e = !1) {\n const i = this.iterator();\n let r = i();\n for (; r; ) {\n const n = r.length();\n if (t < n || e && t === n && (r.next == null || r.next.length() !== 0))\n return [r, t];\n t -= n, r = i();\n }\n return [null, 0];\n }\n forEach(t) {\n const e = this.iterator();\n let i = e();\n for (; i; )\n t(i), i = e();\n }\n forEachAt(t, e, i) {\n if (e <= 0)\n return;\n const [r, n] = this.find(t);\n let l = t - n;\n const c = this.iterator(r);\n let a = c();\n for (; a && l < t + e; ) {\n const h = a.length();\n t > l ? i(\n a,\n t - l,\n Math.min(e, l + h - t)\n ) : i(a, 0, Math.min(h, t + e - l)), l += h, a = c();\n }\n }\n map(t) {\n return this.reduce((e, i) => (e.push(t(i)), e), []);\n }\n reduce(t, e) {\n const i = this.iterator();\n let r = i();\n for (; r; )\n e = t(e, r), r = i();\n return e;\n }\n}\nclass m extends Error {\n constructor(t) {\n t = \"[Parchment] \" + t, super(t), this.message = t, this.name = this.constructor.name;\n }\n}\nconst v = class {\n constructor() {\n this.attributes = {}, this.classes = {}, this.tags = {}, this.types = {};\n }\n static find(s, t = !1) {\n if (s == null)\n return null;\n if (this.blots.has(s))\n return this.blots.get(s) || null;\n if (t) {\n let e = null;\n try {\n e = s.parentNode;\n } catch {\n return null;\n }\n return this.find(e, t);\n }\n return null;\n }\n create(s, t, e) {\n const i = this.query(t);\n if (i == null)\n throw new m(`Unable to create ${t} blot`);\n const r = i, n = (\n // @ts-expect-error\n t instanceof Node || t.nodeType === Node.TEXT_NODE ? t : r.create(e)\n ), l = new r(s, n, e);\n return v.blots.set(l.domNode, l), l;\n }\n find(s, t = !1) {\n return v.find(s, t);\n }\n query(s, t = o.ANY) {\n let e;\n return typeof s == \"string\" ? e = this.types[s] || this.attributes[s] : s instanceof Text || s.nodeType === Node.TEXT_NODE ? e = this.types.text : typeof s == \"number\" ? s & o.LEVEL & o.BLOCK ? e = this.types.block : s & o.LEVEL & o.INLINE && (e = this.types.inline) : s instanceof Element && ((s.getAttribute(\"class\") || \"\").split(/\\s+/).some((r) => (e = this.classes[r], !!e)), e = e || this.tags[s.tagName]), e == null ? null : t & o.LEVEL & e.scope && t & o.TYPE & e.scope ? e : null;\n }\n register(...s) {\n if (s.length > 1)\n return s.map((e) => this.register(e));\n const t = s[0];\n if (typeof t.blotName != \"string\" && typeof t.attrName != \"string\")\n throw new m(\"Invalid definition\");\n if (t.blotName === \"abstract\")\n throw new m(\"Cannot register abstract class\");\n return this.types[t.blotName || t.attrName] = t, typeof t.keyName == \"string\" ? this.attributes[t.keyName] = t : (t.className != null && (this.classes[t.className] = t), t.tagName != null && (Array.isArray(t.tagName) ? t.tagName = t.tagName.map((i) => i.toUpperCase()) : t.tagName = t.tagName.toUpperCase(), (Array.isArray(t.tagName) ? t.tagName : [t.tagName]).forEach((i) => {\n (this.tags[i] == null || t.className == null) && (this.tags[i] = t);\n }))), t;\n }\n};\nlet E = v;\nE.blots = /* @__PURE__ */ new WeakMap();\nclass x {\n constructor(t, e) {\n this.scroll = t, this.domNode = e, E.blots.set(e, this), this.prev = null, this.next = null;\n }\n static create(t) {\n if (this.tagName == null)\n throw new m(\"Blot definition missing tagName\");\n let e;\n return Array.isArray(this.tagName) ? (typeof t == \"string\" && (t = t.toUpperCase(), parseInt(t, 10).toString() === t && (t = parseInt(t, 10))), typeof t == \"number\" ? e = document.createElement(this.tagName[t - 1]) : this.tagName.indexOf(t) > -1 ? e = document.createElement(t) : e = document.createElement(this.tagName[0])) : e = document.createElement(this.tagName), this.className && e.classList.add(this.className), e;\n }\n // Hack for accessing inherited static methods\n get statics() {\n return this.constructor;\n }\n attach() {\n }\n clone() {\n const t = this.domNode.cloneNode(!1);\n return this.scroll.create(t);\n }\n detach() {\n this.parent != null && this.parent.removeChild(this), E.blots.delete(this.domNode);\n }\n deleteAt(t, e) {\n this.isolate(t, e).remove();\n }\n formatAt(t, e, i, r) {\n const n = this.isolate(t, e);\n if (this.scroll.query(i, o.BLOT) != null && r)\n n.wrap(i, r);\n else if (this.scroll.query(i, o.ATTRIBUTE) != null) {\n const l = this.scroll.create(this.statics.scope);\n n.wrap(l), l.format(i, r);\n }\n }\n insertAt(t, e, i) {\n const r = i == null ? this.scroll.create(\"text\", e) : this.scroll.create(e, i), n = this.split(t);\n this.parent.insertBefore(r, n || void 0);\n }\n isolate(t, e) {\n const i = this.split(t);\n if (i == null)\n throw new Error(\"Attempt to isolate at end\");\n return i.split(e), i;\n }\n length() {\n return 1;\n }\n offset(t = this.parent) {\n return this.parent == null || this === t ? 0 : this.parent.children.offset(this) + this.parent.offset(t);\n }\n optimize(t) {\n this.statics.requiredContainer && !(this.parent instanceof this.statics.requiredContainer) && this.wrap(this.statics.requiredContainer.blotName);\n }\n remove() {\n this.domNode.parentNode != null && this.domNode.parentNode.removeChild(this.domNode), this.detach();\n }\n replaceWith(t, e) {\n const i = typeof t == \"string\" ? this.scroll.create(t, e) : t;\n return this.parent != null && (this.parent.insertBefore(i, this.next || void 0), this.remove()), i;\n }\n split(t, e) {\n return t === 0 ? this : this.next;\n }\n update(t, e) {\n }\n wrap(t, e) {\n const i = typeof t == \"string\" ? this.scroll.create(t, e) : t;\n if (this.parent != null && this.parent.insertBefore(i, this.next || void 0), typeof i.appendChild != \"function\")\n throw new m(`Cannot wrap ${t}`);\n return i.appendChild(this), i;\n }\n}\nx.blotName = \"abstract\";\nfunction B(s, t) {\n let e = t.find(s);\n if (e == null)\n try {\n e = t.create(s);\n } catch {\n e = t.create(o.INLINE), Array.from(s.childNodes).forEach((r) => {\n e.domNode.appendChild(r);\n }), s.parentNode && s.parentNode.replaceChild(e.domNode, s), e.attach();\n }\n return e;\n}\nconst u = class extends x {\n constructor(s, t) {\n super(s, t), this.uiNode = null, this.build();\n }\n appendChild(s) {\n this.insertBefore(s);\n }\n attach() {\n super.attach(), this.children.forEach((s) => {\n s.attach();\n });\n }\n attachUI(s) {\n this.uiNode != null && this.uiNode.remove(), this.uiNode = s, u.uiClass && this.uiNode.classList.add(u.uiClass), this.uiNode.setAttribute(\"contenteditable\", \"false\"), this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n build() {\n this.children = new R(), Array.from(this.domNode.childNodes).filter((s) => s !== this.uiNode).reverse().forEach((s) => {\n try {\n const t = B(s, this.scroll);\n this.insertBefore(t, this.children.head || void 0);\n } catch (t) {\n if (t instanceof m)\n return;\n throw t;\n }\n });\n }\n deleteAt(s, t) {\n if (s === 0 && t === this.length())\n return this.remove();\n this.children.forEachAt(s, t, (e, i, r) => {\n e.deleteAt(i, r);\n });\n }\n descendant(s, t = 0) {\n const [e, i] = this.children.find(t);\n return s.blotName == null && s(e) || s.blotName != null && e instanceof s ? [e, i] : e instanceof u ? e.descendant(s, i) : [null, -1];\n }\n descendants(s, t = 0, e = Number.MAX_VALUE) {\n let i = [], r = e;\n return this.children.forEachAt(\n t,\n e,\n (n, l, c) => {\n (s.blotName == null && s(n) || s.blotName != null && n instanceof s) && i.push(n), n instanceof u && (i = i.concat(\n n.descendants(s, l, r)\n )), r -= c;\n }\n ), i;\n }\n detach() {\n this.children.forEach((s) => {\n s.detach();\n }), super.detach();\n }\n enforceAllowedChildren() {\n let s = !1;\n this.children.forEach((t) => {\n s || this.statics.allowedChildren.some(\n (i) => t instanceof i\n ) || (t.statics.scope === o.BLOCK_BLOT ? (t.next != null && this.splitAfter(t), t.prev != null && this.splitAfter(t.prev), t.parent.unwrap(), s = !0) : t instanceof u ? t.unwrap() : t.remove());\n });\n }\n formatAt(s, t, e, i) {\n this.children.forEachAt(s, t, (r, n, l) => {\n r.formatAt(n, l, e, i);\n });\n }\n insertAt(s, t, e) {\n const [i, r] = this.children.find(s);\n if (i)\n i.insertAt(r, t, e);\n else {\n const n = e == null ? this.scroll.create(\"text\", t) : this.scroll.create(t, e);\n this.appendChild(n);\n }\n }\n insertBefore(s, t) {\n s.parent != null && s.parent.children.remove(s);\n let e = null;\n this.children.insertBefore(s, t || null), s.parent = this, t != null && (e = t.domNode), (this.domNode.parentNode !== s.domNode || this.domNode.nextSibling !== e) && this.domNode.insertBefore(s.domNode, e), s.attach();\n }\n length() {\n return this.children.reduce((s, t) => s + t.length(), 0);\n }\n moveChildren(s, t) {\n this.children.forEach((e) => {\n s.insertBefore(e, t);\n });\n }\n optimize(s) {\n if (super.optimize(s), this.enforceAllowedChildren(), this.uiNode != null && this.uiNode !== this.domNode.firstChild && this.domNode.insertBefore(this.uiNode, this.domNode.firstChild), this.children.length === 0)\n if (this.statics.defaultChild != null) {\n const t = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(t);\n } else\n this.remove();\n }\n path(s, t = !1) {\n const [e, i] = this.children.find(s, t), r = [[this, s]];\n return e instanceof u ? r.concat(e.path(i, t)) : (e != null && r.push([e, i]), r);\n }\n removeChild(s) {\n this.children.remove(s);\n }\n replaceWith(s, t) {\n const e = typeof s == \"string\" ? this.scroll.create(s, t) : s;\n return e instanceof u && this.moveChildren(e), super.replaceWith(e);\n }\n split(s, t = !1) {\n if (!t) {\n if (s === 0)\n return this;\n if (s === this.length())\n return this.next;\n }\n const e = this.clone();\n return this.parent && this.parent.insertBefore(e, this.next || void 0), this.children.forEachAt(s, this.length(), (i, r, n) => {\n const l = i.split(r, t);\n l != null && e.appendChild(l);\n }), e;\n }\n splitAfter(s) {\n const t = this.clone();\n for (; s.next != null; )\n t.appendChild(s.next);\n return this.parent && this.parent.insertBefore(t, this.next || void 0), t;\n }\n unwrap() {\n this.parent && this.moveChildren(this.parent, this.next || void 0), this.remove();\n }\n update(s, t) {\n const e = [], i = [];\n s.forEach((r) => {\n r.target === this.domNode && r.type === \"childList\" && (e.push(...r.addedNodes), i.push(...r.removedNodes));\n }), i.forEach((r) => {\n if (r.parentNode != null && // @ts-expect-error\n r.tagName !== \"IFRAME\" && document.body.compareDocumentPosition(r) & Node.DOCUMENT_POSITION_CONTAINED_BY)\n return;\n const n = this.scroll.find(r);\n n != null && (n.domNode.parentNode == null || n.domNode.parentNode === this.domNode) && n.detach();\n }), e.filter((r) => r.parentNode === this.domNode && r !== this.uiNode).sort((r, n) => r === n ? 0 : r.compareDocumentPosition(n) & Node.DOCUMENT_POSITION_FOLLOWING ? 1 : -1).forEach((r) => {\n let n = null;\n r.nextSibling != null && (n = this.scroll.find(r.nextSibling));\n const l = B(r, this.scroll);\n (l.next !== n || l.next == null) && (l.parent != null && l.parent.removeChild(this), this.insertBefore(l, n || void 0));\n }), this.enforceAllowedChildren();\n }\n};\nlet d = u;\nd.uiClass = \"\";\nclass L extends d {\n checkMerge() {\n return this.next !== null && this.next.statics.blotName === this.statics.blotName;\n }\n deleteAt(t, e) {\n super.deleteAt(t, e), this.enforceAllowedChildren();\n }\n formatAt(t, e, i, r) {\n super.formatAt(t, e, i, r), this.enforceAllowedChildren();\n }\n insertAt(t, e, i) {\n super.insertAt(t, e, i), this.enforceAllowedChildren();\n }\n optimize(t) {\n super.optimize(t), this.children.length > 0 && this.next != null && this.checkMerge() && (this.next.moveChildren(this), this.next.remove());\n }\n}\nL.blotName = \"container\";\nL.scope = o.BLOCK_BLOT;\nclass b extends x {\n static value(t) {\n return !0;\n }\n index(t, e) {\n return this.domNode === t || this.domNode.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_CONTAINED_BY ? Math.min(e, 1) : -1;\n }\n position(t, e) {\n let r = Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);\n return t > 0 && (r += 1), [this.parent.domNode, r];\n }\n value() {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || !0\n };\n }\n}\nb.scope = o.INLINE_BLOT;\nclass p {\n static keys(t) {\n return Array.from(t.attributes).map((e) => e.name);\n }\n constructor(t, e, i = {}) {\n this.attrName = t, this.keyName = e;\n const r = o.TYPE & o.ATTRIBUTE;\n this.scope = i.scope != null ? (\n // Ignore type bits, force attribute bit\n i.scope & o.LEVEL | r\n ) : o.ATTRIBUTE, i.whitelist != null && (this.whitelist = i.whitelist);\n }\n add(t, e) {\n return this.canAdd(t, e) ? (t.setAttribute(this.keyName, e), !0) : !1;\n }\n canAdd(t, e) {\n return this.whitelist == null ? !0 : typeof e == \"string\" ? this.whitelist.indexOf(e.replace(/[\"']/g, \"\")) > -1 : this.whitelist.indexOf(e) > -1;\n }\n remove(t) {\n t.removeAttribute(this.keyName);\n }\n value(t) {\n const e = t.getAttribute(this.keyName);\n return this.canAdd(t, e) && e ? e : \"\";\n }\n}\nfunction I(s, t) {\n return (s.getAttribute(\"class\") || \"\").split(/\\s+/).filter((i) => i.indexOf(`${t}-`) === 0);\n}\nclass P extends p {\n static keys(t) {\n return (t.getAttribute(\"class\") || \"\").split(/\\s+/).map((e) => e.split(\"-\").slice(0, -1).join(\"-\"));\n }\n add(t, e) {\n return this.canAdd(t, e) ? (this.remove(t), t.classList.add(`${this.keyName}-${e}`), !0) : !1;\n }\n remove(t) {\n I(t, this.keyName).forEach((i) => {\n t.classList.remove(i);\n }), t.classList.length === 0 && t.removeAttribute(\"class\");\n }\n value(t) {\n const i = (I(t, this.keyName)[0] || \"\").slice(this.keyName.length + 1);\n return this.canAdd(t, i) ? i : \"\";\n }\n}\nfunction w(s) {\n const t = s.split(\"-\"), e = t.slice(1).map((i) => i[0].toUpperCase() + i.slice(1)).join(\"\");\n return t[0] + e;\n}\nclass z extends p {\n static keys(t) {\n return (t.getAttribute(\"style\") || \"\").split(\";\").map((e) => e.split(\":\")[0].trim());\n }\n add(t, e) {\n return this.canAdd(t, e) ? (t.style[w(this.keyName)] = e, !0) : !1;\n }\n remove(t) {\n t.style[w(this.keyName)] = \"\", t.getAttribute(\"style\") || t.removeAttribute(\"style\");\n }\n value(t) {\n const e = t.style[w(this.keyName)];\n return this.canAdd(t, e) ? e : \"\";\n }\n}\nclass O {\n constructor(t) {\n this.attributes = {}, this.domNode = t, this.build();\n }\n attribute(t, e) {\n e ? t.add(this.domNode, e) && (t.value(this.domNode) != null ? this.attributes[t.attrName] = t : delete this.attributes[t.attrName]) : (t.remove(this.domNode), delete this.attributes[t.attrName]);\n }\n build() {\n this.attributes = {};\n const t = E.find(this.domNode);\n if (t == null)\n return;\n const e = p.keys(this.domNode), i = P.keys(this.domNode), r = z.keys(this.domNode);\n e.concat(i).concat(r).forEach((n) => {\n const l = t.scroll.query(n, o.ATTRIBUTE);\n l instanceof p && (this.attributes[l.attrName] = l);\n });\n }\n copy(t) {\n Object.keys(this.attributes).forEach((e) => {\n const i = this.attributes[e].value(this.domNode);\n t.format(e, i);\n });\n }\n move(t) {\n this.copy(t), Object.keys(this.attributes).forEach((e) => {\n this.attributes[e].remove(this.domNode);\n }), this.attributes = {};\n }\n values() {\n return Object.keys(this.attributes).reduce(\n (t, e) => (t[e] = this.attributes[e].value(this.domNode), t),\n {}\n );\n }\n}\nfunction D(s, t) {\n if (Object.keys(s).length !== Object.keys(t).length)\n return !1;\n for (const e in s)\n if (s[e] !== t[e])\n return !1;\n return !0;\n}\nconst f = class extends d {\n constructor(s, t) {\n super(s, t), this.attributes = new O(this.domNode);\n }\n static formats(s, t) {\n const e = t.query(f.blotName);\n if (!(e != null && s.tagName === e.tagName)) {\n if (typeof this.tagName == \"string\")\n return !0;\n if (Array.isArray(this.tagName))\n return s.tagName.toLowerCase();\n }\n }\n format(s, t) {\n if (s === this.statics.blotName && !t)\n this.children.forEach((e) => {\n e instanceof f || (e = e.wrap(f.blotName, !0)), this.attributes.copy(e);\n }), this.unwrap();\n else {\n const e = this.scroll.query(s, o.INLINE);\n if (e == null)\n return;\n e instanceof p ? this.attributes.attribute(e, t) : t && (s !== this.statics.blotName || this.formats()[s] !== t) && this.replaceWith(s, t);\n }\n }\n formats() {\n const s = this.attributes.values(), t = this.statics.formats(this.domNode, this.scroll);\n return t != null && (s[this.statics.blotName] = t), s;\n }\n formatAt(s, t, e, i) {\n this.formats()[e] != null || this.scroll.query(e, o.ATTRIBUTE) ? this.isolate(s, t).format(e, i) : super.formatAt(s, t, e, i);\n }\n optimize(s) {\n super.optimize(s);\n const t = this.formats();\n if (Object.keys(t).length === 0)\n return this.unwrap();\n const e = this.next;\n e instanceof f && e.prev === this && D(t, e.formats()) && (e.moveChildren(this), e.remove());\n }\n replaceWith(s, t) {\n const e = super.replaceWith(s, t);\n return this.attributes.copy(e), e;\n }\n update(s, t) {\n super.update(s, t), s.some(\n (i) => i.target === this.domNode && i.type === \"attributes\"\n ) && this.attributes.build();\n }\n wrap(s, t) {\n const e = super.wrap(s, t);\n return e instanceof f && this.attributes.move(e), e;\n }\n};\nlet g = f;\ng.allowedChildren = [f, b];\ng.blotName = \"inline\";\ng.scope = o.INLINE_BLOT;\ng.tagName = \"SPAN\";\nconst C = class extends d {\n constructor(s, t) {\n super(s, t), this.attributes = new O(this.domNode);\n }\n static formats(s, t) {\n const e = t.query(C.blotName);\n if (!(e != null && s.tagName === e.tagName)) {\n if (typeof this.tagName == \"string\")\n return !0;\n if (Array.isArray(this.tagName))\n return s.tagName.toLowerCase();\n }\n }\n format(s, t) {\n const e = this.scroll.query(s, o.BLOCK);\n e != null && (e instanceof p ? this.attributes.attribute(e, t) : s === this.statics.blotName && !t ? this.replaceWith(C.blotName) : t && (s !== this.statics.blotName || this.formats()[s] !== t) && this.replaceWith(s, t));\n }\n formats() {\n const s = this.attributes.values(), t = this.statics.formats(this.domNode, this.scroll);\n return t != null && (s[this.statics.blotName] = t), s;\n }\n formatAt(s, t, e, i) {\n this.scroll.query(e, o.BLOCK) != null ? this.format(e, i) : super.formatAt(s, t, e, i);\n }\n insertAt(s, t, e) {\n if (e == null || this.scroll.query(t, o.INLINE) != null)\n super.insertAt(s, t, e);\n else {\n const i = this.split(s);\n if (i != null) {\n const r = this.scroll.create(t, e);\n i.parent.insertBefore(r, i);\n } else\n throw new Error(\"Attempt to insertAt after block boundaries\");\n }\n }\n replaceWith(s, t) {\n const e = super.replaceWith(s, t);\n return this.attributes.copy(e), e;\n }\n update(s, t) {\n super.update(s, t), s.some(\n (i) => i.target === this.domNode && i.type === \"attributes\"\n ) && this.attributes.build();\n }\n};\nlet N = C;\nN.blotName = \"block\";\nN.scope = o.BLOCK_BLOT;\nN.tagName = \"P\";\nN.allowedChildren = [\n g,\n C,\n b\n];\nclass V extends b {\n static formats(t, e) {\n }\n format(t, e) {\n super.formatAt(0, this.length(), t, e);\n }\n formatAt(t, e, i, r) {\n t === 0 && e === this.length() ? this.format(i, r) : super.formatAt(t, e, i, r);\n }\n formats() {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\nconst W = {\n attributes: !0,\n characterData: !0,\n characterDataOldValue: !0,\n childList: !0,\n subtree: !0\n}, K = 100;\nclass A extends d {\n constructor(t, e) {\n super(null, e), this.registry = t, this.scroll = this, this.build(), this.observer = new MutationObserver((i) => {\n this.update(i);\n }), this.observer.observe(this.domNode, W), this.attach();\n }\n create(t, e) {\n return this.registry.create(this, t, e);\n }\n find(t, e = !1) {\n const i = this.registry.find(t, e);\n return i ? i.scroll === this ? i : e ? this.find(i.scroll.domNode.parentNode, !0) : null : null;\n }\n query(t, e = o.ANY) {\n return this.registry.query(t, e);\n }\n register(...t) {\n return this.registry.register(...t);\n }\n build() {\n this.scroll != null && super.build();\n }\n detach() {\n super.detach(), this.observer.disconnect();\n }\n deleteAt(t, e) {\n this.update(), t === 0 && e === this.length() ? this.children.forEach((i) => {\n i.remove();\n }) : super.deleteAt(t, e);\n }\n formatAt(t, e, i, r) {\n this.update(), super.formatAt(t, e, i, r);\n }\n insertAt(t, e, i) {\n this.update(), super.insertAt(t, e, i);\n }\n optimize(t = [], e = {}) {\n super.optimize(e);\n const i = e.mutationsMap || /* @__PURE__ */ new WeakMap();\n let r = Array.from(this.observer.takeRecords());\n for (; r.length > 0; )\n t.push(r.pop());\n const n = (a, h = !0) => {\n a == null || a === this || a.domNode.parentNode != null && (i.has(a.domNode) || i.set(a.domNode, []), h && n(a.parent));\n }, l = (a) => {\n i.has(a.domNode) && (a instanceof d && a.children.forEach(l), i.delete(a.domNode), a.optimize(e));\n };\n let c = t;\n for (let a = 0; c.length > 0; a += 1) {\n if (a >= K)\n throw new Error(\"[Parchment] Maximum optimize iterations reached\");\n for (c.forEach((h) => {\n const y = this.find(h.target, !0);\n y != null && (y.domNode === h.target && (h.type === \"childList\" ? (n(this.find(h.previousSibling, !1)), Array.from(h.addedNodes).forEach((M) => {\n const T = this.find(M, !1);\n n(T, !1), T instanceof d && T.children.forEach((U) => {\n n(U, !1);\n });\n })) : h.type === \"attributes\" && n(y.prev)), n(y));\n }), this.children.forEach(l), c = Array.from(this.observer.takeRecords()), r = c.slice(); r.length > 0; )\n t.push(r.pop());\n }\n }\n update(t, e = {}) {\n t = t || this.observer.takeRecords();\n const i = /* @__PURE__ */ new WeakMap();\n t.map((r) => {\n const n = this.find(r.target, !0);\n return n == null ? null : i.has(n.domNode) ? (i.get(n.domNode).push(r), null) : (i.set(n.domNode, [r]), n);\n }).forEach((r) => {\n r != null && r !== this && i.has(r.domNode) && r.update(i.get(r.domNode) || [], e);\n }), e.mutationsMap = i, i.has(this.domNode) && super.update(i.get(this.domNode), e), this.optimize(t, e);\n }\n}\nA.blotName = \"scroll\";\nA.defaultChild = N;\nA.allowedChildren = [N, L];\nA.scope = o.BLOCK_BLOT;\nA.tagName = \"DIV\";\nconst _ = class extends b {\n constructor(s, t) {\n super(s, t), this.text = this.statics.value(this.domNode);\n }\n static create(s) {\n return document.createTextNode(s);\n }\n static value(s) {\n return s.data;\n }\n deleteAt(s, t) {\n this.domNode.data = this.text = this.text.slice(0, s) + this.text.slice(s + t);\n }\n index(s, t) {\n return this.domNode === s ? t : -1;\n }\n insertAt(s, t, e) {\n e == null ? (this.text = this.text.slice(0, s) + t + this.text.slice(s), this.domNode.data = this.text) : super.insertAt(s, t, e);\n }\n length() {\n return this.text.length;\n }\n optimize(s) {\n super.optimize(s), this.text = this.statics.value(this.domNode), this.text.length === 0 ? this.remove() : this.next instanceof _ && this.next.prev === this && (this.insertAt(this.length(), this.next.value()), this.next.remove());\n }\n position(s, t = !1) {\n return [this.domNode, s];\n }\n split(s, t = !1) {\n if (!t) {\n if (s === 0)\n return this;\n if (s === this.length())\n return this.next;\n }\n const e = this.scroll.create(this.domNode.splitText(s));\n return this.parent.insertBefore(e, this.next || void 0), this.text = this.statics.value(this.domNode), e;\n }\n update(s, t) {\n s.some((e) => e.type === \"characterData\" && e.target === this.domNode) && (this.text = this.statics.value(this.domNode));\n }\n value() {\n return this.text;\n }\n};\nlet k = _;\nk.blotName = \"text\";\nk.scope = o.INLINE_BLOT;\n\n//# sourceMappingURL=parchment.mjs.map\n\n\n//# sourceURL=webpack://Quill/./node_modules/parchment/dist/parchment.mjs?"); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_594214__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ loaded: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_594214__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_594214__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __nested_webpack_require_594214__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __nested_webpack_require_594214__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__nested_webpack_require_594214__.o(definition, key) && !__nested_webpack_require_594214__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ !function() { +/******/ __nested_webpack_require_594214__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __nested_webpack_require_594214__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __nested_webpack_require_594214__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/node module decorator */ +/******/ !function() { +/******/ __nested_webpack_require_594214__.nmd = function(module) { +/******/ module.paths = []; +/******/ if (!module.children) module.children = []; +/******/ return module; +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module can't be inlined because the eval devtool is used. +/******/ var __nested_webpack_exports__ = __nested_webpack_require_594214__("./quill.ts"); +/******/ __nested_webpack_exports__ = __nested_webpack_exports__["default"]; +/******/ +/******/ return __nested_webpack_exports__; +/******/ })() +; +}); + +/***/ }), + +/***/ "./node_modules/quill/modules/toolbar.js": +/*!***********************************************!*\ + !*** ./node_modules/quill/modules/toolbar.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ addControls: () => (/* binding */ addControls), +/* harmony export */ "default": () => (/* binding */ Toolbar) +/* harmony export */ }); +/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill-delta */ "./node_modules/quill-delta/dist/Delta.js"); +/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! parchment */ "./node_modules/quill/node_modules/parchment/dist/parchment.mjs"); +/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/quill */ "./node_modules/quill/core/quill.js"); +/* harmony import */ var _core_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/logger */ "./node_modules/quill/core/logger.js"); +/* harmony import */ var _core_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/module */ "./node_modules/quill/core/module.js"); + + + + + +const debug = (0,_core_logger__WEBPACK_IMPORTED_MODULE_3__["default"])('quill:toolbar'); +class Toolbar extends _core_module__WEBPACK_IMPORTED_MODULE_4__["default"] { + constructor(quill, options) { + var _a, _b; + super(quill, options); + if (Array.isArray(this.options.container)) { + const container = document.createElement('div'); + container.setAttribute('role', 'toolbar'); + addControls(container, this.options.container); + (_b = (_a = quill.container) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(container, quill.container); + this.container = container; + } + else if (typeof this.options.container === 'string') { + this.container = document.querySelector(this.options.container); + } + else { + this.container = this.options.container; + } + if (!(this.container instanceof HTMLElement)) { + debug.error('Container required for toolbar', this.options); + return; + } + this.container.classList.add('ql-toolbar'); + this.controls = []; + this.handlers = {}; + if (this.options.handlers) { + Object.keys(this.options.handlers).forEach((format) => { + var _a; + const handler = (_a = this.options.handlers) === null || _a === void 0 ? void 0 : _a[format]; + if (handler) { + this.addHandler(format, handler); + } + }); + } + Array.from(this.container.querySelectorAll('button, select')).forEach((input) => { + // @ts-expect-error + this.attach(input); + }); + this.quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].events.EDITOR_CHANGE, (type, range) => { + if (type === _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].events.SELECTION_CHANGE) { + this.update(range); + } + }); + this.quill.on(_core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].events.SCROLL_OPTIMIZE, () => { + const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update + this.update(range); + }); + } + addHandler(format, handler) { + this.handlers[format] = handler; + } + attach(input) { + let format = Array.from(input.classList).find((className) => { + return className.indexOf('ql-') === 0; + }); + if (!format) + return; + format = format.slice('ql-'.length); + if (input.tagName === 'BUTTON') { + input.setAttribute('type', 'button'); + } + if (this.handlers[format] == null && + this.quill.scroll.query(format) == null) { + debug.warn('ignoring attaching to nonexistent format', format, input); + return; + } + const eventName = input.tagName === 'SELECT' ? 'change' : 'click'; + input.addEventListener(eventName, (e) => { + let value; + if (input.tagName === 'SELECT') { + // @ts-expect-error + if (input.selectedIndex < 0) + return; + // @ts-expect-error + const selected = input.options[input.selectedIndex]; + if (selected.hasAttribute('selected')) { + value = false; + } + else { + value = selected.value || false; + } + } + else { + if (input.classList.contains('ql-active')) { + value = false; + } + else { + // @ts-expect-error + value = input.value || !input.hasAttribute('value'); + } + e.preventDefault(); + } + this.quill.focus(); + const [range] = this.quill.selection.getRange(); + // @ts-expect-error Fix me later + if (this.handlers[format] != null) { + // @ts-expect-error Fix me later + this.handlers[format].call(this, value); + } + else if ( + // @ts-expect-error + this.quill.scroll.query(format).prototype instanceof parchment__WEBPACK_IMPORTED_MODULE_1__.EmbedBlot) { + value = prompt(`Enter ${format}`); // eslint-disable-line no-alert + if (!value) + return; + this.quill.updateContents(new (quill_delta__WEBPACK_IMPORTED_MODULE_0___default())() + // @ts-expect-error Fix me later + .retain(range.index) + // @ts-expect-error Fix me later + .delete(range.length) + // @ts-expect-error Fix me later + .insert({ [format]: value }), _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + else { + // @ts-expect-error Fix me later + this.quill.format(format, value, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + this.update(range); + }); + this.controls.push([format, input]); + } + update(range) { + const formats = range == null ? {} : this.quill.getFormat(range); + this.controls.forEach((pair) => { + const [format, input] = pair; + if (input.tagName === 'SELECT') { + let option = null; + if (range == null) { + option = null; + } + else if (formats[format] == null) { + option = input.querySelector('option[selected]'); + } + else if (!Array.isArray(formats[format])) { + let value = formats[format]; + if (typeof value === 'string') { + value = value.replace(/"/g, '\\"'); + } + option = input.querySelector(`option[value="${value}"]`); + } + if (option == null) { + // @ts-expect-error TODO fix me later + input.value = ''; // TODO make configurable? + // @ts-expect-error TODO fix me later + input.selectedIndex = -1; + } + else { + option.selected = true; + } + } + else if (range == null) { + input.classList.remove('ql-active'); + input.setAttribute('aria-pressed', 'false'); + } + else if (input.hasAttribute('value')) { + // both being null should match (default values) + // '1' should match with 1 (headers) + const value = formats[format]; + const isActive = value === input.getAttribute('value') || + (value != null && value.toString() === input.getAttribute('value')) || + (value == null && !input.getAttribute('value')); + input.classList.toggle('ql-active', isActive); + input.setAttribute('aria-pressed', isActive.toString()); + } + else { + const isActive = formats[format] != null; + input.classList.toggle('ql-active', isActive); + input.setAttribute('aria-pressed', isActive.toString()); + } + }); + } +} +Toolbar.DEFAULTS = {}; +function addButton(container, format, value) { + const input = document.createElement('button'); + input.setAttribute('type', 'button'); + input.classList.add(`ql-${format}`); + input.setAttribute('aria-pressed', 'false'); + if (value != null) { + input.value = value; + input.setAttribute('aria-label', `${format}: ${value}`); + } + else { + input.setAttribute('aria-label', format); + } + container.appendChild(input); +} +function addControls(container, groups) { + if (!Array.isArray(groups[0])) { + // @ts-expect-error + groups = [groups]; + } + groups.forEach((controls) => { + const group = document.createElement('span'); + group.classList.add('ql-formats'); + controls.forEach((control) => { + if (typeof control === 'string') { + addButton(group, control); + } + else { + const format = Object.keys(control)[0]; + const value = control[format]; + if (Array.isArray(value)) { + addSelect(group, format, value); + } + else { + addButton(group, format, value); + } + } + }); + container.appendChild(group); + }); +} +function addSelect(container, format, values) { + const input = document.createElement('select'); + input.classList.add(`ql-${format}`); + values.forEach((value) => { + const option = document.createElement('option'); + if (value !== false) { + option.setAttribute('value', String(value)); + } + else { + option.setAttribute('selected', 'selected'); + } + input.appendChild(option); + }); + container.appendChild(input); +} +Toolbar.DEFAULTS = { + container: null, + handlers: { + clean() { + const range = this.quill.getSelection(); + if (range == null) + return; + if (range.length === 0) { + const formats = this.quill.getFormat(); + Object.keys(formats).forEach((name) => { + // Clean functionality in existing apps only clean inline formats + if (this.quill.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_1__.Scope.INLINE) != null) { + this.quill.format(name, false, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + }); + } + else { + this.quill.removeFormat(range, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + }, + direction(value) { + const { align } = this.quill.getFormat(); + if (value === 'rtl' && align == null) { + this.quill.format('align', 'right', _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + else if (!value && align === 'right') { + this.quill.format('align', false, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + this.quill.format('direction', value, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + }, + indent(value) { + const range = this.quill.getSelection(); + const formats = this.quill.getFormat(range); + const indent = parseInt(formats.indent || 0, 10); + if (value === '+1' || value === '-1') { + let modifier = value === '+1' ? 1 : -1; + if (formats.direction === 'rtl') + modifier *= -1; + this.quill.format('indent', indent + modifier, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + }, + link(value) { + if (value === true) { + value = prompt('Enter link URL:'); // eslint-disable-line no-alert + } + this.quill.format('link', value, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + }, + list(value) { + const range = this.quill.getSelection(); + const formats = this.quill.getFormat(range); + if (value === 'check') { + if (formats.list === 'checked' || formats.list === 'unchecked') { + this.quill.format('list', false, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + else { + this.quill.format('list', 'unchecked', _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + } + else { + this.quill.format('list', value, _core_quill__WEBPACK_IMPORTED_MODULE_2__["default"].sources.USER); + } + }, + }, +}; + +//# sourceMappingURL=toolbar.js.map + +/***/ }), + +/***/ "./node_modules/quill/themes/base.js": +/*!*******************************************!*\ + !*** ./node_modules/quill/themes/base.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BaseTooltip: () => (/* binding */ BaseTooltip), +/* harmony export */ "default": () => (/* binding */ BaseTheme) +/* harmony export */ }); +/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.merge */ "./node_modules/lodash.merge/index.js"); +/* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _core_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/emitter */ "./node_modules/quill/core/emitter.js"); +/* harmony import */ var _core_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/theme */ "./node_modules/quill/core/theme.js"); +/* harmony import */ var _ui_color_picker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ui/color-picker */ "./node_modules/quill/ui/color-picker.js"); +/* harmony import */ var _ui_icon_picker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ui/icon-picker */ "./node_modules/quill/ui/icon-picker.js"); +/* harmony import */ var _ui_picker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ui/picker */ "./node_modules/quill/ui/picker.js"); +/* harmony import */ var _ui_tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ui/tooltip */ "./node_modules/quill/ui/tooltip.js"); + + + + + + + +const ALIGNS = [false, 'center', 'right', 'justify']; +const COLORS = [ + '#000000', + '#e60000', + '#ff9900', + '#ffff00', + '#008a00', + '#0066cc', + '#9933ff', + '#ffffff', + '#facccc', + '#ffebcc', + '#ffffcc', + '#cce8cc', + '#cce0f5', + '#ebd6ff', + '#bbbbbb', + '#f06666', + '#ffc266', + '#ffff66', + '#66b966', + '#66a3e0', + '#c285ff', + '#888888', + '#a10000', + '#b26b00', + '#b2b200', + '#006100', + '#0047b2', + '#6b24b2', + '#444444', + '#5c0000', + '#663d00', + '#666600', + '#003700', + '#002966', + '#3d1466', +]; +const FONTS = [false, 'serif', 'monospace']; +const HEADERS = ['1', '2', '3', false]; +const SIZES = ['small', false, 'large', 'huge']; +class BaseTheme extends _core_theme__WEBPACK_IMPORTED_MODULE_2__["default"] { + constructor(quill, options) { + super(quill, options); + const listener = (e) => { + if (!document.body.contains(quill.root)) { + document.body.removeEventListener('click', listener); + return; + } + if (this.tooltip != null && + // @ts-expect-error + !this.tooltip.root.contains(e.target) && + // @ts-expect-error + document.activeElement !== this.tooltip.textbox && + !this.quill.hasFocus()) { + this.tooltip.hide(); + } + if (this.pickers != null) { + this.pickers.forEach((picker) => { + // @ts-expect-error + if (!picker.container.contains(e.target)) { + picker.close(); + } + }); + } + }; + quill.emitter.listenDOM('click', document.body, listener); + } + addModule(name) { + const module = super.addModule(name); + if (name === 'toolbar') { + // @ts-expect-error + this.extendToolbar(module); + } + return module; + } + buildButtons(buttons, icons) { + Array.from(buttons).forEach((button) => { + const className = button.getAttribute('class') || ''; + className.split(/\s+/).forEach((name) => { + if (!name.startsWith('ql-')) + return; + name = name.slice('ql-'.length); + if (icons[name] == null) + return; + if (name === 'direction') { + button.innerHTML = icons[name][''] + icons[name].rtl; + } + else if (typeof icons[name] === 'string') { + // @ts-expect-error + button.innerHTML = icons[name]; + } + else { + // @ts-expect-error + const value = button.value || ''; + if (value != null && icons[name][value]) { + button.innerHTML = icons[name][value]; + } + } + }); + }); + } + buildPickers(selects, icons) { + this.pickers = Array.from(selects).map((select) => { + if (select.classList.contains('ql-align')) { + if (select.querySelector('option') == null) { + fillSelect(select, ALIGNS); + } + if (typeof icons.align === 'object') { + return new _ui_icon_picker__WEBPACK_IMPORTED_MODULE_4__["default"](select, icons.align); + } + } + if (select.classList.contains('ql-background') || + select.classList.contains('ql-color')) { + const format = select.classList.contains('ql-background') + ? 'background' + : 'color'; + if (select.querySelector('option') == null) { + fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); + } + return new _ui_color_picker__WEBPACK_IMPORTED_MODULE_3__["default"](select, icons[format]); + } + if (select.querySelector('option') == null) { + if (select.classList.contains('ql-font')) { + fillSelect(select, FONTS); + } + else if (select.classList.contains('ql-header')) { + fillSelect(select, HEADERS); + } + else if (select.classList.contains('ql-size')) { + fillSelect(select, SIZES); + } + } + return new _ui_picker__WEBPACK_IMPORTED_MODULE_5__["default"](select); + }); + const update = () => { + this.pickers.forEach((picker) => { + picker.update(); + }); + }; + this.quill.on(_core_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].events.EDITOR_CHANGE, update); + } +} +BaseTheme.DEFAULTS = lodash_merge__WEBPACK_IMPORTED_MODULE_0___default()({}, _core_theme__WEBPACK_IMPORTED_MODULE_2__["default"].DEFAULTS, { + modules: { + toolbar: { + handlers: { + formula() { + this.quill.theme.tooltip.edit('formula'); + }, + image() { + let fileInput = this.container.querySelector('input.ql-image[type=file]'); + if (fileInput == null) { + fileInput = document.createElement('input'); + fileInput.setAttribute('type', 'file'); + fileInput.setAttribute('accept', this.quill.uploader.options.mimetypes.join(', ')); + fileInput.classList.add('ql-image'); + fileInput.addEventListener('change', () => { + const range = this.quill.getSelection(true); + this.quill.uploader.upload(range, fileInput.files); + fileInput.value = ''; + }); + this.container.appendChild(fileInput); + } + fileInput.click(); + }, + video() { + this.quill.theme.tooltip.edit('video'); + }, + }, + }, + }, +}); +class BaseTooltip extends _ui_tooltip__WEBPACK_IMPORTED_MODULE_6__["default"] { + constructor(quill, boundsContainer) { + super(quill, boundsContainer); + this.textbox = this.root.querySelector('input[type="text"]'); + this.listen(); + } + listen() { + // @ts-expect-error Fix me later + this.textbox.addEventListener('keydown', (event) => { + if (event.key === 'Enter') { + this.save(); + event.preventDefault(); + } + else if (event.key === 'Escape') { + this.cancel(); + event.preventDefault(); + } + }); + } + cancel() { + this.hide(); + this.restoreFocus(); + } + edit(mode = 'link', preview = null) { + this.root.classList.remove('ql-hidden'); + this.root.classList.add('ql-editing'); + if (this.textbox == null) + return; + if (preview != null) { + this.textbox.value = preview; + } + else if (mode !== this.root.getAttribute('data-mode')) { + this.textbox.value = ''; + } + const bounds = this.quill.getBounds(this.quill.selection.savedRange); + if (bounds != null) { + this.position(bounds); + } + this.textbox.select(); + this.textbox.setAttribute('placeholder', this.textbox.getAttribute(`data-${mode}`) || ''); + this.root.setAttribute('data-mode', mode); + } + restoreFocus() { + this.quill.focus({ preventScroll: true }); + } + save() { + // @ts-expect-error Fix me later + let { value } = this.textbox; + switch (this.root.getAttribute('data-mode')) { + case 'link': { + const { scrollTop } = this.quill.root; + if (this.linkRange) { + this.quill.formatText(this.linkRange, 'link', value, _core_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].sources.USER); + delete this.linkRange; + } + else { + this.restoreFocus(); + this.quill.format('link', value, _core_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].sources.USER); + } + this.quill.root.scrollTop = scrollTop; + break; + } + case 'video': { + value = extractVideoUrl(value); + } // eslint-disable-next-line no-fallthrough + case 'formula': { + if (!value) + break; + const range = this.quill.getSelection(true); + if (range != null) { + const index = range.index + range.length; + this.quill.insertEmbed(index, + // @ts-expect-error Fix me later + this.root.getAttribute('data-mode'), value, _core_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].sources.USER); + if (this.root.getAttribute('data-mode') === 'formula') { + this.quill.insertText(index + 1, ' ', _core_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].sources.USER); + } + this.quill.setSelection(index + 2, _core_emitter__WEBPACK_IMPORTED_MODULE_1__["default"].sources.USER); + } + break; + } + default: + } + // @ts-expect-error Fix me later + this.textbox.value = ''; + this.hide(); + } +} +function extractVideoUrl(url) { + let match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || + url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); + if (match) { + return `${match[1] || 'https'}://www.youtube.com/embed/${match[2]}?showinfo=0`; + } + // eslint-disable-next-line no-cond-assign + if ((match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))) { + return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`; + } + return url; +} +function fillSelect(select, values, defaultValue = false) { + values.forEach((value) => { + const option = document.createElement('option'); + if (value === defaultValue) { + option.setAttribute('selected', 'selected'); + } + else { + option.setAttribute('value', String(value)); + } + select.appendChild(option); + }); +} + +//# sourceMappingURL=base.js.map + +/***/ }), + +/***/ "./node_modules/quill/ui/color-picker.js": +/*!***********************************************!*\ + !*** ./node_modules/quill/ui/color-picker.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _picker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./picker */ "./node_modules/quill/ui/picker.js"); + +class ColorPicker extends _picker__WEBPACK_IMPORTED_MODULE_0__["default"] { + constructor(select, label) { + super(select); + this.label.innerHTML = label; + this.container.classList.add('ql-color-picker'); + Array.from(this.container.querySelectorAll('.ql-picker-item')) + .slice(0, 7) + .forEach((item) => { + item.classList.add('ql-primary'); + }); + } + buildItem(option) { + const item = super.buildItem(option); + item.style.backgroundColor = option.getAttribute('value') || ''; + return item; + } + selectItem(item, trigger) { + super.selectItem(item, trigger); + const colorLabel = this.label.querySelector('.ql-color-label'); + const value = item ? item.getAttribute('data-value') || '' : ''; + if (colorLabel) { + if (colorLabel.tagName === 'line') { + colorLabel.style.stroke = value; + } + else { + colorLabel.style.fill = value; + } + } + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ColorPicker); +//# sourceMappingURL=color-picker.js.map + +/***/ }), + +/***/ "./node_modules/quill/ui/icon-picker.js": +/*!**********************************************!*\ + !*** ./node_modules/quill/ui/icon-picker.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _picker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./picker */ "./node_modules/quill/ui/picker.js"); + +class IconPicker extends _picker__WEBPACK_IMPORTED_MODULE_0__["default"] { + constructor(select, icons) { + super(select); + this.container.classList.add('ql-icon-picker'); + Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach((item) => { + item.innerHTML = icons[item.getAttribute('data-value') || '']; + }); + this.defaultItem = this.container.querySelector('.ql-selected'); + this.selectItem(this.defaultItem); + } + selectItem(target, trigger) { + super.selectItem(target, trigger); + const item = target || this.defaultItem; + if (item != null) { + if (this.label.innerHTML === item.innerHTML) + return; + this.label.innerHTML = item.innerHTML; + } + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IconPicker); +//# sourceMappingURL=icon-picker.js.map + +/***/ }), + +/***/ "./node_modules/quill/ui/picker.js": +/*!*****************************************!*\ + !*** ./node_modules/quill/ui/picker.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _assets_icons_dropdown_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../assets/icons/dropdown.svg */ "./node_modules/quill/assets/icons/dropdown.svg"); + +let optionsCounter = 0; +function toggleAriaAttribute(element, attribute) { + element.setAttribute(attribute, `${!(element.getAttribute(attribute) === 'true')}`); +} +class Picker { + constructor(select) { + this.select = select; + this.container = document.createElement('span'); + this.buildPicker(); + this.select.style.display = 'none'; + // @ts-expect-error Fix me later + this.select.parentNode.insertBefore(this.container, this.select); + this.label.addEventListener('mousedown', () => { + this.togglePicker(); + }); + this.label.addEventListener('keydown', (event) => { + switch (event.key) { + case 'Enter': + this.togglePicker(); + break; + case 'Escape': + this.escape(); + event.preventDefault(); + break; + default: + } + }); + this.select.addEventListener('change', this.update.bind(this)); + } + togglePicker() { + this.container.classList.toggle('ql-expanded'); + // Toggle aria-expanded and aria-hidden to make the picker accessible + toggleAriaAttribute(this.label, 'aria-expanded'); + // @ts-expect-error + toggleAriaAttribute(this.options, 'aria-hidden'); + } + buildItem(option) { + const item = document.createElement('span'); + // @ts-expect-error + item.tabIndex = '0'; + item.setAttribute('role', 'button'); + item.classList.add('ql-picker-item'); + const value = option.getAttribute('value'); + if (value) { + item.setAttribute('data-value', value); + } + if (option.textContent) { + item.setAttribute('data-label', option.textContent); + } + item.addEventListener('click', () => { + this.selectItem(item, true); + }); + item.addEventListener('keydown', (event) => { + switch (event.key) { + case 'Enter': + this.selectItem(item, true); + event.preventDefault(); + break; + case 'Escape': + this.escape(); + event.preventDefault(); + break; + default: + } + }); + return item; + } + buildLabel() { + const label = document.createElement('span'); + label.classList.add('ql-picker-label'); + label.innerHTML = _assets_icons_dropdown_svg__WEBPACK_IMPORTED_MODULE_0__; + // @ts-expect-error + label.tabIndex = '0'; + label.setAttribute('role', 'button'); + label.setAttribute('aria-expanded', 'false'); + this.container.appendChild(label); + return label; + } + buildOptions() { + const options = document.createElement('span'); + options.classList.add('ql-picker-options'); + // Don't want screen readers to read this until options are visible + options.setAttribute('aria-hidden', 'true'); + // @ts-expect-error + options.tabIndex = '-1'; + // Need a unique id for aria-controls + options.id = `ql-picker-options-${optionsCounter}`; + optionsCounter += 1; + this.label.setAttribute('aria-controls', options.id); + // @ts-expect-error + this.options = options; + Array.from(this.select.options).forEach((option) => { + const item = this.buildItem(option); + options.appendChild(item); + if (option.selected === true) { + this.selectItem(item); + } + }); + this.container.appendChild(options); + } + buildPicker() { + Array.from(this.select.attributes).forEach((item) => { + this.container.setAttribute(item.name, item.value); + }); + this.container.classList.add('ql-picker'); + this.label = this.buildLabel(); + this.buildOptions(); + } + escape() { + // Close menu and return focus to trigger label + this.close(); + // Need setTimeout for accessibility to ensure that the browser executes + // focus on the next process thread and after any DOM content changes + setTimeout(() => this.label.focus(), 1); + } + close() { + this.container.classList.remove('ql-expanded'); + this.label.setAttribute('aria-expanded', 'false'); + // @ts-expect-error + this.options.setAttribute('aria-hidden', 'true'); + } + selectItem(item, trigger = false) { + const selected = this.container.querySelector('.ql-selected'); + if (item === selected) + return; + if (selected != null) { + selected.classList.remove('ql-selected'); + } + if (item == null) + return; + item.classList.add('ql-selected'); + // @ts-expect-error Fix me later + this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(item); + if (item.hasAttribute('data-value')) { + // @ts-expect-error Fix me later + this.label.setAttribute('data-value', item.getAttribute('data-value')); + } + else { + this.label.removeAttribute('data-value'); + } + if (item.hasAttribute('data-label')) { + // @ts-expect-error Fix me later + this.label.setAttribute('data-label', item.getAttribute('data-label')); + } + else { + this.label.removeAttribute('data-label'); + } + if (trigger) { + this.select.dispatchEvent(new Event('change')); + this.close(); + } + } + update() { + let option; + if (this.select.selectedIndex > -1) { + const item = + // @ts-expect-error Fix me later + this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex]; + option = this.select.options[this.select.selectedIndex]; + // @ts-expect-error + this.selectItem(item); + } + else { + this.selectItem(null); + } + const isActive = option != null && + option !== this.select.querySelector('option[selected]'); + this.label.classList.toggle('ql-active', isActive); + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Picker); +//# sourceMappingURL=picker.js.map + +/***/ }), + +/***/ "./node_modules/quill/ui/tooltip.js": +/*!******************************************!*\ + !*** ./node_modules/quill/ui/tooltip.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const isScrollable = (el) => { + const { overflowY } = getComputedStyle(el, null); + return overflowY !== 'visible' && overflowY !== 'clip'; +}; +class Tooltip { + constructor(quill, boundsContainer) { + this.quill = quill; + this.boundsContainer = boundsContainer || document.body; + this.root = quill.addContainer('ql-tooltip'); + // @ts-expect-error + this.root.innerHTML = this.constructor.TEMPLATE; + if (isScrollable(this.quill.root)) { + this.quill.root.addEventListener('scroll', () => { + this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`; + }); + } + this.hide(); + } + hide() { + this.root.classList.add('ql-hidden'); + } + position(reference) { + const left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; + // root.scrollTop should be 0 if scrollContainer !== root + const top = reference.bottom + this.quill.root.scrollTop; + this.root.style.left = `${left}px`; + this.root.style.top = `${top}px`; + this.root.classList.remove('ql-flip'); + const containerBounds = this.boundsContainer.getBoundingClientRect(); + const rootBounds = this.root.getBoundingClientRect(); + let shift = 0; + if (rootBounds.right > containerBounds.right) { + shift = containerBounds.right - rootBounds.right; + this.root.style.left = `${left + shift}px`; + } + if (rootBounds.left < containerBounds.left) { + shift = containerBounds.left - rootBounds.left; + this.root.style.left = `${left + shift}px`; + } + if (rootBounds.bottom > containerBounds.bottom) { + const height = rootBounds.bottom - rootBounds.top; + const verticalShift = reference.bottom - reference.top + height; + this.root.style.top = `${top - verticalShift}px`; + this.root.classList.add('ql-flip'); + } + return shift; + } + show() { + this.root.classList.remove('ql-editing'); + this.root.classList.remove('ql-hidden'); + } +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tooltip); +//# sourceMappingURL=tooltip.js.map + +/***/ }), + +/***/ "./node_modules/react-dom/cjs/react-dom.development.js": +/*!*************************************************************!*\ + !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +/** @license React v17.0.2 + * react-dom.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +if (true) { + (function() { +'use strict'; + +var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); +var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/scheduler/index.js"); +var tracing = __webpack_require__(/*! scheduler/tracing */ "./node_modules/scheduler/tracing.js"); + +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +// by calls to these methods by a Babel plugin. +// +// In PROD (or in packages without access to React internals), +// they are left as they are instead. + +function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + printWarning('warn', format, args); + } +} +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +if (!React) { + { + throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." ); + } +} + +var FunctionComponent = 0; +var ClassComponent = 1; +var IndeterminateComponent = 2; // Before we know whether it is function or class + +var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + +var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + +var HostComponent = 5; +var HostText = 6; +var Fragment = 7; +var Mode = 8; +var ContextConsumer = 9; +var ContextProvider = 10; +var ForwardRef = 11; +var Profiler = 12; +var SuspenseComponent = 13; +var MemoComponent = 14; +var SimpleMemoComponent = 15; +var LazyComponent = 16; +var IncompleteClassComponent = 17; +var DehydratedFragment = 18; +var SuspenseListComponent = 19; +var FundamentalComponent = 20; +var ScopeComponent = 21; +var Block = 22; +var OffscreenComponent = 23; +var LegacyHiddenComponent = 24; + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableProfilerTimer = true; // Record durations for commit and passive effects phases. + +var enableFundamentalAPI = false; // Experimental Scope support. +var enableNewReconciler = false; // Errors that are thrown while unmounting (or after in the case of passive effects) +var warnAboutStringRefs = false; + +var allNativeEvents = new Set(); +/** + * Mapping from registration name to event name + */ + + +var registrationNameDependencies = {}; +/** + * Mapping from lowercase registration names to the properly cased version, + * used to warn in the case of missing event handlers. Available + * only in true. + * @type {Object} + */ + +var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true + +function registerTwoPhaseEvent(registrationName, dependencies) { + registerDirectEvent(registrationName, dependencies); + registerDirectEvent(registrationName + 'Capture', dependencies); +} +function registerDirectEvent(registrationName, dependencies) { + { + if (registrationNameDependencies[registrationName]) { + error('EventRegistry: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName); + } + } + + registrationNameDependencies[registrationName] = dependencies; + + { + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + + if (registrationName === 'onDoubleClick') { + possibleRegistrationNames.ondblclick = registrationName; + } + } + + for (var i = 0; i < dependencies.length; i++) { + allNativeEvents.add(dependencies[i]); + } +} + +var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); + +// A reserved attribute. +// It is handled by React separately and shouldn't be written to the DOM. +var RESERVED = 0; // A simple string attribute. +// Attributes that aren't in the filter are presumed to have this type. + +var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called +// "enumerated" attributes with "true" and "false" as possible values. +// When true, it should be set to a "true" string. +// When false, it should be set to a "false" string. + +var BOOLEANISH_STRING = 2; // A real boolean attribute. +// When true, it should be present (set either to an empty string or its name). +// When false, it should be omitted. + +var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. +// When true, it should be present (set either to an empty string or its name). +// When false, it should be omitted. +// For any other value, should be present with that value. + +var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. +// When falsy, it should be removed. + +var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. +// When falsy, it should be removed. + +var POSITIVE_NUMERIC = 6; + +/* eslint-disable max-len */ +var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; +/* eslint-enable max-len */ + +var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; +var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; +var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); +var hasOwnProperty = Object.prototype.hasOwnProperty; +var illegalAttributeNameCache = {}; +var validatedAttributeNameCache = {}; +function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { + return true; + } + + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { + return false; + } + + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + + illegalAttributeNameCache[attributeName] = true; + + { + error('Invalid attribute name: `%s`', attributeName); + } + + return false; +} +function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null) { + return propertyInfo.type === RESERVED; + } + + if (isCustomComponentTag) { + return false; + } + + if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { + return true; + } + + return false; +} +function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null && propertyInfo.type === RESERVED) { + return false; + } + + switch (typeof value) { + case 'function': // $FlowIssue symbol is perfectly valid here + + case 'symbol': + // eslint-disable-line + return true; + + case 'boolean': + { + if (isCustomComponentTag) { + return false; + } + + if (propertyInfo !== null) { + return !propertyInfo.acceptsBooleans; + } else { + var prefix = name.toLowerCase().slice(0, 5); + return prefix !== 'data-' && prefix !== 'aria-'; + } + } + + default: + return false; + } +} +function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { + if (value === null || typeof value === 'undefined') { + return true; + } + + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { + return true; + } + + if (isCustomComponentTag) { + return false; + } + + if (propertyInfo !== null) { + + switch (propertyInfo.type) { + case BOOLEAN: + return !value; + + case OVERLOADED_BOOLEAN: + return value === false; + + case NUMERIC: + return isNaN(value); + + case POSITIVE_NUMERIC: + return isNaN(value) || value < 1; + } + } + + return false; +} +function getPropertyInfo(name) { + return properties.hasOwnProperty(name) ? properties[name] : null; +} + +function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { + this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + this.attributeName = attributeName; + this.attributeNamespace = attributeNamespace; + this.mustUseProperty = mustUseProperty; + this.propertyName = name; + this.type = type; + this.sanitizeURL = sanitizeURL; + this.removeEmptyString = removeEmptyString; +} // When adding attributes to this list, be sure to also add them to +// the `possibleStandardNames` module to ensure casing and incorrect +// name warnings. + + +var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. + +var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular +// elements (not just inputs). Now that ReactDOMInput assigns to the +// defaultValue property -- do we need this? +'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']; +reservedProps.forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // A few React string attributes have a different name. +// This is a mapping from React prop names to the attribute names. + +[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { + var name = _ref[0], + attributeName = _ref[1]; + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // These are "enumerated" HTML attributes that accept "true" and "false". +// In React, we let users pass `true` and `false` even though technically +// these aren't boolean attributes (they are coerced to strings). + +['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // These are "enumerated" SVG attributes that accept "true" and "false". +// In React, we let users pass `true` and `false` even though technically +// these aren't boolean attributes (they are coerced to strings). +// Since these are SVG attributes, their attribute names are case-sensitive. + +['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // These are HTML boolean attributes. + +['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM +// on the client side because the browsers are inconsistent. Instead we call focus(). +'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata +'itemScope'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // These are the few React props that we set as DOM properties +// rather than attributes. These are all booleans. + +['checked', // Note: `option.selected` is not updated if `select.multiple` is +// disabled with `removeAttribute`. We have special logic for handling this. +'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // These are HTML attributes that are "overloaded booleans": they behave like +// booleans, but can also accept a string value. + +['capture', 'download' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // These are HTML attributes that must be positive numbers. + +['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // These are HTML attributes that must be numbers. + +['rowSpan', 'start'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); +var CAMELIZE = /[\-\:]([a-z])/g; + +var capitalize = function (token) { + return token[1].toUpperCase(); +}; // This is a list of all SVG attributes that need special casing, namespacing, +// or boolean value assignment. Regular attributes that just accept strings +// and have the same names are omitted, just like in the HTML attribute filter. +// Some of these attributes can be hard to find. This list was created by +// scraping the MDN documentation. + + +['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, null, // attributeNamespace + false, // sanitizeURL + false); +}); // String SVG attributes with the xlink namespace. + +['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL + false); +}); // String SVG attributes with the xml namespace. + +['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL + false); +}); // These attribute exists both in HTML and SVG. +// The attribute name is case-sensitive in SVG so we can't just use +// the React name like we do for attributes that exist only in HTML. + +['tabIndex', 'crossOrigin'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + false, // sanitizeURL + false); +}); // These attributes accept URLs. These must not allow javascript: URLS. +// These will also need to accept Trusted Types object in the future. + +var xlinkHref = 'xlinkHref'; +properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty +'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL +false); +['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + true, // sanitizeURL + true); +}); + +// and any newline or tab are filtered out as if they're not part of the URL. +// https://url.spec.whatwg.org/#url-parsing +// Tab or newline are defined as \r\n\t: +// https://infra.spec.whatwg.org/#ascii-tab-or-newline +// A C0 control is a code point in the range \u0000 NULL to \u001F +// INFORMATION SEPARATOR ONE, inclusive: +// https://infra.spec.whatwg.org/#c0-control-or-space + +/* eslint-disable max-len */ + +var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; +var didWarn = false; + +function sanitizeURL(url) { + { + if (!didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; + + error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); + } + } +} + +/** + * Get the value for a property on a node. Only used in DEV for SSR validation. + * The "expected" argument is used as a hint of what the expected value is. + * Some properties have multiple equivalent values. + */ +function getValueForProperty(node, name, expected, propertyInfo) { + { + if (propertyInfo.mustUseProperty) { + var propertyName = propertyInfo.propertyName; + return node[propertyName]; + } else { + if ( propertyInfo.sanitizeURL) { + // If we haven't fully disabled javascript: URLs, and if + // the hydration is successful of a javascript: URL, we + // still want to warn on the client. + sanitizeURL('' + expected); + } + + var attributeName = propertyInfo.attributeName; + var stringValue = null; + + if (propertyInfo.type === OVERLOADED_BOOLEAN) { + if (node.hasAttribute(attributeName)) { + var value = node.getAttribute(attributeName); + + if (value === '') { + return true; + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return value; + } + + if (value === '' + expected) { + return expected; + } + + return value; + } + } else if (node.hasAttribute(attributeName)) { + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + // We had an attribute but shouldn't have had one, so read it + // for the error message. + return node.getAttribute(attributeName); + } + + if (propertyInfo.type === BOOLEAN) { + // If this was a boolean, it doesn't matter what the value is + // the fact that we have it is the same as the expected. + return expected; + } // Even if this property uses a namespace we use getAttribute + // because we assume its namespaced name is the same as our config. + // To use getAttributeNS we need the local name which we don't have + // in our config atm. + + + stringValue = node.getAttribute(attributeName); + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return stringValue === null ? expected : stringValue; + } else if (stringValue === '' + expected) { + return expected; + } else { + return stringValue; + } + } + } +} +/** + * Get the value for a attribute on a node. Only used in DEV for SSR validation. + * The third argument is used as a hint of what the expected value is. Some + * attributes have multiple equivalent values. + */ + +function getValueForAttribute(node, name, expected) { + { + if (!isAttributeNameSafe(name)) { + return; + } // If the object is an opaque reference ID, it's expected that + // the next prop is different than the server value, so just return + // expected + + + if (isOpaqueHydratingObject(expected)) { + return expected; + } + + if (!node.hasAttribute(name)) { + return expected === undefined ? undefined : null; + } + + var value = node.getAttribute(name); + + if (value === '' + expected) { + return expected; + } + + return value; + } +} +/** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + +function setValueForProperty(node, name, value, isCustomComponentTag) { + var propertyInfo = getPropertyInfo(name); + + if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { + return; + } + + if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { + value = null; + } // If the prop isn't in the special list, treat it as a simple attribute. + + + if (isCustomComponentTag || propertyInfo === null) { + if (isAttributeNameSafe(name)) { + var _attributeName = name; + + if (value === null) { + node.removeAttribute(_attributeName); + } else { + node.setAttribute(_attributeName, '' + value); + } + } + + return; + } + + var mustUseProperty = propertyInfo.mustUseProperty; + + if (mustUseProperty) { + var propertyName = propertyInfo.propertyName; + + if (value === null) { + var type = propertyInfo.type; + node[propertyName] = type === BOOLEAN ? false : ''; + } else { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propertyName] = value; + } + + return; + } // The rest are treated as attributes with special cases. + + + var attributeName = propertyInfo.attributeName, + attributeNamespace = propertyInfo.attributeNamespace; + + if (value === null) { + node.removeAttribute(attributeName); + } else { + var _type = propertyInfo.type; + var attributeValue; + + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + // If attribute type is boolean, we know for sure it won't be an execution sink + // and we won't require Trusted Type here. + attributeValue = ''; + } else { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + { + attributeValue = '' + value; + } + + if (propertyInfo.sanitizeURL) { + sanitizeURL(attributeValue.toString()); + } + } + + if (attributeNamespace) { + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } else { + node.setAttribute(attributeName, attributeValue); + } + } +} + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +var REACT_FRAGMENT_TYPE = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + REACT_FRAGMENT_TYPE = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +// Helpers to patch console.logs to avoid logging during side-effect free +// replaying on render function. This currently only patches the object +// lazily which won't cover if the log function was extracted eagerly. +// We could also eagerly patch the method. +var disabledDepth = 0; +var prevLog; +var prevInfo; +var prevWarn; +var prevError; +var prevGroup; +var prevGroupCollapsed; +var prevGroupEnd; + +function disabledLog() {} + +disabledLog.__reactDisabledLog = true; +function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + + disabledDepth++; + } +} +function reenableLogs() { + { + disabledDepth--; + + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: _assign({}, props, { + value: prevLog + }), + info: _assign({}, props, { + value: prevInfo + }), + warn: _assign({}, props, { + value: prevWarn + }), + error: _assign({}, props, { + value: prevError + }), + group: _assign({}, props, { + value: prevGroup + }), + groupCollapsed: _assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: _assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } +} + +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; +var prefix; +function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + + return '\n' + prefix + name; + } +} +var reentry = false; +var componentFrameCache; + +{ + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); +} + +function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher.current = null; + disableLogs(); + } + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe + + + Object.defineProperty(Fake.prototype, 'props', { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; +} + +function describeClassComponentFrame(ctor, source, ownerFn) { + { + return describeNativeComponentFrame(ctor, true); + } +} +function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } +} + +function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); +} + +function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + + if (type == null) { + return ''; + } + + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame('Suspense'); + + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + + case REACT_BLOCK_TYPE: + return describeFunctionComponentFrame(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + + return ''; +} + +function describeFiber(fiber) { + var owner = fiber._debugOwner ? fiber._debugOwner.type : null ; + var source = fiber._debugSource ; + + switch (fiber.tag) { + case HostComponent: + return describeBuiltInComponentFrame(fiber.type); + + case LazyComponent: + return describeBuiltInComponentFrame('Lazy'); + + case SuspenseComponent: + return describeBuiltInComponentFrame('Suspense'); + + case SuspenseListComponent: + return describeBuiltInComponentFrame('SuspenseList'); + + case FunctionComponent: + case IndeterminateComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(fiber.type); + + case ForwardRef: + return describeFunctionComponentFrame(fiber.type.render); + + case Block: + return describeFunctionComponentFrame(fiber.type._render); + + case ClassComponent: + return describeClassComponentFrame(fiber.type); + + default: + return ''; + } +} + +function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ''; + var node = workInProgress; + + do { + info += describeFiber(node); + node = node.return; + } while (node); + + return info; + } catch (x) { + return '\nError generating stack: ' + x.message + '\n' + x.stack; + } +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getContextName(type) { + return type.displayName || 'Context'; +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return 'Profiler'; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentName(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; +} + +var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; +var current = null; +var isRendering = false; +function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + + var owner = current._debugOwner; + + if (owner !== null && typeof owner !== 'undefined') { + return getComponentName(owner.type); + } + } + + return null; +} + +function getCurrentFiberStackInDev() { + { + if (current === null) { + return ''; + } // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. + + + return getStackByFiberInDevAndProd(current); + } +} + +function resetCurrentFiber() { + { + ReactDebugCurrentFrame.getCurrentStack = null; + current = null; + isRendering = false; + } +} +function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + isRendering = false; + } +} +function setIsRendering(rendering) { + { + isRendering = rendering; + } +} +function getIsRendering() { + { + return isRendering; + } +} + +// Flow does not allow string concatenation of most non-string types. To work +// around this limitation, we use an opaque type that can only be obtained by +// passing the value through getToStringValue first. +function toString(value) { + return '' + value; +} +function getToStringValue(value) { + switch (typeof value) { + case 'boolean': + case 'number': + case 'object': + case 'string': + case 'undefined': + return value; + + default: + // function, symbol are assigned as empty strings + return ''; + } +} + +var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true +}; +function checkControlledValueProps(tagName, props) { + { + if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { + error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + } + + if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { + error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + } + } +} + +function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); +} + +function getTracker(node) { + return node._valueTracker; +} + +function detachTracker(node) { + node._valueTracker = null; +} + +function getValueFromNode(node) { + var value = ''; + + if (!node) { + return value; + } + + if (isCheckable(node)) { + value = node.checked ? 'true' : 'false'; + } else { + value = node.value; + } + + return value; +} + +function trackValueOnNode(node) { + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail + // and don't track value will cause over reporting of changes, + // but it's better then a hard failure + // (needed for certain tests that spyOn input values and Safari) + + if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { + return; + } + + var get = descriptor.get, + set = descriptor.set; + Object.defineProperty(node, valueField, { + configurable: true, + get: function () { + return get.call(this); + }, + set: function (value) { + currentValue = '' + value; + set.call(this, value); + } + }); // We could've passed this the first time + // but it triggers a bug in IE11 and Edge 14/15. + // Calling defineProperty() again should be equivalent. + // https://github.com/facebook/react/issues/11768 + + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + var tracker = { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(node); + delete node[valueField]; + } + }; + return tracker; +} + +function track(node) { + if (getTracker(node)) { + return; + } // TODO: Once it's just Fiber we can move this to node._wrapperState + + + node._valueTracker = trackValueOnNode(node); +} +function updateValueIfChanged(node) { + if (!node) { + return false; + } + + var tracker = getTracker(node); // if there is no tracker at this point it's unlikely + // that trying again will succeed + + if (!tracker) { + return true; + } + + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(node); + + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + + return false; +} + +function getActiveElement(doc) { + doc = doc || (typeof document !== 'undefined' ? document : undefined); + + if (typeof doc === 'undefined') { + return null; + } + + try { + return doc.activeElement || doc.body; + } catch (e) { + return doc.body; + } +} + +var didWarnValueDefaultValue = false; +var didWarnCheckedDefaultChecked = false; +var didWarnControlledToUncontrolled = false; +var didWarnUncontrolledToControlled = false; + +function isControlled(props) { + var usesChecked = props.type === 'checkbox' || props.type === 'radio'; + return usesChecked ? props.checked != null : props.value != null; +} +/** + * Implements an host component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. + * + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html + */ + + +function getHostProps(element, props) { + var node = element; + var checked = props.checked; + + var hostProps = _assign({}, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: undefined, + checked: checked != null ? checked : node._wrapperState.initialChecked + }); + + return hostProps; +} +function initWrapperState(element, props) { + { + checkControlledValueProps('input', props); + + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + + didWarnCheckedDefaultChecked = true; + } + + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + + didWarnValueDefaultValue = true; + } + } + + var node = element; + var defaultValue = props.defaultValue == null ? '' : props.defaultValue; + node._wrapperState = { + initialChecked: props.checked != null ? props.checked : props.defaultChecked, + initialValue: getToStringValue(props.value != null ? props.value : defaultValue), + controlled: isControlled(props) + }; +} +function updateChecked(element, props) { + var node = element; + var checked = props.checked; + + if (checked != null) { + setValueForProperty(node, 'checked', checked, false); + } +} +function updateWrapper(element, props) { + var node = element; + + { + var controlled = isControlled(props); + + if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { + error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components'); + + didWarnUncontrolledToControlled = true; + } + + if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { + error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components'); + + didWarnControlledToUncontrolled = true; + } + } + + updateChecked(element, props); + var value = getToStringValue(props.value); + var type = props.type; + + if (value != null) { + if (type === 'number') { + if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value) { + node.value = toString(value); + } + } else if (node.value !== toString(value)) { + node.value = toString(value); + } + } else if (type === 'submit' || type === 'reset') { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute('value'); + return; + } + + { + // When syncing the value attribute, the value comes from a cascade of + // properties: + // 1. The value React property + // 2. The defaultValue React property + // 3. Otherwise there should be no change + if (props.hasOwnProperty('value')) { + setDefaultValue(node, props.type, value); + } else if (props.hasOwnProperty('defaultValue')) { + setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); + } + } + + { + // When syncing the checked attribute, it only changes when it needs + // to be removed, such as transitioning from a checkbox into a text input + if (props.checked == null && props.defaultChecked != null) { + node.defaultChecked = !!props.defaultChecked; + } + } +} +function postMountWrapper(element, props, isHydrating) { + var node = element; // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + + if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { + var type = props.type; + var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the + // default value provided by the browser. See: #12872 + + if (isButton && (props.value === undefined || props.value === null)) { + return; + } + + var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + + if (!isHydrating) { + { + // When syncing the value attribute, the value property should use + // the wrapperState._initialValue property. This uses: + // + // 1. The value React property when present + // 2. The defaultValue React property when present + // 3. An empty string + if (initialValue !== node.value) { + node.value = initialValue; + } + } + } + + { + // Otherwise, the value attribute is synchronized to the property, + // so we assign defaultValue to the same thing as the value property + // assignment step above. + node.defaultValue = initialValue; + } + } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug + // this is needed to work around a chrome bug where setting defaultChecked + // will sometimes influence the value of checked (even after detachment). + // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 + // We need to temporarily unset name to avoid disrupting radio button groups. + + + var name = node.name; + + if (name !== '') { + node.name = ''; + } + + { + // When syncing the checked attribute, both the checked property and + // attribute are assigned at the same time using defaultChecked. This uses: + // + // 1. The checked React property when present + // 2. The defaultChecked React property when present + // 3. Otherwise, false + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !!node._wrapperState.initialChecked; + } + + if (name !== '') { + node.name = name; + } +} +function restoreControlledState(element, props) { + var node = element; + updateWrapper(node, props); + updateNamedCousins(node, props); +} + +function updateNamedCousins(rootNode, props) { + var name = props.name; + + if (props.type === 'radio' && name != null) { + var queryRoot = rootNode; + + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form. It might not even be in the + // document. Let's just use the local `querySelectorAll` to ensure we don't + // miss anything. + + + var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); + + for (var i = 0; i < group.length; i++) { + var otherNode = group[i]; + + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React radio buttons with non-React ones. + + + var otherProps = getFiberCurrentPropsFromNode(otherNode); + + if (!otherProps) { + { + throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." ); + } + } // We need update the tracked value on the named cousin since the value + // was changed but the input saw no event or value set + + + updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + + updateWrapper(otherNode, otherProps); + } + } +} // In Chrome, assigning defaultValue to certain input types triggers input validation. +// For number inputs, the display value loses trailing decimal points. For email inputs, +// Chrome raises "The specified value is not a valid email address". +// +// Here we check to see if the defaultValue has actually changed, avoiding these problems +// when the user is inputting text +// +// https://github.com/facebook/react/issues/7253 + + +function setDefaultValue(node, type, value) { + if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js + type !== 'number' || getActiveElement(node.ownerDocument) !== node) { + if (value == null) { + node.defaultValue = toString(node._wrapperState.initialValue); + } else if (node.defaultValue !== toString(value)) { + node.defaultValue = toString(value); + } + } +} + +var didWarnSelectedSetOnOption = false; +var didWarnInvalidChild = false; + +function flattenChildren(children) { + var content = ''; // Flatten children. We'll warn if they are invalid + // during validateProps() which runs for hydration too. + // Note that this would throw on non-element objects. + // Elements are stringified (which is normally irrelevant + // but matters for ). + + React.Children.forEach(children, function (child) { + if (child == null) { + return; + } + + content += child; // Note: we don't warn about invalid children here. + // Instead, this is done separately below so that + // it happens during the hydration code path too. + }); + return content; +} +/** + * Implements an